| author | paulson <lp15@cam.ac.uk> | 
| Tue, 08 Aug 2017 23:54:49 +0200 | |
| changeset 66384 | cc66710c9d48 | 
| parent 66289 | 2562f151541c | 
| child 66884 | c2128ab11f61 | 
| permissions | -rw-r--r-- | 
| 63992 | 1 | (* Title: HOL/Analysis/Continuous_Extension.thy | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2 | Authors: LC Paulson, based on material from HOL Light | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3 | *) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5 | section \<open>Continuous extensions of functions: Urysohn's lemma, Dugundji extension theorem, Tietze\<close> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6 | |
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63593diff
changeset | 7 | theory Continuous_Extension | 
| 66289 
2562f151541c
Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
 paulson <lp15@cam.ac.uk> parents: 
64267diff
changeset | 8 | imports Starlike | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 9 | begin | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 10 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 11 | subsection\<open>Partitions of unity subordinate to locally finite open coverings\<close> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 12 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 13 | text\<open>A difference from HOL Light: all summations over infinite sets equal zero, | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 14 | so the "support" must be made explicit in the summation below!\<close> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 15 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 16 | proposition subordinate_partition_of_unity: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 17 | fixes S :: "'a :: euclidean_space set" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 18 | assumes "S \<subseteq> \<Union>\<C>" and opC: "\<And>T. T \<in> \<C> \<Longrightarrow> open T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 19 |       and fin: "\<And>x. x \<in> S \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U \<in> \<C>. U \<inter> V \<noteq> {}}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 20 | obtains F :: "['a set, 'a] \<Rightarrow> real" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 21 | where "\<And>U. U \<in> \<C> \<Longrightarrow> continuous_on S (F U) \<and> (\<forall>x \<in> S. 0 \<le> F U x)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 22 | and "\<And>x U. \<lbrakk>U \<in> \<C>; x \<in> S; x \<notin> U\<rbrakk> \<Longrightarrow> F U x = 0" | 
| 64267 | 23 | and "\<And>x. x \<in> S \<Longrightarrow> supp_sum (\<lambda>W. F W x) \<C> = 1" | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 24 |       and "\<And>x. x \<in> S \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U \<in> \<C>. \<exists>x\<in>V. F U x \<noteq> 0}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 25 | proof (cases "\<exists>W. W \<in> \<C> \<and> S \<subseteq> W") | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 26 | case True | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 27 | then obtain W where "W \<in> \<C>" "S \<subseteq> W" by metis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 28 | then show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 29 | apply (rule_tac F = "\<lambda>V x. if V = W then 1 else 0" in that) | 
| 64267 | 30 | apply (auto simp: continuous_on_const supp_sum_def support_on_def) | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 31 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 32 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 33 | case False | 
| 64267 | 34 |     have nonneg: "0 \<le> supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>" for x
 | 
| 35 | by (simp add: supp_sum_def sum_nonneg) | |
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 36 |     have sd_pos: "0 < setdist {x} (S - V)" if "V \<in> \<C>" "x \<in> S" "x \<in> V" for V x
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 37 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 38 | have "closedin (subtopology euclidean S) (S - V)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 39 | by (simp add: Diff_Diff_Int Diff_subset closedin_def opC openin_open_Int \<open>V \<in> \<C>\<close>) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 40 |       with that False setdist_eq_0_closedin [of S "S-V" x] setdist_pos_le [of "{x}" "S - V"]
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 41 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 42 | by (simp add: order_class.order.order_iff_strict) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 43 | qed | 
| 64267 | 44 |     have ss_pos: "0 < supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>" if "x \<in> S" for x
 | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 45 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 46 | obtain U where "U \<in> \<C>" "x \<in> U" using \<open>x \<in> S\<close> \<open>S \<subseteq> \<Union>\<C>\<close> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 47 | by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 48 |       obtain V where "open V" "x \<in> V" "finite {U \<in> \<C>. U \<inter> V \<noteq> {}}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 49 | using \<open>x \<in> S\<close> fin by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 50 |       then have *: "finite {A \<in> \<C>. \<not> S \<subseteq> A \<and> x \<notin> closure (S - A)}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 51 | using closure_def that by (blast intro: rev_finite_subset) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 52 | have "x \<notin> closure (S - U)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 53 | by (metis \<open>U \<in> \<C>\<close> \<open>x \<in> U\<close> less_irrefl sd_pos setdist_eq_0_sing_1 that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 54 | then show ?thesis | 
