src/HOL/Analysis/Homeomorphism.thy
changeset 67399 eab6ce8368fa
parent 66884 c2128ab11f61
child 68006 a1a023f08c8f
child 68072 493b818e8e10
equal deleted inserted replaced
67398:5eb932e604a2 67399:eab6ce8368fa
   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 -
   551 proof -
   552   have 1: "compact (op+ (-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 (op+ (-a) ` S)"
   553   have 2: "0 \<in> rel_interior ((+) (-a) ` S)"
   554     by (simp add: a rel_interior_translation)
   554     by (simp add: a rel_interior_translation)
   555   have 3: "open_segment 0 x \<subseteq> rel_interior (op+ (-a) ` S)" if "x \<in> (op+ (-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 -
   557     have "x+a \<in> S" using that by auto
   557     have "x+a \<in> S" using that by auto
   558     then have "open_segment a (x+a) \<subseteq> rel_interior S" by (metis star)
   558     then have "open_segment a (x+a) \<subseteq> rel_interior S" by (metis star)
   559     then show ?thesis using open_segment_translation
   559     then show ?thesis using open_segment_translation
   560       using rel_interior_translation by fastforce
   560       using rel_interior_translation by fastforce
   561   qed
   561   qed
   562   have "S - rel_interior S homeomorphic (op+ (-a) ` S) - rel_interior (op+ (-a) ` S)"
   562   have "S - rel_interior S homeomorphic ((+) (-a) ` S) - rel_interior ((+) (-a) ` S)"
   563     by (metis rel_interior_translation translation_diff homeomorphic_translation)
   563     by (metis rel_interior_translation translation_diff homeomorphic_translation)
   564   also have "... homeomorphic sphere 0 1 \<inter> affine hull (op+ (-a) ` S)"
   564   also have "... homeomorphic sphere 0 1 \<inter> affine hull ((+) (-a) ` S)"
   565     by (rule starlike_compact_projective1_0 [OF 1 2 3])
   565     by (rule starlike_compact_projective1_0 [OF 1 2 3])
   566   also have "... = op+ (-a) ` (sphere a 1 \<inter> affine hull S)"
   566   also have "... = (+) (-a) ` (sphere a 1 \<inter> affine hull S)"
   567     by (metis affine_hull_translation left_minus sphere_translation translation_Int)
   567     by (metis affine_hull_translation left_minus sphere_translation translation_Int)
   568   also have "... homeomorphic sphere a 1 \<inter> affine hull S"
   568   also have "... homeomorphic sphere a 1 \<inter> affine hull S"
   569     using homeomorphic_translation homeomorphic_sym by blast
   569     using homeomorphic_translation homeomorphic_sym by blast
   570   finally show "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S" .
   570   finally show "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S" .
   571 
   571 
   572   have "S homeomorphic (op+ (-a) ` S)"
   572   have "S homeomorphic ((+) (-a) ` S)"
   573     by (metis homeomorphic_translation)
   573     by (metis homeomorphic_translation)
   574   also have "... homeomorphic cball 0 1 \<inter> affine hull (op+ (-a) ` S)"
   574   also have "... homeomorphic cball 0 1 \<inter> affine hull ((+) (-a) ` S)"
   575     by (rule starlike_compact_projective2_0 [OF 1 2 3])
   575     by (rule starlike_compact_projective2_0 [OF 1 2 3])
   576   also have "... = op+ (-a) ` (cball a 1 \<inter> affine hull S)"
   576   also have "... = (+) (-a) ` (cball a 1 \<inter> affine hull S)"
   577     by (metis affine_hull_translation left_minus cball_translation translation_Int)
   577     by (metis affine_hull_translation left_minus cball_translation translation_Int)
   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
   621     using rel_interior_closure_convex_segment
   621     using rel_interior_closure_convex_segment
   622           a \<open>convex S\<close> closure_subset subsetCE by blast
   622           a \<open>convex S\<close> closure_subset subsetCE by blast
   623   have starT: "\<And>x. x \<in> T \<Longrightarrow> open_segment b x \<subseteq> rel_interior T"
   623   have starT: "\<And>x. x \<in> T \<Longrightarrow> open_segment b x \<subseteq> rel_interior T"
   624     using rel_interior_closure_convex_segment
   624     using rel_interior_closure_convex_segment
   625           b \<open>convex T\<close> closure_subset subsetCE by blast
   625           b \<open>convex T\<close> closure_subset subsetCE by blast
   626   let ?aS = "op+ (-a) ` S" and ?bT = "op+ (-b) ` T"
   626   let ?aS = "(+) (-a) ` S" and ?bT = "(+) (-b) ` T"
   627   have 0: "0 \<in> affine hull ?aS" "0 \<in> affine hull ?bT"
   627   have 0: "0 \<in> affine hull ?aS" "0 \<in> affine hull ?bT"
   628     by (metis a b subsetD hull_inc image_eqI left_minus rel_interior_subset)+
   628     by (metis a b subsetD hull_inc image_eqI left_minus rel_interior_subset)+
   629   have subs: "subspace (span ?aS)" "subspace (span ?bT)"
   629   have subs: "subspace (span ?aS)" "subspace (span ?bT)"
   630     by (rule subspace_span)+
   630     by (rule subspace_span)+
   631   moreover
   631   moreover
   632   have "dim (span (op + (- a) ` S)) = dim (span (op + (- b) ` T))"
   632   have "dim (span ((+) (- a) ` S)) = dim (span ((+) (- b) ` T))"
   633     by (metis 0 aff_dim_translation_eq aff_dim_zero affeq dim_span nat_int)
   633     by (metis 0 aff_dim_translation_eq aff_dim_zero affeq dim_span nat_int)
   634   ultimately obtain f g where "linear f" "linear g"
   634   ultimately obtain f g where "linear f" "linear g"
   635                 and fim: "f ` span ?aS = span ?bT"
   635                 and fim: "f ` span ?aS = span ?bT"
   636                 and gim: "g ` span ?bT = span ?aS"
   636                 and gim: "g ` span ?bT = span ?aS"
   637                 and fno: "\<And>x. x \<in> span ?aS \<Longrightarrow> norm(f x) = norm x"
   637                 and fno: "\<And>x. x \<in> span ?aS \<Longrightarrow> norm(f x) = norm x"
   647     by (metis a affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
   647     by (metis a affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
   648   have eqspanT: "affine hull ?bT = span ?bT"
   648   have eqspanT: "affine hull ?bT = span ?bT"
   649     by (metis b affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
   649     by (metis b affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
   650   have "S homeomorphic cball a 1 \<inter> affine hull S"
   650   have "S homeomorphic cball a 1 \<inter> affine hull S"
   651     by (rule starlike_compact_projective2 [OF \<open>compact S\<close> a starS])
   651     by (rule starlike_compact_projective2 [OF \<open>compact S\<close> a starS])
   652   also have "... homeomorphic op+ (-a) ` (cball a 1 \<inter> affine hull S)"
   652   also have "... homeomorphic (+) (-a) ` (cball a 1 \<inter> affine hull S)"
   653     by (metis homeomorphic_translation)
   653     by (metis homeomorphic_translation)
   654   also have "... = cball 0 1 \<inter> op+ (-a) ` (affine hull S)"
   654   also have "... = cball 0 1 \<inter> (+) (-a) ` (affine hull S)"
   655     by (auto simp: dist_norm)
   655     by (auto simp: dist_norm)
   656   also have "... = cball 0 1 \<inter> span ?aS"
   656   also have "... = cball 0 1 \<inter> span ?aS"
   657     using eqspanS affine_hull_translation by blast
   657     using eqspanS affine_hull_translation by blast
   658   also have "... homeomorphic cball 0 1 \<inter> span ?bT"
   658   also have "... homeomorphic cball 0 1 \<inter> span ?bT"
   659     proof (rule homeomorphicI [where f=f and g=g])
   659     proof (rule homeomorphicI [where f=f and g=g])
   664       show "g ` (cball 0 1 \<inter> span ?bT) = cball 0 1 \<inter> span ?aS"
   664       show "g ` (cball 0 1 \<inter> span ?bT) = cball 0 1 \<inter> span ?aS"
   665         apply (rule subset_antisym)
   665         apply (rule subset_antisym)
   666          using gim gno apply (force simp:, clarify)
   666          using gim gno apply (force simp:, clarify)
   667         by (metis IntI fim1 gf image_eqI)
   667         by (metis IntI fim1 gf image_eqI)
   668     qed (auto simp: fg gf)
   668     qed (auto simp: fg gf)
   669   also have "... = cball 0 1 \<inter> op+ (-b) ` (affine hull T)"
   669   also have "... = cball 0 1 \<inter> (+) (-b) ` (affine hull T)"
   670     using eqspanT affine_hull_translation by blast
   670     using eqspanT affine_hull_translation by blast
   671   also have "... = op+ (-b) ` (cball b 1 \<inter> affine hull T)"
   671   also have "... = (+) (-b) ` (cball b 1 \<inter> affine hull T)"
   672     by (auto simp: dist_norm)
   672     by (auto simp: dist_norm)
   673   also have "... homeomorphic (cball b 1 \<inter> affine hull T)"
   673   also have "... homeomorphic (cball b 1 \<inter> affine hull T)"
   674     by (metis homeomorphic_translation homeomorphic_sym)
   674     by (metis homeomorphic_translation homeomorphic_sym)
   675   also have "... homeomorphic T"
   675   also have "... homeomorphic T"
   676     by (metis starlike_compact_projective2 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
   676     by (metis starlike_compact_projective2 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
   677   finally have 1: "S homeomorphic T" .
   677   finally have 1: "S homeomorphic T" .
   678 
   678 
   679   have "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S"
   679   have "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S"
   680     by (rule starlike_compact_projective1 [OF \<open>compact S\<close> a starS])
   680     by (rule starlike_compact_projective1 [OF \<open>compact S\<close> a starS])
   681   also have "... homeomorphic op+ (-a) ` (sphere a 1 \<inter> affine hull S)"
   681   also have "... homeomorphic (+) (-a) ` (sphere a 1 \<inter> affine hull S)"
   682     by (metis homeomorphic_translation)
   682     by (metis homeomorphic_translation)
   683   also have "... = sphere 0 1 \<inter> op+ (-a) ` (affine hull S)"
   683   also have "... = sphere 0 1 \<inter> (+) (-a) ` (affine hull S)"
   684     by (auto simp: dist_norm)
   684     by (auto simp: dist_norm)
   685   also have "... = sphere 0 1 \<inter> span ?aS"
   685   also have "... = sphere 0 1 \<inter> span ?aS"
   686     using eqspanS affine_hull_translation by blast
   686     using eqspanS affine_hull_translation by blast
   687   also have "... homeomorphic sphere 0 1 \<inter> span ?bT"
   687   also have "... homeomorphic sphere 0 1 \<inter> span ?bT"
   688     proof (rule homeomorphicI [where f=f and g=g])
   688     proof (rule homeomorphicI [where f=f and g=g])
   693       show "g ` (sphere 0 1 \<inter> span ?bT) = sphere 0 1 \<inter> span ?aS"
   693       show "g ` (sphere 0 1 \<inter> span ?bT) = sphere 0 1 \<inter> span ?aS"
   694         apply (rule subset_antisym)
   694         apply (rule subset_antisym)
   695         using gim gno apply (force simp:, clarify)
   695         using gim gno apply (force simp:, clarify)
   696         by (metis IntI fim1 gf image_eqI)
   696         by (metis IntI fim1 gf image_eqI)
   697     qed (auto simp: fg gf)
   697     qed (auto simp: fg gf)
   698   also have "... = sphere 0 1 \<inter> op+ (-b) ` (affine hull T)"
   698   also have "... = sphere 0 1 \<inter> (+) (-b) ` (affine hull T)"
   699     using eqspanT affine_hull_translation by blast
   699     using eqspanT affine_hull_translation by blast
   700   also have "... = op+ (-b) ` (sphere b 1 \<inter> affine hull T)"
   700   also have "... = (+) (-b) ` (sphere b 1 \<inter> affine hull T)"
   701     by (auto simp: dist_norm)
   701     by (auto simp: dist_norm)
   702   also have "... homeomorphic (sphere b 1 \<inter> affine hull T)"
   702   also have "... homeomorphic (sphere b 1 \<inter> affine hull T)"
   703     by (metis homeomorphic_translation homeomorphic_sym)
   703     by (metis homeomorphic_translation homeomorphic_sym)
   704   also have "... homeomorphic T - rel_interior T"
   704   also have "... homeomorphic T - rel_interior T"
   705     by (metis starlike_compact_projective1 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
   705     by (metis starlike_compact_projective1 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
   831 proof -
   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         op+ (-a) ` ((sphere a r \<inter> T) - {b})"
   836         (+) (-a) ` ((sphere a r \<inter> T) - {b})"
   837     by (rule homeomorphic_translation)
   837     by (rule homeomorphic_translation)
   838   also have "... homeomorphic op *\<^sub>R (inverse r) ` op + (- a) ` (sphere a r \<inter> T - {b})"
   838   also have "... homeomorphic ( *\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b})"
   839     by (metis \<open>0 < r\<close> homeomorphic_scaling inverse_inverse_eq inverse_zero less_irrefl)
   839     by (metis \<open>0 < r\<close> homeomorphic_scaling inverse_inverse_eq inverse_zero less_irrefl)
   840   also have "... = sphere 0 1 \<inter> (op *\<^sub>R (inverse r) ` op + (- a) ` T) - {(b - a) /\<^sub>R r}"
   840   also have "... = sphere 0 1 \<inter> (( *\<^sub>R) (inverse r) ` (+) (- a) ` T) - {(b - a) /\<^sub>R r}"
   841     using assms by (auto simp: dist_norm norm_minus_commute divide_simps)
   841     using assms by (auto simp: dist_norm norm_minus_commute divide_simps)
   842   also have "... homeomorphic p"
   842   also have "... homeomorphic p"
   843     apply (rule homeomorphic_punctured_affine_sphere_affine_01)
   843     apply (rule homeomorphic_punctured_affine_sphere_affine_01)
   844     using assms
   844     using assms
   845     apply (auto simp: dist_norm norm_minus_commute affine_scaling affine_translation [symmetric] aff_dim_translation_eq inj)
   845     apply (auto simp: dist_norm norm_minus_commute affine_scaling affine_translation [symmetric] aff_dim_translation_eq inj)
   926 next
   926 next
   927   case False
   927   case False
   928   then obtain a where "a \<in> S" by auto
   928   then obtain a where "a \<in> S" by auto
   929   obtain i::'n where i: "i \<in> Basis" "i \<noteq> 0"
   929   obtain i::'n where i: "i \<in> Basis" "i \<noteq> 0"
   930     using SOME_Basis Basis_zero by force
   930     using SOME_Basis Basis_zero by force
   931   have "0 \<in> affine hull (op + (- a) ` S)"
   931   have "0 \<in> affine hull ((+) (- a) ` S)"
   932     by (simp add: \<open>a \<in> S\<close> hull_inc)
   932     by (simp add: \<open>a \<in> S\<close> hull_inc)
   933   then have "dim (op + (- a) ` S) = aff_dim (op + (- a) ` S)"
   933   then have "dim ((+) (- a) ` S) = aff_dim ((+) (- a) ` S)"
   934     by (simp add: aff_dim_zero)
   934     by (simp add: aff_dim_zero)
   935   also have "... < DIM('n)"
   935   also have "... < DIM('n)"
   936     by (simp add: aff_dim_translation_eq assms)
   936     by (simp add: aff_dim_translation_eq assms)
   937   finally have dd: "dim (op + (- a) ` S) < DIM('n)"
   937   finally have dd: "dim ((+) (- a) ` S) < DIM('n)"
   938     by linarith
   938     by linarith
   939   obtain T where "subspace T" and Tsub: "T \<subseteq> {x. i \<bullet> x = 0}"
   939   obtain T where "subspace T" and Tsub: "T \<subseteq> {x. i \<bullet> x = 0}"
   940              and dimT: "dim T = dim (op + (- a) ` S)"
   940              and dimT: "dim T = dim ((+) (- a) ` S)"
   941     apply (rule choose_subspace_of_subspace [of "dim (op + (- a) ` S)" "{x::'n. i \<bullet> x = 0}"])
   941     apply (rule choose_subspace_of_subspace [of "dim ((+) (- a) ` S)" "{x::'n. i \<bullet> x = 0}"])
   942      apply (simp add: dim_hyperplane [OF \<open>i \<noteq> 0\<close>])
   942      apply (simp add: dim_hyperplane [OF \<open>i \<noteq> 0\<close>])
   943      apply (metis DIM_positive Suc_pred dd not_le not_less_eq_eq)
   943      apply (metis DIM_positive Suc_pred dd not_le not_less_eq_eq)
   944     apply (metis span_eq subspace_hyperplane)
   944     apply (metis span_eq subspace_hyperplane)
   945     done
   945     done
   946   have "subspace (span (op + (- a) ` S))"
   946   have "subspace (span ((+) (- a) ` S))"
   947     using subspace_span by blast
   947     using subspace_span by blast
   948   then obtain h k where "linear h" "linear k"
   948   then obtain h k where "linear h" "linear k"
   949                and heq: "h ` span (op + (- a) ` S) = T"
   949                and heq: "h ` span ((+) (- a) ` S) = T"
   950                and keq:"k ` T = span (op + (- a) ` S)"
   950                and keq:"k ` T = span ((+) (- a) ` S)"
   951                and hinv [simp]:  "\<And>x. x \<in> span (op + (- a) ` S) \<Longrightarrow> k(h x) = x"
   951                and hinv [simp]:  "\<And>x. x \<in> span ((+) (- a) ` S) \<Longrightarrow> k(h x) = x"
   952                and kinv [simp]:  "\<And>x. x \<in> T \<Longrightarrow> h(k x) = x"
   952                and kinv [simp]:  "\<And>x. x \<in> T \<Longrightarrow> h(k x) = x"
   953     apply (rule isometries_subspaces [OF _ \<open>subspace T\<close>])
   953     apply (rule isometries_subspaces [OF _ \<open>subspace T\<close>])
   954     apply (auto simp: dimT)
   954     apply (auto simp: dimT)
   955     done
   955     done
   956   have hcont: "continuous_on A h" and kcont: "continuous_on B k" for A B
   956   have hcont: "continuous_on A h" and kcont: "continuous_on B k" for A B
   962     using i
   962     using i
   963     apply (auto simp: affine_hyperplane)
   963     apply (auto simp: affine_hyperplane)
   964     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)
   964     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)
   965   then obtain f g where fg: "homeomorphism (sphere 0 1 - {i}) {x. i \<bullet> x = 0} f g"
   965   then obtain f g where fg: "homeomorphism (sphere 0 1 - {i}) {x. i \<bullet> x = 0} f g"
   966     by (force simp: homeomorphic_def)
   966     by (force simp: homeomorphic_def)
   967   have "h ` op + (- a) ` S \<subseteq> T"
   967   have "h ` (+) (- a) ` S \<subseteq> T"
   968     using heq span_clauses(1) span_linear_image by blast
   968     using heq span_clauses(1) span_linear_image by blast
   969   then have "g ` h ` op + (- a) ` S \<subseteq> g ` {x. i \<bullet> x = 0}"
   969   then have "g ` h ` (+) (- a) ` S \<subseteq> g ` {x. i \<bullet> x = 0}"
   970     using Tsub by (simp add: image_mono)
   970     using Tsub by (simp add: image_mono)
   971   also have "... \<subseteq> sphere 0 1 - {i}"
   971   also have "... \<subseteq> sphere 0 1 - {i}"
   972     by (simp add: fg [unfolded homeomorphism_def])
   972     by (simp add: fg [unfolded homeomorphism_def])
   973   finally have gh_sub_sph: "(g \<circ> h) ` op + (- a) ` S \<subseteq> sphere 0 1 - {i}"
   973   finally have gh_sub_sph: "(g \<circ> h) ` (+) (- a) ` S \<subseteq> sphere 0 1 - {i}"
   974     by (metis image_comp)
   974     by (metis image_comp)
   975   then have gh_sub_cb: "(g \<circ> h) ` op + (- a) ` S \<subseteq> cball 0 1"
   975   then have gh_sub_cb: "(g \<circ> h) ` (+) (- a) ` S \<subseteq> cball 0 1"
   976     by (metis Diff_subset order_trans sphere_cball)
   976     by (metis Diff_subset order_trans sphere_cball)
   977   have [simp]: "\<And>u. u \<in> S \<Longrightarrow> norm (g (h (u - a))) = 1"
   977   have [simp]: "\<And>u. u \<in> S \<Longrightarrow> norm (g (h (u - a))) = 1"
   978     using gh_sub_sph [THEN subsetD] by (auto simp: o_def)
   978     using gh_sub_sph [THEN subsetD] by (auto simp: o_def)
   979   have ghcont: "continuous_on (op + (- a) ` S) (\<lambda>x. g (h x))"
   979   have ghcont: "continuous_on ((+) (- a) ` S) (\<lambda>x. g (h x))"
   980     apply (rule continuous_on_compose2 [OF homeomorphism_cont2 [OF fg] hcont], force)
   980     apply (rule continuous_on_compose2 [OF homeomorphism_cont2 [OF fg] hcont], force)
   981     done
   981     done
   982   have kfcont: "continuous_on ((g \<circ> h \<circ> op + (- a)) ` S) (\<lambda>x. k (f x))"
   982   have kfcont: "continuous_on ((g \<circ> h \<circ> (+) (- a)) ` S) (\<lambda>x. k (f x))"
   983     apply (rule continuous_on_compose2 [OF kcont])
   983     apply (rule continuous_on_compose2 [OF kcont])
   984     using homeomorphism_cont1 [OF fg] gh_sub_sph apply (force intro: continuous_on_subset, blast)
   984     using homeomorphism_cont1 [OF fg] gh_sub_sph apply (force intro: continuous_on_subset, blast)
   985     done
   985     done
   986   have "S homeomorphic op + (- a) ` S"
   986   have "S homeomorphic (+) (- a) ` S"
   987     by (simp add: homeomorphic_translation)
   987     by (simp add: homeomorphic_translation)
   988   also have Shom: "\<dots> homeomorphic (g \<circ> h) ` op + (- a) ` S"
   988   also have Shom: "\<dots> homeomorphic (g \<circ> h) ` (+) (- a) ` S"
   989     apply (simp add: homeomorphic_def homeomorphism_def)
   989     apply (simp add: homeomorphic_def homeomorphism_def)
   990     apply (rule_tac x="g \<circ> h" in exI)
   990     apply (rule_tac x="g \<circ> h" in exI)
   991     apply (rule_tac x="k \<circ> f" in exI)
   991     apply (rule_tac x="k \<circ> f" in exI)
   992     apply (auto simp: ghcont kfcont span_clauses(1) homeomorphism_apply2 [OF fg] image_comp)
   992     apply (auto simp: ghcont kfcont span_clauses(1) homeomorphism_apply2 [OF fg] image_comp)
   993     apply (force simp: o_def homeomorphism_apply2 [OF fg] span_clauses(1))
   993     apply (force simp: o_def homeomorphism_apply2 [OF fg] span_clauses(1))
   994     done
   994     done
   995   finally have Shom: "S homeomorphic (g \<circ> h) ` op + (- a) ` S" .
   995   finally have Shom: "S homeomorphic (g \<circ> h) ` (+) (- a) ` S" .
   996   show ?thesis
   996   show ?thesis
   997     apply (rule_tac U = "ball 0 1 \<union> image (g o h) (op + (- a) ` S)"
   997     apply (rule_tac U = "ball 0 1 \<union> image (g o h) ((+) (- a) ` S)"
   998                 and T = "image (g o h) (op + (- a) ` S)"
   998                 and T = "image (g o h) ((+) (- a) ` S)"
   999                     in that)
   999                     in that)
  1000     apply (rule convex_intermediate_ball [of 0 1], force)
  1000     apply (rule convex_intermediate_ball [of 0 1], force)
  1001     using gh_sub_cb apply force
  1001     using gh_sub_cb apply force
  1002     apply force
  1002     apply force
  1003     apply (simp add: closedin_closed)
  1003     apply (simp add: closedin_closed)
  2208       obtain q' where "path q'" "path_image q' \<subseteq> C"
  2208       obtain q' where "path q'" "path_image q' \<subseteq> C"
  2209                 and "pathstart q' = pathstart q" "pathfinish q' = pathfinish q"
  2209                 and "pathstart q' = pathstart q" "pathfinish q' = pathfinish q"
  2210                 and pq'_eq: "\<And>t. t \<in> {0..1} \<Longrightarrow> p (q' t) = (f \<circ> g +++ reversepath g') t"
  2210                 and pq'_eq: "\<And>t. t \<in> {0..1} \<Longrightarrow> p (q' t) = (f \<circ> g +++ reversepath g') t"
  2211         using covering_space_lift_homotopic_path [OF cov homotopic_paths_sym [OF homS] \<open>path q\<close> piq refl refl]
  2211         using covering_space_lift_homotopic_path [OF cov homotopic_paths_sym [OF homS] \<open>path q\<close> piq refl refl]
  2212         by auto
  2212         by auto
  2213       have "q' t = (h \<circ> op *\<^sub>R 2) t" if "0 \<le> t" "t \<le> 1/2" for t
  2213       have "q' t = (h \<circ> ( *\<^sub>R) 2) t" if "0 \<le> t" "t \<le> 1/2" for t
  2214       proof (rule covering_space_lift_unique [OF cov, of q' 0 "h \<circ> op *\<^sub>R 2" "{0..1/2}" "f \<circ> g \<circ> op *\<^sub>R 2" t])
  2214       proof (rule covering_space_lift_unique [OF cov, of q' 0 "h \<circ> ( *\<^sub>R) 2" "{0..1/2}" "f \<circ> g \<circ> ( *\<^sub>R) 2" t])
  2215         show "q' 0 = (h \<circ> op *\<^sub>R 2) 0"
  2215         show "q' 0 = (h \<circ> ( *\<^sub>R) 2) 0"
  2216           by (metis \<open>pathstart q' = pathstart q\<close> comp_def g h pastq pathstart_def pth_4(2))
  2216           by (metis \<open>pathstart q' = pathstart q\<close> comp_def g h pastq pathstart_def pth_4(2))
  2217         show "continuous_on {0..1/2} (f \<circ> g \<circ> op *\<^sub>R 2)"
  2217         show "continuous_on {0..1/2} (f \<circ> g \<circ> ( *\<^sub>R) 2)"
  2218           apply (intro continuous_intros continuous_on_compose continuous_on_path [OF \<open>path g\<close>] continuous_on_subset [OF contf])
  2218           apply (intro continuous_intros continuous_on_compose continuous_on_path [OF \<open>path g\<close>] continuous_on_subset [OF contf])
  2219           using g(2) path_image_def by fastforce+
  2219           using g(2) path_image_def by fastforce+
  2220         show "(f \<circ> g \<circ> op *\<^sub>R 2) ` {0..1/2} \<subseteq> S"
  2220         show "(f \<circ> g \<circ> ( *\<^sub>R) 2) ` {0..1/2} \<subseteq> S"
  2221           using g(2) path_image_def fim by fastforce
  2221           using g(2) path_image_def fim by fastforce
  2222         show "(h \<circ> op *\<^sub>R 2) ` {0..1/2} \<subseteq> C"
  2222         show "(h \<circ> ( *\<^sub>R) 2) ` {0..1/2} \<subseteq> C"
  2223           using h path_image_def by fastforce
  2223           using h path_image_def by fastforce
  2224         show "q' ` {0..1/2} \<subseteq> C"
  2224         show "q' ` {0..1/2} \<subseteq> C"
  2225           using \<open>path_image q' \<subseteq> C\<close> path_image_def by fastforce
  2225           using \<open>path_image q' \<subseteq> C\<close> path_image_def by fastforce
  2226         show "\<And>x. x \<in> {0..1/2} \<Longrightarrow> (f \<circ> g \<circ> op *\<^sub>R 2) x = p (q' x)"
  2226         show "\<And>x. x \<in> {0..1/2} \<Longrightarrow> (f \<circ> g \<circ> ( *\<^sub>R) 2) x = p (q' x)"
  2227           by (auto simp: joinpaths_def pq'_eq)
  2227           by (auto simp: joinpaths_def pq'_eq)
  2228         show "\<And>x. x \<in> {0..1/2} \<Longrightarrow> (f \<circ> g \<circ> op *\<^sub>R 2) x = p ((h \<circ> op *\<^sub>R 2) x)"
  2228         show "\<And>x. x \<in> {0..1/2} \<Longrightarrow> (f \<circ> g \<circ> ( *\<^sub>R) 2) x = p ((h \<circ> ( *\<^sub>R) 2) x)"
  2229           by (simp add: phg)
  2229           by (simp add: phg)
  2230         show "continuous_on {0..1/2} q'"
  2230         show "continuous_on {0..1/2} q'"
  2231           by (simp add: continuous_on_path \<open>path q'\<close>)
  2231           by (simp add: continuous_on_path \<open>path q'\<close>)
  2232         show "continuous_on {0..1/2} (h \<circ> op *\<^sub>R 2)"
  2232         show "continuous_on {0..1/2} (h \<circ> ( *\<^sub>R) 2)"
  2233           apply (intro continuous_intros continuous_on_compose continuous_on_path [OF \<open>path h\<close>], force)
  2233           apply (intro continuous_intros continuous_on_compose continuous_on_path [OF \<open>path h\<close>], force)
  2234           done
  2234           done
  2235       qed (use that in auto)
  2235       qed (use that in auto)
  2236       moreover have "q' t = (reversepath h' \<circ> (\<lambda>t. 2 *\<^sub>R t - 1)) t" if "1/2 < t" "t \<le> 1" for t
  2236       moreover have "q' t = (reversepath h' \<circ> (\<lambda>t. 2 *\<^sub>R t - 1)) t" if "1/2 < t" "t \<le> 1" for t
  2237       proof (rule covering_space_lift_unique [OF cov, of q' 1 "reversepath h' \<circ> (\<lambda>t. 2 *\<^sub>R t - 1)" "{1/2<..1}" "f \<circ> reversepath g' \<circ> (\<lambda>t. 2 *\<^sub>R t - 1)" t])
  2237       proof (rule covering_space_lift_unique [OF cov, of q' 1 "reversepath h' \<circ> (\<lambda>t. 2 *\<^sub>R t - 1)" "{1/2<..1}" "f \<circ> reversepath g' \<circ> (\<lambda>t. 2 *\<^sub>R t - 1)" t])