src/HOL/Analysis/Continuous_Extension.thy
author nipkow
Wed, 25 Jun 2025 16:16:26 +0200
changeset 82736 1ca8d9705e34
parent 78277 6726b20289b4
permissions -rw-r--r--
added lemmas
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63992
3aa9837d05c7 updated headers;
wenzelm
parents: 63627
diff changeset
     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
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69286
diff changeset
     5
section \<open>Continuous Extensions of Functions\<close>
63305
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: 63593
diff changeset
     7
theory Continuous_Extension
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff 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
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68224
diff changeset
    16
proposition subordinate_partition_of_unity:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    17
  fixes S :: "'a::metric_space set"
63305
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
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    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}"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68224
diff changeset
    25
proof (cases "\<exists>W. W \<in> \<C> \<and> S \<subseteq> W")
63305
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
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    29
      by (rule_tac F = "\<lambda>V x. if V = W then 1 else 0" in that) (auto simp: 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
    30
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    31
  case False
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    32
    have nonneg: "0 \<le> supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>" for x
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    33
      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
    34
    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
    35
    proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
    36
      have "closedin (top_of_set S) (S - V)"
69286
nipkow
parents: 68607
diff changeset
    37
        by (simp add: Diff_Diff_Int closedin_def opC openin_open_Int \<open>V \<in> \<C>\<close>)
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    38
      with that False  setdist_pos_le [of "{x}" "S - V"]
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    39
      show ?thesis
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    40
        using setdist_gt_0_closedin by fastforce
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    41
    qed
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    42
    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
    43
    proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    44
      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
    45
        by blast
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    46
      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
    47
        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
    48
      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
    49
        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
    50
      have "x \<notin> closure (S - U)"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    51
        using \<open>U \<in> \<C>\<close> \<open>x \<in> U\<close> opC open_Int_closure_eq_empty by fastforce
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    52
      then show ?thesis
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    53
        apply (simp add: setdist_eq_0_sing_1 supp_sum_def support_on_def)
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    54
        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
    55
        using \<open>U \<in> \<C>\<close> \<open>x \<in> U\<close> False
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    56
        apply (auto simp: sd_pos that)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    57
        done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    58
    qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    59
    define F where
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
    60
      "F \<equiv> \<lambda>W x. if x \<in> S then setdist {x} (S - W) / supp_sum (\<lambda>V. setdist {x} (S - V)) \<C> else 0"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    61
    show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    62
    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
    63
      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
    64
      proof -
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    65
        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
    66
        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
    67
          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
    68
          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
    69
            using assms by blast
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
    70
          then have OSX: "openin (top_of_set S) (S \<inter> X)" by blast
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    71
          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
    72
                     (\<Sum>V | V \<in> \<C> \<and> V \<inter> X \<noteq> {}. setdist {x} (S - V))
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    73
                     = supp_sum (\<lambda>V. setdist {x} (S - V)) \<C>"
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    74
            apply (simp add: supp_sum_def)
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    75
            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: 63306
diff changeset
    76
            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
    77
            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
    78
            done
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    79
          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
    80
            apply (rule continuous_transform_within_openin
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
    81
                     [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
    82
                        and S ="S \<inter> X"])
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    83
            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
    84
            apply (simp add: sumeq)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    85
            done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    86
        qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    87
        show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    88
          apply (simp add: F_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    89
          apply (rule continuous_intros *)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    90
          using ss_pos apply force
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    91
          done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    92
      qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    93
      moreover have "\<lbrakk>U \<in> \<C>; x \<in> S\<rbrakk> \<Longrightarrow> 0 \<le> F U x" for U x
71172
nipkow
parents: 70817
diff changeset
    94
        using nonneg [of x] by (simp add: F_def field_split_simps)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    95
      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
    96
        by metis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    97
    next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    98
      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
    99
        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
   100
    next
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   101
      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
   102
        using that ss_pos [OF that]
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70136
diff changeset
   103
        by (simp add: F_def field_split_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
   104
    next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   105
      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
   106
        using fin [OF that] that
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   107
        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
   108
    qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   109
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   110
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   111
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69286
diff changeset
   112
subsection\<open>Urysohn's Lemma for Euclidean Spaces\<close>
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69286
diff changeset
   113
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69286
diff changeset
   114
text \<open>For Euclidean spaces 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
   115
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   116
lemma Urysohn_both_ne:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   117
  assumes US: "closedin (top_of_set U) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   118
      and UT: "closedin (top_of_set U) T"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   119
      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
   120
  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
   121
    where "continuous_on U f"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   122
          "\<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
   123
          "\<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
   124
          "\<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
   125
proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   126
  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
   127
    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
   128
  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
   129
    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
   130
  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
   131
  proof -
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69286
diff changeset
   132
    have "\<not> (setdist {x} S = 0 \<and> setdist {x} T = 0)"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   133
      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
   134
    then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   135
      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
   136
  qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   137
  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
   138
  show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   139
  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
   140
    show "continuous_on U f"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   141
      using sdpos unfolding f_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   142
      by (intro continuous_intros | force)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   143
    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
   144
        unfolding f_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   145
      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
   146
      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
   147
      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
   148
      done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   149
    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
   150
      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
   151
    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
   152
    proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   153
      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
   154
        unfolding f_def
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   155
        by (metis add_diff_cancel_left' \<open>a \<noteq> b\<close> diff_add_cancel eq_iff_diff_eq_0 scaleR_cancel_right scaleR_one)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   156
      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
   157
        using sdpos that
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70136
diff changeset
   158
        by (simp add: field_split_simps) linarith
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   159
      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
   160
        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
   161
        by (force simp: S0 T0)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   162
      finally show ?thesis .
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   163
    qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   164
  qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   165
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   166
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   167
lemma Urysohn_local_strong_aux:
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   168
  assumes US: "closedin (top_of_set U) S"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   169
      and UT: "closedin (top_of_set U) T"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   170
      and "S \<inter> T = {}" "a \<noteq> b" "S \<noteq> {}"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   171
  obtains f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   172
    where "continuous_on U f"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   173
          "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a b"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   174
          "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   175
          "\<And>x. x \<in> U \<Longrightarrow> (f x = b \<longleftrightarrow> x \<in> T)"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   176
proof (cases "T = {}")
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   177
  case True show ?thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   178
  proof (cases "S = U")
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   179
    case True with \<open>T = {}\<close> \<open>a \<noteq> b\<close> show ?thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   180
      by (rule_tac f = "\<lambda>x. a" in that) (auto)
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   181
  next
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   182
    case False
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   183
    with US closedin_subset obtain c where c: "c \<in> U" "c \<notin> S"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   184
      by fastforce
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   185
    obtain f where f: "continuous_on U f"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   186
      "\<And>x. x \<in> U \<Longrightarrow> f x \<in> closed_segment a (midpoint a b)"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   187
      "\<And>x. x \<in> U \<Longrightarrow> (f x = midpoint a b \<longleftrightarrow> x = c)"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   188
      "\<And>x. x \<in> U \<Longrightarrow> (f x = a \<longleftrightarrow> x \<in> S)"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   189
      apply (rule Urysohn_both_ne [of U S "{c}" a "midpoint a b"])
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   190
      using c \<open>S \<noteq> {}\<close> assms apply simp_all
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   191
      apply (metis midpoint_eq_endpoint)
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   192
      done
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   193
    show ?thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   194
      apply (rule_tac f=f in that)
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   195
      using \<open>S \<noteq> {}\<close> \<open>T = {}\<close> f  \<open>a \<noteq> b\<close>
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   196
         apply simp_all
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   197
       apply (metis (no_types) closed_segment_commute csegment_midpoint_subset midpoint_sym subset_iff)
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   198
      apply (metis closed_segment_commute midpoint_sym notin_segment_midpoint)
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   199
      done
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   200
  qed
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   201
next
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   202
  case False
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   203
  show ?thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   204
    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
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   205
    by blast
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   206
qed
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   207
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   208
proposition Urysohn_local_strong:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   209
  assumes US: "closedin (top_of_set U) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   210
      and UT: "closedin (top_of_set U) T"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   211
      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
   212
  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
   213
    where "continuous_on U f"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   214
          "\<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
   215
          "\<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
   216
          "\<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
   217
proof (cases "S = {}")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   218
  case True show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   219
  proof (cases "T = {}")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   220
    case True show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   221
    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
   222
      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
   223
        by (intro continuous_intros)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   224
      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
   225
        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
   226
      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
   227
        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
   228
      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
   229
        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
   230
    qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   231
  next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   232
    case False
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   233
    with Urysohn_local_strong_aux [OF UT US] assms show ?thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   234
      by (smt (verit) True closed_segment_commute inf_bot_right that)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   235
  qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   236
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   237
  case False
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   238
  with Urysohn_local_strong_aux [OF assms] show ?thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   239
    using that by blast
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   240
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   241
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   242
lemma Urysohn_local:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   243
  assumes US: "closedin (top_of_set U) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   244
      and UT: "closedin (top_of_set U) T"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   245
      and "S \<inter> T = {}"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   246
  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
   247
    where "continuous_on U f"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   248
          "\<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
   249
          "\<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
   250
          "\<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
   251
proof (cases "a = b")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   252
  case True then show ?thesis
71172
nipkow
parents: 70817
diff changeset
   253
    by (rule_tac f = "\<lambda>x. b" in that) (auto)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   254
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   255
  case False
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   256
  with Urysohn_local_strong [OF assms] show ?thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   257
    by (smt (verit) US UT closedin_imp_subset subset_eq that)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   258
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   259
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   260
lemma Urysohn_strong:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   261
  assumes US: "closed S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   262
      and UT: "closed T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   263
      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
   264
  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
   265
    where "continuous_on UNIV f"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   266
          "\<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
   267
          "\<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
   268
          "\<And>x. f x = b \<longleftrightarrow> x \<in> T"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
   269
using assms by (auto intro: Urysohn_local_strong [of UNIV S T])
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   270
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68224
diff changeset
   271
proposition Urysohn:
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   272
  assumes US: "closed S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   273
      and UT: "closed T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   274
      and "S \<inter> T = {}"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   275
  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
   276
    where "continuous_on UNIV f"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   277
          "\<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
   278
          "\<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
   279
          "\<And>x. x \<in> T \<Longrightarrow> f x = b"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68224
diff changeset
   280
  using assms by (auto intro: Urysohn_local [of UNIV S T a b])
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   281
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   282
69518
bf88364c9e94 tuned headers etc, added bib-file
nipkow
parents: 69508
diff changeset
   283
subsection\<open>Dugundji's Extension Theorem and Tietze Variants\<close>
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   284
76987
4c275405faae isabelle update -u cite;
wenzelm
parents: 71255
diff changeset
   285
text \<open>See \<^cite>\<open>"dugundji"\<close>.\<close>
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   286
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68224
diff changeset
   287
theorem Dugundji:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   288
  fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   289
  assumes "convex C" "C \<noteq> {}"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   290
      and cloin: "closedin (top_of_set U) S"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   291
      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
   292
  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
   293
                  "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68224
diff changeset
   294
proof (cases "S = {}")
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   295
  case True show thesis
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   296
  proof
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   297
    show "continuous_on U (\<lambda>x. SOME y. y \<in> C)"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   298
      by (rule continuous_intros)
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   299
    show "(\<lambda>x. SOME y. y \<in> C) ` U \<subseteq> C"
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   300
      by (simp add: \<open>C \<noteq> {}\<close> image_subsetI some_in_eq)
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   301
  qed (use True in auto)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   302
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   303
  case False
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   304
  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
   305
    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
   306
  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
   307
  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
   308
    by (auto simp: \<B>_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   309
  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
   310
    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
   311
  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
   312
       and nbrhd: "\<And>U. U \<in> \<C> \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<B> \<and> U \<subseteq> T)"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   313
       and fin: "\<And>x. x \<in> U - S \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U. U \<in> \<C> \<and> U \<inter> V \<noteq> {}}"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   314
    by (rule paracompact [OF USS]) auto
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   315
  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
   316
              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
   317
              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
   318
  proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   319
    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
   320
      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
   321
    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
   322
      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
   323
      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
   324
    with v show ?thesis
78277
6726b20289b4 A bit of prerelease tidying
paulson <lp15@cam.ac.uk>
parents: 76987
diff changeset
   325
      by force
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   326
  qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   327
  then obtain \<V> \<A> where
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   328
    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
   329
              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
   330
              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
   331
    by metis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   332
  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
   333
    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
   334
  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
   335
  proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   336
    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
   337
      using that VA mem_ball by blast
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   338
    also have "\<dots> \<le> setdist {v} S"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   339
      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
   340
    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
   341
      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
   342
    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
   343
    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
   344
      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
   345
    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
   346
      by (metis add.commute add_le_cancel_left dist_commute dist_triangle2 dist_triangle_le)
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   347
    also have "\<dots> \<le> dist a v + dist a v + dist (\<V> T) (\<A> T)"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   348
      using VTV by (simp add: dist_commute)
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   349
    also have "\<dots> \<le> 2 * dist a v + 2 * setdist {\<V> T} S"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   350
      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
   351
    finally show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   352
      using VTS by linarith
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   353
  qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   354
  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
   355
    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
   356
      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
   357
      and Heq0: "\<And>x Z. \<lbrakk>Z \<in> \<C>; x \<in> U-S; x \<notin> Z\<rbrakk> \<Longrightarrow> H Z x = 0"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   358
      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
   359
      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
   360
    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
   361
    using nbrhd by auto
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   362
  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
   363
  show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   364
  proof (rule that)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   365
    show "continuous_on U g"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   366
    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
   367
      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
   368
      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
   369
      proof (cases "a \<in> S")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   370
        case True show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   371
        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
   372
          fix W
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   373
          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
   374
          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
   375
            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
   376
          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
   377
            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
   378
          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
   379
                        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
   380
            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
   381
          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
   382
          proof (cases "y \<in> S")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   383
            case True
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   384
            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
   385
              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
   386
            then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   387
              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
   388
          next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   389
            case False
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   390
            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
   391
            proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   392
              have "y \<in> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   393
                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
   394
              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
   395
                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
   396
                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
   397
              then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   398
                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
   399
            qed
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   400
            have "supp_sum (\<lambda>T. H T y *\<^sub>R f (\<A> T)) \<C> \<in> ball (f a) e"
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   401
              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
   402
              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
   403
              by (metis dist_commute *)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   404
            then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   405
              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
   406
          qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   407
          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
   408
            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
   409
            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
   410
        qed
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
        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
   414
                   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
   415
          using Hfin False \<open>a \<in> U\<close> by auto
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   416
        have oUS: "openin (top_of_set U) (U - S)"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   417
          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
   418
        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
   419
          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
   420
          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
   421
          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
   422
          using oUS
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   423
            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
   424
          done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   425
        show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   426
        proof (rule continuous_transform_within_openin [OF _ oUS])
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   427
          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
   428
          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
   429
            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
   430
                    (\<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
   431
              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
   432
          next
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   433
            show "openin (top_of_set U) ((U - S) \<inter> N)"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   434
              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
   435
          next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   436
            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
   437
          next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   438
            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
   439
                         (\<Sum>T \<in> {U \<in> \<C>. \<exists>x\<in>N. H U x \<noteq> 0}. H T x *\<^sub>R f (\<A> T))
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   440
                         = supp_sum (\<lambda>T. H T x *\<^sub>R f (\<A> T)) \<C>"
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   441
              by (auto simp: supp_sum_def support_on_def
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   442
                       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
   443
          qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   444
        next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   445
          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
   446
        next
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   447
          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
   448
            by (simp add: g_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   449
        qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   450
      qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   451
    qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   452
    show "g ` U \<subseteq> C"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   453
      using \<open>f ` S \<subseteq> C\<close> VA
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63992
diff changeset
   454
      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
   455
    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
   456
      by (simp add: g_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   457
  qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   458
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   459
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   460
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68224
diff changeset
   461
corollary Tietze:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   462
  fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   463
  assumes "continuous_on S f"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   464
    and "closedin (top_of_set U) S"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   465
    and "0 \<le> B"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   466
    and "\<And>x. x \<in> S \<Longrightarrow> norm(f x) \<le> B"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   467
  obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   468
    "\<And>x. x \<in> U \<Longrightarrow> norm(g x) \<le> B"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   469
  using assms by (auto simp: image_subset_iff intro: Dugundji [of "cball 0 B" U S f])
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   470
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   471
corollary\<^marker>\<open>tag unimportant\<close> Tietze_closed_interval:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   472
  fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::euclidean_space"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   473
  assumes "continuous_on S f"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   474
    and "closedin (top_of_set U) S"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   475
    and "cbox a b \<noteq> {}"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   476
    and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   477
  obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   478
    "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   479
  apply (rule Dugundji [of "cbox a b" U S f])
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   480
  using assms by auto
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   481
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   482
corollary\<^marker>\<open>tag unimportant\<close> Tietze_closed_interval_1:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   483
  fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> real"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   484
  assumes "continuous_on S f"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   485
    and "closedin (top_of_set U) S"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   486
    and "a \<le> b"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   487
    and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> cbox a b"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   488
  obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   489
    "\<And>x. x \<in> U \<Longrightarrow> g x \<in> cbox a b"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   490
  apply (rule Dugundji [of "cbox a b" U S f])
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   491
  using assms by (auto simp: image_subset_iff)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   492
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   493
corollary\<^marker>\<open>tag unimportant\<close> Tietze_open_interval:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   494
  fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::euclidean_space"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   495
  assumes "continuous_on S f"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   496
    and "closedin (top_of_set U) S"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   497
    and "box a b \<noteq> {}"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   498
    and "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   499
  obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   500
    "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   501
  apply (rule Dugundji [of "box a b" U S f])
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   502
  using assms by auto
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   503
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   504
corollary\<^marker>\<open>tag unimportant\<close> Tietze_open_interval_1:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   505
  fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> real"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   506
  assumes "continuous_on S f"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   507
    and "closedin (top_of_set U) S"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   508
    and "a < b"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   509
    and no: "\<And>x. x \<in> S \<Longrightarrow> f x \<in> box a b"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   510
  obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   511
    "\<And>x. x \<in> U \<Longrightarrow> g x \<in> box a b"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   512
  apply (rule Dugundji [of "box a b" U S f])
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   513
  using assms by (auto simp: image_subset_iff)
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   514
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   515
corollary\<^marker>\<open>tag unimportant\<close> Tietze_unbounded:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   516
  fixes f :: "'a::{metric_space,second_countable_topology} \<Rightarrow> 'b::real_inner"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   517
  assumes "continuous_on S f"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
   518
    and "closedin (top_of_set U) S"
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   519
  obtains g where "continuous_on U g" "\<And>x. x \<in> S \<Longrightarrow> g x = f x"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   520
  apply (rule Dugundji [of UNIV U S f])
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69518
diff changeset
   521
  using assms by auto
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   522
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   523
end