| 64267 | 55 | apply (simp add: setdist_eq_0_sing_1 supp_sum_def support_on_def) | 
| 56 | apply (rule ordered_comm_monoid_add_class.sum_pos2 [OF *, of U]) | |
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 57 | using \<open>U \<in> \<C>\<close> \<open>x \<in> U\<close> False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 58 | apply (auto simp: setdist_pos_le sd_pos that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 59 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 60 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 61 | define F where | 
| 64267 | 62 |       "F \<equiv> \<lambda>W x. if x \<in> S then setdist {x} (S - W) / supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>
 | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 63 | else 0" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 64 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 65 | proof (rule_tac F = F in that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 66 | have "continuous_on S (F U)" if "U \<in> \<C>" for U | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 67 | proof - | 
| 64267 | 68 |         have *: "continuous_on S (\<lambda>x. supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>)"
 | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 69 | proof (clarsimp simp add: continuous_on_eq_continuous_within) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 70 | fix x assume "x \<in> S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 71 |           then obtain X where "open X" and x: "x \<in> S \<inter> X" and finX: "finite {U \<in> \<C>. U \<inter> X \<noteq> {}}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 72 | using assms by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 73 | then have OSX: "openin (subtopology euclidean S) (S \<inter> X)" by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 74 | have sumeq: "\<And>x. x \<in> S \<inter> X \<Longrightarrow> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 75 |                      (\<Sum>V | V \<in> \<C> \<and> V \<inter> X \<noteq> {}. setdist {x} (S - V))
 | 
| 64267 | 76 |                      = supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>"
 | 
| 77 | apply (simp add: supp_sum_def) | |
| 78 | apply (rule sum.mono_neutral_right [OF finX]) | |
| 63593 
bbcb05504fdc
HOL-Multivariate_Analysis: replace neutral, monoidal, and iterate by the comm_monoid_set versions. Changed operative to comm_monoid_set. Renamed support_on to support and changed to comm_monoid_add.
 hoelzl parents: 
63306diff
changeset | 79 | apply (auto simp: setdist_eq_0_sing_1 support_on_def subset_iff) | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 80 | apply (meson DiffI closure_subset disjoint_iff_not_equal subsetCE) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 81 | done | 
| 64267 | 82 |           show "continuous (at x within S) (\<lambda>x. supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>)"
 | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 83 | apply (rule continuous_transform_within_openin | 
| 64267 | 84 |                      [where f = "\<lambda>x. (sum (\<lambda>V. setdist {x} (S - V)) {V \<in> \<C>. V \<inter> X \<noteq> {}})"
 | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 85 | and S ="S \<inter> X"]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 86 | apply (rule continuous_intros continuous_at_setdist continuous_at_imp_continuous_at_within OSX x)+ | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 87 | apply (simp add: sumeq) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 88 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 89 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 90 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 91 | apply (simp add: F_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 92 | apply (rule continuous_intros *)+ | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 93 | using ss_pos apply force | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 94 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 95 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 96 | moreover have "\<lbrakk>U \<in> \<C>; x \<in> S\<rbrakk> \<Longrightarrow> 0 \<le> F U x" for U x | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 97 | using nonneg [of x] by (simp add: F_def divide_simps setdist_pos_le) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 98 | ultimately show "\<And>U. U \<in> \<C> \<Longrightarrow> continuous_on S (F U) \<and> (\<forall>x\<in>S. 0 \<le> F U x)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 99 | by metis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 100 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 101 | show "\<And>x U. \<lbrakk>U \<in> \<C>; x \<in> S; x \<notin> U\<rbrakk> \<Longrightarrow> F U x = 0" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 102 | by (simp add: setdist_eq_0_sing_1 closure_def F_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 103 | next | 
| 64267 | 104 | show "supp_sum (\<lambda>W. F W x) \<C> = 1" if "x \<in> S" for x | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 105 | using that ss_pos [OF that] | 
| 64267 | 106 | by (simp add: F_def divide_simps supp_sum_divide_distrib [symmetric]) | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 107 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 108 |       show "\<exists>V. open V \<and> x \<in> V \<and> finite {U \<in> \<C>. \<exists>x\<in>V. F U x \<noteq> 0}" if "x \<in> S" for x
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 109 | using fin [OF that] that | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 110 | by (fastforce simp: setdist_eq_0_sing_1 closure_def F_def elim!: rev_finite_subset) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 111 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 112 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 113 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 114 | |
| 63306 
00090a0cd17f
Removed instances of ^ from theory markup
 paulson <lp15@cam.ac.uk> parents: 
63305diff
changeset | 115 | subsection\<open>Urysohn's lemma (for Euclidean spaces, where the proof is easy using distances)\<close> | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 116 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 117 | lemma Urysohn_both_ne: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 118 | assumes US: "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 119 | and UT: "closedin (subtopology euclidean U) T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 120 |       and "S \<inter> T = {}" "S \<noteq> {}" "T \<noteq> {}" "a \<noteq> b"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 121 | obtains f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 122 | where "continuous_on U f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 123 | "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 124 | "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 125 | "\<And>x. x \<in> U \<Longrightarrow> (f x = b \<longleftrightarrow> x \<in> T)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 126 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 127 |   have S0: "\<And>x. x \<in> U \<Longrightarrow> setdist {x} S = 0 \<longleftrightarrow> x \<in> S"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 128 |     using \<open>S \<noteq> {}\<close>  US setdist_eq_0_closedin  by auto
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 129 |   have T0: "\<And>x. x \<in> U \<Longrightarrow> setdist {x} T = 0 \<longleftrightarrow> x \<in> T"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 130 |     using \<open>T \<noteq> {}\<close>  UT setdist_eq_0_closedin  by auto
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 131 |   have sdpos: "0 < setdist {x} S + setdist {x} T" if "x \<in> U" for x
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 132 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 133 |     have "~ (setdist {x} S = 0 \<and> setdist {x} T = 0)"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 134 | using assms by (metis IntI empty_iff setdist_eq_0_closedin that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 135 | then show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 136 | by (metis add.left_neutral add.right_neutral add_pos_pos linorder_neqE_linordered_idom not_le setdist_pos_le) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 137 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 138 |   define f where "f \<equiv> \<lambda>x. a + (setdist {x} S / (setdist {x} S + setdist {x} T)) *\<^sub>R (b - a)"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 139 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 140 | proof (rule_tac f = f in that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 141 | show "continuous_on U f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 142 | using sdpos unfolding f_def | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 143 | by (intro continuous_intros | force)+ | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 144 | show "f x \<in> closed_segment a b" if "x \<in> U" for x | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 145 | unfolding f_def | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 146 | apply (simp add: closed_segment_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 147 |       apply (rule_tac x="(setdist {x} S / (setdist {x} S + setdist {x} T))" in exI)
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 148 | using sdpos that apply (simp add: algebra_simps) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 149 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 150 | show "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 151 | using S0 \<open>a \<noteq> b\<close> f_def sdpos by force | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 152 | show "(f x = b \<longleftrightarrow> x \<in> T)" if "x \<in> U" for x | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 153 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 154 |       have "f x = b \<longleftrightarrow> (setdist {x} S / (setdist {x} S + setdist {x} T)) = 1"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 155 | unfolding f_def | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 156 | apply (rule iffI) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 157 | apply (metis \<open>a \<noteq> b\<close> add_diff_cancel_left' eq_iff_diff_eq_0 pth_1 real_vector.scale_right_imp_eq, force) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 158 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 159 |       also have "...  \<longleftrightarrow> setdist {x} T = 0 \<and> setdist {x} S \<noteq> 0"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 160 | using sdpos that | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 161 | by (simp add: divide_simps) linarith | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 162 | also have "... \<longleftrightarrow> x \<in> T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 163 |         using \<open>S \<noteq> {}\<close> \<open>T \<noteq> {}\<close> \<open>S \<inter> T = {}\<close> that
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 164 | by (force simp: S0 T0) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 165 | finally show ?thesis . | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 166 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 167 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 168 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 169 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 170 | proposition Urysohn_local_strong: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 171 | assumes US: "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 172 | and UT: "closedin (subtopology euclidean U) T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 173 |       and "S \<inter> T = {}" "a \<noteq> b"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 174 | obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 175 | where "continuous_on U f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 176 | "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 177 | "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 178 | "\<And>x. x \<in> U \<Longrightarrow> (f x = b \<longleftrightarrow> x \<in> T)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 179 | proof (cases "S = {}")
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 180 | case True show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 181 |   proof (cases "T = {}")
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 182 | case True show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 183 | proof (rule_tac f = "\<lambda>x. midpoint a b" in that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 184 | show "continuous_on U (\<lambda>x. midpoint a b)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 185 | by (intro continuous_intros) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 186 | show "midpoint a b \<in> closed_segment a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 187 | using csegment_midpoint_subset by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 188 | show "(midpoint a b = a) = (x \<in> S)" for x | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 189 |         using \<open>S = {}\<close> \<open>a \<noteq> b\<close> by simp
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 190 | show "(midpoint a b = b) = (x \<in> T)" for x | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 191 |         using \<open>T = {}\<close> \<open>a \<noteq> b\<close> by simp
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 192 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 193 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 194 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 195 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 196 | proof (cases "T = U") | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 197 |       case True with \<open>S = {}\<close> \<open>a \<noteq> b\<close> show ?thesis
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 198 | by (rule_tac f = "\<lambda>x. b" in that) (auto simp: continuous_on_const) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 199 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 200 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 201 | with UT closedin_subset obtain c where c: "c \<in> U" "c \<notin> T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 202 | by fastforce | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 203 | obtain f where f: "continuous_on U f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 204 | "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment (midpoint a b) b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 205 | "\<And>x. x \<in> U \<Longrightarrow> (f x = midpoint a b \<longleftrightarrow> x = c)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 206 | "\<And>x. x \<in> U \<Longrightarrow> (f x = b \<longleftrightarrow> x \<in> T)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 207 |         apply (rule Urysohn_both_ne [of U "{c}" T "midpoint a b" "b"])
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 208 |         using c \<open>T \<noteq> {}\<close> assms apply simp_all
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 209 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 210 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 211 | apply (rule_tac f=f in that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 212 |         using \<open>S = {}\<close> \<open>T \<noteq> {}\<close> f csegment_midpoint_subset notin_segment_midpoint [OF \<open>a \<noteq> b\<close>]
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 213 | apply force+ | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 214 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 215 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 216 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 217 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 218 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 219 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 220 |   proof (cases "T = {}")
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 221 | case True show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 222 | proof (cases "S = U") | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 223 |       case True with \<open>T = {}\<close> \<open>a \<noteq> b\<close> show ?thesis
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 224 | by (rule_tac f = "\<lambda>x. a" in that) (auto simp: continuous_on_const) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 225 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 226 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 227 | with US closedin_subset obtain c where c: "c \<in> U" "c \<notin> S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 228 | by fastforce | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 229 | obtain f where f: "continuous_on U f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 230 | "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a (midpoint a b)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 231 | "\<And>x. x \<in> U \<Longrightarrow> (f x = midpoint a b \<longleftrightarrow> x = c)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 232 | "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 233 |         apply (rule Urysohn_both_ne [of U S "{c}" a "midpoint a b"])
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 234 |         using c \<open>S \<noteq> {}\<close> assms apply simp_all
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 235 | apply (metis midpoint_eq_endpoint) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 236 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 237 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 238 | apply (rule_tac f=f in that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 239 |         using \<open>S \<noteq> {}\<close> \<open>T = {}\<close> f  \<open>a \<noteq> b\<close>
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 240 | apply simp_all | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 241 | apply (metis (no_types) closed_segment_commute csegment_midpoint_subset midpoint_sym subset_iff) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 242 | apply (metis closed_segment_commute midpoint_sym notin_segment_midpoint) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 243 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 244 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 245 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 246 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 247 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 248 |       using Urysohn_both_ne [OF US UT \<open>S \<inter> T = {}\<close> \<open>S \<noteq> {}\<close> \<open>T \<noteq> {}\<close> \<open>a \<noteq> b\<close>] that
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 249 | by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 250 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 251 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 252 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 253 | lemma Urysohn_local: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 254 | assumes US: "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 255 | and UT: "closedin (subtopology euclidean U) T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 256 |       and "S \<inter> T = {}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 257 | obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 258 | where "continuous_on U f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 259 | "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 260 | "\<And>x. x \<in> S \<Longrightarrow> f x = a" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 261 | "\<And>x. x \<in> T \<Longrightarrow> f x = b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 262 | proof (cases "a = b") | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 263 | case True then show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 264 | by (rule_tac f = "\<lambda>x. b" in that) (auto simp: continuous_on_const) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 265 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 266 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 267 | then show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 268 | apply (rule Urysohn_local_strong [OF assms]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 269 | apply (erule that, assumption) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 270 | apply (meson US closedin_singleton closedin_trans) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 271 | apply (meson UT closedin_singleton closedin_trans) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 272 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 273 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 274 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 275 | lemma Urysohn_strong: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 276 | assumes US: "closed S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 277 | and UT: "closed T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 278 |       and "S \<inter> T = {}" "a \<noteq> b"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 279 | obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 280 | where "continuous_on UNIV f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 281 | "\<And>x. f x \<in> closed_segment a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 282 | "\<And>x. f x = a \<longleftrightarrow> x \<in> S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 283 | "\<And>x. f x = b \<longleftrightarrow> x \<in> T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 284 | apply (rule Urysohn_local_strong [of UNIV S T]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 285 | using assms | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 286 | apply (auto simp: closed_closedin) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 287 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 288 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 289 | proposition Urysohn: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 290 | assumes US: "closed S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 291 | and UT: "closed T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 292 |       and "S \<inter> T = {}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 293 | obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 294 | where "continuous_on UNIV f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 295 | "\<And>x. f x \<in> closed_segment a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 296 | "\<And>x. x \<in> S \<Longrightarrow> f x = a" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 297 | "\<And>x. x \<in> T \<Longrightarrow> f x = b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 298 | apply (rule Urysohn_local [of UNIV S T a b]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 299 | using assms | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 300 | apply (auto simp: closed_closedin) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 301 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 302 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 303 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 304 | subsection\<open> The Dugundji extension theorem, and Tietze variants as corollaries.\<close> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 305 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 306 | text\<open>J. Dugundji. An extension of Tietze's theorem. Pacific J. Math. Volume 1, Number 3 (1951), 353-367. | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 307 | http://projecteuclid.org/euclid.pjm/1103052106\<close> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 308 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 309 | theorem Dugundji: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 310 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_inner" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 311 |   assumes "convex C" "C \<noteq> {}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 312 | and cloin: "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 313 | and contf: "continuous_on S f" and "f ` S \<subseteq> C" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 314 | obtains g where "continuous_on U g" "g ` U \<subseteq> C" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 315 | "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 316 | proof (cases "S = {}")
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 317 | case True then show thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 318 | apply (rule_tac g="\<lambda>x. @y. y \<in> C" in that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 319 | apply (rule continuous_intros) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 320 |      apply (meson all_not_in_conv \<open>C \<noteq> {}\<close> image_subsetI someI_ex, simp)
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 321 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 322 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 323 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 324 |   then have sd_pos: "\<And>x. \<lbrakk>x \<in> U; x \<notin> S\<rbrakk> \<Longrightarrow> 0 < setdist {x} S"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 325 | using setdist_eq_0_closedin [OF cloin] le_less setdist_pos_le by fastforce | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 326 |   define \<B> where "\<B> = {ball x (setdist {x} S / 2) |x. x \<in> U - S}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 327 | have [simp]: "\<And>T. T \<in> \<B> \<Longrightarrow> open T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 328 | by (auto simp: \<B>_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 329 | have USS: "U - S \<subseteq> \<Union>\<B>" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 330 | by (auto simp: sd_pos \<B>_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 331 | obtain \<C> where USsub: "U - S \<subseteq> \<Union>\<C>" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 332 | and nbrhd: "\<And>U. U \<in> \<C> \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<B> \<and> U \<subseteq> T)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 333 | and fin: "\<And>x. x \<in> U - S | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 334 |                      \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U. U \<in> \<C> \<and> U \<inter> V \<noteq> {}}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 335 | using paracompact [OF USS] by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 336 | have "\<exists>v a. v \<in> U \<and> v \<notin> S \<and> a \<in> S \<and> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 337 |               T \<subseteq> ball v (setdist {v} S / 2) \<and>
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 338 |               dist v a \<le> 2 * setdist {v} S" if "T \<in> \<C>" for T
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 339 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 340 |     obtain v where v: "T \<subseteq> ball v (setdist {v} S / 2)" "v \<in> U" "v \<notin> S"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 341 | using \<open>T \<in> \<C>\<close> nbrhd by (force simp: \<B>_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 342 |     then obtain a where "a \<in> S" "dist v a < 2 * setdist {v} S"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 343 |       using setdist_ltE [of "{v}" S "2 * setdist {v} S"]
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 344 | using False sd_pos by force | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 345 | with v show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 346 | apply (rule_tac x=v in exI) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 347 | apply (rule_tac x=a in exI, auto) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 348 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 349 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 350 | then obtain \<V> \<A> where | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 351 | VA: "\<And>T. T \<in> \<C> \<Longrightarrow> \<V> T \<in> U \<and> \<V> T \<notin> S \<and> \<A> T \<in> S \<and> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 352 |               T \<subseteq> ball (\<V> T) (setdist {\<V> T} S / 2) \<and>
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 353 |               dist (\<V> T) (\<A> T) \<le> 2 * setdist {\<V> T} S"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 354 | by metis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 355 |   have sdle: "setdist {\<V> T} S \<le> 2 * setdist {v} S" if "T \<in> \<C>" "v \<in> T" for T v
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 356 | using setdist_Lipschitz [of "\<V> T" S v] VA [OF \<open>T \<in> \<C>\<close>] \<open>v \<in> T\<close> by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 357 | have d6: "dist a (\<A> T) \<le> 6 * dist a v" if "T \<in> \<C>" "v \<in> T" "a \<in> S" for T v a | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 358 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 359 |     have "dist (\<V> T) v < setdist {\<V> T} S / 2"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 360 | using that VA mem_ball by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 361 |     also have "... \<le> setdist {v} S"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 362 | using sdle [OF \<open>T \<in> \<C>\<close> \<open>v \<in> T\<close>] by simp | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 363 |     also have vS: "setdist {v} S \<le> dist a v"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 364 | by (simp add: setdist_le_dist setdist_sym \<open>a \<in> S\<close>) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 365 | finally have VTV: "dist (\<V> T) v < dist a v" . | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 366 |     have VTS: "setdist {\<V> T} S \<le> 2 * dist a v"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 367 | using sdle that vS by force | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 368 | have "dist a (\<A> T) \<le> dist a v + dist v (\<V> T) + dist (\<V> T) (\<A> T)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 369 | by (metis add.commute add_le_cancel_left dist_commute dist_triangle2 dist_triangle_le) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 370 | also have "... \<le> dist a v + dist a v + dist (\<V> T) (\<A> T)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 371 | using VTV by (simp add: dist_commute) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 372 |     also have "... \<le> 2 * dist a v + 2 * setdist {\<V> T} S"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 373 | using VA [OF \<open>T \<in> \<C>\<close>] by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 374 | finally show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 375 | using VTS by linarith | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 376 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 377 | obtain H :: "['a set, 'a] \<Rightarrow> real" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 378 | where Hcont: "\<And>Z. Z \<in> \<C> \<Longrightarrow> continuous_on (U-S) (H Z)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 379 | and Hge0: "\<And>Z x. \<lbrakk>Z \<in> \<C>; x \<in> U-S\<rbrakk> \<Longrightarrow> 0 \<le> H Z x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 380 | and Heq0: "\<And>x Z. \<lbrakk>Z \<in> \<C>; x \<in> U-S; x \<notin> Z\<rbrakk> \<Longrightarrow> H Z x = 0" | 
| 64267 | 381 | and H1: "\<And>x. x \<in> U-S \<Longrightarrow> supp_sum (\<lambda>W. H W x) \<C> = 1" | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 382 |       and Hfin: "\<And>x. x \<in> U-S \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U \<in> \<C>. \<exists>x\<in>V. H U x \<noteq> 0}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 383 | apply (rule subordinate_partition_of_unity [OF USsub _ fin]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 384 | using nbrhd by auto | 
| 64267 | 385 | define g where "g \<equiv> \<lambda>x. if x \<in> S then f x else supp_sum (\<lambda>T. H T x *\<^sub>R f(\<A> T)) \<C>" | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 386 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 387 | proof (rule that) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 388 | show "continuous_on U g" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 389 | proof (clarsimp simp: continuous_on_eq_continuous_within) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 390 | fix a assume "a \<in> U" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 391 | show "continuous (at a within U) g" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 392 | proof (cases "a \<in> S") | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 393 | case True show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 394 | proof (clarsimp simp add: continuous_within_topological) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 395 | fix W | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 396 | assume "open W" "g a \<in> W" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 397 | then obtain e where "0 < e" and e: "ball (f a) e \<subseteq> W" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 398 | using openE True g_def by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 399 | have "continuous (at a within S) f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 400 | using True contf continuous_on_eq_continuous_within by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 401 | then obtain d where "0 < d" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 402 | and d: "\<And>x. \<lbrakk>x \<in> S; dist x a < d\<rbrakk> \<Longrightarrow> dist (f x) (f a) < e" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 403 | using continuous_within_eps_delta \<open>0 < e\<close> by force | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 404 | have "g y \<in> ball (f a) e" if "y \<in> U" and y: "y \<in> ball a (d / 6)" for y | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 405 | proof (cases "y \<in> S") | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 406 | case True | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 407 | then have "dist (f a) (f y) < e" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 408 | by (metis ball_divide_subset_numeral dist_commute in_mono mem_ball y d) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 409 | then show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 410 | by (simp add: True g_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 411 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 412 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 413 | have *: "dist (f (\<A> T)) (f a) < e" if "T \<in> \<C>" "H T y \<noteq> 0" for T | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 414 | proof - | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 415 | have "y \<in> T" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 416 | using Heq0 that False \<open>y \<in> U\<close> by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 417 | have "dist (\<A> T) a < d" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 418 | using d6 [OF \<open>T \<in> \<C>\<close> \<open>y \<in> T\<close> \<open>a \<in> S\<close>] y | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 419 | by (simp add: dist_commute mult.commute) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 420 | then show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 421 | using VA [OF \<open>T \<in> \<C>\<close>] by (auto simp: d) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 422 | qed | 
| 64267 | 423 | have "supp_sum (\<lambda>T. H T y *\<^sub>R f (\<A> T)) \<C> \<in> ball (f a) e" | 
| 424 | apply (rule convex_supp_sum [OF convex_ball]) | |
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 425 | apply (simp_all add: False H1 Hge0 \<open>y \<in> U\<close>) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 426 | by (metis dist_commute *) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 427 | then show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 428 | by (simp add: False g_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 429 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 430 | then show "\<exists>A. open A \<and> a \<in> A \<and> (\<forall>y\<in>U. y \<in> A \<longrightarrow> g y \<in> W)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 431 | apply (rule_tac x = "ball a (d / 6)" in exI) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 432 | using e \<open>0 < d\<close> by fastforce | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 433 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 434 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 435 | case False | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 436 | obtain N where N: "open N" "a \<in> N" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 437 |                    and finN: "finite {U \<in> \<C>. \<exists>a\<in>N. H U a \<noteq> 0}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 438 | using Hfin False \<open>a \<in> U\<close> by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 439 | have oUS: "openin (subtopology euclidean U) (U - S)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 440 | using cloin by (simp add: openin_diff) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 441 | have HcontU: "continuous (at a within U) (H T)" if "T \<in> \<C>" for T | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 442 | using Hcont [OF \<open>T \<in> \<C>\<close>] False \<open>a \<in> U\<close> \<open>T \<in> \<C>\<close> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 443 | apply (simp add: continuous_on_eq_continuous_within continuous_within) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 444 | apply (rule Lim_transform_within_set) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 445 | using oUS | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 446 | apply (force simp: eventually_at openin_contains_ball dist_commute dest!: bspec)+ | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 447 | done | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 448 | show ?thesis | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 449 | proof (rule continuous_transform_within_openin [OF _ oUS]) | 
| 64267 | 450 | show "continuous (at a within U) (\<lambda>x. supp_sum (\<lambda>T. H T x *\<^sub>R f (\<A> T)) \<C>)" | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 451 | proof (rule continuous_transform_within_openin) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 452 | show "continuous (at a within U) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 453 |                     (\<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))"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 454 | by (force intro: continuous_intros HcontU)+ | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 455 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 456 | show "openin (subtopology euclidean U) ((U - S) \<inter> N)" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 457 | using N oUS openin_trans by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 458 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 459 | show "a \<in> (U - S) \<inter> N" using False \<open>a \<in> U\<close> N by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 460 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 461 | show "\<And>x. x \<in> (U - S) \<inter> N \<Longrightarrow> | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 462 |                          (\<Sum>T \<in> {U \<in> \<C>. \<exists>x\<in>N. H U x \<noteq> 0}. H T x *\<^sub>R f (\<A> T))
 | 
| 64267 | 463 | = supp_sum (\<lambda>T. H T x *\<^sub>R f (\<A> T)) \<C>" | 
| 464 | by (auto simp: supp_sum_def support_on_def | |
| 465 | intro: sum.mono_neutral_right [OF finN]) | |
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 466 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 467 | next | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 468 | show "a \<in> U - S" using False \<open>a \<in> U\<close> by blast | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 469 | next | 
| 64267 | 470 | show "\<And>x. x \<in> U - S \<Longrightarrow> supp_sum (\<lambda>T. H T x *\<^sub>R f (\<A> T)) \<C> = g x" | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 471 | by (simp add: g_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 472 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 473 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 474 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 475 | show "g ` U \<subseteq> C" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 476 | using \<open>f ` S \<subseteq> C\<close> VA | 
| 64267 | 477 | by (fastforce simp: g_def Hge0 intro!: convex_supp_sum [OF \<open>convex C\<close>] H1) | 
| 63305 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 478 | show "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 479 | by (simp add: g_def) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 480 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 481 | qed | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 482 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 483 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 484 | corollary Tietze: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 485 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_inner" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 486 | assumes "continuous_on S f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 487 | and "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 488 | and "0 \<le> B" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 489 | and "\<And>x. x \<in> S \<Longrightarrow> norm(f x) \<le> B" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 490 | obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 491 | "\<And>x. x \<in> U \<Longrightarrow> norm(g x) \<le> B" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 492 | using assms | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 493 | by (auto simp: image_subset_iff intro: Dugundji [of "cball 0 B" U S f]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 494 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 495 | corollary Tietze_closed_interval: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 496 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 497 | assumes "continuous_on S f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 498 | and "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 499 |       and "cbox a b \<noteq> {}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 500 | and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 501 | obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 502 | "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 503 | apply (rule Dugundji [of "cbox a b" U S f]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 504 | using assms by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 505 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 506 | corollary Tietze_closed_interval_1: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 507 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 508 | assumes "continuous_on S f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 509 | and "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 510 | and "a \<le> b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 511 | and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 512 | obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 513 | "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 514 | apply (rule Dugundji [of "cbox a b" U S f]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 515 | using assms by (auto simp: image_subset_iff) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 516 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 517 | corollary Tietze_open_interval: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 518 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 519 | assumes "continuous_on S f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 520 | and "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 521 |       and "box a b \<noteq> {}"
 | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 522 | and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 523 | obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 524 | "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 525 | apply (rule Dugundji [of "box a b" U S f]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 526 | using assms by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 527 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 528 | corollary Tietze_open_interval_1: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 529 | fixes f :: "'a::euclidean_space \<Rightarrow> real" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 530 | assumes "continuous_on S f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 531 | and "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 532 | and "a < b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 533 | and no: "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 534 | obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 535 | "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 536 | apply (rule Dugundji [of "box a b" U S f]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 537 | using assms by (auto simp: image_subset_iff) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 538 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 539 | corollary Tietze_unbounded: | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 540 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_inner" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 541 | assumes "continuous_on S f" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 542 | and "closedin (subtopology euclidean U) S" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 543 | obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x" | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 544 | apply (rule Dugundji [of UNIV U S f]) | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 545 | using assms by auto | 
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 546 | |
| 
3b6975875633
Urysohn's lemma, Dugundji extension theorem and many other proofs
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 547 | end |