src/HOL/Analysis/Homeomorphism.thy
changeset 69678 0f4d4a13dc16
parent 69661 a03a63b81f44
child 69680 96a43caa4902
equal deleted inserted replaced
69677:a06b204527e6 69678:0f4d4a13dc16
     6 
     6 
     7 theory Homeomorphism
     7 theory Homeomorphism
     8 imports Homotopy
     8 imports Homotopy
     9 begin
     9 begin
    10 
    10 
    11 lemma%unimportant homeomorphic_spheres':
    11 lemma homeomorphic_spheres':
    12   fixes a ::"'a::euclidean_space" and b ::"'b::euclidean_space"
    12   fixes a ::"'a::euclidean_space" and b ::"'b::euclidean_space"
    13   assumes "0 < \<delta>" and dimeq: "DIM('a) = DIM('b)"
    13   assumes "0 < \<delta>" and dimeq: "DIM('a) = DIM('b)"
    14   shows "(sphere a \<delta>) homeomorphic (sphere b \<delta>)"
    14   shows "(sphere a \<delta>) homeomorphic (sphere b \<delta>)"
    15 proof -
    15 proof -
    16   obtain f :: "'a\<Rightarrow>'b" and g where "linear f" "linear g"
    16   obtain f :: "'a\<Rightarrow>'b" and g where "linear f" "linear g"
    26     apply (force intro: continuous_intros
    26     apply (force intro: continuous_intros
    27                   continuous_on_compose2 [of _ f] continuous_on_compose2 [of _ g] simp: dist_commute dist_norm fg)
    27                   continuous_on_compose2 [of _ f] continuous_on_compose2 [of _ g] simp: dist_commute dist_norm fg)
    28     done
    28     done
    29 qed
    29 qed
    30 
    30 
    31 lemma%unimportant homeomorphic_spheres_gen:
    31 lemma homeomorphic_spheres_gen:
    32     fixes a :: "'a::euclidean_space" and b :: "'b::euclidean_space"
    32     fixes a :: "'a::euclidean_space" and b :: "'b::euclidean_space"
    33   assumes "0 < r" "0 < s" "DIM('a::euclidean_space) = DIM('b::euclidean_space)"
    33   assumes "0 < r" "0 < s" "DIM('a::euclidean_space) = DIM('b::euclidean_space)"
    34   shows "(sphere a r homeomorphic sphere b s)"
    34   shows "(sphere a r homeomorphic sphere b s)"
    35   apply (rule homeomorphic_trans [OF homeomorphic_spheres homeomorphic_spheres'])
    35   apply (rule homeomorphic_trans [OF homeomorphic_spheres homeomorphic_spheres'])
    36   using assms  apply auto
    36   using assms  apply auto
    37   done
    37   done
    38 
    38 
    39 subsection%important \<open>Homeomorphism of all convex compact sets with nonempty interior\<close>
    39 subsection%important \<open>Homeomorphism of all convex compact sets with nonempty interior\<close>
    40 
    40 
    41 proposition%important ray_to_rel_frontier:
    41 proposition ray_to_rel_frontier:
    42   fixes a :: "'a::real_inner"
    42   fixes a :: "'a::real_inner"
    43   assumes "bounded S"
    43   assumes "bounded S"
    44       and a: "a \<in> rel_interior S"
    44       and a: "a \<in> rel_interior S"
    45       and aff: "(a + l) \<in> affine hull S"
    45       and aff: "(a + l) \<in> affine hull S"
    46       and "l \<noteq> 0"
    46       and "l \<noteq> 0"
    47   obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> rel_frontier S"
    47   obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> rel_frontier S"
    48            "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> rel_interior S"
    48            "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> rel_interior S"
    49 proof%unimportant -
    49 proof -
    50   have aaff: "a \<in> affine hull S"
    50   have aaff: "a \<in> affine hull S"
    51     by (meson a hull_subset rel_interior_subset rev_subsetD)
    51     by (meson a hull_subset rel_interior_subset rev_subsetD)
    52   let ?D = "{d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
    52   let ?D = "{d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
    53   obtain B where "B > 0" and B: "S \<subseteq> ball a B"
    53   obtain B where "B > 0" and B: "S \<subseteq> ball a B"
    54     using bounded_subset_ballD [OF \<open>bounded S\<close>] by blast
    54     using bounded_subset_ballD [OF \<open>bounded S\<close>] by blast
   137     by (simp add: rel_frontier_def)
   137     by (simp add: rel_frontier_def)
   138   show ?thesis
   138   show ?thesis
   139     by (rule that [OF \<open>0 < d\<close> infront inint])
   139     by (rule that [OF \<open>0 < d\<close> infront inint])
   140 qed
   140 qed
   141 
   141 
   142 corollary%important ray_to_frontier:
   142 corollary ray_to_frontier:
   143   fixes a :: "'a::euclidean_space"
   143   fixes a :: "'a::euclidean_space"
   144   assumes "bounded S"
   144   assumes "bounded S"
   145       and a: "a \<in> interior S"
   145       and a: "a \<in> interior S"
   146       and "l \<noteq> 0"
   146       and "l \<noteq> 0"
   147   obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> frontier S"
   147   obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> frontier S"
   148            "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> interior S"
   148            "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> interior S"
   149 proof%unimportant -
   149 proof -
   150   have "interior S = rel_interior S"
   150   have "interior S = rel_interior S"
   151     using a rel_interior_nonempty_interior by auto
   151     using a rel_interior_nonempty_interior by auto
   152   then have "a \<in> rel_interior S"
   152   then have "a \<in> rel_interior S"
   153     using a by simp
   153     using a by simp
   154   then show ?thesis
   154   then show ?thesis
   156      using a affine_hull_nonempty_interior apply blast
   156      using a affine_hull_nonempty_interior apply blast
   157     by (simp add: \<open>interior S = rel_interior S\<close> frontier_def rel_frontier_def that)
   157     by (simp add: \<open>interior S = rel_interior S\<close> frontier_def rel_frontier_def that)
   158 qed
   158 qed
   159 
   159 
   160 
   160 
   161 lemma%unimportant segment_to_rel_frontier_aux:
   161 lemma segment_to_rel_frontier_aux:
   162   fixes x :: "'a::euclidean_space"
   162   fixes x :: "'a::euclidean_space"
   163   assumes "convex S" "bounded S" and x: "x \<in> rel_interior S" and y: "y \<in> S" and xy: "x \<noteq> y"
   163   assumes "convex S" "bounded S" and x: "x \<in> rel_interior S" and y: "y \<in> S" and xy: "x \<noteq> y"
   164   obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z"
   164   obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z"
   165                    "open_segment x z \<subseteq> rel_interior S"
   165                    "open_segment x z \<subseteq> rel_interior S"
   166 proof -
   166 proof -
   196       apply (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> x])
   196       apply (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> x])
   197       using df rel_frontier_def by auto
   197       using df rel_frontier_def by auto
   198   qed
   198   qed
   199 qed
   199 qed
   200 
   200 
   201 lemma%unimportant segment_to_rel_frontier:
   201 lemma segment_to_rel_frontier:
   202   fixes x :: "'a::euclidean_space"
   202   fixes x :: "'a::euclidean_space"
   203   assumes S: "convex S" "bounded S" and x: "x \<in> rel_interior S"
   203   assumes S: "convex S" "bounded S" and x: "x \<in> rel_interior S"
   204       and y: "y \<in> S" and xy: "\<not>(x = y \<and> S = {x})"
   204       and y: "y \<in> S" and xy: "\<not>(x = y \<and> S = {x})"
   205   obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z"
   205   obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z"
   206                   "open_segment x z \<subseteq> rel_interior S"
   206                   "open_segment x z \<subseteq> rel_interior S"
   214   case False
   214   case False
   215   then show ?thesis
   215   then show ?thesis
   216     using segment_to_rel_frontier_aux [OF S x y] that by blast
   216     using segment_to_rel_frontier_aux [OF S x y] that by blast
   217 qed
   217 qed
   218 
   218 
   219 proposition%important rel_frontier_not_sing:
   219 proposition rel_frontier_not_sing:
   220   fixes a :: "'a::euclidean_space"
   220   fixes a :: "'a::euclidean_space"
   221   assumes "bounded S"
   221   assumes "bounded S"
   222     shows "rel_frontier S \<noteq> {a}"
   222     shows "rel_frontier S \<noteq> {a}"
   223 proof%unimportant (cases "S = {}")
   223 proof (cases "S = {}")
   224   case True  then show ?thesis  by simp
   224   case True  then show ?thesis  by simp
   225 next
   225 next
   226   case False
   226   case False
   227   then obtain z where "z \<in> S"
   227   then obtain z where "z \<in> S"
   228     by blast
   228     by blast
   276       qed
   276       qed
   277     qed
   277     qed
   278   qed
   278   qed
   279 qed
   279 qed
   280 
   280 
   281 proposition%important
   281 proposition (*FIXME needs name *)
   282   fixes S :: "'a::euclidean_space set"
   282   fixes S :: "'a::euclidean_space set"
   283   assumes "compact S" and 0: "0 \<in> rel_interior S"
   283   assumes "compact S" and 0: "0 \<in> rel_interior S"
   284       and star: "\<And>x. x \<in> S \<Longrightarrow> open_segment 0 x \<subseteq> rel_interior S"
   284       and star: "\<And>x. x \<in> S \<Longrightarrow> open_segment 0 x \<subseteq> rel_interior S"
   285     shows starlike_compact_projective1_0:
   285     shows starlike_compact_projective1_0:
   286             "S - rel_interior S homeomorphic sphere 0 1 \<inter> affine hull S"
   286             "S - rel_interior S homeomorphic sphere 0 1 \<inter> affine hull S"
   287             (is "?SMINUS homeomorphic ?SPHER")
   287             (is "?SMINUS homeomorphic ?SPHER")
   288       and starlike_compact_projective2_0:
   288       and starlike_compact_projective2_0:
   289             "S homeomorphic cball 0 1 \<inter> affine hull S"
   289             "S homeomorphic cball 0 1 \<inter> affine hull S"
   290             (is "S homeomorphic ?CBALL")
   290             (is "S homeomorphic ?CBALL")
   291 proof%unimportant -
   291 proof -
   292   have starI: "(u *\<^sub>R x) \<in> rel_interior S" if "x \<in> S" "0 \<le> u" "u < 1" for x u
   292   have starI: "(u *\<^sub>R x) \<in> rel_interior S" if "x \<in> S" "0 \<le> u" "u < 1" for x u
   293   proof (cases "x=0 \<or> u=0")
   293   proof (cases "x=0 \<or> u=0")
   294     case True with 0 show ?thesis by force
   294     case True with 0 show ?thesis by force
   295   next
   295   next
   296     case False with that show ?thesis
   296     case False with that show ?thesis
   538     apply (subst homeomorphic_sym)
   538     apply (subst homeomorphic_sym)
   539     apply (rule homeomorphic_compact [OF co01 cont_nosp2 [unfolded o_def] im_cball inj_cball])
   539     apply (rule homeomorphic_compact [OF co01 cont_nosp2 [unfolded o_def] im_cball inj_cball])
   540     done
   540     done
   541 qed
   541 qed
   542 
   542 
   543 corollary%important
   543 corollary (* FIXME needs name *)
   544   fixes S :: "'a::euclidean_space set"
   544   fixes S :: "'a::euclidean_space set"
   545   assumes "compact S" and a: "a \<in> rel_interior S"
   545   assumes "compact S" and a: "a \<in> rel_interior S"
   546       and star: "\<And>x. x \<in> S \<Longrightarrow> open_segment a x \<subseteq> rel_interior S"
   546       and star: "\<And>x. x \<in> S \<Longrightarrow> open_segment a x \<subseteq> rel_interior S"
   547     shows starlike_compact_projective1:
   547     shows starlike_compact_projective1:
   548             "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S"
   548             "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S"
   549       and starlike_compact_projective2:
   549       and starlike_compact_projective2:
   550             "S homeomorphic cball a 1 \<inter> affine hull S"
   550             "S homeomorphic cball a 1 \<inter> affine hull S"
   551 proof%unimportant -
   551 proof -
   552   have 1: "compact ((+) (-a) ` S)" by (meson assms compact_translation)
   552   have 1: "compact ((+) (-a) ` S)" by (meson assms compact_translation)
   553   have 2: "0 \<in> rel_interior ((+) (-a) ` S)"
   553   have 2: "0 \<in> rel_interior ((+) (-a) ` S)"
   554     using a rel_interior_translation [of "- a" S] by (simp cong: image_cong_simp)
   554     using a rel_interior_translation [of "- a" S] by (simp cong: image_cong_simp)
   555   have 3: "open_segment 0 x \<subseteq> rel_interior ((+) (-a) ` S)" if "x \<in> ((+) (-a) ` S)" for x
   555   have 3: "open_segment 0 x \<subseteq> rel_interior ((+) (-a) ` S)" if "x \<in> ((+) (-a) ` S)" for x
   556   proof -
   556   proof -
   578   also have "... homeomorphic cball a 1 \<inter> affine hull S"
   578   also have "... homeomorphic cball a 1 \<inter> affine hull S"
   579     using homeomorphic_translation homeomorphic_sym by blast
   579     using homeomorphic_translation homeomorphic_sym by blast
   580   finally show "S homeomorphic cball a 1 \<inter> affine hull S" .
   580   finally show "S homeomorphic cball a 1 \<inter> affine hull S" .
   581 qed
   581 qed
   582 
   582 
   583 corollary%important starlike_compact_projective_special:
   583 corollary starlike_compact_projective_special:
   584   assumes "compact S"
   584   assumes "compact S"
   585     and cb01: "cball (0::'a::euclidean_space) 1 \<subseteq> S"
   585     and cb01: "cball (0::'a::euclidean_space) 1 \<subseteq> S"
   586     and scale: "\<And>x u. \<lbrakk>x \<in> S; 0 \<le> u; u < 1\<rbrakk> \<Longrightarrow> u *\<^sub>R x \<in> S - frontier S"
   586     and scale: "\<And>x u. \<lbrakk>x \<in> S; 0 \<le> u; u < 1\<rbrakk> \<Longrightarrow> u *\<^sub>R x \<in> S - frontier S"
   587   shows "S homeomorphic (cball (0::'a::euclidean_space) 1)"
   587   shows "S homeomorphic (cball (0::'a::euclidean_space) 1)"
   588 proof%unimportant -
   588 proof -
   589   have "ball 0 1 \<subseteq> interior S"
   589   have "ball 0 1 \<subseteq> interior S"
   590     using cb01 interior_cball interior_mono by blast
   590     using cb01 interior_cball interior_mono by blast
   591   then have 0: "0 \<in> rel_interior S"
   591   then have 0: "0 \<in> rel_interior S"
   592     by (meson centre_in_ball subsetD interior_subset_rel_interior le_numeral_extra(2) not_le)
   592     by (meson centre_in_ball subsetD interior_subset_rel_interior le_numeral_extra(2) not_le)
   593   have [simp]: "affine hull S = UNIV"
   593   have [simp]: "affine hull S = UNIV"
   602   qed
   602   qed
   603   show ?thesis
   603   show ?thesis
   604     using starlike_compact_projective2_0 [OF \<open>compact S\<close> 0 star] by simp
   604     using starlike_compact_projective2_0 [OF \<open>compact S\<close> 0 star] by simp
   605 qed
   605 qed
   606 
   606 
   607 lemma%important homeomorphic_convex_lemma:
   607 lemma homeomorphic_convex_lemma:
   608   fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
   608   fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
   609   assumes "convex S" "compact S" "convex T" "compact T"
   609   assumes "convex S" "compact S" "convex T" "compact T"
   610       and affeq: "aff_dim S = aff_dim T"
   610       and affeq: "aff_dim S = aff_dim T"
   611     shows "(S - rel_interior S) homeomorphic (T - rel_interior T) \<and>
   611     shows "(S - rel_interior S) homeomorphic (T - rel_interior T) \<and>
   612            S homeomorphic T"
   612            S homeomorphic T"
   613 proof%unimportant (cases "rel_interior S = {} \<or> rel_interior T = {}")
   613 proof (cases "rel_interior S = {} \<or> rel_interior T = {}")
   614   case True
   614   case True
   615     then show ?thesis
   615     then show ?thesis
   616       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)
   616       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)
   617 next
   617 next
   618   case False
   618   case False
   706   finally have 2: "S - rel_interior S homeomorphic T - rel_interior T" .
   706   finally have 2: "S - rel_interior S homeomorphic T - rel_interior T" .
   707   show ?thesis
   707   show ?thesis
   708     using 1 2 by blast
   708     using 1 2 by blast
   709 qed
   709 qed
   710 
   710 
   711 lemma%unimportant homeomorphic_convex_compact_sets:
   711 lemma homeomorphic_convex_compact_sets:
   712   fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
   712   fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
   713   assumes "convex S" "compact S" "convex T" "compact T"
   713   assumes "convex S" "compact S" "convex T" "compact T"
   714       and affeq: "aff_dim S = aff_dim T"
   714       and affeq: "aff_dim S = aff_dim T"
   715     shows "S homeomorphic T"
   715     shows "S homeomorphic T"
   716 using homeomorphic_convex_lemma [OF assms] assms
   716 using homeomorphic_convex_lemma [OF assms] assms
   717 by (auto simp: rel_frontier_def)
   717 by (auto simp: rel_frontier_def)
   718 
   718 
   719 lemma%unimportant homeomorphic_rel_frontiers_convex_bounded_sets:
   719 lemma homeomorphic_rel_frontiers_convex_bounded_sets:
   720   fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
   720   fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
   721   assumes "convex S" "bounded S" "convex T" "bounded T"
   721   assumes "convex S" "bounded S" "convex T" "bounded T"
   722       and affeq: "aff_dim S = aff_dim T"
   722       and affeq: "aff_dim S = aff_dim T"
   723     shows  "rel_frontier S homeomorphic rel_frontier T"
   723     shows  "rel_frontier S homeomorphic rel_frontier T"
   724 using assms homeomorphic_convex_lemma [of "closure S" "closure T"]
   724 using assms homeomorphic_convex_lemma [of "closure S" "closure T"]
   727 
   727 
   728 subsection%important\<open>Homeomorphisms between punctured spheres and affine sets\<close>
   728 subsection%important\<open>Homeomorphisms between punctured spheres and affine sets\<close>
   729 text\<open>Including the famous stereoscopic projection of the 3-D sphere to the complex plane\<close>
   729 text\<open>Including the famous stereoscopic projection of the 3-D sphere to the complex plane\<close>
   730 
   730 
   731 text\<open>The special case with centre 0 and radius 1\<close>
   731 text\<open>The special case with centre 0 and radius 1\<close>
   732 lemma%unimportant homeomorphic_punctured_affine_sphere_affine_01:
   732 lemma homeomorphic_punctured_affine_sphere_affine_01:
   733   assumes "b \<in> sphere 0 1" "affine T" "0 \<in> T" "b \<in> T" "affine p"
   733   assumes "b \<in> sphere 0 1" "affine T" "0 \<in> T" "b \<in> T" "affine p"
   734       and affT: "aff_dim T = aff_dim p + 1"
   734       and affT: "aff_dim T = aff_dim p + 1"
   735     shows "(sphere 0 1 \<inter> T) - {b} homeomorphic p"
   735     shows "(sphere 0 1 \<inter> T) - {b} homeomorphic p"
   736 proof -
   736 proof -
   737   have [simp]: "norm b = 1" "b\<bullet>b = 1"
   737   have [simp]: "norm b = 1" "b\<bullet>b = 1"
   821     apply (simp add: Int_commute aff_dim_affine_Int_hyperplane [OF \<open>affine T\<close>] affT)
   821     apply (simp add: Int_commute aff_dim_affine_Int_hyperplane [OF \<open>affine T\<close>] affT)
   822     done
   822     done
   823   finally show ?thesis .
   823   finally show ?thesis .
   824 qed
   824 qed
   825 
   825 
   826 theorem%important homeomorphic_punctured_affine_sphere_affine:
   826 theorem homeomorphic_punctured_affine_sphere_affine:
   827   fixes a :: "'a :: euclidean_space"
   827   fixes a :: "'a :: euclidean_space"
   828   assumes "0 < r" "b \<in> sphere a r" "affine T" "a \<in> T" "b \<in> T" "affine p"
   828   assumes "0 < r" "b \<in> sphere a r" "affine T" "a \<in> T" "b \<in> T" "affine p"
   829       and aff: "aff_dim T = aff_dim p + 1"
   829       and aff: "aff_dim T = aff_dim p + 1"
   830     shows "(sphere a r \<inter> T) - {b} homeomorphic p"
   830     shows "(sphere a r \<inter> T) - {b} homeomorphic p"
   831 proof%unimportant -
   831 proof -
   832   have "a \<noteq> b" using assms by auto
   832   have "a \<noteq> b" using assms by auto
   833   then have inj: "inj (\<lambda>x::'a. x /\<^sub>R norm (a - b))"
   833   then have inj: "inj (\<lambda>x::'a. x /\<^sub>R norm (a - b))"
   834     by (simp add: inj_on_def)
   834     by (simp add: inj_on_def)
   835   have "((sphere a r \<inter> T) - {b}) homeomorphic
   835   have "((sphere a r \<inter> T) - {b}) homeomorphic
   836         (+) (-a) ` ((sphere a r \<inter> T) - {b})"
   836         (+) (-a) ` ((sphere a r \<inter> T) - {b})"
   845          apply (auto simp: dist_norm norm_minus_commute affine_scaling inj)
   845          apply (auto simp: dist_norm norm_minus_commute affine_scaling inj)
   846     done
   846     done
   847   finally show ?thesis .
   847   finally show ?thesis .
   848 qed
   848 qed
   849 
   849 
   850 corollary%important homeomorphic_punctured_sphere_affine:
   850 corollary homeomorphic_punctured_sphere_affine:
   851   fixes a :: "'a :: euclidean_space"
   851   fixes a :: "'a :: euclidean_space"
   852   assumes "0 < r" and b: "b \<in> sphere a r"
   852   assumes "0 < r" and b: "b \<in> sphere a r"
   853       and "affine T" and affS: "aff_dim T + 1 = DIM('a)"
   853       and "affine T" and affS: "aff_dim T + 1 = DIM('a)"
   854     shows "(sphere a r - {b}) homeomorphic T"
   854     shows "(sphere a r - {b}) homeomorphic T"
   855   using%unimportant homeomorphic_punctured_affine_sphere_affine [of r b a UNIV T] assms by%unimportant auto
   855   using%unimportant homeomorphic_punctured_affine_sphere_affine [of r b a UNIV T] assms by%unimportant auto
   856 
   856 
   857 corollary%important homeomorphic_punctured_sphere_hyperplane:
   857 corollary homeomorphic_punctured_sphere_hyperplane:
   858   fixes a :: "'a :: euclidean_space"
   858   fixes a :: "'a :: euclidean_space"
   859   assumes "0 < r" and b: "b \<in> sphere a r"
   859   assumes "0 < r" and b: "b \<in> sphere a r"
   860       and "c \<noteq> 0"
   860       and "c \<noteq> 0"
   861     shows "(sphere a r - {b}) homeomorphic {x::'a. c \<bullet> x = d}"
   861     shows "(sphere a r - {b}) homeomorphic {x::'a. c \<bullet> x = d}"
   862 apply (rule homeomorphic_punctured_sphere_affine)
   862 apply (rule homeomorphic_punctured_sphere_affine)
   863 using assms
   863 using assms
   864 apply (auto simp: affine_hyperplane of_nat_diff)
   864 apply (auto simp: affine_hyperplane of_nat_diff)
   865 done
   865 done
   866 
   866 
   867 proposition%important homeomorphic_punctured_sphere_affine_gen:
   867 proposition homeomorphic_punctured_sphere_affine_gen:
   868   fixes a :: "'a :: euclidean_space"
   868   fixes a :: "'a :: euclidean_space"
   869   assumes "convex S" "bounded S" and a: "a \<in> rel_frontier S"
   869   assumes "convex S" "bounded S" and a: "a \<in> rel_frontier S"
   870       and "affine T" and affS: "aff_dim S = aff_dim T + 1"
   870       and "affine T" and affS: "aff_dim S = aff_dim T + 1"
   871     shows "rel_frontier S - {a} homeomorphic T"
   871     shows "rel_frontier S - {a} homeomorphic T"
   872 proof%unimportant -
   872 proof -
   873   obtain U :: "'a set" where "affine U" "convex U" and affdS: "aff_dim U = aff_dim S"
   873   obtain U :: "'a set" where "affine U" "convex U" and affdS: "aff_dim U = aff_dim S"
   874     using choose_affine_subset [OF affine_UNIV aff_dim_geq]
   874     using choose_affine_subset [OF affine_UNIV aff_dim_geq]
   875     by (meson aff_dim_affine_hull affine_affine_hull affine_imp_convex)
   875     by (meson aff_dim_affine_hull affine_affine_hull affine_imp_convex)
   876   have "S \<noteq> {}" using assms by auto
   876   have "S \<noteq> {}" using assms by auto
   877   then obtain z where "z \<in> U"
   877   then obtain z where "z \<in> U"
   910 
   910 
   911 text\<open> When dealing with AR, ANR and ANR later, it's useful to know that every set
   911 text\<open> When dealing with AR, ANR and ANR later, it's useful to know that every set
   912   is homeomorphic to a closed subset of a convex set, and
   912   is homeomorphic to a closed subset of a convex set, and
   913   if the set is locally compact we can take the convex set to be the universe.\<close>
   913   if the set is locally compact we can take the convex set to be the universe.\<close>
   914 
   914 
   915 proposition%important homeomorphic_closedin_convex:
   915 proposition homeomorphic_closedin_convex:
   916   fixes S :: "'m::euclidean_space set"
   916   fixes S :: "'m::euclidean_space set"
   917   assumes "aff_dim S < DIM('n)"
   917   assumes "aff_dim S < DIM('n)"
   918   obtains U and T :: "'n::euclidean_space set"
   918   obtains U and T :: "'n::euclidean_space set"
   919      where "convex U" "U \<noteq> {}" "closedin (subtopology euclidean U) T"
   919      where "convex U" "U \<noteq> {}" "closedin (subtopology euclidean U) T"
   920            "S homeomorphic T"
   920            "S homeomorphic T"
   921 proof%unimportant (cases "S = {}")
   921 proof (cases "S = {}")
   922   case True then show ?thesis
   922   case True then show ?thesis
   923     by (rule_tac U=UNIV and T="{}" in that) auto
   923     by (rule_tac U=UNIV and T="{}" in that) auto
   924 next
   924 next
   925   case False
   925   case False
   926   then obtain a where "a \<in> S" by auto
   926   then obtain a where "a \<in> S" by auto
  1007 subsection%important\<open>Locally compact sets in an open set\<close>
  1007 subsection%important\<open>Locally compact sets in an open set\<close>
  1008 
  1008 
  1009 text\<open> Locally compact sets are closed in an open set and are homeomorphic
  1009 text\<open> Locally compact sets are closed in an open set and are homeomorphic
  1010   to an absolutely closed set if we have one more dimension to play with.\<close>
  1010   to an absolutely closed set if we have one more dimension to play with.\<close>
  1011 
  1011 
  1012 lemma%important locally_compact_open_Int_closure:
  1012 lemma locally_compact_open_Int_closure:
  1013   fixes S :: "'a :: metric_space set"
  1013   fixes S :: "'a :: metric_space set"
  1014   assumes "locally compact S"
  1014   assumes "locally compact S"
  1015   obtains T where "open T" "S = T \<inter> closure S"
  1015   obtains T where "open T" "S = T \<inter> closure S"
  1016 proof%unimportant -
  1016 proof -
  1017   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"
  1017   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"
  1018     by (metis assms locally_compact openin_open)
  1018     by (metis assms locally_compact openin_open)
  1019   then obtain t v where
  1019   then obtain t v where
  1020         tv: "\<And>x. x \<in> S
  1020         tv: "\<And>x. x \<in> S
  1021              \<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)"
  1021              \<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)"
  1046   show ?thesis
  1046   show ?thesis
  1047     by (rule that [OF o e])
  1047     by (rule that [OF o e])
  1048 qed
  1048 qed
  1049 
  1049 
  1050 
  1050 
  1051 lemma%unimportant locally_compact_closedin_open:
  1051 lemma locally_compact_closedin_open:
  1052     fixes S :: "'a :: metric_space set"
  1052     fixes S :: "'a :: metric_space set"
  1053     assumes "locally compact S"
  1053     assumes "locally compact S"
  1054     obtains T where "open T" "closedin (subtopology euclidean T) S"
  1054     obtains T where "open T" "closedin (subtopology euclidean T) S"
  1055   by (metis locally_compact_open_Int_closure [OF assms] closed_closure closedin_closed_Int)
  1055   by (metis locally_compact_open_Int_closure [OF assms] closed_closure closedin_closed_Int)
  1056 
  1056 
  1057 
  1057 
  1058 lemma%unimportant locally_compact_homeomorphism_projection_closed:
  1058 lemma locally_compact_homeomorphism_projection_closed:
  1059   assumes "locally compact S"
  1059   assumes "locally compact S"
  1060   obtains T and f :: "'a \<Rightarrow> 'a :: euclidean_space \<times> 'b :: euclidean_space"
  1060   obtains T and f :: "'a \<Rightarrow> 'a :: euclidean_space \<times> 'b :: euclidean_space"
  1061     where "closed T" "homeomorphism S T f fst"
  1061     where "closed T" "homeomorphism S T f fst"
  1062 proof (cases "closed S")
  1062 proof (cases "closed S")
  1063   case True
  1063   case True
  1106       apply (rule homeomorphism_of_subsets [OF homU])
  1106       apply (rule homeomorphism_of_subsets [OF homU])
  1107       using US apply auto
  1107       using US apply auto
  1108       done
  1108       done
  1109 qed
  1109 qed
  1110 
  1110 
  1111 lemma%unimportant locally_compact_closed_Int_open:
  1111 lemma locally_compact_closed_Int_open:
  1112   fixes S :: "'a :: euclidean_space set"
  1112   fixes S :: "'a :: euclidean_space set"
  1113   shows
  1113   shows
  1114     "locally compact S \<longleftrightarrow> (\<exists>U u. closed U \<and> open u \<and> S = U \<inter> u)"
  1114     "locally compact S \<longleftrightarrow> (\<exists>U u. closed U \<and> open u \<and> S = U \<inter> u)"
  1115 by (metis closed_closure closed_imp_locally_compact inf_commute locally_compact_Int locally_compact_open_Int_closure open_imp_locally_compact)
  1115 by (metis closed_closure closed_imp_locally_compact inf_commute locally_compact_Int locally_compact_open_Int_closure open_imp_locally_compact)
  1116 
  1116 
  1117 
  1117 
  1118 lemma%unimportant lowerdim_embeddings:
  1118 lemma lowerdim_embeddings:
  1119   assumes  "DIM('a) < DIM('b)"
  1119   assumes  "DIM('a) < DIM('b)"
  1120   obtains f :: "'a::euclidean_space*real \<Rightarrow> 'b::euclidean_space" 
  1120   obtains f :: "'a::euclidean_space*real \<Rightarrow> 'b::euclidean_space" 
  1121       and g :: "'b \<Rightarrow> 'a*real"
  1121       and g :: "'b \<Rightarrow> 'a*real"
  1122       and j :: 'b
  1122       and j :: 'b
  1123   where "linear f" "linear g" "\<And>z. g (f z) = z" "j \<in> Basis" "\<And>x. f(x,0) \<bullet> j = 0"
  1123   where "linear f" "linear g" "\<And>z. g (f z) = z" "j \<in> Basis" "\<And>x. f(x,0) \<bullet> j = 0"
  1159       apply (rule comm_monoid_add_class.sum.neutral)
  1159       apply (rule comm_monoid_add_class.sum.neutral)
  1160       using b01 inner_not_same_Basis by fastforce
  1160       using b01 inner_not_same_Basis by fastforce
  1161   qed
  1161   qed
  1162 qed
  1162 qed
  1163 
  1163 
  1164 proposition%important locally_compact_homeomorphic_closed:
  1164 proposition locally_compact_homeomorphic_closed:
  1165   fixes S :: "'a::euclidean_space set"
  1165   fixes S :: "'a::euclidean_space set"
  1166   assumes "locally compact S" and dimlt: "DIM('a) < DIM('b)"
  1166   assumes "locally compact S" and dimlt: "DIM('a) < DIM('b)"
  1167   obtains T :: "'b::euclidean_space set" where "closed T" "S homeomorphic T"
  1167   obtains T :: "'b::euclidean_space set" where "closed T" "S homeomorphic T"
  1168 proof%unimportant -
  1168 proof -
  1169   obtain U:: "('a*real)set" and h
  1169   obtain U:: "('a*real)set" and h
  1170     where "closed U" and homU: "homeomorphism S U h fst"
  1170     where "closed U" and homU: "homeomorphism S U h fst"
  1171     using locally_compact_homeomorphism_projection_closed assms by metis
  1171     using locally_compact_homeomorphism_projection_closed assms by metis
  1172   obtain f :: "'a*real \<Rightarrow> 'b" and g :: "'b \<Rightarrow> 'a*real"
  1172   obtain f :: "'a*real \<Rightarrow> 'b" and g :: "'b \<Rightarrow> 'a*real"
  1173     where "linear f" "linear g" and gf [simp]: "\<And>z. g (f z) = z"
  1173     where "linear f" "linear g" and gf [simp]: "\<And>z. g (f z) = z"
  1189     apply (rule closed_injective_linear_image [OF \<open>closed U\<close> \<open>linear f\<close> \<open>inj f\<close>], assumption)
  1189     apply (rule closed_injective_linear_image [OF \<open>closed U\<close> \<open>linear f\<close> \<open>inj f\<close>], assumption)
  1190     done
  1190     done
  1191 qed
  1191 qed
  1192 
  1192 
  1193 
  1193 
  1194 lemma%important homeomorphic_convex_compact_lemma:
  1194 lemma homeomorphic_convex_compact_lemma:
  1195   fixes S :: "'a::euclidean_space set"
  1195   fixes S :: "'a::euclidean_space set"
  1196   assumes "convex S"
  1196   assumes "convex S"
  1197     and "compact S"
  1197     and "compact S"
  1198     and "cball 0 1 \<subseteq> S"
  1198     and "cball 0 1 \<subseteq> S"
  1199   shows "S homeomorphic (cball (0::'a) 1)"
  1199   shows "S homeomorphic (cball (0::'a) 1)"
  1200 proof%unimportant (rule starlike_compact_projective_special[OF assms(2-3)])
  1200 proof (rule starlike_compact_projective_special[OF assms(2-3)])
  1201   fix x u
  1201   fix x u
  1202   assume "x \<in> S" and "0 \<le> u" and "u < (1::real)"
  1202   assume "x \<in> S" and "0 \<le> u" and "u < (1::real)"
  1203   have "open (ball (u *\<^sub>R x) (1 - u))"
  1203   have "open (ball (u *\<^sub>R x) (1 - u))"
  1204     by (rule open_ball)
  1204     by (rule open_ball)
  1205   moreover have "u *\<^sub>R x \<in> ball (u *\<^sub>R x) (1 - u)"
  1205   moreover have "u *\<^sub>R x \<in> ball (u *\<^sub>R x) (1 - u)"
  1221   ultimately have "u *\<^sub>R x \<in> interior S" ..
  1221   ultimately have "u *\<^sub>R x \<in> interior S" ..
  1222   then show "u *\<^sub>R x \<in> S - frontier S"
  1222   then show "u *\<^sub>R x \<in> S - frontier S"
  1223     using frontier_def and interior_subset by auto
  1223     using frontier_def and interior_subset by auto
  1224 qed
  1224 qed
  1225 
  1225 
  1226 proposition%important homeomorphic_convex_compact_cball:
  1226 proposition homeomorphic_convex_compact_cball:
  1227   fixes e :: real
  1227   fixes e :: real
  1228     and S :: "'a::euclidean_space set"
  1228     and S :: "'a::euclidean_space set"
  1229   assumes "convex S"
  1229   assumes "convex S"
  1230     and "compact S"
  1230     and "compact S"
  1231     and "interior S \<noteq> {}"
  1231     and "interior S \<noteq> {}"
  1232     and "e > 0"
  1232     and "e > 0"
  1233   shows "S homeomorphic (cball (b::'a) e)"
  1233   shows "S homeomorphic (cball (b::'a) e)"
  1234 proof%unimportant -
  1234 proof -
  1235   obtain a where "a \<in> interior S"
  1235   obtain a where "a \<in> interior S"
  1236     using assms(3) by auto
  1236     using assms(3) by auto
  1237   then obtain d where "d > 0" and d: "cball a d \<subseteq> S"
  1237   then obtain d where "d > 0" and d: "cball a d \<subseteq> S"
  1238     unfolding mem_interior_cball by auto
  1238     unfolding mem_interior_cball by auto
  1239   let ?d = "inverse d" and ?n = "0::'a"
  1239   let ?d = "inverse d" and ?n = "0::'a"
  1257     using \<open>d>0\<close> \<open>e>0\<close>
  1257     using \<open>d>0\<close> \<open>e>0\<close>
  1258     apply (auto simp add: scaleR_right_diff_distrib)
  1258     apply (auto simp add: scaleR_right_diff_distrib)
  1259     done
  1259     done
  1260 qed
  1260 qed
  1261 
  1261 
  1262 corollary%important homeomorphic_convex_compact:
  1262 corollary homeomorphic_convex_compact:
  1263   fixes S :: "'a::euclidean_space set"
  1263   fixes S :: "'a::euclidean_space set"
  1264     and T :: "'a set"
  1264     and T :: "'a set"
  1265   assumes "convex S" "compact S" "interior S \<noteq> {}"
  1265   assumes "convex S" "compact S" "interior S \<noteq> {}"
  1266     and "convex T" "compact T" "interior T \<noteq> {}"
  1266     and "convex T" "compact T" "interior T \<noteq> {}"
  1267   shows "S homeomorphic T"
  1267   shows "S homeomorphic T"
  1268   using assms
  1268   using assms
  1269   by (meson zero_less_one homeomorphic_trans homeomorphic_convex_compact_cball homeomorphic_sym)
  1269   by (meson zero_less_one homeomorphic_trans homeomorphic_convex_compact_cball homeomorphic_sym)
  1270 
  1270 
  1271 subsection%important\<open>Covering spaces and lifting results for them\<close>
  1271 subsection\<open>Covering spaces and lifting results for them\<close>
  1272 
  1272 
  1273 definition%important covering_space
  1273 definition%important covering_space
  1274            :: "'a::topological_space set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b::topological_space set \<Rightarrow> bool"
  1274            :: "'a::topological_space set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b::topological_space set \<Rightarrow> bool"
  1275   where
  1275   where
  1276   "covering_space c p S \<equiv>
  1276   "covering_space c p S \<equiv>
  1279                     (\<exists>v. \<Union>v = c \<inter> p -` T \<and>
  1279                     (\<exists>v. \<Union>v = c \<inter> p -` T \<and>
  1280                         (\<forall>u \<in> v. openin (subtopology euclidean c) u) \<and>
  1280                         (\<forall>u \<in> v. openin (subtopology euclidean c) u) \<and>
  1281                         pairwise disjnt v \<and>
  1281                         pairwise disjnt v \<and>
  1282                         (\<forall>u \<in> v. \<exists>q. homeomorphism u T p q)))"
  1282                         (\<forall>u \<in> v. \<exists>q. homeomorphism u T p q)))"
  1283 
  1283 
  1284 lemma%unimportant covering_space_imp_continuous: "covering_space c p S \<Longrightarrow> continuous_on c p"
  1284 lemma covering_space_imp_continuous: "covering_space c p S \<Longrightarrow> continuous_on c p"
  1285   by (simp add: covering_space_def)
  1285   by (simp add: covering_space_def)
  1286 
  1286 
  1287 lemma%unimportant covering_space_imp_surjective: "covering_space c p S \<Longrightarrow> p ` c = S"
  1287 lemma covering_space_imp_surjective: "covering_space c p S \<Longrightarrow> p ` c = S"
  1288   by (simp add: covering_space_def)
  1288   by (simp add: covering_space_def)
  1289 
  1289 
  1290 lemma%unimportant homeomorphism_imp_covering_space: "homeomorphism S T f g \<Longrightarrow> covering_space S f T"
  1290 lemma homeomorphism_imp_covering_space: "homeomorphism S T f g \<Longrightarrow> covering_space S f T"
  1291   apply (simp add: homeomorphism_def covering_space_def, clarify)
  1291   apply (simp add: homeomorphism_def covering_space_def, clarify)
  1292   apply (rule_tac x=T in exI, simp)
  1292   apply (rule_tac x=T in exI, simp)
  1293   apply (rule_tac x="{S}" in exI, auto)
  1293   apply (rule_tac x="{S}" in exI, auto)
  1294   done
  1294   done
  1295 
  1295 
  1296 lemma%unimportant covering_space_local_homeomorphism:
  1296 lemma covering_space_local_homeomorphism:
  1297   assumes "covering_space c p S" "x \<in> c"
  1297   assumes "covering_space c p S" "x \<in> c"
  1298   obtains T u q where "x \<in> T" "openin (subtopology euclidean c) T"
  1298   obtains T u q where "x \<in> T" "openin (subtopology euclidean c) T"
  1299                       "p x \<in> u" "openin (subtopology euclidean S) u"
  1299                       "p x \<in> u" "openin (subtopology euclidean S) u"
  1300                       "homeomorphism T u p q"
  1300                       "homeomorphism T u p q"
  1301 using assms
  1301 using assms
  1302 apply (simp add: covering_space_def, clarify)
  1302 apply (simp add: covering_space_def, clarify)
  1303   apply (drule_tac x="p x" in bspec, force)
  1303   apply (drule_tac x="p x" in bspec, force)
  1304   by (metis IntI UnionE vimage_eq) 
  1304   by (metis IntI UnionE vimage_eq) 
  1305 
  1305 
  1306 
  1306 
  1307 lemma%important covering_space_local_homeomorphism_alt:
  1307 lemma covering_space_local_homeomorphism_alt:
  1308   assumes p: "covering_space c p S" and "y \<in> S"
  1308   assumes p: "covering_space c p S" and "y \<in> S"
  1309   obtains x T U q where "p x = y"
  1309   obtains x T U q where "p x = y"
  1310                         "x \<in> T" "openin (subtopology euclidean c) T"
  1310                         "x \<in> T" "openin (subtopology euclidean c) T"
  1311                         "y \<in> U" "openin (subtopology euclidean S) U"
  1311                         "y \<in> U" "openin (subtopology euclidean S) U"
  1312                           "homeomorphism T U p q"
  1312                           "homeomorphism T U p q"
  1313 proof%unimportant -
  1313 proof -
  1314   obtain x where "p x = y" "x \<in> c"
  1314   obtain x where "p x = y" "x \<in> c"
  1315     using assms covering_space_imp_surjective by blast
  1315     using assms covering_space_imp_surjective by blast
  1316   show ?thesis
  1316   show ?thesis
  1317     apply (rule covering_space_local_homeomorphism [OF p \<open>x \<in> c\<close>])
  1317     apply (rule covering_space_local_homeomorphism [OF p \<open>x \<in> c\<close>])
  1318     using that \<open>p x = y\<close> by blast
  1318     using that \<open>p x = y\<close> by blast
  1319 qed
  1319 qed
  1320 
  1320 
  1321 proposition%important covering_space_open_map:
  1321 proposition covering_space_open_map:
  1322   fixes S :: "'a :: metric_space set" and T :: "'b :: metric_space set"
  1322   fixes S :: "'a :: metric_space set" and T :: "'b :: metric_space set"
  1323   assumes p: "covering_space c p S" and T: "openin (subtopology euclidean c) T"
  1323   assumes p: "covering_space c p S" and T: "openin (subtopology euclidean c) T"
  1324     shows "openin (subtopology euclidean S) (p ` T)"
  1324     shows "openin (subtopology euclidean S) (p ` T)"
  1325 proof%unimportant -
  1325 proof -
  1326   have pce: "p ` c = S"
  1326   have pce: "p ` c = S"
  1327    and covs:
  1327    and covs:
  1328        "\<And>x. x \<in> S \<Longrightarrow>
  1328        "\<And>x. x \<in> S \<Longrightarrow>
  1329             \<exists>X VS. x \<in> X \<and> openin (subtopology euclidean S) X \<and>
  1329             \<exists>X VS. x \<in> X \<and> openin (subtopology euclidean S) X \<and>
  1330                   \<Union>VS = c \<inter> p -` X \<and>
  1330                   \<Union>VS = c \<inter> p -` X \<and>
  1366       done
  1366       done
  1367   qed
  1367   qed
  1368   with openin_subopen show ?thesis by blast
  1368   with openin_subopen show ?thesis by blast
  1369 qed
  1369 qed
  1370 
  1370 
  1371 lemma%important covering_space_lift_unique_gen:
  1371 lemma covering_space_lift_unique_gen:
  1372   fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
  1372   fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
  1373   fixes g1 :: "'a \<Rightarrow> 'c::real_normed_vector"
  1373   fixes g1 :: "'a \<Rightarrow> 'c::real_normed_vector"
  1374   assumes cov: "covering_space c p S"
  1374   assumes cov: "covering_space c p S"
  1375       and eq: "g1 a = g2 a"
  1375       and eq: "g1 a = g2 a"
  1376       and f: "continuous_on T f"  "f ` T \<subseteq> S"
  1376       and f: "continuous_on T f"  "f ` T \<subseteq> S"
  1378       and fg1: "\<And>x. x \<in> T \<Longrightarrow> f x = p(g1 x)"
  1378       and fg1: "\<And>x. x \<in> T \<Longrightarrow> f x = p(g1 x)"
  1379       and g2: "continuous_on T g2"  "g2 ` T \<subseteq> c"
  1379       and g2: "continuous_on T g2"  "g2 ` T \<subseteq> c"
  1380       and fg2: "\<And>x. x \<in> T \<Longrightarrow> f x = p(g2 x)"
  1380       and fg2: "\<And>x. x \<in> T \<Longrightarrow> f x = p(g2 x)"
  1381       and u_compt: "U \<in> components T" and "a \<in> U" "x \<in> U"
  1381       and u_compt: "U \<in> components T" and "a \<in> U" "x \<in> U"
  1382     shows "g1 x = g2 x"
  1382     shows "g1 x = g2 x"
  1383 proof%unimportant -
  1383 proof -
  1384   have "U \<subseteq> T" by (rule in_components_subset [OF u_compt])
  1384   have "U \<subseteq> T" by (rule in_components_subset [OF u_compt])
  1385   define G12 where "G12 \<equiv> {x \<in> U. g1 x - g2 x = 0}"
  1385   define G12 where "G12 \<equiv> {x \<in> U. g1 x - g2 x = 0}"
  1386   have "connected U" by (rule in_components_connected [OF u_compt])
  1386   have "connected U" by (rule in_components_connected [OF u_compt])
  1387   have contu: "continuous_on U g1" "continuous_on U g2"
  1387   have contu: "continuous_on U g1" "continuous_on U g2"
  1388        using \<open>U \<subseteq> T\<close> continuous_on_subset g1 g2 by blast+
  1388        using \<open>U \<subseteq> T\<close> continuous_on_subset g1 g2 by blast+
  1425   with eq \<open>a \<in> U\<close> have "\<And>x. x \<in> U \<Longrightarrow> g1 x - g2 x = 0" by (auto simp: G12_def)
  1425   with eq \<open>a \<in> U\<close> have "\<And>x. x \<in> U \<Longrightarrow> g1 x - g2 x = 0" by (auto simp: G12_def)
  1426   then show ?thesis
  1426   then show ?thesis
  1427     using \<open>x \<in> U\<close> by force
  1427     using \<open>x \<in> U\<close> by force
  1428 qed
  1428 qed
  1429 
  1429 
  1430 proposition%important covering_space_lift_unique:
  1430 proposition covering_space_lift_unique:
  1431   fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
  1431   fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
  1432   fixes g1 :: "'a \<Rightarrow> 'c::real_normed_vector"
  1432   fixes g1 :: "'a \<Rightarrow> 'c::real_normed_vector"
  1433   assumes "covering_space c p S"
  1433   assumes "covering_space c p S"
  1434           "g1 a = g2 a"
  1434           "g1 a = g2 a"
  1435           "continuous_on T f"  "f ` T \<subseteq> S"
  1435           "continuous_on T f"  "f ` T \<subseteq> S"
  1436           "continuous_on T g1"  "g1 ` T \<subseteq> c"  "\<And>x. x \<in> T \<Longrightarrow> f x = p(g1 x)"
  1436           "continuous_on T g1"  "g1 ` T \<subseteq> c"  "\<And>x. x \<in> T \<Longrightarrow> f x = p(g1 x)"
  1437           "continuous_on T g2"  "g2 ` T \<subseteq> c"  "\<And>x. x \<in> T \<Longrightarrow> f x = p(g2 x)"
  1437           "continuous_on T g2"  "g2 ` T \<subseteq> c"  "\<And>x. x \<in> T \<Longrightarrow> f x = p(g2 x)"
  1438           "connected T"  "a \<in> T"   "x \<in> T"
  1438           "connected T"  "a \<in> T"   "x \<in> T"
  1439    shows "g1 x = g2 x"
  1439    shows "g1 x = g2 x"
  1440   using%unimportant covering_space_lift_unique_gen [of c p S] in_components_self assms ex_in_conv
  1440   using covering_space_lift_unique_gen [of c p S] in_components_self assms ex_in_conv
  1441   by%unimportant blast
  1441   by blast
  1442 
  1442 
  1443 lemma%unimportant covering_space_locally:
  1443 lemma covering_space_locally:
  1444   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1444   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1445   assumes loc: "locally \<phi> C" and cov: "covering_space C p S"
  1445   assumes loc: "locally \<phi> C" and cov: "covering_space C p S"
  1446       and pim: "\<And>T. \<lbrakk>T \<subseteq> C; \<phi> T\<rbrakk> \<Longrightarrow> \<psi>(p ` T)"
  1446       and pim: "\<And>T. \<lbrakk>T \<subseteq> C; \<phi> T\<rbrakk> \<Longrightarrow> \<psi>(p ` T)"
  1447     shows "locally \<psi> S"
  1447     shows "locally \<psi> S"
  1448 proof -
  1448 proof -
  1454   then show ?thesis
  1454   then show ?thesis
  1455     using covering_space_imp_surjective [OF cov] by metis
  1455     using covering_space_imp_surjective [OF cov] by metis
  1456 qed
  1456 qed
  1457 
  1457 
  1458 
  1458 
  1459 proposition%important covering_space_locally_eq:
  1459 proposition covering_space_locally_eq:
  1460   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1460   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1461   assumes cov: "covering_space C p S"
  1461   assumes cov: "covering_space C p S"
  1462       and pim: "\<And>T. \<lbrakk>T \<subseteq> C; \<phi> T\<rbrakk> \<Longrightarrow> \<psi>(p ` T)"
  1462       and pim: "\<And>T. \<lbrakk>T \<subseteq> C; \<phi> T\<rbrakk> \<Longrightarrow> \<psi>(p ` T)"
  1463       and qim: "\<And>q U. \<lbrakk>U \<subseteq> S; continuous_on U q; \<psi> U\<rbrakk> \<Longrightarrow> \<phi>(q ` U)"
  1463       and qim: "\<And>q U. \<lbrakk>U \<subseteq> S; continuous_on U q; \<psi> U\<rbrakk> \<Longrightarrow> \<phi>(q ` U)"
  1464     shows "locally \<psi> S \<longleftrightarrow> locally \<phi> C"
  1464     shows "locally \<psi> S \<longleftrightarrow> locally \<phi> C"
  1465          (is "?lhs = ?rhs")
  1465          (is "?lhs = ?rhs")
  1466 proof%unimportant
  1466 proof
  1467   assume L: ?lhs
  1467   assume L: ?lhs
  1468   show ?rhs
  1468   show ?rhs
  1469   proof (rule locallyI)
  1469   proof (rule locallyI)
  1470     fix V x
  1470     fix V x
  1471     assume V: "openin (subtopology euclidean C) V" and "x \<in> V"
  1471     assume V: "openin (subtopology euclidean C) V" and "x \<in> V"
  1516   assume ?rhs
  1516   assume ?rhs
  1517   then show ?lhs
  1517   then show ?lhs
  1518     using cov covering_space_locally pim by blast
  1518     using cov covering_space_locally pim by blast
  1519 qed
  1519 qed
  1520 
  1520 
  1521 lemma%unimportant covering_space_locally_compact_eq:
  1521 lemma covering_space_locally_compact_eq:
  1522   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1522   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1523   assumes "covering_space C p S"
  1523   assumes "covering_space C p S"
  1524   shows "locally compact S \<longleftrightarrow> locally compact C"
  1524   shows "locally compact S \<longleftrightarrow> locally compact C"
  1525   apply (rule covering_space_locally_eq [OF assms])
  1525   apply (rule covering_space_locally_eq [OF assms])
  1526    apply (meson assms compact_continuous_image continuous_on_subset covering_space_imp_continuous)
  1526    apply (meson assms compact_continuous_image continuous_on_subset covering_space_imp_continuous)
  1527   using compact_continuous_image by blast
  1527   using compact_continuous_image by blast
  1528 
  1528 
  1529 lemma%unimportant covering_space_locally_connected_eq:
  1529 lemma covering_space_locally_connected_eq:
  1530   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1530   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1531   assumes "covering_space C p S"
  1531   assumes "covering_space C p S"
  1532     shows "locally connected S \<longleftrightarrow> locally connected C"
  1532     shows "locally connected S \<longleftrightarrow> locally connected C"
  1533   apply (rule covering_space_locally_eq [OF assms])
  1533   apply (rule covering_space_locally_eq [OF assms])
  1534    apply (meson connected_continuous_image assms continuous_on_subset covering_space_imp_continuous)
  1534    apply (meson connected_continuous_image assms continuous_on_subset covering_space_imp_continuous)
  1535   using connected_continuous_image by blast
  1535   using connected_continuous_image by blast
  1536 
  1536 
  1537 lemma%unimportant covering_space_locally_path_connected_eq:
  1537 lemma covering_space_locally_path_connected_eq:
  1538   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1538   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1539   assumes "covering_space C p S"
  1539   assumes "covering_space C p S"
  1540     shows "locally path_connected S \<longleftrightarrow> locally path_connected C"
  1540     shows "locally path_connected S \<longleftrightarrow> locally path_connected C"
  1541   apply (rule covering_space_locally_eq [OF assms])
  1541   apply (rule covering_space_locally_eq [OF assms])
  1542    apply (meson path_connected_continuous_image assms continuous_on_subset covering_space_imp_continuous)
  1542    apply (meson path_connected_continuous_image assms continuous_on_subset covering_space_imp_continuous)
  1543   using path_connected_continuous_image by blast
  1543   using path_connected_continuous_image by blast
  1544 
  1544 
  1545 
  1545 
  1546 lemma%unimportant covering_space_locally_compact:
  1546 lemma covering_space_locally_compact:
  1547   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1547   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1548   assumes "locally compact C" "covering_space C p S"
  1548   assumes "locally compact C" "covering_space C p S"
  1549   shows "locally compact S"
  1549   shows "locally compact S"
  1550   using assms covering_space_locally_compact_eq by blast
  1550   using assms covering_space_locally_compact_eq by blast
  1551 
  1551 
  1552 
  1552 
  1553 lemma%unimportant covering_space_locally_connected:
  1553 lemma covering_space_locally_connected:
  1554   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1554   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1555   assumes "locally connected C" "covering_space C p S"
  1555   assumes "locally connected C" "covering_space C p S"
  1556   shows "locally connected S"
  1556   shows "locally connected S"
  1557   using assms covering_space_locally_connected_eq by blast
  1557   using assms covering_space_locally_connected_eq by blast
  1558 
  1558 
  1559 lemma%unimportant covering_space_locally_path_connected:
  1559 lemma covering_space_locally_path_connected:
  1560   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1560   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1561   assumes "locally path_connected C" "covering_space C p S"
  1561   assumes "locally path_connected C" "covering_space C p S"
  1562   shows "locally path_connected S"
  1562   shows "locally path_connected S"
  1563   using assms covering_space_locally_path_connected_eq by blast
  1563   using assms covering_space_locally_path_connected_eq by blast
  1564 
  1564 
  1565 proposition%important covering_space_lift_homotopy:
  1565 proposition covering_space_lift_homotopy:
  1566   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1566   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1567     and h :: "real \<times> 'c::real_normed_vector \<Rightarrow> 'b"
  1567     and h :: "real \<times> 'c::real_normed_vector \<Rightarrow> 'b"
  1568   assumes cov: "covering_space C p S"
  1568   assumes cov: "covering_space C p S"
  1569       and conth: "continuous_on ({0..1} \<times> U) h"
  1569       and conth: "continuous_on ({0..1} \<times> U) h"
  1570       and him: "h ` ({0..1} \<times> U) \<subseteq> S"
  1570       and him: "h ` ({0..1} \<times> U) \<subseteq> S"
  1572       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> C"
  1572       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> C"
  1573     obtains k where "continuous_on ({0..1} \<times> U) k"
  1573     obtains k where "continuous_on ({0..1} \<times> U) k"
  1574                     "k ` ({0..1} \<times> U) \<subseteq> C"
  1574                     "k ` ({0..1} \<times> U) \<subseteq> C"
  1575                     "\<And>y. y \<in> U \<Longrightarrow> k(0, y) = f y"
  1575                     "\<And>y. y \<in> U \<Longrightarrow> k(0, y) = f y"
  1576                     "\<And>z. z \<in> {0..1} \<times> U \<Longrightarrow> h z = p(k z)"
  1576                     "\<And>z. z \<in> {0..1} \<times> U \<Longrightarrow> h z = p(k z)"
  1577 proof%unimportant -
  1577 proof -
  1578   have "\<exists>V k. openin (subtopology euclidean U) V \<and> y \<in> V \<and>
  1578   have "\<exists>V k. openin (subtopology euclidean U) V \<and> y \<in> V \<and>
  1579               continuous_on ({0..1} \<times> V) k \<and> k ` ({0..1} \<times> V) \<subseteq> C \<and>
  1579               continuous_on ({0..1} \<times> V) k \<and> k ` ({0..1} \<times> V) \<subseteq> C \<and>
  1580               (\<forall>z \<in> V. k(0, z) = f z) \<and> (\<forall>z \<in> {0..1} \<times> V. h z = p(k z))"
  1580               (\<forall>z \<in> V. k(0, z) = f z) \<and> (\<forall>z \<in> {0..1} \<times> V. h z = p(k z))"
  1581         if "y \<in> U" for y
  1581         if "y \<in> U" for y
  1582   proof -
  1582   proof -
  1910     show "\<And>z. z \<in> {0..1} \<times> U \<Longrightarrow> h z = p (k z)"
  1910     show "\<And>z. z \<in> {0..1} \<times> U \<Longrightarrow> h z = p (k z)"
  1911       using V*k by auto
  1911       using V*k by auto
  1912   qed (auto simp: contk)
  1912   qed (auto simp: contk)
  1913 qed
  1913 qed
  1914 
  1914 
  1915 corollary%important covering_space_lift_homotopy_alt:
  1915 corollary covering_space_lift_homotopy_alt:
  1916   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1916   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  1917     and h :: "'c::real_normed_vector \<times> real \<Rightarrow> 'b"
  1917     and h :: "'c::real_normed_vector \<times> real \<Rightarrow> 'b"
  1918   assumes cov: "covering_space C p S"
  1918   assumes cov: "covering_space C p S"
  1919       and conth: "continuous_on (U \<times> {0..1}) h"
  1919       and conth: "continuous_on (U \<times> {0..1}) h"
  1920       and him: "h ` (U \<times> {0..1}) \<subseteq> S"
  1920       and him: "h ` (U \<times> {0..1}) \<subseteq> S"
  1922       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> C"
  1922       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> C"
  1923   obtains k where "continuous_on (U \<times> {0..1}) k"
  1923   obtains k where "continuous_on (U \<times> {0..1}) k"
  1924                   "k ` (U \<times> {0..1}) \<subseteq> C"
  1924                   "k ` (U \<times> {0..1}) \<subseteq> C"
  1925                   "\<And>y. y \<in> U \<Longrightarrow> k(y, 0) = f y"
  1925                   "\<And>y. y \<in> U \<Longrightarrow> k(y, 0) = f y"
  1926                   "\<And>z. z \<in> U \<times> {0..1} \<Longrightarrow> h z = p(k z)"
  1926                   "\<And>z. z \<in> U \<times> {0..1} \<Longrightarrow> h z = p(k z)"
  1927 proof%unimportant -
  1927 proof -
  1928   have "continuous_on ({0..1} \<times> U) (h \<circ> (\<lambda>z. (snd z, fst z)))"
  1928   have "continuous_on ({0..1} \<times> U) (h \<circ> (\<lambda>z. (snd z, fst z)))"
  1929     by (intro continuous_intros continuous_on_subset [OF conth]) auto
  1929     by (intro continuous_intros continuous_on_subset [OF conth]) auto
  1930   then obtain k where contk: "continuous_on ({0..1} \<times> U) k"
  1930   then obtain k where contk: "continuous_on ({0..1} \<times> U) k"
  1931                   and kim:  "k ` ({0..1} \<times> U) \<subseteq> C"
  1931                   and kim:  "k ` ({0..1} \<times> U) \<subseteq> C"
  1932                   and k0: "\<And>y. y \<in> U \<Longrightarrow> k(0, y) = f y"
  1932                   and k0: "\<And>y. y \<in> U \<Longrightarrow> k(0, y) = f y"
  1938        apply (intro continuous_intros continuous_on_subset [OF contk])
  1938        apply (intro continuous_intros continuous_on_subset [OF contk])
  1939     using kim heqp apply (auto simp: k0)
  1939     using kim heqp apply (auto simp: k0)
  1940     done
  1940     done
  1941 qed
  1941 qed
  1942 
  1942 
  1943 corollary%important covering_space_lift_homotopic_function:
  1943 corollary covering_space_lift_homotopic_function:
  1944   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" and g:: "'c::real_normed_vector \<Rightarrow> 'a"
  1944   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" and g:: "'c::real_normed_vector \<Rightarrow> 'a"
  1945   assumes cov: "covering_space C p S"
  1945   assumes cov: "covering_space C p S"
  1946       and contg: "continuous_on U g"
  1946       and contg: "continuous_on U g"
  1947       and gim: "g ` U \<subseteq> C"
  1947       and gim: "g ` U \<subseteq> C"
  1948       and pgeq: "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  1948       and pgeq: "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  1949       and hom: "homotopic_with (\<lambda>x. True) U S f f'"
  1949       and hom: "homotopic_with (\<lambda>x. True) U S f f'"
  1950     obtains g' where "continuous_on U g'" "image g' U \<subseteq> C" "\<And>y. y \<in> U \<Longrightarrow> p(g' y) = f' y"
  1950     obtains g' where "continuous_on U g'" "image g' U \<subseteq> C" "\<And>y. y \<in> U \<Longrightarrow> p(g' y) = f' y"
  1951 proof%unimportant -
  1951 proof -
  1952   obtain h where conth: "continuous_on ({0..1::real} \<times> U) h"
  1952   obtain h where conth: "continuous_on ({0..1::real} \<times> U) h"
  1953              and him: "h ` ({0..1} \<times> U) \<subseteq> S"
  1953              and him: "h ` ({0..1} \<times> U) \<subseteq> S"
  1954              and h0:  "\<And>x. h(0, x) = f x"
  1954              and h0:  "\<And>x. h(0, x) = f x"
  1955              and h1: "\<And>x. h(1, x) = f' x"
  1955              and h1: "\<And>x. h(1, x) = f' x"
  1956     using hom by (auto simp: homotopic_with_def)
  1956     using hom by (auto simp: homotopic_with_def)
  1970     show "\<And>y. y \<in> U \<Longrightarrow> p ((k \<circ> Pair 1) y) = f' y"
  1970     show "\<And>y. y \<in> U \<Longrightarrow> p ((k \<circ> Pair 1) y) = f' y"
  1971       by (auto simp: h1 heq [symmetric])
  1971       by (auto simp: h1 heq [symmetric])
  1972   qed
  1972   qed
  1973 qed
  1973 qed
  1974 
  1974 
  1975 corollary%important covering_space_lift_inessential_function:
  1975 corollary covering_space_lift_inessential_function:
  1976   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" and U :: "'c::real_normed_vector set"
  1976   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" and U :: "'c::real_normed_vector set"
  1977   assumes cov: "covering_space C p S"
  1977   assumes cov: "covering_space C p S"
  1978       and hom: "homotopic_with (\<lambda>x. True) U S f (\<lambda>x. a)"
  1978       and hom: "homotopic_with (\<lambda>x. True) U S f (\<lambda>x. a)"
  1979   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  1979   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  1980 proof%unimportant (cases "U = {}")
  1980 proof (cases "U = {}")
  1981   case True
  1981   case True
  1982   then show ?thesis
  1982   then show ?thesis
  1983     using that continuous_on_empty by blast
  1983     using that continuous_on_empty by blast
  1984 next
  1984 next
  1985   case False
  1985   case False
  1995     done
  1995     done
  1996 qed
  1996 qed
  1997 
  1997 
  1998 subsection%important\<open> Lifting of general functions to covering space\<close>
  1998 subsection%important\<open> Lifting of general functions to covering space\<close>
  1999 
  1999 
  2000 proposition%important covering_space_lift_path_strong:
  2000 proposition covering_space_lift_path_strong:
  2001   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2001   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2002     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2002     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2003   assumes cov: "covering_space C p S" and "a \<in> C"
  2003   assumes cov: "covering_space C p S" and "a \<in> C"
  2004       and "path g" and pag: "path_image g \<subseteq> S" and pas: "pathstart g = p a"
  2004       and "path g" and pag: "path_image g \<subseteq> S" and pas: "pathstart g = p a"
  2005     obtains h where "path h" "path_image h \<subseteq> C" "pathstart h = a"
  2005     obtains h where "path h" "path_image h \<subseteq> C" "pathstart h = a"
  2006                 and "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h t) = g t"
  2006                 and "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h t) = g t"
  2007 proof%unimportant -
  2007 proof -
  2008   obtain k:: "real \<times> 'c \<Rightarrow> 'a"
  2008   obtain k:: "real \<times> 'c \<Rightarrow> 'a"
  2009     where contk: "continuous_on ({0..1} \<times> {undefined}) k"
  2009     where contk: "continuous_on ({0..1} \<times> {undefined}) k"
  2010       and kim: "k ` ({0..1} \<times> {undefined}) \<subseteq> C"
  2010       and kim: "k ` ({0..1} \<times> {undefined}) \<subseteq> C"
  2011       and k0:  "k (0, undefined) = a"
  2011       and k0:  "k (0, undefined) = a"
  2012       and pk: "\<And>z. z \<in> {0..1} \<times> {undefined} \<Longrightarrow> p(k z) = (g \<circ> fst) z"
  2012       and pk: "\<And>z. z \<in> {0..1} \<times> {undefined} \<Longrightarrow> p(k z) = (g \<circ> fst) z"
  2031     show "\<And>t. t \<in> {0..1} \<Longrightarrow> p ((k \<circ> (\<lambda>t. (t, undefined))) t) = g t"
  2031     show "\<And>t. t \<in> {0..1} \<Longrightarrow> p ((k \<circ> (\<lambda>t. (t, undefined))) t) = g t"
  2032       by (auto simp: pk)
  2032       by (auto simp: pk)
  2033   qed
  2033   qed
  2034 qed
  2034 qed
  2035 
  2035 
  2036 corollary%important covering_space_lift_path:
  2036 corollary covering_space_lift_path:
  2037   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2037   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2038   assumes cov: "covering_space C p S" and "path g" and pig: "path_image g \<subseteq> S"
  2038   assumes cov: "covering_space C p S" and "path g" and pig: "path_image g \<subseteq> S"
  2039   obtains h where "path h" "path_image h \<subseteq> C" "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h t) = g t"
  2039   obtains h where "path h" "path_image h \<subseteq> C" "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h t) = g t"
  2040 proof%unimportant -
  2040 proof -
  2041   obtain a where "a \<in> C" "pathstart g = p a"
  2041   obtain a where "a \<in> C" "pathstart g = p a"
  2042     by (metis pig cov covering_space_imp_surjective imageE pathstart_in_path_image subsetCE)
  2042     by (metis pig cov covering_space_imp_surjective imageE pathstart_in_path_image subsetCE)
  2043   show ?thesis
  2043   show ?thesis
  2044     using covering_space_lift_path_strong [OF cov \<open>a \<in> C\<close> \<open>path g\<close> pig]
  2044     using covering_space_lift_path_strong [OF cov \<open>a \<in> C\<close> \<open>path g\<close> pig]
  2045     by (metis \<open>pathstart g = p a\<close> that)
  2045     by (metis \<open>pathstart g = p a\<close> that)
  2046 qed
  2046 qed
  2047 
  2047 
  2048   
  2048   
  2049 proposition%important covering_space_lift_homotopic_paths:
  2049 proposition covering_space_lift_homotopic_paths:
  2050   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2050   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2051   assumes cov: "covering_space C p S"
  2051   assumes cov: "covering_space C p S"
  2052       and "path g1" and pig1: "path_image g1 \<subseteq> S"
  2052       and "path g1" and pig1: "path_image g1 \<subseteq> S"
  2053       and "path g2" and pig2: "path_image g2 \<subseteq> S"
  2053       and "path g2" and pig2: "path_image g2 \<subseteq> S"
  2054       and hom: "homotopic_paths S g1 g2"
  2054       and hom: "homotopic_paths S g1 g2"
  2055       and "path h1" and pih1: "path_image h1 \<subseteq> C" and ph1: "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h1 t) = g1 t"
  2055       and "path h1" and pih1: "path_image h1 \<subseteq> C" and ph1: "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h1 t) = g1 t"
  2056       and "path h2" and pih2: "path_image h2 \<subseteq> C" and ph2: "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h2 t) = g2 t"
  2056       and "path h2" and pih2: "path_image h2 \<subseteq> C" and ph2: "\<And>t. t \<in> {0..1} \<Longrightarrow> p(h2 t) = g2 t"
  2057       and h1h2: "pathstart h1 = pathstart h2"
  2057       and h1h2: "pathstart h1 = pathstart h2"
  2058     shows "homotopic_paths C h1 h2"
  2058     shows "homotopic_paths C h1 h2"
  2059 proof%unimportant -
  2059 proof -
  2060   obtain h :: "real \<times> real \<Rightarrow> 'b"
  2060   obtain h :: "real \<times> real \<Rightarrow> 'b"
  2061      where conth: "continuous_on ({0..1} \<times> {0..1}) h"
  2061      where conth: "continuous_on ({0..1} \<times> {0..1}) h"
  2062        and him: "h ` ({0..1} \<times> {0..1}) \<subseteq> S"
  2062        and him: "h ` ({0..1} \<times> {0..1}) \<subseteq> S"
  2063        and h0: "\<And>x. h (0, x) = g1 x" and h1: "\<And>x. h (1, x) = g2 x"
  2063        and h0: "\<And>x. h (0, x) = g1 x" and h1: "\<And>x. h (1, x) = g2 x"
  2064        and heq0: "\<And>t. t \<in> {0..1} \<Longrightarrow> h (t, 0) = g1 0"
  2064        and heq0: "\<And>t. t \<in> {0..1} \<Longrightarrow> h (t, 0) = g1 0"
  2115     qed (use contk kim g1im h1im that in \<open>auto simp: ph1 continuous_on_const\<close>)
  2115     qed (use contk kim g1im h1im that in \<open>auto simp: ph1 continuous_on_const\<close>)
  2116   qed (use contk kim in auto)
  2116   qed (use contk kim in auto)
  2117 qed
  2117 qed
  2118 
  2118 
  2119 
  2119 
  2120 corollary%important covering_space_monodromy:
  2120 corollary covering_space_monodromy:
  2121   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2121   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2122   assumes cov: "covering_space C p S"
  2122   assumes cov: "covering_space C p S"
  2123       and "path g1" and pig1: "path_image g1 \<subseteq> S"
  2123       and "path g1" and pig1: "path_image g1 \<subseteq> S"
  2124       and "path g2" and pig2: "path_image g2 \<subseteq> S"
  2124       and "path g2" and pig2: "path_image g2 \<subseteq> S"
  2125       and hom: "homotopic_paths S g1 g2"
  2125       and hom: "homotopic_paths S g1 g2"
  2129     shows "pathfinish h1 = pathfinish h2"
  2129     shows "pathfinish h1 = pathfinish h2"
  2130   using%unimportant covering_space_lift_homotopic_paths [OF assms] homotopic_paths_imp_pathfinish
  2130   using%unimportant covering_space_lift_homotopic_paths [OF assms] homotopic_paths_imp_pathfinish
  2131   by%unimportant blast
  2131   by%unimportant blast
  2132 
  2132 
  2133 
  2133 
  2134 corollary%important covering_space_lift_homotopic_path:
  2134 corollary covering_space_lift_homotopic_path:
  2135   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2135   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2136   assumes cov: "covering_space C p S"
  2136   assumes cov: "covering_space C p S"
  2137       and hom: "homotopic_paths S f f'"
  2137       and hom: "homotopic_paths S f f'"
  2138       and "path g" and pig: "path_image g \<subseteq> C"
  2138       and "path g" and pig: "path_image g \<subseteq> C"
  2139       and a: "pathstart g = a" and b: "pathfinish g = b"
  2139       and a: "pathstart g = a" and b: "pathfinish g = b"
  2140       and pgeq: "\<And>t. t \<in> {0..1} \<Longrightarrow> p(g t) = f t"
  2140       and pgeq: "\<And>t. t \<in> {0..1} \<Longrightarrow> p(g t) = f t"
  2141   obtains g' where "path g'" "path_image g' \<subseteq> C"
  2141   obtains g' where "path g'" "path_image g' \<subseteq> C"
  2142                    "pathstart g' = a" "pathfinish g' = b" "\<And>t. t \<in> {0..1} \<Longrightarrow> p(g' t) = f' t"
  2142                    "pathstart g' = a" "pathfinish g' = b" "\<And>t. t \<in> {0..1} \<Longrightarrow> p(g' t) = f' t"
  2143 proof%unimportant (rule covering_space_lift_path_strong [OF cov, of a f'])
  2143 proof (rule covering_space_lift_path_strong [OF cov, of a f'])
  2144   show "a \<in> C"
  2144   show "a \<in> C"
  2145     using a pig by auto
  2145     using a pig by auto
  2146   show "path f'" "path_image f' \<subseteq> S"
  2146   show "path f'" "path_image f' \<subseteq> S"
  2147     using hom homotopic_paths_imp_path homotopic_paths_imp_subset by blast+
  2147     using hom homotopic_paths_imp_path homotopic_paths_imp_subset by blast+
  2148   show "pathstart f' = p a"
  2148   show "pathstart f' = p a"
  2149     by (metis a atLeastAtMost_iff hom homotopic_paths_imp_pathstart order_refl pathstart_def pgeq zero_le_one)
  2149     by (metis a atLeastAtMost_iff hom homotopic_paths_imp_pathstart order_refl pathstart_def pgeq zero_le_one)
  2150 qed (metis (mono_tags, lifting) assms cov covering_space_monodromy hom homotopic_paths_imp_path homotopic_paths_imp_subset pgeq pig)
  2150 qed (metis (mono_tags, lifting) assms cov covering_space_monodromy hom homotopic_paths_imp_path homotopic_paths_imp_subset pgeq pig)
  2151 
  2151 
  2152 
  2152 
  2153 proposition%important covering_space_lift_general:
  2153 proposition covering_space_lift_general:
  2154   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2154   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2155     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2155     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2156   assumes cov: "covering_space C p S" and "a \<in> C" "z \<in> U"
  2156   assumes cov: "covering_space C p S" and "a \<in> C" "z \<in> U"
  2157       and U: "path_connected U" "locally path_connected U"
  2157       and U: "path_connected U" "locally path_connected U"
  2158       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2158       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2160       and hom: "\<And>r. \<lbrakk>path r; path_image r \<subseteq> U; pathstart r = z; pathfinish r = z\<rbrakk>
  2160       and hom: "\<And>r. \<lbrakk>path r; path_image r \<subseteq> U; pathstart r = z; pathfinish r = z\<rbrakk>
  2161                      \<Longrightarrow> \<exists>q. path q \<and> path_image q \<subseteq> C \<and>
  2161                      \<Longrightarrow> \<exists>q. path q \<and> path_image q \<subseteq> C \<and>
  2162                              pathstart q = a \<and> pathfinish q = a \<and>
  2162                              pathstart q = a \<and> pathfinish q = a \<and>
  2163                              homotopic_paths S (f \<circ> r) (p \<circ> q)"
  2163                              homotopic_paths S (f \<circ> r) (p \<circ> q)"
  2164   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "g z = a" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2164   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "g z = a" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2165 proof%unimportant -
  2165 proof -
  2166   have *: "\<exists>g h. path g \<and> path_image g \<subseteq> U \<and>
  2166   have *: "\<exists>g h. path g \<and> path_image g \<subseteq> U \<and>
  2167                  pathstart g = z \<and> pathfinish g = y \<and>
  2167                  pathstart g = z \<and> pathfinish g = y \<and>
  2168                  path h \<and> path_image h \<subseteq> C \<and> pathstart h = a \<and>
  2168                  path h \<and> path_image h \<subseteq> C \<and> pathstart h = a \<and>
  2169                  (\<forall>t \<in> {0..1}. p(h t) = f(g t))"
  2169                  (\<forall>t \<in> {0..1}. p(h t) = f(g t))"
  2170           if "y \<in> U" for y
  2170           if "y \<in> U" for y
  2403       by (metis IntD1 IntD2 vimage_eq openin_subopen continuous_on_open_gen [OF LC])
  2403       by (metis IntD1 IntD2 vimage_eq openin_subopen continuous_on_open_gen [OF LC])
  2404   qed
  2404   qed
  2405 qed
  2405 qed
  2406 
  2406 
  2407 
  2407 
  2408 corollary%important covering_space_lift_stronger:
  2408 corollary covering_space_lift_stronger:
  2409   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2409   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2410     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2410     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2411   assumes cov: "covering_space C p S" "a \<in> C" "z \<in> U"
  2411   assumes cov: "covering_space C p S" "a \<in> C" "z \<in> U"
  2412       and U: "path_connected U" "locally path_connected U"
  2412       and U: "path_connected U" "locally path_connected U"
  2413       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2413       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2414       and feq: "f z = p a"
  2414       and feq: "f z = p a"
  2415       and hom: "\<And>r. \<lbrakk>path r; path_image r \<subseteq> U; pathstart r = z; pathfinish r = z\<rbrakk>
  2415       and hom: "\<And>r. \<lbrakk>path r; path_image r \<subseteq> U; pathstart r = z; pathfinish r = z\<rbrakk>
  2416                      \<Longrightarrow> \<exists>b. homotopic_paths S (f \<circ> r) (linepath b b)"
  2416                      \<Longrightarrow> \<exists>b. homotopic_paths S (f \<circ> r) (linepath b b)"
  2417   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "g z = a" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2417   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "g z = a" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2418 proof%unimportant (rule covering_space_lift_general [OF cov U contf fim feq])
  2418 proof (rule covering_space_lift_general [OF cov U contf fim feq])
  2419   fix r
  2419   fix r
  2420   assume "path r" "path_image r \<subseteq> U" "pathstart r = z" "pathfinish r = z"
  2420   assume "path r" "path_image r \<subseteq> U" "pathstart r = z" "pathfinish r = z"
  2421   then obtain b where b: "homotopic_paths S (f \<circ> r) (linepath b b)"
  2421   then obtain b where b: "homotopic_paths S (f \<circ> r) (linepath b b)"
  2422     using hom by blast
  2422     using hom by blast
  2423   then have "f (pathstart r) = b"
  2423   then have "f (pathstart r) = b"
  2430                   path_image q \<subseteq> C \<and>
  2430                   path_image q \<subseteq> C \<and>
  2431                   pathstart q = a \<and> pathfinish q = a \<and> homotopic_paths S (f \<circ> r) (p \<circ> q)"
  2431                   pathstart q = a \<and> pathfinish q = a \<and> homotopic_paths S (f \<circ> r) (p \<circ> q)"
  2432     by (force simp: \<open>a \<in> C\<close>)
  2432     by (force simp: \<open>a \<in> C\<close>)
  2433 qed auto
  2433 qed auto
  2434 
  2434 
  2435 corollary%important covering_space_lift_strong:
  2435 corollary covering_space_lift_strong:
  2436   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2436   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2437     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2437     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2438   assumes cov: "covering_space C p S" "a \<in> C" "z \<in> U"
  2438   assumes cov: "covering_space C p S" "a \<in> C" "z \<in> U"
  2439       and scU: "simply_connected U" and lpcU: "locally path_connected U"
  2439       and scU: "simply_connected U" and lpcU: "locally path_connected U"
  2440       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2440       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2441       and feq: "f z = p a"
  2441       and feq: "f z = p a"
  2442   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "g z = a" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2442   obtains g where "continuous_on U g" "g ` U \<subseteq> C" "g z = a" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2443 proof%unimportant (rule covering_space_lift_stronger [OF cov _ lpcU contf fim feq])
  2443 proof (rule covering_space_lift_stronger [OF cov _ lpcU contf fim feq])
  2444   show "path_connected U"
  2444   show "path_connected U"
  2445     using scU simply_connected_eq_contractible_loop_some by blast
  2445     using scU simply_connected_eq_contractible_loop_some by blast
  2446   fix r
  2446   fix r
  2447   assume r: "path r" "path_image r \<subseteq> U" "pathstart r = z" "pathfinish r = z"
  2447   assume r: "path r" "path_image r \<subseteq> U" "pathstart r = z" "pathfinish r = z"
  2448   have "linepath (f z) (f z) = f \<circ> linepath z z"
  2448   have "linepath (f z) (f z) = f \<circ> linepath z z"
  2451     by (metis r contf fim homotopic_paths_continuous_image scU simply_connected_eq_contractible_path)
  2451     by (metis r contf fim homotopic_paths_continuous_image scU simply_connected_eq_contractible_path)
  2452   then show "\<exists>b. homotopic_paths S (f \<circ> r) (linepath b b)"
  2452   then show "\<exists>b. homotopic_paths S (f \<circ> r) (linepath b b)"
  2453     by blast
  2453     by blast
  2454 qed blast
  2454 qed blast
  2455 
  2455 
  2456 corollary%important covering_space_lift:
  2456 corollary covering_space_lift:
  2457   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2457   fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  2458     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2458     and f :: "'c::real_normed_vector \<Rightarrow> 'b"
  2459   assumes cov: "covering_space C p S"
  2459   assumes cov: "covering_space C p S"
  2460       and U: "simply_connected U"  "locally path_connected U"
  2460       and U: "simply_connected U"  "locally path_connected U"
  2461       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2461       and contf: "continuous_on U f" and fim: "f ` U \<subseteq> S"
  2462     obtains g where "continuous_on U g" "g ` U \<subseteq> C" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2462     obtains g where "continuous_on U g" "g ` U \<subseteq> C" "\<And>y. y \<in> U \<Longrightarrow> p(g y) = f y"
  2463 proof%unimportant (cases "U = {}")
  2463 proof (cases "U = {}")
  2464   case True
  2464   case True
  2465   with that show ?thesis by auto
  2465   with that show ?thesis by auto
  2466 next
  2466 next
  2467   case False
  2467   case False
  2468   then obtain z where "z \<in> U" by blast
  2468   then obtain z where "z \<in> U" by blast