src/HOL/Analysis/Homeomorphism.thy
author hoelzl
Mon, 08 Aug 2016 14:13:14 +0200
changeset 63627 6ddb43c6b711
parent 63301 src/HOL/Multivariate_Analysis/Homeomorphism.thy@d3c87eb0bad2
child 63918 6bf55e6e0b75
permissions -rw-r--r--
rename HOL-Multivariate_Analysis to HOL-Analysis.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63627
6ddb43c6b711 rename HOL-Multivariate_Analysis to HOL-Analysis.
hoelzl
parents: 63301
diff changeset
     1
(*  Title:      HOL/Analysis/Homeomorphism.thy
63130
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     2
    Author: LC Paulson (ported from HOL Light)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     3
*)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     4
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     5
section \<open>Homeomorphism Theorems\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     6
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     7
theory Homeomorphism
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     8
imports Path_Connected
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     9
begin
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    10
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    11
subsection \<open>Homeomorphism of all convex compact sets with nonempty interior\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    12
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    13
proposition ray_to_rel_frontier:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    14
  fixes a :: "'a::real_inner"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    15
  assumes "bounded S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    16
      and a: "a \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    17
      and aff: "(a + l) \<in> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    18
      and "l \<noteq> 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    19
  obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> rel_frontier S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    20
           "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    21
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    22
  have aaff: "a \<in> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    23
    by (meson a hull_subset rel_interior_subset rev_subsetD)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    24
  let ?D = "{d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    25
  obtain B where "B > 0" and B: "S \<subseteq> ball a B"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    26
    using bounded_subset_ballD [OF \<open>bounded S\<close>] by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    27
  have "a + (B / norm l) *\<^sub>R l \<notin> ball a B"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    28
    by (simp add: dist_norm \<open>l \<noteq> 0\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    29
  with B have "a + (B / norm l) *\<^sub>R l \<notin> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    30
    using rel_interior_subset subsetCE by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    31
  with \<open>B > 0\<close> \<open>l \<noteq> 0\<close> have nonMT: "?D \<noteq> {}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    32
    using divide_pos_pos zero_less_norm_iff by fastforce
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    33
  have bdd: "bdd_below ?D"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    34
    by (metis (no_types, lifting) bdd_belowI le_less mem_Collect_eq)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    35
  have relin_Ex: "\<And>x. x \<in> rel_interior S \<Longrightarrow>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    36
                    \<exists>e>0. \<forall>x'\<in>affine hull S. dist x' x < e \<longrightarrow> x' \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    37
    using openin_rel_interior [of S] by (simp add: openin_euclidean_subtopology_iff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    38
  define d where "d = Inf ?D"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    39
  obtain \<epsilon> where "0 < \<epsilon>" and \<epsilon>: "\<And>\<eta>. \<lbrakk>0 \<le> \<eta>; \<eta> < \<epsilon>\<rbrakk> \<Longrightarrow> (a + \<eta> *\<^sub>R l) \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    40
  proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    41
    obtain e where "e>0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    42
            and e: "\<And>x'. x' \<in> affine hull S \<Longrightarrow> dist x' a < e \<Longrightarrow> x' \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    43
      using relin_Ex a by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    44
    show thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    45
    proof (rule_tac \<epsilon> = "e / norm l" in that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    46
      show "0 < e / norm l" by (simp add: \<open>0 < e\<close> \<open>l \<noteq> 0\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    47
    next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    48
      show "a + \<eta> *\<^sub>R l \<in> rel_interior S" if "0 \<le> \<eta>" "\<eta> < e / norm l" for \<eta>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    49
      proof (rule e)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    50
        show "a + \<eta> *\<^sub>R l \<in> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    51
          by (metis (no_types) add_diff_cancel_left' aff affine_affine_hull mem_affine_3_minus aaff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    52
        show "dist (a + \<eta> *\<^sub>R l) a < e"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    53
          using that by (simp add: \<open>l \<noteq> 0\<close> dist_norm pos_less_divide_eq)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    54
      qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    55
    qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    56
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    57
  have inint: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> a + e *\<^sub>R l \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    58
    unfolding d_def using cInf_lower [OF _ bdd]
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    59
    by (metis (no_types, lifting) a add.right_neutral le_less mem_Collect_eq not_less real_vector.scale_zero_left)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    60
  have "\<epsilon> \<le> d"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    61
    unfolding d_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    62
    apply (rule cInf_greatest [OF nonMT])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    63
    using \<epsilon> dual_order.strict_implies_order le_less_linear by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    64
  with \<open>0 < \<epsilon>\<close> have "0 < d" by simp
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    65
  have "a + d *\<^sub>R l \<notin> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    66
  proof
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    67
    assume adl: "a + d *\<^sub>R l \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    68
    obtain e where "e > 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    69
             and e: "\<And>x'. x' \<in> affine hull S \<Longrightarrow> dist x' (a + d *\<^sub>R l) < e \<Longrightarrow> x' \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    70
      using relin_Ex adl by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    71
    have "d + e / norm l \<le> Inf {d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    72
    proof (rule cInf_greatest [OF nonMT], clarsimp)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    73
      fix x::real
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    74
      assume "0 < x" and nonrel: "a + x *\<^sub>R l \<notin> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    75
      show "d + e / norm l \<le> x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    76
      proof (cases "x < d")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    77
        case True with inint nonrel \<open>0 < x\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    78
          show ?thesis by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    79
      next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    80
        case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    81
          then have dle: "x < d + e / norm l \<Longrightarrow> dist (a + x *\<^sub>R l) (a + d *\<^sub>R l) < e"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    82
            by (simp add: field_simps \<open>l \<noteq> 0\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    83
          have ain: "a + x *\<^sub>R l \<in> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    84
            by (metis add_diff_cancel_left' aff affine_affine_hull mem_affine_3_minus aaff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    85
          show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    86
            using e [OF ain] nonrel dle by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    87
      qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    88
    qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    89
    then show False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    90
      using \<open>0 < e\<close> \<open>l \<noteq> 0\<close> by (simp add: d_def [symmetric] divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    91
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    92
  moreover have "a + d *\<^sub>R l \<in> closure S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    93
  proof (clarsimp simp: closure_approachable)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    94
    fix \<eta>::real assume "0 < \<eta>"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    95
    have 1: "a + (d - min d (\<eta> / 2 / norm l)) *\<^sub>R l \<in> S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    96
      apply (rule subsetD [OF rel_interior_subset inint])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    97
      using \<open>l \<noteq> 0\<close> \<open>0 < d\<close> \<open>0 < \<eta>\<close> by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    98
    have "norm l * min d (\<eta> / (norm l * 2)) \<le> norm l * (\<eta> / (norm l * 2))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    99
      by (metis min_def mult_left_mono norm_ge_zero order_refl)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   100
    also have "... < \<eta>"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   101
      using \<open>l \<noteq> 0\<close> \<open>0 < \<eta>\<close> by (simp add: divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   102
    finally have 2: "norm l * min d (\<eta> / (norm l * 2)) < \<eta>" .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   103
    show "\<exists>y\<in>S. dist y (a + d *\<^sub>R l) < \<eta>"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   104
      apply (rule_tac x="a + (d - min d (\<eta> / 2 / norm l)) *\<^sub>R l" in bexI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   105
      using 1 2 \<open>0 < d\<close> \<open>0 < \<eta>\<close> apply (auto simp: algebra_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   106
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   107
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   108
  ultimately have infront: "a + d *\<^sub>R l \<in> rel_frontier S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   109
    by (simp add: rel_frontier_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   110
  show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   111
    by (rule that [OF \<open>0 < d\<close> infront inint])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   112
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   113
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   114
corollary ray_to_frontier:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   115
  fixes a :: "'a::euclidean_space"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   116
  assumes "bounded S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   117
      and a: "a \<in> interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   118
      and "l \<noteq> 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   119
  obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> frontier S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   120
           "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   121
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   122
  have "interior S = rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   123
    using a rel_interior_nonempty_interior by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   124
  then have "a \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   125
    using a by simp
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   126
  then show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   127
    apply (rule ray_to_rel_frontier [OF \<open>bounded S\<close> _ _ \<open>l \<noteq> 0\<close>])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   128
     using a affine_hull_nonempty_interior apply blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   129
    by (simp add: \<open>interior S = rel_interior S\<close> frontier_def rel_frontier_def that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   130
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   131
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   132
proposition
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   133
  fixes S :: "'a::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   134
  assumes "compact S" and 0: "0 \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   135
      and star: "\<And>x. x \<in> S \<Longrightarrow> open_segment 0 x \<subseteq> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   136
    shows starlike_compact_projective1_0:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   137
            "S - rel_interior S homeomorphic sphere 0 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   138
            (is "?SMINUS homeomorphic ?SPHER")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   139
      and starlike_compact_projective2_0:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   140
            "S homeomorphic cball 0 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   141
            (is "S homeomorphic ?CBALL")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   142
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   143
  have starI: "(u *\<^sub>R x) \<in> rel_interior S" if "x \<in> S" "0 \<le> u" "u < 1" for x u
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   144
  proof (cases "x=0 \<or> u=0")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   145
    case True with 0 show ?thesis by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   146
  next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   147
    case False with that show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   148
      by (auto simp: in_segment intro: star [THEN subsetD])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   149
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   150
  have "0 \<in> S"  using assms rel_interior_subset by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   151
  define proj where "proj \<equiv> \<lambda>x::'a. x /\<^sub>R norm x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   152
  have eqI: "x = y" if "proj x = proj y" "norm x = norm y" for x y
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   153
    using that  by (force simp: proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   154
  then have iff_eq: "\<And>x y. (proj x = proj y \<and> norm x = norm y) \<longleftrightarrow> x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   155
    by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   156
  have projI: "x \<in> affine hull S \<Longrightarrow> proj x \<in> affine hull S" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   157
    by (metis \<open>0 \<in> S\<close> affine_hull_span_0 hull_inc span_mul proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   158
  have nproj1 [simp]: "x \<noteq> 0 \<Longrightarrow> norm(proj x) = 1" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   159
    by (simp add: proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   160
  have proj0_iff [simp]: "proj x = 0 \<longleftrightarrow> x = 0" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   161
    by (simp add: proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   162
  have cont_proj: "continuous_on (UNIV - {0}) proj"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   163
    unfolding proj_def by (rule continuous_intros | force)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   164
  have proj_spherI: "\<And>x. \<lbrakk>x \<in> affine hull S; x \<noteq> 0\<rbrakk> \<Longrightarrow> proj x \<in> ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   165
    by (simp add: projI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   166
  have "bounded S" "closed S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   167
    using \<open>compact S\<close> compact_eq_bounded_closed by blast+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   168
  have inj_on_proj: "inj_on proj (S - rel_interior S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   169
  proof
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   170
    fix x y
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   171
    assume x: "x \<in> S - rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   172
       and y: "y \<in> S - rel_interior S" and eq: "proj x = proj y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   173
    then have xynot: "x \<noteq> 0" "y \<noteq> 0" "x \<in> S" "y \<in> S" "x \<notin> rel_interior S" "y \<notin> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   174
      using 0 by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   175
    consider "norm x = norm y" | "norm x < norm y" | "norm x > norm y" by linarith
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   176
    then show "x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   177
    proof cases
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   178
      assume "norm x = norm y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   179
        with iff_eq eq show "x = y" by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   180
    next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   181
      assume *: "norm x < norm y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   182
      have "x /\<^sub>R norm x = norm x *\<^sub>R (x /\<^sub>R norm x) /\<^sub>R norm (norm x *\<^sub>R (x /\<^sub>R norm x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   183
        by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   184
      then have "proj ((norm x / norm y) *\<^sub>R y) = proj x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   185
        by (metis (no_types) divide_inverse local.proj_def eq scaleR_scaleR)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   186
      then have [simp]: "(norm x / norm y) *\<^sub>R y = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   187
        by (rule eqI) (simp add: \<open>y \<noteq> 0\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   188
      have no: "0 \<le> norm x / norm y" "norm x / norm y < 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   189
        using * by (auto simp: divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   190
      then show "x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   191
        using starI [OF \<open>y \<in> S\<close> no] xynot by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   192
    next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   193
      assume *: "norm x > norm y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   194
      have "y /\<^sub>R norm y = norm y *\<^sub>R (y /\<^sub>R norm y) /\<^sub>R norm (norm y *\<^sub>R (y /\<^sub>R norm y))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   195
        by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   196
      then have "proj ((norm y / norm x) *\<^sub>R x) = proj y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   197
        by (metis (no_types) divide_inverse local.proj_def eq scaleR_scaleR)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   198
      then have [simp]: "(norm y / norm x) *\<^sub>R x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   199
        by (rule eqI) (simp add: \<open>x \<noteq> 0\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   200
      have no: "0 \<le> norm y / norm x" "norm y / norm x < 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   201
        using * by (auto simp: divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   202
      then show "x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   203
        using starI [OF \<open>x \<in> S\<close> no] xynot by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   204
    qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   205
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   206
  have "\<exists>surf. homeomorphism (S - rel_interior S) ?SPHER proj surf"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   207
  proof (rule homeomorphism_compact)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   208
    show "compact (S - rel_interior S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   209
       using \<open>compact S\<close> compact_rel_boundary by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   210
    show "continuous_on (S - rel_interior S) proj"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   211
      using 0 by (blast intro: continuous_on_subset [OF cont_proj])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   212
    show "proj ` (S - rel_interior S) = ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   213
    proof
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   214
      show "proj ` (S - rel_interior S) \<subseteq> ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   215
        using 0 by (force simp: hull_inc projI intro: nproj1)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   216
      show "?SPHER \<subseteq> proj ` (S - rel_interior S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   217
      proof (clarsimp simp: proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   218
        fix x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   219
        assume "x \<in> affine hull S" and nox: "norm x = 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   220
        then have "x \<noteq> 0" by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   221
        obtain d where "0 < d" and dx: "(d *\<^sub>R x) \<in> rel_frontier S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   222
                   and ri: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (e *\<^sub>R x) \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   223
          using ray_to_rel_frontier [OF \<open>bounded S\<close> 0] \<open>x \<in> affine hull S\<close> \<open>x \<noteq> 0\<close> by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   224
        show "x \<in> (\<lambda>x. x /\<^sub>R norm x) ` (S - rel_interior S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   225
          apply (rule_tac x="d *\<^sub>R x" in image_eqI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   226
          using \<open>0 < d\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   227
          using dx \<open>closed S\<close> apply (auto simp: rel_frontier_def divide_simps nox)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   228
          done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   229
      qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   230
    qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   231
  qed (rule inj_on_proj)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   232
  then obtain surf where surf: "homeomorphism (S - rel_interior S) ?SPHER proj surf"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   233
    by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   234
  then have cont_surf: "continuous_on (proj ` (S - rel_interior S)) surf"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   235
    by (auto simp: homeomorphism_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   236
  have surf_nz: "\<And>x. x \<in> ?SPHER \<Longrightarrow> surf x \<noteq> 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   237
    by (metis "0" DiffE homeomorphism_def imageI surf)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   238
  have cont_nosp: "continuous_on (?SPHER) (\<lambda>x. norm x *\<^sub>R ((surf o proj) x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   239
    apply (rule continuous_intros)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   240
    apply (rule continuous_on_subset [OF cont_proj], force)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   241
    apply (rule continuous_on_subset [OF cont_surf])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   242
    apply (force simp: homeomorphism_image1 [OF surf] dest: proj_spherI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   243
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   244
  have surfpS: "\<And>x. \<lbrakk>norm x = 1; x \<in> affine hull S\<rbrakk> \<Longrightarrow> surf (proj x) \<in> S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   245
    by (metis (full_types) DiffE \<open>0 \<in> S\<close> homeomorphism_def image_eqI norm_zero proj_spherI real_vector.scale_zero_left scaleR_one surf)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   246
  have *: "\<exists>y. norm y = 1 \<and> y \<in> affine hull S \<and> x = surf (proj y)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   247
          if "x \<in> S" "x \<notin> rel_interior S" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   248
  proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   249
    have "proj x \<in> ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   250
      by (metis (full_types) "0" hull_inc proj_spherI that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   251
    moreover have "surf (proj x) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   252
      by (metis Diff_iff homeomorphism_def surf that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   253
    ultimately show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   254
      by (metis \<open>\<And>x. x \<in> ?SPHER \<Longrightarrow> surf x \<noteq> 0\<close> hull_inc inverse_1 local.proj_def norm_sgn projI scaleR_one sgn_div_norm that(1))
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   255
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   256
  have surfp_notin: "\<And>x. \<lbrakk>norm x = 1; x \<in> affine hull S\<rbrakk> \<Longrightarrow> surf (proj x) \<notin> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   257
    by (metis (full_types) DiffE one_neq_zero homeomorphism_def image_eqI norm_zero proj_spherI surf)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   258
  have no_sp_im: "(\<lambda>x. norm x *\<^sub>R surf (proj x)) ` (?SPHER) = S - rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   259
    by (auto simp: surfpS image_def Bex_def surfp_notin *)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   260
  have inj_spher: "inj_on (\<lambda>x. norm x *\<^sub>R surf (proj x)) ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   261
  proof
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   262
    fix x y
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   263
    assume xy: "x \<in> ?SPHER" "y \<in> ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   264
       and eq: " norm x *\<^sub>R surf (proj x) = norm y *\<^sub>R surf (proj y)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   265
    then have "norm x = 1" "norm y = 1" "x \<in> affine hull S" "y \<in> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   266
      using 0 by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   267
    with eq show "x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   268
      by (simp add: proj_def) (metis surf xy homeomorphism_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   269
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   270
  have co01: "compact ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   271
    by (simp add: closed_affine_hull compact_Int_closed)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   272
  show "?SMINUS homeomorphic ?SPHER"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   273
    apply (subst homeomorphic_sym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   274
    apply (rule homeomorphic_compact [OF co01 cont_nosp [unfolded o_def] no_sp_im inj_spher])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   275
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   276
  have proj_scaleR: "\<And>a x. 0 < a \<Longrightarrow> proj (a *\<^sub>R x) = proj x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   277
    by (simp add: proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   278
  have cont_sp0: "continuous_on (affine hull S - {0}) (surf o proj)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   279
    apply (rule continuous_on_compose [OF continuous_on_subset [OF cont_proj]], force)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   280
    apply (rule continuous_on_subset [OF cont_surf])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   281
    using homeomorphism_image1 proj_spherI surf by fastforce
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   282
  obtain B where "B>0" and B: "\<And>x. x \<in> S \<Longrightarrow> norm x \<le> B"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   283
    by (metis compact_imp_bounded \<open>compact S\<close> bounded_pos_less less_eq_real_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   284
  have cont_nosp: "continuous (at x within ?CBALL) (\<lambda>x. norm x *\<^sub>R surf (proj x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   285
         if "norm x \<le> 1" "x \<in> affine hull S" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   286
  proof (cases "x=0")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   287
    case True
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   288
    show ?thesis using True
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   289
      apply (simp add: continuous_within)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   290
      apply (rule lim_null_scaleR_bounded [where B=B])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   291
      apply (simp_all add: tendsto_norm_zero eventually_at)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   292
      apply (rule_tac x=B in exI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   293
      using B surfpS proj_def projI apply (auto simp: \<open>B > 0\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   294
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   295
  next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   296
    case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   297
    then have "\<forall>\<^sub>F x in at x. (x \<in> affine hull S - {0}) = (x \<in> affine hull S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   298
      apply (simp add: eventually_at)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   299
      apply (rule_tac x="norm x" in exI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   300
      apply (auto simp: False)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   301
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   302
    with cont_sp0 have *: "continuous (at x within affine hull S) (\<lambda>x. surf (proj x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   303
      apply (simp add: continuous_on_eq_continuous_within)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   304
      apply (drule_tac x=x in bspec, force simp: False that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   305
      apply (simp add: continuous_within Lim_transform_within_set)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   306
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   307
    show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   308
      apply (rule continuous_within_subset [where s = "affine hull S", OF _ Int_lower2])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   309
      apply (rule continuous_intros *)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   310
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   311
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   312
  have cont_nosp2: "continuous_on ?CBALL (\<lambda>x. norm x *\<^sub>R ((surf o proj) x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   313
    by (simp add: continuous_on_eq_continuous_within cont_nosp)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   314
  have "norm y *\<^sub>R surf (proj y) \<in> S"  if "y \<in> cball 0 1" and yaff: "y \<in> affine hull S" for y
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   315
  proof (cases "y=0")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   316
    case True then show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   317
      by (simp add: \<open>0 \<in> S\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   318
  next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   319
    case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   320
    then have "norm y *\<^sub>R surf (proj y) = norm y *\<^sub>R surf (proj (y /\<^sub>R norm y))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   321
      by (simp add: proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   322
    have "norm y \<le> 1" using that by simp
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   323
    have "surf (proj (y /\<^sub>R norm y)) \<in> S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   324
      apply (rule surfpS)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   325
      using proj_def projI yaff
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   326
      by (auto simp: False)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   327
    then have "surf (proj y) \<in> S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   328
      by (simp add: False proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   329
    then show "norm y *\<^sub>R surf (proj y) \<in> S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   330
      by (metis dual_order.antisym le_less_linear norm_ge_zero rel_interior_subset scaleR_one
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   331
                starI subset_eq \<open>norm y \<le> 1\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   332
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   333
  moreover have "x \<in> (\<lambda>x. norm x *\<^sub>R surf (proj x)) ` (?CBALL)" if "x \<in> S" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   334
  proof (cases "x=0")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   335
    case True with that hull_inc  show ?thesis by fastforce
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   336
  next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   337
    case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   338
    then have psp: "proj (surf (proj x)) = proj x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   339
      by (metis homeomorphism_def hull_inc proj_spherI surf that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   340
    have nxx: "norm x *\<^sub>R proj x = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   341
      by (simp add: False local.proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   342
    have affineI: "(1 / norm (surf (proj x))) *\<^sub>R x \<in> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   343
      by (metis \<open>0 \<in> S\<close> affine_hull_span_0 hull_inc span_clauses(4) that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   344
    have sproj_nz: "surf (proj x) \<noteq> 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   345
      by (metis False proj0_iff psp)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   346
    then have "proj x = proj (proj x)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   347
      by (metis False nxx proj_scaleR zero_less_norm_iff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   348
    moreover have scaleproj: "\<And>a r. r *\<^sub>R proj a = (r / norm a) *\<^sub>R a"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   349
      by (simp add: divide_inverse local.proj_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   350
    ultimately have "(norm (surf (proj x)) / norm x) *\<^sub>R x \<notin> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   351
      by (metis (no_types) sproj_nz divide_self_if hull_inc norm_eq_zero nproj1 projI psp scaleR_one surfp_notin that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   352
    then have "(norm (surf (proj x)) / norm x) \<ge> 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   353
      using starI [OF that] by (meson starI [OF that] le_less_linear norm_ge_zero zero_le_divide_iff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   354
    then have nole: "norm x \<le> norm (surf (proj x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   355
      by (simp add: le_divide_eq_1)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   356
    show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   357
      apply (rule_tac x="inverse(norm(surf (proj x))) *\<^sub>R x" in image_eqI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   358
      apply (metis (no_types, hide_lams) mult.commute scaleproj abs_inverse abs_norm_cancel divide_inverse norm_scaleR nxx positive_imp_inverse_positive proj_scaleR psp sproj_nz zero_less_norm_iff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   359
      apply (auto simp: divide_simps nole affineI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   360
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   361
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   362
  ultimately have im_cball: "(\<lambda>x. norm x *\<^sub>R surf (proj x)) ` ?CBALL = S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   363
    by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   364
  have inj_cball: "inj_on (\<lambda>x. norm x *\<^sub>R surf (proj x)) ?CBALL"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   365
  proof
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   366
    fix x y
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   367
    assume "x \<in> ?CBALL" "y \<in> ?CBALL"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   368
       and eq: "norm x *\<^sub>R surf (proj x) = norm y *\<^sub>R surf (proj y)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   369
    then have x: "x \<in> affine hull S" and y: "y \<in> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   370
      using 0 by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   371
    show "x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   372
    proof (cases "x=0 \<or> y=0")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   373
      case True then show "x = y" using eq proj_spherI surf_nz x y by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   374
    next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   375
      case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   376
      with x y have speq: "surf (proj x) = surf (proj y)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   377
        by (metis eq homeomorphism_apply2 proj_scaleR proj_spherI surf zero_less_norm_iff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   378
      then have "norm x = norm y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   379
        by (metis \<open>x \<in> affine hull S\<close> \<open>y \<in> affine hull S\<close> eq proj_spherI real_vector.scale_cancel_right surf_nz)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   380
      moreover have "proj x = proj y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   381
        by (metis (no_types) False speq homeomorphism_apply2 proj_spherI surf x y)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   382
      ultimately show "x = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   383
        using eq eqI by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   384
    qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   385
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   386
  have co01: "compact ?CBALL"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   387
    by (simp add: closed_affine_hull compact_Int_closed)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   388
  show "S homeomorphic ?CBALL"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   389
    apply (subst homeomorphic_sym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   390
    apply (rule homeomorphic_compact [OF co01 cont_nosp2 [unfolded o_def] im_cball inj_cball])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   391
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   392
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   393
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   394
corollary
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   395
  fixes S :: "'a::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   396
  assumes "compact S" and a: "a \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   397
      and star: "\<And>x. x \<in> S \<Longrightarrow> open_segment a x \<subseteq> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   398
    shows starlike_compact_projective1:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   399
            "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   400
      and starlike_compact_projective2:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   401
            "S homeomorphic cball a 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   402
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   403
  have 1: "compact (op+ (-a) ` S)" by (meson assms compact_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   404
  have 2: "0 \<in> rel_interior (op+ (-a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   405
    by (simp add: a rel_interior_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   406
  have 3: "open_segment 0 x \<subseteq> rel_interior (op+ (-a) ` S)" if "x \<in> (op+ (-a) ` S)" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   407
  proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   408
    have "x+a \<in> S" using that by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   409
    then have "open_segment a (x+a) \<subseteq> rel_interior S" by (metis star)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   410
    then show ?thesis using open_segment_translation
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   411
      using rel_interior_translation by fastforce
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   412
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   413
  have "S - rel_interior S homeomorphic (op+ (-a) ` S) - rel_interior (op+ (-a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   414
    by (metis rel_interior_translation translation_diff homeomorphic_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   415
  also have "... homeomorphic sphere 0 1 \<inter> affine hull (op+ (-a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   416
    by (rule starlike_compact_projective1_0 [OF 1 2 3])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   417
  also have "... = op+ (-a) ` (sphere a 1 \<inter> affine hull S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   418
    by (metis affine_hull_translation left_minus sphere_translation translation_Int)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   419
  also have "... homeomorphic sphere a 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   420
    using homeomorphic_translation homeomorphic_sym by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   421
  finally show "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S" .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   422
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   423
  have "S homeomorphic (op+ (-a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   424
    by (metis homeomorphic_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   425
  also have "... homeomorphic cball 0 1 \<inter> affine hull (op+ (-a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   426
    by (rule starlike_compact_projective2_0 [OF 1 2 3])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   427
  also have "... = op+ (-a) ` (cball a 1 \<inter> affine hull S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   428
    by (metis affine_hull_translation left_minus cball_translation translation_Int)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   429
  also have "... homeomorphic cball a 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   430
    using homeomorphic_translation homeomorphic_sym by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   431
  finally show "S homeomorphic cball a 1 \<inter> affine hull S" .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   432
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   433
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   434
corollary starlike_compact_projective_special:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   435
  assumes "compact S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   436
    and cb01: "cball (0::'a::euclidean_space) 1 \<subseteq> S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   437
    and scale: "\<And>x u. \<lbrakk>x \<in> S; 0 \<le> u; u < 1\<rbrakk> \<Longrightarrow> u *\<^sub>R x \<in> S - frontier S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   438
  shows "S homeomorphic (cball (0::'a::euclidean_space) 1)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   439
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   440
  have "ball 0 1 \<subseteq> interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   441
    using cb01 interior_cball interior_mono by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   442
  then have 0: "0 \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   443
    by (meson centre_in_ball subsetD interior_subset_rel_interior le_numeral_extra(2) not_le)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   444
  have [simp]: "affine hull S = UNIV"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   445
    using \<open>ball 0 1 \<subseteq> interior S\<close> by (auto intro!: affine_hull_nonempty_interior)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   446
  have star: "open_segment 0 x \<subseteq> rel_interior S" if "x \<in> S" for x
63627
6ddb43c6b711 rename HOL-Multivariate_Analysis to HOL-Analysis.
hoelzl
parents: 63301
diff changeset
   447
  proof
63130
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   448
    fix p assume "p \<in> open_segment 0 x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   449
    then obtain u where "x \<noteq> 0" and u: "0 \<le> u" "u < 1" and p: "u *\<^sub>R x = p"
63627
6ddb43c6b711 rename HOL-Multivariate_Analysis to HOL-Analysis.
hoelzl
parents: 63301
diff changeset
   450
      by (auto simp: in_segment)
63130
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   451
    then show "p \<in> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   452
      using scale [OF that u] closure_subset frontier_def interior_subset_rel_interior by fastforce
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   453
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   454
  show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   455
    using starlike_compact_projective2_0 [OF \<open>compact S\<close> 0 star] by simp
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   456
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   457
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   458
lemma homeomorphic_convex_lemma:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   459
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   460
  assumes "convex S" "compact S" "convex T" "compact T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   461
      and affeq: "aff_dim S = aff_dim T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   462
    shows "(S - rel_interior S) homeomorphic (T - rel_interior T) \<and>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   463
           S homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   464
proof (cases "rel_interior S = {} \<or> rel_interior T = {}")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   465
  case True
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   466
    then show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   467
      by (metis Diff_empty affeq \<open>convex S\<close> \<open>convex T\<close> aff_dim_empty homeomorphic_empty rel_interior_eq_empty aff_dim_empty)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   468
next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   469
  case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   470
  then obtain a b where a: "a \<in> rel_interior S" and b: "b \<in> rel_interior T" by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   471
  have starS: "\<And>x. x \<in> S \<Longrightarrow> open_segment a x \<subseteq> rel_interior S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   472
    using rel_interior_closure_convex_segment
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   473
          a \<open>convex S\<close> closure_subset subsetCE by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   474
  have starT: "\<And>x. x \<in> T \<Longrightarrow> open_segment b x \<subseteq> rel_interior T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   475
    using rel_interior_closure_convex_segment
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   476
          b \<open>convex T\<close> closure_subset subsetCE by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   477
  let ?aS = "op+ (-a) ` S" and ?bT = "op+ (-b) ` T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   478
  have 0: "0 \<in> affine hull ?aS" "0 \<in> affine hull ?bT"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   479
    by (metis a b subsetD hull_inc image_eqI left_minus rel_interior_subset)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   480
  have subs: "subspace (span ?aS)" "subspace (span ?bT)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   481
    by (rule subspace_span)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   482
  moreover
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   483
  have "dim (span (op + (- a) ` S)) = dim (span (op + (- b) ` T))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   484
    by (metis 0 aff_dim_translation_eq aff_dim_zero affeq dim_span nat_int)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   485
  ultimately obtain f g where "linear f" "linear g"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   486
                and fim: "f ` span ?aS = span ?bT"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   487
                and gim: "g ` span ?bT = span ?aS"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   488
                and fno: "\<And>x. x \<in> span ?aS \<Longrightarrow> norm(f x) = norm x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   489
                and gno: "\<And>x. x \<in> span ?bT \<Longrightarrow> norm(g x) = norm x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   490
                and gf: "\<And>x. x \<in> span ?aS \<Longrightarrow> g(f x) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   491
                and fg: "\<And>x. x \<in> span ?bT \<Longrightarrow> f(g x) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   492
    by (rule isometries_subspaces) blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   493
  have [simp]: "continuous_on A f" for A
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   494
    using \<open>linear f\<close> linear_conv_bounded_linear linear_continuous_on by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   495
  have [simp]: "continuous_on B g" for B
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   496
    using \<open>linear g\<close> linear_conv_bounded_linear linear_continuous_on by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   497
  have eqspanS: "affine hull ?aS = span ?aS"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   498
    by (metis a affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   499
  have eqspanT: "affine hull ?bT = span ?bT"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   500
    by (metis b affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   501
  have "S homeomorphic cball a 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   502
    by (rule starlike_compact_projective2 [OF \<open>compact S\<close> a starS])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   503
  also have "... homeomorphic op+ (-a) ` (cball a 1 \<inter> affine hull S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   504
    by (metis homeomorphic_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   505
  also have "... = cball 0 1 \<inter> op+ (-a) ` (affine hull S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   506
    by (auto simp: dist_norm)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   507
  also have "... = cball 0 1 \<inter> span ?aS"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   508
    using eqspanS affine_hull_translation by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   509
  also have "... homeomorphic cball 0 1 \<inter> span ?bT"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   510
    proof (rule homeomorphicI [where f=f and g=g])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   511
      show fim1: "f ` (cball 0 1 \<inter> span ?aS) = cball 0 1 \<inter> span ?bT"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   512
        apply (rule subset_antisym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   513
         using fim fno apply (force simp:, clarify)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   514
        by (metis IntI fg gim gno image_eqI mem_cball_0)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   515
      show "g ` (cball 0 1 \<inter> span ?bT) = cball 0 1 \<inter> span ?aS"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   516
        apply (rule subset_antisym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   517
         using gim gno apply (force simp:, clarify)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   518
        by (metis IntI fim1 gf image_eqI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   519
    qed (auto simp: fg gf)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   520
  also have "... = cball 0 1 \<inter> op+ (-b) ` (affine hull T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   521
    using eqspanT affine_hull_translation by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   522
  also have "... = op+ (-b) ` (cball b 1 \<inter> affine hull T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   523
    by (auto simp: dist_norm)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   524
  also have "... homeomorphic (cball b 1 \<inter> affine hull T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   525
    by (metis homeomorphic_translation homeomorphic_sym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   526
  also have "... homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   527
    by (metis starlike_compact_projective2 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   528
  finally have 1: "S homeomorphic T" .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   529
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   530
  have "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   531
    by (rule starlike_compact_projective1 [OF \<open>compact S\<close> a starS])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   532
  also have "... homeomorphic op+ (-a) ` (sphere a 1 \<inter> affine hull S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   533
    by (metis homeomorphic_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   534
  also have "... = sphere 0 1 \<inter> op+ (-a) ` (affine hull S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   535
    by (auto simp: dist_norm)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   536
  also have "... = sphere 0 1 \<inter> span ?aS"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   537
    using eqspanS affine_hull_translation by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   538
  also have "... homeomorphic sphere 0 1 \<inter> span ?bT"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   539
    proof (rule homeomorphicI [where f=f and g=g])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   540
      show fim1: "f ` (sphere 0 1 \<inter> span ?aS) = sphere 0 1 \<inter> span ?bT"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   541
        apply (rule subset_antisym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   542
        using fim fno apply (force simp:, clarify)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   543
        by (metis IntI fg gim gno image_eqI mem_sphere_0)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   544
      show "g ` (sphere 0 1 \<inter> span ?bT) = sphere 0 1 \<inter> span ?aS"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   545
        apply (rule subset_antisym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   546
        using gim gno apply (force simp:, clarify)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   547
        by (metis IntI fim1 gf image_eqI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   548
    qed (auto simp: fg gf)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   549
  also have "... = sphere 0 1 \<inter> op+ (-b) ` (affine hull T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   550
    using eqspanT affine_hull_translation by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   551
  also have "... = op+ (-b) ` (sphere b 1 \<inter> affine hull T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   552
    by (auto simp: dist_norm)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   553
  also have "... homeomorphic (sphere b 1 \<inter> affine hull T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   554
    by (metis homeomorphic_translation homeomorphic_sym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   555
  also have "... homeomorphic T - rel_interior T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   556
    by (metis starlike_compact_projective1 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   557
  finally have 2: "S - rel_interior S homeomorphic T - rel_interior T" .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   558
  show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   559
    using 1 2 by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   560
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   561
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   562
lemma homeomorphic_convex_compact_sets:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   563
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   564
  assumes "convex S" "compact S" "convex T" "compact T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   565
      and affeq: "aff_dim S = aff_dim T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   566
    shows "S homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   567
using homeomorphic_convex_lemma [OF assms] assms
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   568
by (auto simp: rel_frontier_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   569
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   570
lemma homeomorphic_rel_frontiers_convex_bounded_sets:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   571
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   572
  assumes "convex S" "bounded S" "convex T" "bounded T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   573
      and affeq: "aff_dim S = aff_dim T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   574
    shows  "rel_frontier S homeomorphic rel_frontier T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   575
using assms homeomorphic_convex_lemma [of "closure S" "closure T"]
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   576
by (simp add: rel_frontier_def convex_rel_interior_closure)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   577
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   578
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   579
subsection\<open>Homeomorphisms between punctured spheres and affine sets\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   580
text\<open>Including the famous stereoscopic projection of the 3-D sphere to the complex plane\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   581
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   582
text\<open>The special case with centre 0 and radius 1\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   583
lemma homeomorphic_punctured_affine_sphere_affine_01:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   584
  assumes "b \<in> sphere 0 1" "affine T" "0 \<in> T" "b \<in> T" "affine p"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   585
      and affT: "aff_dim T = aff_dim p + 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   586
    shows "(sphere 0 1 \<inter> T) - {b} homeomorphic p"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   587
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   588
  have [simp]: "norm b = 1" "b\<bullet>b = 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   589
    using assms by (auto simp: norm_eq_1)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   590
  have [simp]: "T \<inter> {v. b\<bullet>v = 0} \<noteq> {}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   591
    using \<open>0 \<in> T\<close> by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   592
  have [simp]: "\<not> T \<subseteq> {v. b\<bullet>v = 0}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   593
    using \<open>norm b = 1\<close> \<open>b \<in> T\<close> by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   594
  define f where "f \<equiv> \<lambda>x. 2 *\<^sub>R b + (2 / (1 - b\<bullet>x)) *\<^sub>R (x - b)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   595
  define g where "g \<equiv> \<lambda>y. b + (4 / (norm y ^ 2 + 4)) *\<^sub>R (y - 2 *\<^sub>R b)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   596
  have [simp]: "\<And>x. \<lbrakk>x \<in> T; b\<bullet>x = 0\<rbrakk> \<Longrightarrow> f (g x) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   597
    unfolding f_def g_def by (simp add: algebra_simps divide_simps add_nonneg_eq_0_iff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   598
  have no: "\<And>x. \<lbrakk>norm x = 1; b\<bullet>x \<noteq> 1\<rbrakk> \<Longrightarrow> (norm (f x))\<^sup>2 = 4 * (1 + b\<bullet>x) / (1 - b\<bullet>x)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   599
    apply (simp add: dot_square_norm [symmetric])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   600
    apply (simp add: f_def vector_add_divide_simps divide_simps norm_eq_1)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   601
    apply (simp add: algebra_simps inner_commute)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   602
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   603
  have [simp]: "\<And>u::real. 8 + u * (u * 8) = u * 16 \<longleftrightarrow> u=1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   604
    by algebra
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   605
  have [simp]: "\<And>x. \<lbrakk>norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> g (f x) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   606
    unfolding g_def no by (auto simp: f_def divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   607
  have [simp]: "\<And>x. \<lbrakk>x \<in> T; b \<bullet> x = 0\<rbrakk> \<Longrightarrow> norm (g x) = 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   608
    unfolding g_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   609
    apply (rule power2_eq_imp_eq)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   610
    apply (simp_all add: dot_square_norm [symmetric] divide_simps vector_add_divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   611
    apply (simp add: algebra_simps inner_commute)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   612
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   613
  have [simp]: "\<And>x. \<lbrakk>x \<in> T; b \<bullet> x = 0\<rbrakk> \<Longrightarrow> b \<bullet> g x \<noteq> 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   614
    unfolding g_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   615
    apply (simp_all add: dot_square_norm [symmetric] divide_simps vector_add_divide_simps add_nonneg_eq_0_iff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   616
    apply (auto simp: algebra_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   617
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   618
  have "subspace T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   619
    by (simp add: assms subspace_affine)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   620
  have [simp]: "\<And>x. \<lbrakk>x \<in> T; b \<bullet> x = 0\<rbrakk> \<Longrightarrow> g x \<in> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   621
    unfolding g_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   622
    by (blast intro: \<open>subspace T\<close> \<open>b \<in> T\<close> subspace_add subspace_mul subspace_diff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   623
  have "f ` {x. norm x = 1 \<and> b\<bullet>x \<noteq> 1} \<subseteq> {x. b\<bullet>x = 0}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   624
    unfolding f_def using \<open>norm b = 1\<close> norm_eq_1
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   625
    by (force simp: field_simps inner_add_right inner_diff_right)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   626
  moreover have "f ` T \<subseteq> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   627
    unfolding f_def using assms
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   628
    apply (auto simp: field_simps inner_add_right inner_diff_right)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   629
    by (metis add_0 diff_zero mem_affine_3_minus)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   630
  moreover have "{x. b\<bullet>x = 0} \<inter> T \<subseteq> f ` ({x. norm x = 1 \<and> b\<bullet>x \<noteq> 1} \<inter> T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   631
    apply clarify
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   632
    apply (rule_tac x = "g x" in image_eqI, auto)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   633
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   634
  ultimately have imf: "f ` ({x. norm x = 1 \<and> b\<bullet>x \<noteq> 1} \<inter> T) = {x. b\<bullet>x = 0} \<inter> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   635
    by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   636
  have no4: "\<And>y. b\<bullet>y = 0 \<Longrightarrow> norm ((y\<bullet>y + 4) *\<^sub>R b + 4 *\<^sub>R (y - 2 *\<^sub>R b)) = y\<bullet>y + 4"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   637
    apply (rule power2_eq_imp_eq)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   638
    apply (simp_all add: dot_square_norm [symmetric])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   639
    apply (auto simp: power2_eq_square algebra_simps inner_commute)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   640
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   641
  have [simp]: "\<And>x. \<lbrakk>norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> b \<bullet> f x = 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   642
    by (simp add: f_def algebra_simps divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   643
  have [simp]: "\<And>x. \<lbrakk>x \<in> T; norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> f x \<in> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   644
    unfolding f_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   645
    by (blast intro: \<open>subspace T\<close> \<open>b \<in> T\<close> subspace_add subspace_mul subspace_diff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   646
  have "g ` {x. b\<bullet>x = 0} \<subseteq> {x. norm x = 1 \<and> b\<bullet>x \<noteq> 1}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   647
    unfolding g_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   648
    apply (clarsimp simp: no4 vector_add_divide_simps divide_simps add_nonneg_eq_0_iff dot_square_norm [symmetric])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   649
    apply (auto simp: algebra_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   650
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   651
  moreover have "g ` T \<subseteq> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   652
    unfolding g_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   653
    by (blast intro: \<open>subspace T\<close> \<open>b \<in> T\<close> subspace_add subspace_mul subspace_diff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   654
  moreover have "{x. norm x = 1 \<and> b\<bullet>x \<noteq> 1} \<inter> T \<subseteq> g ` ({x. b\<bullet>x = 0} \<inter> T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   655
    apply clarify
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   656
    apply (rule_tac x = "f x" in image_eqI, auto)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   657
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   658
  ultimately have img: "g ` ({x. b\<bullet>x = 0} \<inter> T) = {x. norm x = 1 \<and> b\<bullet>x \<noteq> 1} \<inter> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   659
    by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   660
  have aff: "affine ({x. b\<bullet>x = 0} \<inter> T)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   661
    by (blast intro: affine_hyperplane assms)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   662
  have contf: "continuous_on ({x. norm x = 1 \<and> b\<bullet>x \<noteq> 1} \<inter> T) f"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   663
    unfolding f_def by (rule continuous_intros | force)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   664
  have contg: "continuous_on ({x. b\<bullet>x = 0} \<inter> T) g"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   665
    unfolding g_def by (rule continuous_intros | force simp: add_nonneg_eq_0_iff)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   666
  have "(sphere 0 1 \<inter> T) - {b} = {x. norm x = 1 \<and> (b\<bullet>x \<noteq> 1)} \<inter> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   667
    using  \<open>norm b = 1\<close> by (auto simp: norm_eq_1) (metis vector_eq  \<open>b\<bullet>b = 1\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   668
  also have "... homeomorphic {x. b\<bullet>x = 0} \<inter> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   669
    by (rule homeomorphicI [OF imf img contf contg]) auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   670
  also have "... homeomorphic p"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   671
    apply (rule homeomorphic_affine_sets [OF aff \<open>affine p\<close>])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   672
    apply (simp add: Int_commute aff_dim_affine_Int_hyperplane [OF \<open>affine T\<close>] affT)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   673
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   674
  finally show ?thesis .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   675
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   676
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   677
theorem homeomorphic_punctured_affine_sphere_affine:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   678
  fixes a :: "'a :: euclidean_space"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   679
  assumes "0 < r" "b \<in> sphere a r" "affine T" "a \<in> T" "b \<in> T" "affine p"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   680
      and aff: "aff_dim T = aff_dim p + 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   681
    shows "((sphere a r \<inter> T) - {b}) homeomorphic p"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   682
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   683
  have "a \<noteq> b" using assms by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   684
  then have inj: "inj (\<lambda>x::'a. x /\<^sub>R norm (a - b))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   685
    by (simp add: inj_on_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   686
  have "((sphere a r \<inter> T) - {b}) homeomorphic
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   687
        op+ (-a) ` ((sphere a r \<inter> T) - {b})"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   688
    by (rule homeomorphic_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   689
  also have "... homeomorphic op *\<^sub>R (inverse r) ` op + (- a) ` (sphere a r \<inter> T - {b})"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   690
    by (metis \<open>0 < r\<close> homeomorphic_scaling inverse_inverse_eq inverse_zero less_irrefl)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   691
  also have "... = sphere 0 1 \<inter> (op *\<^sub>R (inverse r) ` op + (- a) ` T) - {(b - a) /\<^sub>R r}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   692
    using assms by (auto simp: dist_norm norm_minus_commute divide_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   693
  also have "... homeomorphic p"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   694
    apply (rule homeomorphic_punctured_affine_sphere_affine_01)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   695
    using assms
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   696
    apply (auto simp: dist_norm norm_minus_commute affine_scaling affine_translation [symmetric] aff_dim_translation_eq inj)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   697
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   698
  finally show ?thesis .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   699
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   700
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   701
proposition homeomorphic_punctured_sphere_affine_gen:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   702
  fixes a :: "'a :: euclidean_space"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   703
  assumes "convex S" "bounded S" and a: "a \<in> rel_frontier S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   704
      and "affine T" and affS: "aff_dim S = aff_dim T + 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   705
    shows "rel_frontier S - {a} homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   706
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   707
  have "S \<noteq> {}" using assms by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   708
  obtain U :: "'a set" where "affine U" and affdS: "aff_dim U = aff_dim S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   709
    using choose_affine_subset [OF affine_UNIV aff_dim_geq]
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   710
    by (meson aff_dim_affine_hull affine_affine_hull)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   711
  have "convex U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   712
    by (simp add: affine_imp_convex \<open>affine U\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   713
  have "U \<noteq> {}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   714
    by (metis \<open>S \<noteq> {}\<close> \<open>aff_dim U = aff_dim S\<close> aff_dim_empty)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   715
  then obtain z where "z \<in> U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   716
    by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   717
  then have bne: "ball z 1 \<inter> U \<noteq> {}" by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   718
  have [simp]: "aff_dim(ball z 1 \<inter> U) = aff_dim U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   719
    using aff_dim_convex_Int_open [OF \<open>convex U\<close> open_ball] bne
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   720
    by (fastforce simp add: Int_commute)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   721
  have "rel_frontier S homeomorphic rel_frontier (ball z 1 \<inter> U)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   722
    apply (rule homeomorphic_rel_frontiers_convex_bounded_sets)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   723
    apply (auto simp: \<open>affine U\<close> affine_imp_convex convex_Int affdS assms)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   724
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   725
  also have "... = sphere z 1 \<inter> U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   726
    using convex_affine_rel_frontier_Int [of "ball z 1" U]
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   727
    by (simp add: \<open>affine U\<close> bne)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   728
  finally obtain h k where him: "h ` rel_frontier S = sphere z 1 \<inter> U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   729
                    and kim: "k ` (sphere z 1 \<inter> U) = rel_frontier S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   730
                    and hcon: "continuous_on (rel_frontier S) h"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   731
                    and kcon: "continuous_on (sphere z 1 \<inter> U) k"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   732
                    and kh:  "\<And>x. x \<in> rel_frontier S \<Longrightarrow> k(h(x)) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   733
                    and hk:  "\<And>y. y \<in> sphere z 1 \<inter> U \<Longrightarrow> h(k(y)) = y"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   734
    unfolding homeomorphic_def homeomorphism_def by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   735
  have "rel_frontier S - {a} homeomorphic (sphere z 1 \<inter> U) - {h a}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   736
  proof (rule homeomorphicI [where f=h and g=k])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   737
    show h: "h ` (rel_frontier S - {a}) = sphere z 1 \<inter> U - {h a}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   738
      using him a kh by auto metis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   739
    show "k ` (sphere z 1 \<inter> U - {h a}) = rel_frontier S - {a}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   740
      by (force simp: h [symmetric] image_comp o_def kh)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   741
  qed (auto intro: continuous_on_subset hcon kcon simp: kh hk)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   742
  also have "... homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   743
    apply (rule homeomorphic_punctured_affine_sphere_affine)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   744
    using a him
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   745
    by (auto simp: affS affdS \<open>affine T\<close>  \<open>affine U\<close> \<open>z \<in> U\<close>)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   746
  finally show ?thesis .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   747
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   748
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   749
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   750
lemma homeomorphic_punctured_sphere_affine:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   751
  fixes a :: "'a :: euclidean_space"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   752
  assumes "0 < r" and b: "b \<in> sphere a r"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   753
      and "affine T" and affS: "aff_dim T + 1 = DIM('a)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   754
    shows "(sphere a r - {b}) homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   755
using homeomorphic_punctured_sphere_affine_gen [of "cball a r" b T]
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   756
  assms aff_dim_cball by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   757
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   758
corollary homeomorphic_punctured_sphere_hyperplane:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   759
  fixes a :: "'a :: euclidean_space"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   760
  assumes "0 < r" and b: "b \<in> sphere a r"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   761
      and "c \<noteq> 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   762
    shows "(sphere a r - {b}) homeomorphic {x::'a. c \<bullet> x = d}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   763
apply (rule homeomorphic_punctured_sphere_affine)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   764
using assms
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   765
apply (auto simp: affine_hyperplane of_nat_diff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   766
done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   767
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   768
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   769
text\<open> When dealing with AR, ANR and ANR later, it's useful to know that every set
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   770
  is homeomorphic to a closed subset of a convex set, and
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   771
  if the set is locally compact we can take the convex set to be the universe.\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   772
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   773
proposition homeomorphic_closedin_convex:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   774
  fixes S :: "'m::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   775
  assumes "aff_dim S < DIM('n)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   776
  obtains U and T :: "'n::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   777
     where "convex U" "U \<noteq> {}" "closedin (subtopology euclidean U) T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   778
           "S homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   779
proof (cases "S = {}")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   780
  case True then show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   781
    by (rule_tac U=UNIV and T="{}" in that) auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   782
next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   783
  case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   784
  then obtain a where "a \<in> S" by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   785
  obtain i::'n where i: "i \<in> Basis" "i \<noteq> 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   786
    using SOME_Basis Basis_zero by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   787
  have "0 \<in> affine hull (op + (- a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   788
    by (simp add: \<open>a \<in> S\<close> hull_inc)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   789
  then have "dim (op + (- a) ` S) = aff_dim (op + (- a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   790
    by (simp add: aff_dim_zero)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   791
  also have "... < DIM('n)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   792
    by (simp add: aff_dim_translation_eq assms)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   793
  finally have dd: "dim (op + (- a) ` S) < DIM('n)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   794
    by linarith
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   795
  obtain T where "subspace T" and Tsub: "T \<subseteq> {x. i \<bullet> x = 0}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   796
             and dimT: "dim T = dim (op + (- a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   797
    apply (rule choose_subspace_of_subspace [of "dim (op + (- a) ` S)" "{x::'n. i \<bullet> x = 0}"])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   798
     apply (simp add: dim_hyperplane [OF \<open>i \<noteq> 0\<close>])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   799
     apply (metis DIM_positive Suc_pred dd not_le not_less_eq_eq)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   800
    apply (metis span_eq subspace_hyperplane)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   801
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   802
  have "subspace (span (op + (- a) ` S))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   803
    using subspace_span by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   804
  then obtain h k where "linear h" "linear k"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   805
               and heq: "h ` span (op + (- a) ` S) = T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   806
               and keq:"k ` T = span (op + (- a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   807
               and hinv [simp]:  "\<And>x. x \<in> span (op + (- a) ` S) \<Longrightarrow> k(h x) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   808
               and kinv [simp]:  "\<And>x. x \<in> T \<Longrightarrow> h(k x) = x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   809
    apply (rule isometries_subspaces [OF _ \<open>subspace T\<close>])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   810
    apply (auto simp: dimT)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   811
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   812
  have hcont: "continuous_on A h" and kcont: "continuous_on B k" for A B
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   813
    using \<open>linear h\<close> \<open>linear k\<close> linear_continuous_on linear_conv_bounded_linear by blast+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   814
  have ihhhh[simp]: "\<And>x. x \<in> S \<Longrightarrow> i \<bullet> h (x - a) = 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   815
    using Tsub [THEN subsetD] heq span_inc by fastforce
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   816
  have "sphere 0 1 - {i} homeomorphic {x. i \<bullet> x = 0}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   817
    apply (rule homeomorphic_punctured_sphere_affine)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   818
    using i
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   819
    apply (auto simp: affine_hyperplane)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   820
    by (metis DIM_positive Suc_eq_plus1 add.left_neutral diff_add_cancel not_le not_less_eq_eq of_nat_1 of_nat_diff)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   821
  then obtain f g where fg: "homeomorphism (sphere 0 1 - {i}) {x. i \<bullet> x = 0} f g"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   822
    by (force simp: homeomorphic_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   823
  have "h ` op + (- a) ` S \<subseteq> T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   824
    using heq span_clauses(1) span_linear_image by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   825
  then have "g ` h ` op + (- a) ` S \<subseteq> g ` {x. i \<bullet> x = 0}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   826
    using Tsub by (simp add: image_mono)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   827
  also have "... \<subseteq> sphere 0 1 - {i}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   828
    by (simp add: fg [unfolded homeomorphism_def])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   829
  finally have gh_sub_sph: "(g \<circ> h) ` op + (- a) ` S \<subseteq> sphere 0 1 - {i}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   830
    by (metis image_comp)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   831
  then have gh_sub_cb: "(g \<circ> h) ` op + (- a) ` S \<subseteq> cball 0 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   832
    by (metis Diff_subset order_trans sphere_cball)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   833
  have [simp]: "\<And>u. u \<in> S \<Longrightarrow> norm (g (h (u - a))) = 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   834
    using gh_sub_sph [THEN subsetD] by (auto simp: o_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   835
  have ghcont: "continuous_on (op + (- a) ` S) (\<lambda>x. g (h x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   836
    apply (rule continuous_on_compose2 [OF homeomorphism_cont2 [OF fg] hcont], force)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   837
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   838
  have kfcont: "continuous_on ((g \<circ> h \<circ> op + (- a)) ` S) (\<lambda>x. k (f x))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   839
    apply (rule continuous_on_compose2 [OF kcont])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   840
    using homeomorphism_cont1 [OF fg] gh_sub_sph apply (force intro: continuous_on_subset, blast)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   841
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   842
  have "S homeomorphic op + (- a) ` S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   843
    by (simp add: homeomorphic_translation)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   844
  also have Shom: "\<dots> homeomorphic (g \<circ> h) ` op + (- a) ` S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   845
    apply (simp add: homeomorphic_def homeomorphism_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   846
    apply (rule_tac x="g \<circ> h" in exI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   847
    apply (rule_tac x="k \<circ> f" in exI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   848
    apply (auto simp: ghcont kfcont span_clauses(1) homeomorphism_apply2 [OF fg] image_comp)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   849
    apply (force simp: o_def homeomorphism_apply2 [OF fg] span_clauses(1))
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   850
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   851
  finally have Shom: "S homeomorphic (g \<circ> h) ` op + (- a) ` S" .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   852
  show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   853
    apply (rule_tac U = "ball 0 1 \<union> image (g o h) (op + (- a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   854
                and T = "image (g o h) (op + (- a) ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   855
                    in that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   856
    apply (rule convex_intermediate_ball [of 0 1], force)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   857
    using gh_sub_cb apply force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   858
    apply force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   859
    apply (simp add: closedin_closed)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   860
    apply (rule_tac x="sphere 0 1" in exI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   861
    apply (auto simp: Shom)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   862
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   863
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   864
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   865
subsection\<open>Locally compact sets in an open set\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   866
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   867
text\<open> Locally compact sets are closed in an open set and are homeomorphic
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   868
  to an absolutely closed set if we have one more dimension to play with.\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   869
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   870
lemma locally_compact_open_Int_closure:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   871
  fixes S :: "'a :: metric_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   872
  assumes "locally compact S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   873
  obtains T where "open T" "S = T \<inter> closure S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   874
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   875
  have "\<forall>x\<in>S. \<exists>T v u. u = S \<inter> T \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> open T \<and> compact v"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   876
    by (metis assms locally_compact openin_open)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   877
  then obtain t v where
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   878
        tv: "\<And>x. x \<in> S
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   879
             \<Longrightarrow> v x \<subseteq> S \<and> open (t x) \<and> compact (v x) \<and> (\<exists>u. x \<in> u \<and> u \<subseteq> v x \<and> u = S \<inter> t x)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   880
    by metis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   881
  then have o: "open (UNION S t)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   882
    by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   883
  have "S = \<Union> (v ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   884
    using tv by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   885
  also have "... = UNION S t \<inter> closure S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   886
  proof
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   887
    show "UNION S v \<subseteq> UNION S t \<inter> closure S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   888
      apply safe
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   889
       apply (metis Int_iff subsetD UN_iff tv)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   890
      apply (simp add: closure_def rev_subsetD tv)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   891
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   892
    have "t x \<inter> closure S \<subseteq> v x" if "x \<in> S" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   893
    proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   894
      have "t x \<inter> closure S \<subseteq> closure (t x \<inter> S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   895
        by (simp add: open_Int_closure_subset that tv)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   896
      also have "... \<subseteq> v x"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   897
        by (metis Int_commute closure_minimal compact_imp_closed that tv)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   898
      finally show ?thesis .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   899
    qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   900
    then show "UNION S t \<inter> closure S \<subseteq> UNION S v"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   901
      by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   902
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   903
  finally have e: "S = UNION S t \<inter> closure S" .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   904
  show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   905
    by (rule that [OF o e])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   906
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   907
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   908
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   909
lemma locally_compact_closedin_open:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   910
    fixes S :: "'a :: metric_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   911
    assumes "locally compact S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   912
    obtains T where "open T" "closedin (subtopology euclidean T) S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   913
  by (metis locally_compact_open_Int_closure [OF assms] closed_closure closedin_closed_Int)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   914
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   915
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   916
lemma locally_compact_homeomorphism_projection_closed:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   917
  assumes "locally compact S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   918
  obtains T and f :: "'a \<Rightarrow> 'a :: euclidean_space \<times> 'b :: euclidean_space"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   919
    where "closed T" "homeomorphism S T f fst"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   920
proof (cases "closed S")
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   921
  case True
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   922
    then show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   923
      apply (rule_tac T = "S \<times> {0}" and f = "\<lambda>x. (x, 0)" in that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   924
      apply (auto simp: closed_Times homeomorphism_def continuous_intros)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   925
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   926
next
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   927
  case False
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   928
    obtain U where "open U" and US: "U \<inter> closure S = S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   929
      by (metis locally_compact_open_Int_closure [OF assms])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   930
    with False have Ucomp: "-U \<noteq> {}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   931
      using closure_eq by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   932
    have [simp]: "closure (- U) = -U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   933
      by (simp add: \<open>open U\<close> closed_Compl)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   934
    define f :: "'a \<Rightarrow> 'a \<times> 'b" where "f \<equiv> \<lambda>x. (x, One /\<^sub>R setdist {x} (- U))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   935
    have "continuous_on U (\<lambda>x. (x, One /\<^sub>R setdist {x} (- U)))"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
   936
      apply (intro continuous_intros continuous_on_setdist)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
   937
      by (simp add: Ucomp setdist_eq_0_sing_1)
63130
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   938
    then have homU: "homeomorphism U (f`U) f fst"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   939
      by (auto simp: f_def homeomorphism_def image_iff continuous_intros)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   940
    have cloS: "closedin (subtopology euclidean U) S"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   941
      by (metis US closed_closure closedin_closed_Int)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   942
    have cont: "isCont ((\<lambda>x. setdist {x} (- U)) o fst) z" for z :: "'a \<times> 'b"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   943
      by (rule isCont_o continuous_intros continuous_at_setdist)+
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   944
    have setdist1D: "setdist {a} (- U) *\<^sub>R b = One \<Longrightarrow> setdist {a} (- U) \<noteq> 0" for a::'a and b::'b
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   945
      by force
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   946
    have *: "r *\<^sub>R b = One \<Longrightarrow> b = (1 / r) *\<^sub>R One" for r and b::'b
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   947
      by (metis One_non_0 nonzero_divide_eq_eq real_vector.scale_eq_0_iff real_vector.scale_scale scaleR_one)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   948
    have "f ` U = {z. (setdist {fst z} (- U) *\<^sub>R snd z) \<in> {One}}"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
   949
      apply (auto simp: f_def setdist_eq_0_sing_1 field_simps Ucomp)
63130
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   950
      apply (rule_tac x=a in image_eqI)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
   951
      apply (auto simp: * setdist_eq_0_sing_1 dest: setdist1D)
63130
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   952
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   953
    then have clfU: "closed (f ` U)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   954
      apply (rule ssubst)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   955
      apply (rule continuous_closed_preimage_univ)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   956
      apply (auto intro: continuous_intros cont [unfolded o_def])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   957
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   958
    have "closed (f ` S)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   959
       apply (rule closedin_closed_trans [OF _ clfU])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   960
       apply (rule homeomorphism_imp_closed_map [OF homU cloS])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   961
       done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   962
    then show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   963
      apply (rule that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   964
      apply (rule homeomorphism_of_subsets [OF homU])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   965
      using US apply auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   966
      done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   967
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   968
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   969
lemma locally_compact_closed_Int_open:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   970
  fixes S :: "'a :: euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   971
  shows
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   972
    "locally compact S \<longleftrightarrow> (\<exists>U u. closed U \<and> open u \<and> S = U \<inter> u)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   973
by (metis closed_closure closed_imp_locally_compact inf_commute locally_compact_Int locally_compact_open_Int_closure open_imp_locally_compact)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   974
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   975
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   976
proposition locally_compact_homeomorphic_closed:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   977
  fixes S :: "'a::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   978
  assumes "locally compact S" and dimlt: "DIM('a) < DIM('b)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   979
  obtains T :: "'b::euclidean_space set" where "closed T" "S homeomorphic T"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   980
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   981
  obtain U:: "('a*real)set" and h
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   982
    where "closed U" and homU: "homeomorphism S U h fst"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   983
    using locally_compact_homeomorphism_projection_closed assms by metis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   984
  let ?BP = "Basis :: ('a*real) set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   985
  have "DIM('a * real) \<le> DIM('b)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   986
    by (simp add: Suc_leI dimlt)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   987
  then obtain basf :: "'a*real \<Rightarrow> 'b" where surbf: "basf ` ?BP \<subseteq> Basis" and injbf: "inj_on basf Basis"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   988
    by (metis finite_Basis card_le_inj)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   989
  define basg:: "'b \<Rightarrow> 'a * real" where
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   990
    "basg \<equiv> \<lambda>i. inv_into Basis basf i"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   991
  have bgf[simp]: "basg (basf i) = i" if "i \<in> Basis" for i
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   992
    using inv_into_f_f injbf that by (force simp: basg_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   993
  define f :: "'a*real \<Rightarrow> 'b" where "f \<equiv> \<lambda>u. \<Sum>j\<in>Basis. (u \<bullet> basg j) *\<^sub>R j"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   994
  have "linear f"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   995
    unfolding f_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   996
    apply (intro linear_compose_setsum linearI ballI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   997
    apply (auto simp: algebra_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   998
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   999
  define g :: "'b \<Rightarrow> 'a*real" where "g \<equiv> \<lambda>z. (\<Sum>i\<in>Basis. (z \<bullet> basf i) *\<^sub>R i)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1000
  have "linear g"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1001
    unfolding g_def
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1002
    apply (intro linear_compose_setsum linearI ballI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1003
    apply (auto simp: algebra_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1004
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1005
  have *: "(\<Sum>a \<in> Basis. a \<bullet> basf b * (x \<bullet> basg a)) = x \<bullet> b" if "b \<in> Basis" for x b
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1006
    using surbf that by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1007
  have gf[simp]: "g (f x) = x" for x
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1008
    apply (rule euclidean_eqI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1009
    apply (simp add: f_def g_def inner_setsum_left scaleR_setsum_left algebra_simps)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1010
    apply (simp add: Groups_Big.setsum_right_distrib [symmetric] *)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1011
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1012
  then have "inj f" by (metis injI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1013
  have gfU: "g ` f ` U = U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1014
    by (rule set_eqI) (auto simp: image_def)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1015
  have "S homeomorphic U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1016
    using homU homeomorphic_def by blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1017
  also have "... homeomorphic f ` U"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1018
    apply (rule homeomorphicI [OF refl gfU])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1019
       apply (meson \<open>inj f\<close> \<open>linear f\<close> homeomorphism_cont2 linear_homeomorphism_image)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1020
      using \<open>linear g\<close> linear_continuous_on linear_conv_bounded_linear apply blast
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1021
     apply auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1022
     done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1023
  finally show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1024
    apply (rule_tac T = "f ` U" in that)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1025
    apply (rule closed_injective_linear_image [OF \<open>closed U\<close> \<open>linear f\<close> \<open>inj f\<close>], assumption)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1026
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1027
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1028
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1029
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1030
lemma homeomorphic_convex_compact_lemma:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1031
  fixes s :: "'a::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1032
  assumes "convex s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1033
    and "compact s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1034
    and "cball 0 1 \<subseteq> s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1035
  shows "s homeomorphic (cball (0::'a) 1)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1036
proof (rule starlike_compact_projective_special[OF assms(2-3)])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1037
  fix x u
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1038
  assume "x \<in> s" and "0 \<le> u" and "u < (1::real)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1039
  have "open (ball (u *\<^sub>R x) (1 - u))"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1040
    by (rule open_ball)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1041
  moreover have "u *\<^sub>R x \<in> ball (u *\<^sub>R x) (1 - u)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1042
    unfolding centre_in_ball using \<open>u < 1\<close> by simp
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1043
  moreover have "ball (u *\<^sub>R x) (1 - u) \<subseteq> s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1044
  proof
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1045
    fix y
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1046
    assume "y \<in> ball (u *\<^sub>R x) (1 - u)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1047
    then have "dist (u *\<^sub>R x) y < 1 - u"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1048
      unfolding mem_ball .
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1049
    with \<open>u < 1\<close> have "inverse (1 - u) *\<^sub>R (y - u *\<^sub>R x) \<in> cball 0 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1050
      by (simp add: dist_norm inverse_eq_divide norm_minus_commute)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1051
    with assms(3) have "inverse (1 - u) *\<^sub>R (y - u *\<^sub>R x) \<in> s" ..
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1052
    with assms(1) have "(1 - u) *\<^sub>R ((y - u *\<^sub>R x) /\<^sub>R (1 - u)) + u *\<^sub>R x \<in> s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1053
      using \<open>x \<in> s\<close> \<open>0 \<le> u\<close> \<open>u < 1\<close> [THEN less_imp_le] by (rule convexD_alt)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1054
    then show "y \<in> s" using \<open>u < 1\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1055
      by simp
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1056
  qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1057
  ultimately have "u *\<^sub>R x \<in> interior s" ..
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1058
  then show "u *\<^sub>R x \<in> s - frontier s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1059
    using frontier_def and interior_subset by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1060
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1061
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1062
proposition homeomorphic_convex_compact_cball:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1063
  fixes e :: real
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1064
    and s :: "'a::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1065
  assumes "convex s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1066
    and "compact s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1067
    and "interior s \<noteq> {}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1068
    and "e > 0"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1069
  shows "s homeomorphic (cball (b::'a) e)"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1070
proof -
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1071
  obtain a where "a \<in> interior s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1072
    using assms(3) by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1073
  then obtain d where "d > 0" and d: "cball a d \<subseteq> s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1074
    unfolding mem_interior_cball by auto
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1075
  let ?d = "inverse d" and ?n = "0::'a"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1076
  have "cball ?n 1 \<subseteq> (\<lambda>x. inverse d *\<^sub>R (x - a)) ` s"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1077
    apply rule
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1078
    apply (rule_tac x="d *\<^sub>R x + a" in image_eqI)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1079
    defer
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1080
    apply (rule d[unfolded subset_eq, rule_format])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1081
    using \<open>d > 0\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1082
    unfolding mem_cball dist_norm
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1083
    apply (auto simp add: mult_right_le_one_le)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1084
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1085
  then have "(\<lambda>x. inverse d *\<^sub>R (x - a)) ` s homeomorphic cball ?n 1"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1086
    using homeomorphic_convex_compact_lemma[of "(\<lambda>x. ?d *\<^sub>R -a + ?d *\<^sub>R x) ` s",
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1087
      OF convex_affinity compact_affinity]
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1088
    using assms(1,2)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1089
    by (auto simp add: scaleR_right_diff_distrib)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1090
  then show ?thesis
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1091
    apply (rule_tac homeomorphic_trans[OF _ homeomorphic_balls(2)[of 1 _ ?n]])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1092
    apply (rule homeomorphic_trans[OF homeomorphic_affinity[of "?d" s "?d *\<^sub>R -a"]])
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1093
    using \<open>d>0\<close> \<open>e>0\<close>
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1094
    apply (auto simp add: scaleR_right_diff_distrib)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1095
    done
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1096
qed
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1097
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1098
corollary homeomorphic_convex_compact:
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1099
  fixes s :: "'a::euclidean_space set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1100
    and t :: "'a set"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1101
  assumes "convex s" "compact s" "interior s \<noteq> {}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1102
    and "convex t" "compact t" "interior t \<noteq> {}"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1103
  shows "s homeomorphic t"
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1104
  using assms
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1105
  by (meson zero_less_one homeomorphic_trans homeomorphic_convex_compact_cball homeomorphic_sym)
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1106
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1107
subsection\<open>Covering spaces and lifting results for them\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1108
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1109
definition covering_space
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1110
           :: "'a::topological_space set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b::topological_space set \<Rightarrow> bool"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1111
  where
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1112
  "covering_space c p s \<equiv>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1113
       continuous_on c p \<and> p ` c = s \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1114
       (\<forall>x \<in> s. \<exists>t. x \<in> t \<and> openin (subtopology euclidean s) t \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1115
                    (\<exists>v. \<Union>v = {x. x \<in> c \<and> p x \<in> t} \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1116
                        (\<forall>u \<in> v. openin (subtopology euclidean c) u) \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1117
                        pairwise disjnt v \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1118
                        (\<forall>u \<in> v. \<exists>q. homeomorphism u t p q)))"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1119
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1120
lemma covering_space_imp_continuous: "covering_space c p s \<Longrightarrow> continuous_on c p"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1121
  by (simp add: covering_space_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1122
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1123
lemma covering_space_imp_surjective: "covering_space c p s \<Longrightarrow> p ` c = s"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1124
  by (simp add: covering_space_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1125
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1126
lemma homeomorphism_imp_covering_space: "homeomorphism s t f g \<Longrightarrow> covering_space s f t"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1127
  apply (simp add: homeomorphism_def covering_space_def, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1128
  apply (rule_tac x=t in exI, simp)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1129
  apply (rule_tac x="{s}" in exI, auto)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1130
  done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1131
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1132
lemma covering_space_local_homeomorphism:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1133
  assumes "covering_space c p s" "x \<in> c"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1134
  obtains t u q where "x \<in> t" "openin (subtopology euclidean c) t"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1135
                      "p x \<in> u" "openin (subtopology euclidean s) u"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1136
                      "homeomorphism t u p q"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1137
using assms
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1138
apply (simp add: covering_space_def, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1139
apply (drule_tac x="p x" in bspec, force)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1140
by (metis (no_types, lifting) Union_iff mem_Collect_eq)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1141
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1142
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1143
lemma covering_space_local_homeomorphism_alt:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1144
  assumes p: "covering_space c p s" and "y \<in> s"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1145
  obtains x t u q where "p x = y"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1146
                        "x \<in> t" "openin (subtopology euclidean c) t"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1147
                        "y \<in> u" "openin (subtopology euclidean s) u"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1148
                          "homeomorphism t u p q"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1149
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1150
  obtain x where "p x = y" "x \<in> c"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1151
    using assms covering_space_imp_surjective by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1152
  show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1153
    apply (rule covering_space_local_homeomorphism [OF p \<open>x \<in> c\<close>])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1154
    using that \<open>p x = y\<close> by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1155
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1156
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1157
proposition covering_space_open_map:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1158
  fixes s :: "'a :: metric_space set" and t :: "'b :: metric_space set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1159
  assumes p: "covering_space c p s" and t: "openin (subtopology euclidean c) t"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1160
    shows "openin (subtopology euclidean s) (p ` t)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1161
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1162
  have pce: "p ` c = s"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1163
   and covs:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1164
       "\<And>x. x \<in> s \<Longrightarrow>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1165
            \<exists>X VS. x \<in> X \<and> openin (subtopology euclidean s) X \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1166
                  \<Union>VS = {x. x \<in> c \<and> p x \<in> X} \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1167
                  (\<forall>u \<in> VS. openin (subtopology euclidean c) u) \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1168
                  pairwise disjnt VS \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1169
                  (\<forall>u \<in> VS. \<exists>q. homeomorphism u X p q)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1170
    using p by (auto simp: covering_space_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1171
  have "t \<subseteq> c"  by (metis openin_euclidean_subtopology_iff t)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1172
  have "\<exists>T. openin (subtopology euclidean s) T \<and> y \<in> T \<and> T \<subseteq> p ` t"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1173
          if "y \<in> p ` t" for y
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1174
  proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1175
    have "y \<in> s" using \<open>t \<subseteq> c\<close> pce that by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1176
    obtain U VS where "y \<in> U" and U: "openin (subtopology euclidean s) U"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1177
                  and VS: "\<Union>VS = {x. x \<in> c \<and> p x \<in> U}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1178
                  and openVS: "\<forall>V \<in> VS. openin (subtopology euclidean c) V"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1179
                  and homVS: "\<And>V. V \<in> VS \<Longrightarrow> \<exists>q. homeomorphism V U p q"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1180
      using covs [OF \<open>y \<in> s\<close>] by auto
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1181
    obtain x where "x \<in> c" "p x \<in> U" "x \<in> t" "p x = y"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1182
      apply simp
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1183
      using t [unfolded openin_euclidean_subtopology_iff] \<open>y \<in> U\<close> \<open>y \<in> p ` t\<close> by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1184
    with VS obtain V where "x \<in> V" "V \<in> VS" by auto
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1185
    then obtain q where q: "homeomorphism V U p q" using homVS by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1186
    then have ptV: "p ` (t \<inter> V) = U \<inter> {z. q z \<in> (t \<inter> V)}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1187
      using VS \<open>V \<in> VS\<close> by (auto simp: homeomorphism_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1188
    have ocv: "openin (subtopology euclidean c) V"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1189
      by (simp add: \<open>V \<in> VS\<close> openVS)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1190
    have "openin (subtopology euclidean U) {z \<in> U. q z \<in> t \<inter> V}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1191
      apply (rule continuous_on_open [THEN iffD1, rule_format])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1192
       using homeomorphism_def q apply blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1193
      using openin_subtopology_Int_subset [of c] q t unfolding homeomorphism_def
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1194
      by (metis inf.absorb_iff2 Int_commute ocv openin_euclidean_subtopology_iff)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1195
    then have os: "openin (subtopology euclidean s) (U \<inter> {z. q z \<in> t \<inter> V})"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1196
      using openin_trans [of U] by (simp add: Collect_conj_eq U)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1197
    show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1198
      apply (rule_tac x = "p ` (t \<inter> V)" in exI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1199
      apply (rule conjI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1200
      apply (simp only: ptV os)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1201
      using \<open>p x = y\<close> \<open>x \<in> V\<close> \<open>x \<in> t\<close> apply blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1202
      done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1203
  qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1204
  with openin_subopen show ?thesis by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1205
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1206
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1207
lemma covering_space_lift_unique_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1208
  fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1209
  fixes g1 :: "'a \<Rightarrow> 'c::real_normed_vector"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1210
  assumes cov: "covering_space c p s"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1211
      and eq: "g1 a = g2 a"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1212
      and f: "continuous_on t f"  "f ` t \<subseteq> s"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1213
      and g1: "continuous_on t g1"  "g1 ` t \<subseteq> c"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1214
      and fg1: "\<And>x. x \<in> t \<Longrightarrow> f x = p(g1 x)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1215
      and g2: "continuous_on t g2"  "g2 ` t \<subseteq> c"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1216
      and fg2: "\<And>x. x \<in> t \<Longrightarrow> f x = p(g2 x)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1217
      and u_compt: "u \<in> components t" and "a \<in> u" "x \<in> u"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1218
    shows "g1 x = g2 x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1219
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1220
  have "u \<subseteq> t" by (rule in_components_subset [OF u_compt])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1221
  def G12 \<equiv> "{x \<in> u. g1 x - g2 x = 0}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1222
  have "connected u" by (rule in_components_connected [OF u_compt])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1223
  have contu: "continuous_on u g1" "continuous_on u g2"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1224
       using \<open>u \<subseteq> t\<close> continuous_on_subset g1 g2 by blast+
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1225
  have o12: "openin (subtopology euclidean u) G12"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1226
  unfolding G12_def
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1227
  proof (subst openin_subopen, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1228
    fix z
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1229
    assume z: "z \<in> u" "g1 z - g2 z = 0"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1230
    obtain v w q where "g1 z \<in> v" and ocv: "openin (subtopology euclidean c) v"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1231
                   and "p (g1 z) \<in> w" and osw: "openin (subtopology euclidean s) w"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1232
                   and hom: "homeomorphism v w p q"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1233
      apply (rule_tac x = "g1 z" in covering_space_local_homeomorphism [OF cov])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1234
       using \<open>u \<subseteq> t\<close> \<open>z \<in> u\<close> g1(2) apply blast+
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1235
      done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1236
    have "g2 z \<in> v" using \<open>g1 z \<in> v\<close> z by auto
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1237
    have gg: "{x \<in> u. g x \<in> v} = {x \<in> u. g x \<in> (v \<inter> g ` u)}" for g
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1238
      by auto
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1239
    have "openin (subtopology euclidean (g1 ` u)) (v \<inter> g1 ` u)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1240
      using ocv \<open>u \<subseteq> t\<close> g1 by (fastforce simp add: openin_open)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1241
    then have 1: "openin (subtopology euclidean u) {x \<in> u. g1 x \<in> v}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1242
      unfolding gg by (blast intro: contu continuous_on_open [THEN iffD1, rule_format])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1243
    have "openin (subtopology euclidean (g2 ` u)) (v \<inter> g2 ` u)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1244
      using ocv \<open>u \<subseteq> t\<close> g2 by (fastforce simp add: openin_open)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1245
    then have 2: "openin (subtopology euclidean u) {x \<in> u. g2 x \<in> v}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1246
      unfolding gg by (blast intro: contu continuous_on_open [THEN iffD1, rule_format])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1247
    show "\<exists>T. openin (subtopology euclidean u) T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1248
              z \<in> T \<and> T \<subseteq> {z \<in> u. g1 z - g2 z = 0}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1249
      using z
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1250
      apply (rule_tac x = "{x. x \<in> u \<and> g1 x \<in> v} \<inter> {x. x \<in> u \<and> g2 x \<in> v}" in exI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1251
      apply (intro conjI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1252
      apply (rule openin_Int [OF 1 2])
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1253
      using \<open>g1 z \<in> v\<close>  \<open>g2 z \<in> v\<close>  apply (force simp:, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1254
      apply (metis \<open>u \<subseteq> t\<close> subsetD eq_iff_diff_eq_0 fg1 fg2 hom homeomorphism_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1255
      done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1256
  qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1257
  have c12: "closedin (subtopology euclidean u) G12"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1258
    unfolding G12_def
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1259
    by (intro continuous_intros continuous_closedin_preimage_constant contu)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1260
  have "G12 = {} \<or> G12 = u"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1261
    by (intro connected_clopen [THEN iffD1, rule_format] \<open>connected u\<close> conjI o12 c12)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1262
  with eq \<open>a \<in> u\<close> have "\<And>x. x \<in> u \<Longrightarrow> g1 x - g2 x = 0" by (auto simp: G12_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1263
  then show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1264
    using \<open>x \<in> u\<close> by force
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1265
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1266
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1267
proposition covering_space_lift_unique:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1268
  fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1269
  fixes g1 :: "'a \<Rightarrow> 'c::real_normed_vector"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1270
  assumes "covering_space c p s"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1271
          "g1 a = g2 a"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1272
          "continuous_on t f"  "f ` t \<subseteq> s"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1273
          "continuous_on t g1"  "g1 ` t \<subseteq> c"  "\<And>x. x \<in> t \<Longrightarrow> f x = p(g1 x)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1274
          "continuous_on t g2"  "g2 ` t \<subseteq> c"  "\<And>x. x \<in> t \<Longrightarrow> f x = p(g2 x)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1275
          "connected t"  "a \<in> t"   "x \<in> t"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1276
   shows "g1 x = g2 x"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1277
using covering_space_lift_unique_gen [of c p s] in_components_self assms ex_in_conv by blast
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63130
diff changeset
  1278
63130
4ae5da02d627 New theory for Homeomorphisms
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1279
end