93 then have "proj ((norm x / norm y) *\<^sub>R y) = proj x" |
93 then have "proj ((norm x / norm y) *\<^sub>R y) = proj x" |
94 by (metis (no_types) divide_inverse local.proj_def eq scaleR_scaleR) |
94 by (metis (no_types) divide_inverse local.proj_def eq scaleR_scaleR) |
95 then have [simp]: "(norm x / norm y) *\<^sub>R y = x" |
95 then have [simp]: "(norm x / norm y) *\<^sub>R y = x" |
96 by (rule eqI) (simp add: \<open>y \<noteq> 0\<close>) |
96 by (rule eqI) (simp add: \<open>y \<noteq> 0\<close>) |
97 have no: "0 \<le> norm x / norm y" "norm x / norm y < 1" |
97 have no: "0 \<le> norm x / norm y" "norm x / norm y < 1" |
98 using * by (auto simp: divide_simps) |
98 using * by (auto simp: field_split_simps) |
99 then show "x = y" |
99 then show "x = y" |
100 using starI [OF \<open>y \<in> S\<close> no] xynot by auto |
100 using starI [OF \<open>y \<in> S\<close> no] xynot by auto |
101 next |
101 next |
102 assume *: "norm x > norm y" |
102 assume *: "norm x > norm y" |
103 have "y /\<^sub>R norm y = norm y *\<^sub>R (y /\<^sub>R norm y) /\<^sub>R norm (norm y *\<^sub>R (y /\<^sub>R norm y))" |
103 have "y /\<^sub>R norm y = norm y *\<^sub>R (y /\<^sub>R norm y) /\<^sub>R norm (norm y *\<^sub>R (y /\<^sub>R norm y))" |
105 then have "proj ((norm y / norm x) *\<^sub>R x) = proj y" |
105 then have "proj ((norm y / norm x) *\<^sub>R x) = proj y" |
106 by (metis (no_types) divide_inverse local.proj_def eq scaleR_scaleR) |
106 by (metis (no_types) divide_inverse local.proj_def eq scaleR_scaleR) |
107 then have [simp]: "(norm y / norm x) *\<^sub>R x = y" |
107 then have [simp]: "(norm y / norm x) *\<^sub>R x = y" |
108 by (rule eqI) (simp add: \<open>x \<noteq> 0\<close>) |
108 by (rule eqI) (simp add: \<open>x \<noteq> 0\<close>) |
109 have no: "0 \<le> norm y / norm x" "norm y / norm x < 1" |
109 have no: "0 \<le> norm y / norm x" "norm y / norm x < 1" |
110 using * by (auto simp: divide_simps) |
110 using * by (auto simp: field_split_simps) |
111 then show "x = y" |
111 then show "x = y" |
112 using starI [OF \<open>x \<in> S\<close> no] xynot by auto |
112 using starI [OF \<open>x \<in> S\<close> no] xynot by auto |
113 qed |
113 qed |
114 qed |
114 qed |
115 have "\<exists>surf. homeomorphism (S - rel_interior S) ?SPHER proj surf" |
115 have "\<exists>surf. homeomorphism (S - rel_interior S) ?SPHER proj surf" |
131 and ri: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (e *\<^sub>R x) \<in> rel_interior S" |
131 and ri: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (e *\<^sub>R x) \<in> rel_interior S" |
132 using ray_to_rel_frontier [OF \<open>bounded S\<close> 0] \<open>x \<in> affine hull S\<close> \<open>x \<noteq> 0\<close> by auto |
132 using ray_to_rel_frontier [OF \<open>bounded S\<close> 0] \<open>x \<in> affine hull S\<close> \<open>x \<noteq> 0\<close> by auto |
133 show "x \<in> (\<lambda>x. x /\<^sub>R norm x) ` (S - rel_interior S)" |
133 show "x \<in> (\<lambda>x. x /\<^sub>R norm x) ` (S - rel_interior S)" |
134 apply (rule_tac x="d *\<^sub>R x" in image_eqI) |
134 apply (rule_tac x="d *\<^sub>R x" in image_eqI) |
135 using \<open>0 < d\<close> |
135 using \<open>0 < d\<close> |
136 using dx \<open>closed S\<close> apply (auto simp: rel_frontier_def divide_simps nox) |
136 using dx \<open>closed S\<close> apply (auto simp: rel_frontier_def field_split_simps nox) |
137 done |
137 done |
138 qed |
138 qed |
139 qed |
139 qed |
140 qed (rule inj_on_proj) |
140 qed (rule inj_on_proj) |
141 then obtain surf where surf: "homeomorphism (S - rel_interior S) ?SPHER proj surf" |
141 then obtain surf where surf: "homeomorphism (S - rel_interior S) ?SPHER proj surf" |
263 then have nole: "norm x \<le> norm (surf (proj x))" |
263 then have nole: "norm x \<le> norm (surf (proj x))" |
264 by (simp add: le_divide_eq_1) |
264 by (simp add: le_divide_eq_1) |
265 show ?thesis |
265 show ?thesis |
266 apply (rule_tac x="inverse(norm(surf (proj x))) *\<^sub>R x" in image_eqI) |
266 apply (rule_tac x="inverse(norm(surf (proj x))) *\<^sub>R x" in image_eqI) |
267 apply (metis (no_types, hide_lams) mult.commute scaleproj abs_inverse abs_norm_cancel divide_inverse norm_scaleR nxx positive_imp_inverse_positive proj_scaleR psp sproj_nz zero_less_norm_iff) |
267 apply (metis (no_types, hide_lams) mult.commute scaleproj abs_inverse abs_norm_cancel divide_inverse norm_scaleR nxx positive_imp_inverse_positive proj_scaleR psp sproj_nz zero_less_norm_iff) |
268 apply (auto simp: divide_simps nole affineI) |
268 apply (auto simp: field_split_simps nole affineI) |
269 done |
269 done |
270 qed |
270 qed |
271 ultimately have im_cball: "(\<lambda>x. norm x *\<^sub>R surf (proj x)) ` ?CBALL = S" |
271 ultimately have im_cball: "(\<lambda>x. norm x *\<^sub>R surf (proj x)) ` ?CBALL = S" |
272 by blast |
272 by blast |
273 have inj_cball: "inj_on (\<lambda>x. norm x *\<^sub>R surf (proj x)) ?CBALL" |
273 have inj_cball: "inj_on (\<lambda>x. norm x *\<^sub>R surf (proj x)) ?CBALL" |
501 have [simp]: "\<not> T \<subseteq> {v. b\<bullet>v = 0}" |
501 have [simp]: "\<not> T \<subseteq> {v. b\<bullet>v = 0}" |
502 using \<open>norm b = 1\<close> \<open>b \<in> T\<close> by auto |
502 using \<open>norm b = 1\<close> \<open>b \<in> T\<close> by auto |
503 define f where "f \<equiv> \<lambda>x. 2 *\<^sub>R b + (2 / (1 - b\<bullet>x)) *\<^sub>R (x - b)" |
503 define f where "f \<equiv> \<lambda>x. 2 *\<^sub>R b + (2 / (1 - b\<bullet>x)) *\<^sub>R (x - b)" |
504 define g where "g \<equiv> \<lambda>y. b + (4 / (norm y ^ 2 + 4)) *\<^sub>R (y - 2 *\<^sub>R b)" |
504 define g where "g \<equiv> \<lambda>y. b + (4 / (norm y ^ 2 + 4)) *\<^sub>R (y - 2 *\<^sub>R b)" |
505 have [simp]: "\<And>x. \<lbrakk>x \<in> T; b\<bullet>x = 0\<rbrakk> \<Longrightarrow> f (g x) = x" |
505 have [simp]: "\<And>x. \<lbrakk>x \<in> T; b\<bullet>x = 0\<rbrakk> \<Longrightarrow> f (g x) = x" |
506 unfolding f_def g_def by (simp add: algebra_simps divide_simps add_nonneg_eq_0_iff) |
506 unfolding f_def g_def by (simp add: algebra_simps field_split_simps add_nonneg_eq_0_iff) |
507 have no: "\<And>x. \<lbrakk>norm x = 1; b\<bullet>x \<noteq> 1\<rbrakk> \<Longrightarrow> (norm (f x))\<^sup>2 = 4 * (1 + b\<bullet>x) / (1 - b\<bullet>x)" |
507 have no: "(norm (f x))\<^sup>2 = 4 * (1 + b \<bullet> x) / (1 - b \<bullet> x)" |
508 apply (simp add: dot_square_norm [symmetric]) |
508 if "norm x = 1" and "b \<bullet> x \<noteq> 1" for x |
509 apply (simp add: f_def vector_add_divide_simps divide_simps norm_eq_1) |
509 using that |
510 apply (simp add: algebra_simps inner_commute) |
510 apply (simp flip: dot_square_norm add: norm_eq_1 nonzero_eq_divide_eq) |
|
511 apply (simp add: f_def vector_add_divide_simps inner_simps) |
|
512 apply (use sum_sqs_eq [of 1 "b \<bullet> x"] |
|
513 in \<open>auto simp add: field_split_simps inner_commute\<close>) |
511 done |
514 done |
512 have [simp]: "\<And>u::real. 8 + u * (u * 8) = u * 16 \<longleftrightarrow> u=1" |
515 have [simp]: "\<And>u::real. 8 + u * (u * 8) = u * 16 \<longleftrightarrow> u=1" |
513 by algebra |
516 by algebra |
514 have [simp]: "\<And>x. \<lbrakk>norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> g (f x) = x" |
517 have [simp]: "\<And>x. \<lbrakk>norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> g (f x) = x" |
515 unfolding g_def no by (auto simp: f_def divide_simps) |
518 unfolding g_def no by (auto simp: f_def field_split_simps) |
516 have [simp]: "\<And>x. \<lbrakk>x \<in> T; b \<bullet> x = 0\<rbrakk> \<Longrightarrow> norm (g x) = 1" |
519 have [simp]: "norm (g x) = 1" if "x \<in> T" and "b \<bullet> x = 0" for x |
517 unfolding g_def |
520 using that |
|
521 apply (simp only: g_def) |
518 apply (rule power2_eq_imp_eq) |
522 apply (rule power2_eq_imp_eq) |
519 apply (simp_all add: dot_square_norm [symmetric] divide_simps vector_add_divide_simps) |
523 apply (simp_all add: dot_square_norm [symmetric] divide_simps vector_add_divide_simps) |
520 apply (simp add: algebra_simps inner_commute) |
524 apply (simp add: algebra_simps inner_commute) |
521 done |
525 done |
522 have [simp]: "\<And>x. \<lbrakk>x \<in> T; b \<bullet> x = 0\<rbrakk> \<Longrightarrow> b \<bullet> g x \<noteq> 1" |
526 have [simp]: "b \<bullet> g x \<noteq> 1" if "x \<in> T" and "b \<bullet> x = 0" for x |
523 unfolding g_def |
527 using that unfolding g_def |
524 apply (simp_all add: dot_square_norm [symmetric] divide_simps vector_add_divide_simps add_nonneg_eq_0_iff) |
528 apply (simp_all add: dot_square_norm [symmetric] divide_simps vector_add_divide_simps add_nonneg_eq_0_iff) |
525 apply (auto simp: algebra_simps) |
529 apply (auto simp: algebra_simps) |
526 done |
530 done |
527 have "subspace T" |
531 have "subspace T" |
528 by (simp add: assms subspace_affine) |
532 by (simp add: assms subspace_affine) |
545 apply (rule power2_eq_imp_eq) |
549 apply (rule power2_eq_imp_eq) |
546 apply (simp_all add: dot_square_norm [symmetric]) |
550 apply (simp_all add: dot_square_norm [symmetric]) |
547 apply (auto simp: power2_eq_square algebra_simps inner_commute) |
551 apply (auto simp: power2_eq_square algebra_simps inner_commute) |
548 done |
552 done |
549 have [simp]: "\<And>x. \<lbrakk>norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> b \<bullet> f x = 0" |
553 have [simp]: "\<And>x. \<lbrakk>norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> b \<bullet> f x = 0" |
550 by (simp add: f_def algebra_simps divide_simps) |
554 by (simp add: f_def algebra_simps field_split_simps) |
551 have [simp]: "\<And>x. \<lbrakk>x \<in> T; norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> f x \<in> T" |
555 have [simp]: "\<And>x. \<lbrakk>x \<in> T; norm x = 1; b \<bullet> x \<noteq> 1\<rbrakk> \<Longrightarrow> f x \<in> T" |
552 unfolding f_def |
556 unfolding f_def |
553 by (blast intro: \<open>subspace T\<close> \<open>b \<in> T\<close> subspace_add subspace_mul subspace_diff) |
557 by (blast intro: \<open>subspace T\<close> \<open>b \<in> T\<close> subspace_add subspace_mul subspace_diff) |
554 have "g ` {x. b\<bullet>x = 0} \<subseteq> {x. norm x = 1 \<and> b\<bullet>x \<noteq> 1}" |
558 have "g ` {x. b\<bullet>x = 0} \<subseteq> {x. norm x = 1 \<and> b\<bullet>x \<noteq> 1}" |
555 unfolding g_def |
559 unfolding g_def |
1440 have "n \<le> N" |
1444 have "n \<le> N" |
1441 using Suc.prems by auto |
1445 using Suc.prems by auto |
1442 obtain t where "t \<in> tk" and t: "{real n / real N .. (1 + real n) / real N} \<subseteq> K t" |
1446 obtain t where "t \<in> tk" and t: "{real n / real N .. (1 + real n) / real N} \<subseteq> K t" |
1443 proof (rule bexE [OF \<delta>]) |
1447 proof (rule bexE [OF \<delta>]) |
1444 show "{real n / real N .. (1 + real n) / real N} \<subseteq> {0..1}" |
1448 show "{real n / real N .. (1 + real n) / real N} \<subseteq> {0..1}" |
1445 using Suc.prems by (auto simp: divide_simps algebra_simps) |
1449 using Suc.prems by (auto simp: field_split_simps algebra_simps) |
1446 show diameter_less: "diameter {real n / real N .. (1 + real n) / real N} < \<delta>" |
1450 show diameter_less: "diameter {real n / real N .. (1 + real n) / real N} < \<delta>" |
1447 using \<open>0 < \<delta>\<close> N by (auto simp: divide_simps algebra_simps) |
1451 using \<open>0 < \<delta>\<close> N by (auto simp: field_split_simps algebra_simps) |
1448 qed blast |
1452 qed blast |
1449 have t01: "t \<in> {0..1}" |
1453 have t01: "t \<in> {0..1}" |
1450 using \<open>t \<in> tk\<close> \<open>tk \<subseteq> {0..1}\<close> by blast |
1454 using \<open>t \<in> tk\<close> \<open>tk \<subseteq> {0..1}\<close> by blast |
1451 obtain \<V> where \<V>: "\<Union>\<V> = C \<inter> p -` UU (X t)" |
1455 obtain \<V> where \<V>: "\<Union>\<V> = C \<inter> p -` UU (X t)" |
1452 and opeC: "\<And>U. U \<in> \<V> \<Longrightarrow> openin (top_of_set C) U" |
1456 and opeC: "\<And>U. U \<in> \<V> \<Longrightarrow> openin (top_of_set C) U" |
1453 and "pairwise disjnt \<V>" |
1457 and "pairwise disjnt \<V>" |
1454 and homuu: "\<And>U. U \<in> \<V> \<Longrightarrow> \<exists>q. homeomorphism U (UU (X t)) p q" |
1458 and homuu: "\<And>U. U \<in> \<V> \<Longrightarrow> \<exists>q. homeomorphism U (UU (X t)) p q" |
1455 using inUS [OF t01] UU by meson |
1459 using inUS [OF t01] UU by meson |
1456 have n_div_N_in: "real n / real N \<in> {real n / real N .. (1 + real n) / real N}" |
1460 have n_div_N_in: "real n / real N \<in> {real n / real N .. (1 + real n) / real N}" |
1457 using N by (auto simp: divide_simps algebra_simps) |
1461 using N by (auto simp: field_split_simps algebra_simps) |
1458 with t have nN_in_kkt: "real n / real N \<in> K t" |
1462 with t have nN_in_kkt: "real n / real N \<in> K t" |
1459 by blast |
1463 by blast |
1460 have "k (real n / real N, y) \<in> C \<inter> p -` UU (X t)" |
1464 have "k (real n / real N, y) \<in> C \<inter> p -` UU (X t)" |
1461 proof (simp, rule conjI) |
1465 proof (simp, rule conjI) |
1462 show "k (real n / real N, y) \<in> C" |
1466 show "k (real n / real N, y) \<in> C" |
1464 have "p (k (real n / real N, y)) = h (real n / real N, y)" |
1468 have "p (k (real n / real N, y)) = h (real n / real N, y)" |
1465 by (simp add: \<open>y \<in> V\<close> heq) |
1469 by (simp add: \<open>y \<in> V\<close> heq) |
1466 also have "... \<in> h ` (({0..1} \<inter> K t) \<times> (U \<inter> NN t))" |
1470 also have "... \<in> h ` (({0..1} \<inter> K t) \<times> (U \<inter> NN t))" |
1467 apply (rule imageI) |
1471 apply (rule imageI) |
1468 using \<open>y \<in> V\<close> t01 \<open>n \<le> N\<close> |
1472 using \<open>y \<in> V\<close> t01 \<open>n \<le> N\<close> |
1469 apply (simp add: nN_in_kkt \<open>y \<in> U\<close> inUS divide_simps) |
1473 apply (simp add: nN_in_kkt \<open>y \<in> U\<close> inUS field_split_simps) |
1470 done |
1474 done |
1471 also have "... \<subseteq> UU (X t)" |
1475 also have "... \<subseteq> UU (X t)" |
1472 using him t01 by blast |
1476 using him t01 by blast |
1473 finally show "p (k (real n / real N, y)) \<in> UU (X t)" . |
1477 finally show "p (k (real n / real N, y)) \<in> UU (X t)" . |
1474 qed |
1478 qed |
1512 qed (use \<open>y \<in> U\<close> \<open>e > 0\<close> VO VX e in auto) |
1516 qed (use \<open>y \<in> U\<close> \<open>e > 0\<close> VO VX e in auto) |
1513 qed |
1517 qed |
1514 then have "y \<in> Q'" "Q \<subseteq> (U \<inter> NN(t)) \<inter> N' \<inter> V" |
1518 then have "y \<in> Q'" "Q \<subseteq> (U \<inter> NN(t)) \<inter> N' \<inter> V" |
1515 by blast+ |
1519 by blast+ |
1516 have neq: "{0..real n / real N} \<union> {real n / real N..(1 + real n) / real N} = {0..(1 + real n) / real N}" |
1520 have neq: "{0..real n / real N} \<union> {real n / real N..(1 + real n) / real N} = {0..(1 + real n) / real N}" |
1517 apply (auto simp: divide_simps) |
1521 apply (auto simp: field_split_simps) |
1518 by (metis mult_zero_left of_nat_0_le_iff of_nat_0_less_iff order_trans real_mult_le_cancel_iff1) |
1522 by (metis mult_zero_left of_nat_0_le_iff of_nat_0_less_iff order_trans real_mult_le_cancel_iff1) |
1519 then have neqQ': "{0..real n / real N} \<times> Q' \<union> {real n / real N..(1 + real n) / real N} \<times> Q' = {0..(1 + real n) / real N} \<times> Q'" |
1523 then have neqQ': "{0..real n / real N} \<times> Q' \<union> {real n / real N..(1 + real n) / real N} \<times> Q' = {0..(1 + real n) / real N} \<times> Q'" |
1520 by blast |
1524 by blast |
1521 have cont: "continuous_on ({0..(1 + real n) / real N} \<times> Q') |
1525 have cont: "continuous_on ({0..(1 + real n) / real N} \<times> Q') |
1522 (\<lambda>x. if x \<in> {0..real n / real N} \<times> Q' then k x else (p' \<circ> h) x)" |
1526 (\<lambda>x. if x \<in> {0..real n / real N} \<times> Q' then k x else (p' \<circ> h) x)" |