src/HOL/Analysis/Brouwer_Fixpoint.thy
changeset 68621 27432da24236
parent 68617 75129a73aca3
child 69286 e4d5a07fecb6
equal deleted inserted replaced
68619:79abf4201e8d 68621:27432da24236
    15 section \<open>Brouwer's Fixed Point Theorem\<close>
    15 section \<open>Brouwer's Fixed Point Theorem\<close>
    16 
    16 
    17 theory Brouwer_Fixpoint
    17 theory Brouwer_Fixpoint
    18 imports Path_Connected Homeomorphism
    18 imports Path_Connected Homeomorphism
    19 begin
    19 begin
    20 
       
    21 subsection \<open>Unit cubes\<close>
       
    22 
       
    23 (* FIXME mv euclidean topological space *)
       
    24 definition unit_cube :: "'a::euclidean_space set"
       
    25   where "unit_cube = {x. \<forall>i\<in>Basis. 0 \<le> x \<bullet> i \<and> x \<bullet> i \<le> 1}"
       
    26 
       
    27 lemma mem_unit_cube: "x \<in> unit_cube \<longleftrightarrow> (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i \<and> x \<bullet> i \<le> 1)"
       
    28   unfolding unit_cube_def by simp
       
    29 
       
    30 lemma bounded_unit_cube: "bounded unit_cube"
       
    31   unfolding bounded_def
       
    32 proof (intro exI ballI)
       
    33   fix y :: 'a assume y: "y \<in> unit_cube"
       
    34   have "dist 0 y = norm y" by (rule dist_0_norm)
       
    35   also have "\<dots> = norm (\<Sum>i\<in>Basis. (y \<bullet> i) *\<^sub>R i)" unfolding euclidean_representation ..
       
    36   also have "\<dots> \<le> (\<Sum>i\<in>Basis. norm ((y \<bullet> i) *\<^sub>R i))" by (rule norm_sum)
       
    37   also have "\<dots> \<le> (\<Sum>i::'a\<in>Basis. 1)"
       
    38     by (rule sum_mono, simp add: y [unfolded mem_unit_cube])
       
    39   finally show "dist 0 y \<le> (\<Sum>i::'a\<in>Basis. 1)" .
       
    40 qed
       
    41 
       
    42 lemma closed_unit_cube: "closed unit_cube"
       
    43   unfolding unit_cube_def Collect_ball_eq Collect_conj_eq
       
    44   by (rule closed_INT, auto intro!: closed_Collect_le continuous_on_inner continuous_on_const continuous_on_id)
       
    45 
       
    46 lemma compact_unit_cube: "compact unit_cube" (is "compact ?C")
       
    47   unfolding compact_eq_seq_compact_metric
       
    48   using bounded_unit_cube closed_unit_cube
       
    49   by (rule bounded_closed_imp_seq_compact)
       
    50 
       
    51 lemma convex_unit_cube: "convex unit_cube"
       
    52   by (rule is_interval_convex) (fastforce simp add: is_interval_def mem_unit_cube)
       
    53 
       
    54 
    20 
    55 (* FIXME mv topology euclidean space *)
    21 (* FIXME mv topology euclidean space *)
    56 subsection \<open>Retractions\<close>
    22 subsection \<open>Retractions\<close>
    57 
    23 
    58 definition "retraction S T r \<longleftrightarrow> T \<subseteq> S \<and> continuous_on S r \<and> r ` S \<subseteq> T \<and> (\<forall>x\<in>T. r x = x)"
    24 definition "retraction S T r \<longleftrightarrow> T \<subseteq> S \<and> continuous_on S r \<and> r ` S \<subseteq> T \<and> (\<forall>x\<in>T. r x = x)"
  3124   qed
  3090   qed
  3125 qed
  3091 qed
  3126 
  3092 
  3127 subsection \<open>Brouwer's fixed point theorem\<close>
  3093 subsection \<open>Brouwer's fixed point theorem\<close>
  3128 
  3094 
  3129 text \<open>We start proving Brouwer's fixed point theorem for unit cubes.\<close>
  3095 text \<open>We start proving Brouwer's fixed point theorem for the unit cube = \<open>cbox 0 One\<close>.\<close>
  3130 
  3096 
  3131 lemma brouwer_cube:
  3097 lemma brouwer_cube:
  3132   fixes f :: "'a::euclidean_space \<Rightarrow> 'a"
  3098   fixes f :: "'a::euclidean_space \<Rightarrow> 'a"
  3133   assumes "continuous_on unit_cube f"
  3099   assumes "continuous_on (cbox 0 One) f"
  3134     and "f ` unit_cube \<subseteq> unit_cube"
  3100     and "f ` cbox 0 One \<subseteq> cbox 0 One"
  3135   shows "\<exists>x\<in>unit_cube. f x = x"
  3101   shows "\<exists>x\<in>cbox 0 One. f x = x"
  3136 proof (rule ccontr)
  3102 proof (rule ccontr)
  3137   define n where "n = DIM('a)"
  3103   define n where "n = DIM('a)"
  3138   have n: "1 \<le> n" "0 < n" "n \<noteq> 0"
  3104   have n: "1 \<le> n" "0 < n" "n \<noteq> 0"
  3139     unfolding n_def by (auto simp: Suc_le_eq DIM_positive)
  3105     unfolding n_def by (auto simp: Suc_le_eq DIM_positive)
  3140   assume "\<not> ?thesis"
  3106   assume "\<not> ?thesis"
  3141   then have *: "\<not> (\<exists>x\<in>unit_cube. f x - x = 0)"
  3107   then have *: "\<not> (\<exists>x\<in>cbox 0 One. f x - x = 0)"
  3142     by auto
  3108     by auto
  3143   obtain d where
  3109   obtain d where
  3144       d: "d > 0" "\<And>x. x \<in> unit_cube \<Longrightarrow> d \<le> norm (f x - x)"
  3110       d: "d > 0" "\<And>x. x \<in> cbox 0 One \<Longrightarrow> d \<le> norm (f x - x)"
  3145     apply (rule brouwer_compactness_lemma[OF compact_unit_cube _ *])
  3111     apply (rule brouwer_compactness_lemma[OF compact_cbox _ *])
  3146     apply (rule continuous_intros assms)+
  3112     apply (rule continuous_intros assms)+
  3147     apply blast
  3113     apply blast
  3148     done
  3114     done
  3149   have *: "\<forall>x. x \<in> unit_cube \<longrightarrow> f x \<in> unit_cube"
  3115   have *: "\<forall>x. x \<in> cbox 0 One \<longrightarrow> f x \<in> cbox 0 One"
  3150     "\<forall>x. x \<in> (unit_cube::'a set) \<longrightarrow> (\<forall>i\<in>Basis. True \<longrightarrow> 0 \<le> x \<bullet> i \<and> x \<bullet> i \<le> 1)"
  3116     "\<forall>x. x \<in> (cbox 0 One::'a set) \<longrightarrow> (\<forall>i\<in>Basis. True \<longrightarrow> 0 \<le> x \<bullet> i \<and> x \<bullet> i \<le> 1)"
  3151     using assms(2)[unfolded image_subset_iff Ball_def]
  3117     using assms(2)[unfolded image_subset_iff Ball_def]
  3152     unfolding mem_unit_cube
  3118     unfolding cbox_def
  3153     by auto
  3119     by auto
  3154   obtain label :: "'a \<Rightarrow> 'a \<Rightarrow> nat" where label [rule_format]:
  3120   obtain label :: "'a \<Rightarrow> 'a \<Rightarrow> nat" where label [rule_format]:
  3155     "\<forall>x. \<forall>i\<in>Basis. label x i \<le> 1"
  3121     "\<forall>x. \<forall>i\<in>Basis. label x i \<le> 1"
  3156     "\<forall>x. \<forall>i\<in>Basis. x \<in> unit_cube \<and> x \<bullet> i = 0 \<longrightarrow> label x i = 0"
  3122     "\<forall>x. \<forall>i\<in>Basis. x \<in> cbox 0 One \<and> x \<bullet> i = 0 \<longrightarrow> label x i = 0"
  3157     "\<forall>x. \<forall>i\<in>Basis. x \<in> unit_cube \<and> x \<bullet> i = 1 \<longrightarrow> label x i = 1"
  3123     "\<forall>x. \<forall>i\<in>Basis. x \<in> cbox 0 One \<and> x \<bullet> i = 1 \<longrightarrow> label x i = 1"
  3158     "\<forall>x. \<forall>i\<in>Basis. x \<in> unit_cube \<and> label x i = 0 \<longrightarrow> x \<bullet> i \<le> f x \<bullet> i"
  3124     "\<forall>x. \<forall>i\<in>Basis. x \<in> cbox 0 One \<and> label x i = 0 \<longrightarrow> x \<bullet> i \<le> f x \<bullet> i"
  3159     "\<forall>x. \<forall>i\<in>Basis. x \<in> unit_cube \<and> label x i = 1 \<longrightarrow> f x \<bullet> i \<le> x \<bullet> i"
  3125     "\<forall>x. \<forall>i\<in>Basis. x \<in> cbox 0 One \<and> label x i = 1 \<longrightarrow> f x \<bullet> i \<le> x \<bullet> i"
  3160     using kuhn_labelling_lemma[OF *] by auto
  3126     using kuhn_labelling_lemma[OF *] by auto
  3161   note label = this [rule_format]
  3127   note label = this [rule_format]
  3162   have lem1: "\<forall>x\<in>unit_cube. \<forall>y\<in>unit_cube. \<forall>i\<in>Basis. label x i \<noteq> label y i \<longrightarrow>
  3128   have lem1: "\<forall>x\<in>cbox 0 One. \<forall>y\<in>cbox 0 One. \<forall>i\<in>Basis. label x i \<noteq> label y i \<longrightarrow>
  3163     \<bar>f x \<bullet> i - x \<bullet> i\<bar> \<le> norm (f y - f x) + norm (y - x)"
  3129     \<bar>f x \<bullet> i - x \<bullet> i\<bar> \<le> norm (f y - f x) + norm (y - x)"
  3164   proof safe
  3130   proof safe
  3165     fix x y :: 'a
  3131     fix x y :: 'a
  3166     assume x: "x \<in> unit_cube" and y: "y \<in> unit_cube"
  3132     assume x: "x \<in> cbox 0 One" and y: "y \<in> cbox 0 One"
  3167     fix i
  3133     fix i
  3168     assume i: "label x i \<noteq> label y i" "i \<in> Basis"
  3134     assume i: "label x i \<noteq> label y i" "i \<in> Basis"
  3169     have *: "\<And>x y fx fy :: real. x \<le> fx \<and> fy \<le> y \<or> fx \<le> x \<and> y \<le> fy \<Longrightarrow>
  3135     have *: "\<And>x y fx fy :: real. x \<le> fx \<and> fy \<le> y \<or> fx \<le> x \<and> y \<le> fy \<Longrightarrow>
  3170       \<bar>fx - x\<bar> \<le> \<bar>fy - fx\<bar> + \<bar>y - x\<bar>" by auto
  3136       \<bar>fx - x\<bar> \<le> \<bar>fy - fx\<bar> + \<bar>y - x\<bar>" by auto
  3171     have "\<bar>(f x - x) \<bullet> i\<bar> \<le> \<bar>(f y - f x)\<bullet>i\<bar> + \<bar>(y - x)\<bullet>i\<bar>"
  3137     have "\<bar>(f x - x) \<bullet> i\<bar> \<le> \<bar>(f y - f x)\<bullet>i\<bar> + \<bar>(y - x)\<bullet>i\<bar>"
  3186     also have "\<dots> \<le> norm (f y - f x) + norm (y - x)"
  3152     also have "\<dots> \<le> norm (f y - f x) + norm (y - x)"
  3187       by (simp add: add_mono i(2) norm_bound_Basis_le)
  3153       by (simp add: add_mono i(2) norm_bound_Basis_le)
  3188     finally show "\<bar>f x \<bullet> i - x \<bullet> i\<bar> \<le> norm (f y - f x) + norm (y - x)"
  3154     finally show "\<bar>f x \<bullet> i - x \<bullet> i\<bar> \<le> norm (f y - f x) + norm (y - x)"
  3189       unfolding inner_simps .
  3155       unfolding inner_simps .
  3190   qed
  3156   qed
  3191   have "\<exists>e>0. \<forall>x\<in>unit_cube. \<forall>y\<in>unit_cube. \<forall>z\<in>unit_cube. \<forall>i\<in>Basis.
  3157   have "\<exists>e>0. \<forall>x\<in>cbox 0 One. \<forall>y\<in>cbox 0 One. \<forall>z\<in>cbox 0 One. \<forall>i\<in>Basis.
  3192     norm (x - z) < e \<longrightarrow> norm (y - z) < e \<longrightarrow> label x i \<noteq> label y i \<longrightarrow>
  3158     norm (x - z) < e \<longrightarrow> norm (y - z) < e \<longrightarrow> label x i \<noteq> label y i \<longrightarrow>
  3193       \<bar>(f(z) - z)\<bullet>i\<bar> < d / (real n)"
  3159       \<bar>(f(z) - z)\<bullet>i\<bar> < d / (real n)"
  3194   proof -
  3160   proof -
  3195     have d': "d / real n / 8 > 0"
  3161     have d': "d / real n / 8 > 0"
  3196       using d(1) by (simp add: n_def DIM_positive)
  3162       using d(1) by (simp add: n_def DIM_positive)
  3197     have *: "uniformly_continuous_on unit_cube f"
  3163     have *: "uniformly_continuous_on (cbox 0 One) f"
  3198       by (rule compact_uniformly_continuous[OF assms(1) compact_unit_cube])
  3164       by (rule compact_uniformly_continuous[OF assms(1) compact_cbox])
  3199     obtain e where e:
  3165     obtain e where e:
  3200         "e > 0"
  3166         "e > 0"
  3201         "\<And>x x'. x \<in> unit_cube \<Longrightarrow>
  3167         "\<And>x x'. x \<in> cbox 0 One \<Longrightarrow>
  3202           x' \<in> unit_cube \<Longrightarrow>
  3168           x' \<in> cbox 0 One \<Longrightarrow>
  3203           norm (x' - x) < e \<Longrightarrow>
  3169           norm (x' - x) < e \<Longrightarrow>
  3204           norm (f x' - f x) < d / real n / 8"
  3170           norm (f x' - f x) < d / real n / 8"
  3205       using *[unfolded uniformly_continuous_on_def,rule_format,OF d']
  3171       using *[unfolded uniformly_continuous_on_def,rule_format,OF d']
  3206       unfolding dist_norm
  3172       unfolding dist_norm
  3207       by blast
  3173       by blast
  3209     proof (intro exI conjI ballI impI)
  3175     proof (intro exI conjI ballI impI)
  3210       show "0 < min (e / 2) (d / real n / 8)"
  3176       show "0 < min (e / 2) (d / real n / 8)"
  3211         using d' e by auto
  3177         using d' e by auto
  3212       fix x y z i
  3178       fix x y z i
  3213       assume as:
  3179       assume as:
  3214         "x \<in> unit_cube" "y \<in> unit_cube" "z \<in> unit_cube"
  3180         "x \<in> cbox 0 One" "y \<in> cbox 0 One" "z \<in> cbox 0 One"
  3215         "norm (x - z) < min (e / 2) (d / real n / 8)"
  3181         "norm (x - z) < min (e / 2) (d / real n / 8)"
  3216         "norm (y - z) < min (e / 2) (d / real n / 8)"
  3182         "norm (y - z) < min (e / 2) (d / real n / 8)"
  3217         "label x i \<noteq> label y i"
  3183         "label x i \<noteq> label y i"
  3218       assume i: "i \<in> Basis"
  3184       assume i: "i \<in> Basis"
  3219       have *: "\<And>z fz x fx n1 n2 n3 n4 d4 d :: real. \<bar>fx - x\<bar> \<le> n1 + n2 \<Longrightarrow>
  3185       have *: "\<And>z fz x fx n1 n2 n3 n4 d4 d :: real. \<bar>fx - x\<bar> \<le> n1 + n2 \<Longrightarrow>
  3247     qed
  3213     qed
  3248   qed
  3214   qed
  3249   then
  3215   then
  3250   obtain e where e:
  3216   obtain e where e:
  3251     "e > 0"
  3217     "e > 0"
  3252     "\<And>x y z i. x \<in> unit_cube \<Longrightarrow>
  3218     "\<And>x y z i. x \<in> cbox 0 One \<Longrightarrow>
  3253       y \<in> unit_cube \<Longrightarrow>
  3219       y \<in> cbox 0 One \<Longrightarrow>
  3254       z \<in> unit_cube \<Longrightarrow>
  3220       z \<in> cbox 0 One \<Longrightarrow>
  3255       i \<in> Basis \<Longrightarrow>
  3221       i \<in> Basis \<Longrightarrow>
  3256       norm (x - z) < e \<and> norm (y - z) < e \<and> label x i \<noteq> label y i \<Longrightarrow>
  3222       norm (x - z) < e \<and> norm (y - z) < e \<and> label x i \<noteq> label y i \<Longrightarrow>
  3257       \<bar>(f z - z) \<bullet> i\<bar> < d / real n"
  3223       \<bar>(f z - z) \<bullet> i\<bar> < d / real n"
  3258     by blast
  3224     by blast
  3259   obtain p :: nat where p: "1 + real n / e \<le> real p"
  3225   obtain p :: nat where p: "1 + real n / e \<le> real p"
  3288     unfolding *
  3254     unfolding *
  3289     using \<open>p > 0\<close> \<open>n > 0\<close>
  3255     using \<open>p > 0\<close> \<open>n > 0\<close>
  3290     using label(1)[OF b'']
  3256     using label(1)[OF b'']
  3291     by auto
  3257     by auto
  3292   { fix x :: "nat \<Rightarrow> nat" and i assume "\<forall>i<n. x i \<le> p" "i < n" "x i = p \<or> x i = 0"
  3258   { fix x :: "nat \<Rightarrow> nat" and i assume "\<forall>i<n. x i \<le> p" "i < n" "x i = p \<or> x i = 0"
  3293     then have "(\<Sum>i\<in>Basis. (real (x (b' i)) / real p) *\<^sub>R i) \<in> (unit_cube::'a set)"
  3259     then have "(\<Sum>i\<in>Basis. (real (x (b' i)) / real p) *\<^sub>R i) \<in> (cbox 0 One::'a set)"
  3294       using b'_Basis
  3260       using b'_Basis
  3295       by (auto simp: mem_unit_cube inner_simps bij_betw_def zero_le_divide_iff divide_le_eq_1) }
  3261       by (auto simp: cbox_def inner_simps bij_betw_def zero_le_divide_iff divide_le_eq_1) }
  3296   note cube = this
  3262   note cube = this
  3297   have q2: "\<forall>x. (\<forall>i<n. x i \<le> p) \<longrightarrow> (\<forall>i<n. x i = 0 \<longrightarrow>
  3263   have q2: "\<forall>x. (\<forall>i<n. x i \<le> p) \<longrightarrow> (\<forall>i<n. x i = 0 \<longrightarrow>
  3298       (label (\<Sum>i\<in>Basis. (real (x (b' i)) / real p) *\<^sub>R i) \<circ> b) i = 0)"
  3264       (label (\<Sum>i\<in>Basis. (real (x (b' i)) / real p) *\<^sub>R i) \<circ> b) i = 0)"
  3299     unfolding o_def using cube \<open>p > 0\<close> by (intro allI impI label(2)) (auto simp: b'')
  3265     unfolding o_def using cube \<open>p > 0\<close> by (intro allI impI label(2)) (auto simp: b'')
  3300   have q3: "\<forall>x. (\<forall>i<n. x i \<le> p) \<longrightarrow> (\<forall>i<n. x i = p \<longrightarrow>
  3266   have q3: "\<forall>x. (\<forall>i<n. x i \<le> p) \<longrightarrow> (\<forall>i<n. x i = p \<longrightarrow>
  3312   have "\<exists>i\<in>Basis. d / real n \<le> \<bar>(f z - z)\<bullet>i\<bar>"
  3278   have "\<exists>i\<in>Basis. d / real n \<le> \<bar>(f z - z)\<bullet>i\<bar>"
  3313   proof (rule ccontr)
  3279   proof (rule ccontr)
  3314     have "\<forall>i\<in>Basis. q (b' i) \<in> {0..p}"
  3280     have "\<forall>i\<in>Basis. q (b' i) \<in> {0..p}"
  3315       using q(1) b'
  3281       using q(1) b'
  3316       by (auto intro: less_imp_le simp: bij_betw_def)
  3282       by (auto intro: less_imp_le simp: bij_betw_def)
  3317     then have "z \<in> unit_cube"
  3283     then have "z \<in> cbox 0 One"
  3318       unfolding z_def mem_unit_cube
  3284       unfolding z_def cbox_def
  3319       using b'_Basis
  3285       using b'_Basis
  3320       by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1)
  3286       by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1)
  3321     then have d_fz_z: "d \<le> norm (f z - z)"
  3287     then have d_fz_z: "d \<le> norm (f z - z)"
  3322       by (rule d)
  3288       by (rule d)
  3323     assume "\<not> ?thesis"
  3289     assume "\<not> ?thesis"
  3351     apply (rule order_trans)
  3317     apply (rule order_trans)
  3352     apply (rule rs(1)[OF b'_im,THEN conjunct2])
  3318     apply (rule rs(1)[OF b'_im,THEN conjunct2])
  3353     using q(1)[rule_format,OF b'_im]
  3319     using q(1)[rule_format,OF b'_im]
  3354     apply (auto simp: Suc_le_eq)
  3320     apply (auto simp: Suc_le_eq)
  3355     done
  3321     done
  3356   then have "r' \<in> unit_cube"
  3322   then have "r' \<in> cbox 0 One"
  3357     unfolding r'_def mem_unit_cube
  3323     unfolding r'_def cbox_def
  3358     using b'_Basis
  3324     using b'_Basis
  3359     by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1)
  3325     by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1)
  3360   define s' :: 'a where "s' = (\<Sum>i\<in>Basis. (real (s (b' i)) / real p) *\<^sub>R i)"
  3326   define s' :: 'a where "s' = (\<Sum>i\<in>Basis. (real (s (b' i)) / real p) *\<^sub>R i)"
  3361   have "\<And>i. i \<in> Basis \<Longrightarrow> s (b' i) \<le> p"
  3327   have "\<And>i. i \<in> Basis \<Longrightarrow> s (b' i) \<le> p"
  3362     using b'_im q(1) rs(2) by fastforce
  3328     using b'_im q(1) rs(2) by fastforce
  3363   then have "s' \<in> unit_cube"
  3329   then have "s' \<in> cbox 0 One"
  3364     unfolding s'_def mem_unit_cube
  3330     unfolding s'_def cbox_def
  3365     using b'_Basis by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1)
  3331     using b'_Basis by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1)
  3366   have "z \<in> unit_cube"
  3332   have "z \<in> cbox 0 One"
  3367     unfolding z_def mem_unit_cube
  3333     unfolding z_def cbox_def
  3368     using b'_Basis q(1)[rule_format,OF b'_im] \<open>p > 0\<close>
  3334     using b'_Basis q(1)[rule_format,OF b'_im] \<open>p > 0\<close>
  3369     by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1 less_imp_le)
  3335     by (auto simp: bij_betw_def zero_le_divide_iff divide_le_eq_1 less_imp_le)
  3370   {
  3336   {
  3371     have "(\<Sum>i\<in>Basis. \<bar>real (r (b' i)) - real (q (b' i))\<bar>) \<le> (\<Sum>(i::'a)\<in>Basis. 1)"
  3337     have "(\<Sum>i\<in>Basis. \<bar>real (r (b' i)) - real (q (b' i))\<bar>) \<le> (\<Sum>(i::'a)\<in>Basis. 1)"
  3372       by (rule sum_mono) (use rs(1)[OF b'_im] in force)
  3338       by (rule sum_mono) (use rs(1)[OF b'_im] in force)
  3392     apply (auto simp: field_simps sum_divide_distrib[symmetric] inner_diff_left)
  3358     apply (auto simp: field_simps sum_divide_distrib[symmetric] inner_diff_left)
  3393     done
  3359     done
  3394   then have "\<bar>(f z - z) \<bullet> i\<bar> < d / real n"
  3360   then have "\<bar>(f z - z) \<bullet> i\<bar> < d / real n"
  3395     using rs(3) i
  3361     using rs(3) i
  3396     unfolding r'_def[symmetric] s'_def[symmetric] o_def bb'
  3362     unfolding r'_def[symmetric] s'_def[symmetric] o_def bb'
  3397     by (intro e(2)[OF \<open>r'\<in>unit_cube\<close> \<open>s'\<in>unit_cube\<close> \<open>z\<in>unit_cube\<close>]) auto
  3363     by (intro e(2)[OF \<open>r'\<in>cbox 0 One\<close> \<open>s'\<in>cbox 0 One\<close> \<open>z\<in>cbox 0 One\<close>]) auto
  3398   then show False
  3364   then show False
  3399     using i by auto
  3365     using i by auto
  3400 qed
  3366 qed
  3401 
  3367 
  3402 text \<open>Next step is to prove it for nonempty interiors.\<close>
  3368 text \<open>Next step is to prove it for nonempty interiors.\<close>
  3408     and "interior S \<noteq> {}"
  3374     and "interior S \<noteq> {}"
  3409     and "continuous_on S f"
  3375     and "continuous_on S f"
  3410     and "f ` S \<subseteq> S"
  3376     and "f ` S \<subseteq> S"
  3411   obtains x where "x \<in> S" and "f x = x"
  3377   obtains x where "x \<in> S" and "f x = x"
  3412 proof -
  3378 proof -
  3413   let ?U = "unit_cube :: 'a set"
  3379   let ?U = "cbox 0 One :: 'a set"
  3414   have "\<Sum>Basis /\<^sub>R 2 \<in> interior ?U"
  3380   have "\<Sum>Basis /\<^sub>R 2 \<in> interior ?U"
  3415   proof (rule interiorI)
  3381   proof (rule interiorI)
  3416     let ?I = "(\<Inter>i\<in>Basis. {x::'a. 0 < x \<bullet> i} \<inter> {x. x \<bullet> i < 1})"
  3382     let ?I = "(\<Inter>i\<in>Basis. {x::'a. 0 < x \<bullet> i} \<inter> {x. x \<bullet> i < 1})"
  3417     show "open ?I"
  3383     show "open ?I"
  3418       by (intro open_INT finite_Basis ballI open_Int, auto intro: open_Collect_less simp: continuous_on_inner continuous_on_const continuous_on_id)
  3384       by (intro open_INT finite_Basis ballI open_Int, auto intro: open_Collect_less simp: continuous_on_inner continuous_on_const continuous_on_id)
  3419     show "\<Sum>Basis /\<^sub>R 2 \<in> ?I"
  3385     show "\<Sum>Basis /\<^sub>R 2 \<in> ?I"
  3420       by simp
  3386       by simp
  3421     show "?I \<subseteq> unit_cube"
  3387     show "?I \<subseteq> cbox 0 One"
  3422       unfolding unit_cube_def by force
  3388       unfolding cbox_def by force
  3423   qed
  3389   qed
  3424   then have *: "interior ?U \<noteq> {}" by fast
  3390   then have *: "interior ?U \<noteq> {}" by fast
  3425   have *: "?U homeomorphic S"
  3391   have *: "?U homeomorphic S"
  3426     using homeomorphic_convex_compact[OF convex_unit_cube compact_unit_cube * assms(2,1,3)] .
  3392     using homeomorphic_convex_compact[OF convex_box(1) compact_cbox * assms(2,1,3)] .
  3427   have "\<forall>f. continuous_on ?U f \<and> f ` ?U \<subseteq> ?U \<longrightarrow>
  3393   have "\<forall>f. continuous_on ?U f \<and> f ` ?U \<subseteq> ?U \<longrightarrow>
  3428     (\<exists>x\<in>?U. f x = x)"
  3394     (\<exists>x\<in>?U. f x = x)"
  3429     using brouwer_cube by auto
  3395     using brouwer_cube by auto
  3430   then show ?thesis
  3396   then show ?thesis
  3431     unfolding homeomorphic_fixpoint_property[OF *]
  3397     unfolding homeomorphic_fixpoint_property[OF *]