# HG changeset patch # User hoelzl # Date 1362494598 -3600 # Node ID f8a00792fbc1c874e81a7266ef07b6214f0c04ab # Parent d33de22432e2c76b8470b676b242c962d993f786 tuned proof of Edelstein fixed point theorem (use continuity of dist and attains_sup) diff -r d33de22432e2 -r f8a00792fbc1 src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Tue Mar 05 15:43:17 2013 +0100 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Tue Mar 05 15:43:18 2013 +0100 @@ -6569,129 +6569,37 @@ fixes s :: "'a::metric_space set" assumes s:"compact s" "s \ {}" and gs:"(g ` s) \ s" and dist:"\x\s. \y\s. x \ y \ dist (g x) (g y) < dist x y" - shows "\! x\s. g x = x" -proof(cases "\x\s. g x \ x") - obtain x where "x\s" using s(2) by auto - case False hence g:"\x\s. g x = x" by auto - { fix y assume "y\s" - hence "x = y" using `x\s` and dist[THEN bspec[where x=x], THEN bspec[where x=y]] - unfolding g[THEN bspec[where x=x], OF `x\s`] - unfolding g[THEN bspec[where x=y], OF `y\s`] by auto } - thus ?thesis using `x\s` and g by blast+ -next - case True - then obtain x where [simp]:"x\s" and "g x \ x" by auto - { fix x y assume "x \ s" "y \ s" - hence "dist (g x) (g y) \ dist x y" - using dist[THEN bspec[where x=x], THEN bspec[where x=y]] by auto } note dist' = this - def y \ "g x" - have [simp]:"y\s" unfolding y_def using gs[unfolded image_subset_iff] and `x\s` by blast - def f \ "\n. g ^^ n" - have [simp]:"\n z. g (f n z) = f (Suc n) z" unfolding f_def by auto - have [simp]:"\z. f 0 z = z" unfolding f_def by auto - { fix n::nat and z assume "z\s" - have "f n z \ s" unfolding f_def - proof(induct n) - case 0 thus ?case using `z\s` by simp - next - case (Suc n) thus ?case using gs[unfolded image_subset_iff] by auto - qed } note fs = this - { fix m n ::nat assume "m\n" - fix w z assume "w\s" "z\s" - have "dist (f n w) (f n z) \ dist (f m w) (f m z)" using `m\n` - proof(induct n) - case 0 thus ?case by auto - next - case (Suc n) - thus ?case proof(cases "m\n") - case True thus ?thesis using Suc(1) - using dist'[OF fs fs, OF `w\s` `z\s`, of n n] by auto - next - case False hence mn:"m = Suc n" using Suc(2) by simp - show ?thesis unfolding mn by auto - qed - qed } note distf = this - - def h \ "\n. (f n x, f n y)" - let ?s2 = "s \ s" - obtain l r where "l\?s2" and r:"subseq r" and lr:"((h \ r) ---> l) sequentially" - using compact_Times [OF s(1) s(1), unfolded compact_def, THEN spec[where x=h]] unfolding h_def - using fs[OF `x\s`] and fs[OF `y\s`] by blast - def a \ "fst l" def b \ "snd l" - have lab:"l = (a, b)" unfolding a_def b_def by simp - have [simp]:"a\s" "b\s" unfolding a_def b_def using `l\?s2` by auto - - have lima:"((fst \ (h \ r)) ---> a) sequentially" - and limb:"((snd \ (h \ r)) ---> b) sequentially" - using lr - unfolding o_def a_def b_def by (rule tendsto_intros)+ - - { fix n::nat - have *:"\fx fy (x::'a) y. dist fx fy \ dist x y \ \ (\dist fx fy - dist a b\ < dist a b - dist x y)" by auto - - { assume as:"dist a b > dist (f n x) (f n y)" - then obtain Na Nb where "\m\Na. dist (f (r m) x) a < (dist a b - dist (f n x) (f n y)) / 2" - and "\m\Nb. dist (f (r m) y) b < (dist a b - dist (f n x) (f n y)) / 2" - using lima limb unfolding h_def LIMSEQ_def by (fastforce simp del: less_divide_eq_numeral1) - hence "\dist (f (r (Na + Nb + n)) x) (f (r (Na + Nb + n)) y) - dist a b\ < dist a b - dist (f n x) (f n y)" - apply - - apply (drule_tac x="Na+Nb+n" in spec, drule mp, simp) - apply (drule_tac x="Na+Nb+n" in spec, drule mp, simp) - apply (drule (1) add_strict_mono, simp only: real_sum_of_halves) - apply (erule le_less_trans [rotated]) - apply (erule thin_rl) - apply (rule abs_leI) - apply (simp add: diff_le_iff add_assoc) - apply (rule order_trans [OF dist_triangle add_left_mono]) - apply (subst add_commute, rule dist_triangle2) - apply (simp add: diff_le_iff add_assoc) - apply (rule order_trans [OF dist_triangle3 add_left_mono]) - apply (subst add_commute, rule dist_triangle) - done - moreover - have "\dist (f (r (Na + Nb + n)) x) (f (r (Na + Nb + n)) y) - dist a b\ \ dist a b - dist (f n x) (f n y)" - using distf[of n "r (Na+Nb+n)", OF _ `x\s` `y\s`] - using seq_suble[OF r, of "Na+Nb+n"] - using *[of "f (r (Na + Nb + n)) x" "f (r (Na + Nb + n)) y" "f n x" "f n y"] by auto - ultimately have False by simp - } - hence "dist a b \ dist (f n x) (f n y)" by(rule ccontr)auto } - note ab_fn = this - - have [simp]:"a = b" proof(rule ccontr) - def e \ "dist a b - dist (g a) (g b)" - assume "a\b" hence "e > 0" unfolding e_def using dist by fastforce - hence "\n. dist (f n x) a < e/2 \ dist (f n y) b < e/2" - using lima limb unfolding LIMSEQ_def - apply (auto elim!: allE[where x="e/2"]) apply(rename_tac N N', rule_tac x="r (max N N')" in exI) unfolding h_def by fastforce - then obtain n where n:"dist (f n x) a < e/2 \ dist (f n y) b < e/2" by auto - have "dist (f (Suc n) x) (g a) \ dist (f n x) a" - using dist[THEN bspec[where x="f n x"], THEN bspec[where x="a"]] and fs by auto - moreover have "dist (f (Suc n) y) (g b) \ dist (f n y) b" - using dist[THEN bspec[where x="f n y"], THEN bspec[where x="b"]] and fs by auto - ultimately have "dist (f (Suc n) x) (g a) + dist (f (Suc n) y) (g b) < e" using n by auto - thus False unfolding e_def using ab_fn[of "Suc n"] - using dist_triangle2 [of "f (Suc n) y" "g a" "g b"] - using dist_triangle2 [of "f (Suc n) x" "f (Suc n) y" "g a"] - by auto + shows "\!x\s. g x = x" +proof - + let ?D = "(\x. (x, x)) ` s" + have D: "compact ?D" "?D \ {}" + by (rule compact_continuous_image) + (auto intro!: s continuous_Pair continuous_within_id simp: continuous_on_eq_continuous_within) + + have "\x y e. x \ s \ y \ s \ 0 < e \ dist y x < e \ dist (g y) (g x) < e" + using dist by fastforce + then have "continuous_on s g" + unfolding continuous_on_iff by auto + then have cont: "continuous_on ?D (\x. dist ((g \ fst) x) (snd x))" + unfolding continuous_on_eq_continuous_within + by (intro continuous_dist ballI continuous_within_compose) + (auto intro!: continuous_fst continuous_snd continuous_within_id simp: image_image) + + obtain a where "a \ s" and le: "\x. x \ s \ dist (g a) a \ dist (g x) x" + using continuous_attains_inf[OF D cont] by auto + + have "g a = a" + proof (rule ccontr) + assume "g a \ a" + with `a \ s` gs have "dist (g (g a)) (g a) < dist (g a) a" + by (intro dist[rule_format]) auto + moreover have "dist (g a) a \ dist (g (g a)) (g a)" + using `a \ s` gs by (intro le) auto + ultimately show False by auto qed - - have [simp]:"\n. f (Suc n) x = f n y" unfolding f_def y_def by(induct_tac n)auto - { fix x y assume "x\s" "y\s" moreover - fix e::real assume "e>0" ultimately - have "dist y x < e \ dist (g y) (g x) < e" using dist by fastforce } - hence "continuous_on s g" unfolding continuous_on_iff by auto - - hence "((snd \ h \ r) ---> g a) sequentially" unfolding continuous_on_sequentially - apply (rule allE[where x="\n. (fst \ h \ r) n"]) apply (erule ballE[where x=a]) - using lima unfolding h_def o_def using fs[OF `x\s`] by (auto simp add: y_def) - hence "g a = a" using tendsto_unique[OF trivial_limit_sequentially limb, of "g a"] - unfolding `a=b` and o_assoc by auto - moreover - { fix x assume "x\s" "g x = x" "x\a" - hence "False" using dist[THEN bspec[where x=a], THEN bspec[where x=x]] - using `g a = a` and `a\s` by auto } - ultimately show "\!x\s. g x = x" using `a\s` by blast + moreover have "\x. x \ s \ g x = x \ x = a" + using dist[THEN bspec[where x=a]] `g a = a` and `a\s` by auto + ultimately show "\!x\s. g x = x" using `a \ s` by blast qed declare tendsto_const [intro] (* FIXME: move *)