# HG changeset patch # User huffman # Date 1394752047 25200 # Node ID 2dbf84ee3deb8b498b83fce8b28213f00ab5d73d # Parent bdc03e91684a9681f8a0f52d8f0bd0ab2404ac5c remove ordered_euclidean_space constraint from brouwer/derivative lemmas; add constant unit_cube for class euclidean_space diff -r bdc03e91684a -r 2dbf84ee3deb src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Thu Mar 13 17:36:56 2014 +0100 +++ b/src/HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy Thu Mar 13 16:07:27 2014 -0700 @@ -3752,43 +3752,70 @@ qed qed +definition unit_cube :: "'a::euclidean_space set" + where "unit_cube = {x. \i\Basis. 0 \ x \ i \ x \ i \ 1}" + +lemma mem_unit_cube: "x \ unit_cube \ (\i\Basis. 0 \ x \ i \ x \ i \ 1)" + unfolding unit_cube_def by simp + +lemma bounded_unit_cube: "bounded unit_cube" + unfolding bounded_def +proof (intro exI ballI) + fix y :: 'a assume y: "y \ unit_cube" + have "dist 0 y = norm y" by (rule dist_0_norm) + also have "\ = norm (\i\Basis. (y \ i) *\<^sub>R i)" unfolding euclidean_representation .. + also have "\ \ (\i\Basis. norm ((y \ i) *\<^sub>R i))" by (rule norm_setsum) + also have "\ \ (\i::'a\Basis. 1)" + by (rule setsum_mono, simp add: y [unfolded mem_unit_cube]) + finally show "dist 0 y \ (\i::'a\Basis. 1)" . +qed + +lemma closed_unit_cube: "closed unit_cube" + unfolding unit_cube_def Collect_ball_eq Collect_conj_eq + by (rule closed_INT, auto intro!: closed_Collect_le) + +lemma compact_unit_cube: "compact unit_cube" (is "compact ?C") + unfolding compact_eq_seq_compact_metric + using bounded_unit_cube closed_unit_cube + by (rule bounded_closed_imp_seq_compact) + lemma brouwer_cube: - fixes f :: "'a::ordered_euclidean_space \ 'a::ordered_euclidean_space" - assumes "continuous_on {0..(\Basis)} f" - and "f ` {0..(\Basis)} \ {0..(\Basis)}" - shows "\x\{0..(\Basis)}. f x = x" + fixes f :: "'a::euclidean_space \ 'a" + assumes "continuous_on unit_cube f" + and "f ` unit_cube \ unit_cube" + shows "\x\unit_cube. f x = x" proof (rule ccontr) def n \ "DIM('a)" have n: "1 \ n" "0 < n" "n \ 0" unfolding n_def by (auto simp add: Suc_le_eq DIM_positive) assume "\ ?thesis" - then have *: "\ (\x\{0..\Basis}. f x - x = 0)" + then have *: "\ (\x\unit_cube. f x - x = 0)" by auto obtain d where - d: "d > 0" "\x. x \ {0..\Basis} \ d \ norm (f x - x)" - apply (rule brouwer_compactness_lemma[OF compact_interval _ *]) + d: "d > 0" "\x. x \ unit_cube \ d \ norm (f x - x)" + apply (rule brouwer_compactness_lemma[OF compact_unit_cube _ *]) apply (rule continuous_on_intros assms)+ apply blast done - have *: "\x. x \ {0..\Basis} \ f x \ {0..\Basis}" - "\x. x \ {0..(\Basis)::'a} \ (\i\Basis. True \ 0 \ x \ i \ x \ i \ 1)" + have *: "\x. x \ unit_cube \ f x \ unit_cube" + "\x. x \ (unit_cube::'a set) \ (\i\Basis. True \ 0 \ x \ i \ x \ i \ 1)" using assms(2)[unfolded image_subset_iff Ball_def] - unfolding mem_interval + unfolding mem_unit_cube by auto obtain label :: "'a \ 'a \ nat" where "\x. \i\Basis. label x i \ 1" - "\x. \i\Basis. x \ {0..\Basis} \ True \ x \ i = 0 \ label x i = 0" - "\x. \i\Basis. x \ {0..\Basis} \ True \ x \ i = 1 \ label x i = 1" - "\x. \i\Basis. x \ {0..\Basis} \ True \ label x i = 0 \ x \ i \ f x \ i" - "\x. \i\Basis. x \ {0..\Basis} \ True \ label x i = 1 \ f x \ i \ x \ i" + "\x. \i\Basis. x \ unit_cube \ True \ x \ i = 0 \ label x i = 0" + "\x. \i\Basis. x \ unit_cube \ True \ x \ i = 1 \ label x i = 1" + "\x. \i\Basis. x \ unit_cube \ True \ label x i = 0 \ x \ i \ f x \ i" + "\x. \i\Basis. x \ unit_cube \ True \ label x i = 1 \ f x \ i \ x \ i" using kuhn_labelling_lemma[OF *] by blast note label = this [rule_format] - have lem1: "\x\{0..\Basis}.\y\{0..\Basis}.\i\Basis. label x i \ label y i \ + have lem1: "\x\unit_cube. \y\unit_cube. \i\Basis. label x i \ label y i \ abs (f x \ i - x \ i) \ norm (f y - f x) + norm (y - x)" proof safe fix x y :: 'a - assume x: "x \ {0..\Basis}" - assume y: "y \ {0..\Basis}" + assume x: "x \ unit_cube" + assume y: "y \ unit_cube" fix i assume i: "label x i \ label y i" "i \ Basis" have *: "\x y fx fy :: real. x \ fx \ fy \ y \ fx \ x \ y \ fy \ @@ -3840,7 +3867,7 @@ finally show "\f x \ i - x \ i\ \ norm (f y - f x) + norm (y - x)" unfolding inner_simps . qed - have "\e>0. \x\{0..\Basis}. \y\{0..\Basis}. \z\{0..\Basis}. \i\Basis. + have "\e>0. \x\unit_cube. \y\unit_cube. \z\unit_cube. \i\Basis. norm (x - z) < e \ norm (y - z) < e \ label x i \ label y i \ abs ((f(z) - z)\i) < d / (real n)" proof - @@ -3850,12 +3877,12 @@ unfolding n_def apply (auto simp: DIM_positive) done - have *: "uniformly_continuous_on {0..\Basis} f" - by (rule compact_uniformly_continuous[OF assms(1) compact_interval]) + have *: "uniformly_continuous_on unit_cube f" + by (rule compact_uniformly_continuous[OF assms(1) compact_unit_cube]) obtain e where e: "e > 0" - "\x x'. x \ {0..\Basis} \ - x' \ {0..\Basis} \ + "\x x'. x \ unit_cube \ + x' \ unit_cube \ norm (x' - x) < e \ norm (f x' - f x) < d / real n / 8" using *[unfolded uniformly_continuous_on_def,rule_format,OF d'] @@ -3869,7 +3896,7 @@ using d' e by auto fix x y z i assume as: - "x \ {0..\Basis}" "y \ {0..\Basis}" "z \ {0..\Basis}" + "x \ unit_cube" "y \ unit_cube" "z \ unit_cube" "norm (x - z) < min (e / 2) (d / real n / 8)" "norm (y - z) < min (e / 2) (d / real n / 8)" "label x i \ label y i" @@ -3924,9 +3951,9 @@ then obtain e where e: "e > 0" - "\x y z i. x \ {0..\Basis} \ - y \ {0..\Basis} \ - z \ {0..\Basis} \ + "\x y z i. x \ unit_cube \ + y \ unit_cube \ + z \ unit_cube \ i \ Basis \ norm (x - z) < e \ norm (y - z) < e \ label x i \ label y i \ \(f z - z) \ i\ < d / real n" @@ -3987,8 +4014,8 @@ assume as: "\i\{1..n}. x i \ p" "i \ {1..n}" { assume "x i = p \ x i = 0" - have "(\i\Basis. (real (x (b' i)) / real p) *\<^sub>R i) \ {0::'a..\Basis}" - unfolding mem_interval + have "(\i\Basis. (real (x (b' i)) / real p) *\<^sub>R i) \ (unit_cube::'a set)" + unfolding mem_unit_cube using as b'_Basis by (auto simp add: inner_simps bij_betw_def zero_le_divide_iff divide_le_eq_1) } @@ -4021,8 +4048,8 @@ have "\i\Basis. q (b' i) \ {0..p}" using q(1) b' by (auto intro: less_imp_le simp: bij_betw_def) - then have "z \ {0..\Basis}" - unfolding z_def mem_interval + then have "z \ unit_cube" + unfolding z_def mem_unit_cube using b'_Basis by (auto simp add: inner_simps bij_betw_def zero_le_divide_iff divide_le_eq_1) then have d_fz_z: "d \ norm (f z - z)" @@ -4064,8 +4091,8 @@ using q(1)[rule_format,OF b'_im] apply (auto simp add: Suc_le_eq) done - then have "r' \ {0..\Basis}" - unfolding r'_def mem_interval + then have "r' \ unit_cube" + unfolding r'_def mem_unit_cube using b'_Basis by (auto simp add: inner_simps bij_betw_def zero_le_divide_iff divide_le_eq_1) def s' \ "(\i\Basis. (real (s (b' i)) / real p) *\<^sub>R i)::'a" @@ -4075,12 +4102,12 @@ using q(1)[rule_format,OF b'_im] apply (auto simp add: Suc_le_eq) done - then have "s' \ {0..\Basis}" - unfolding s'_def mem_interval + then have "s' \ unit_cube" + unfolding s'_def mem_unit_cube using b'_Basis by (auto simp add: inner_simps bij_betw_def zero_le_divide_iff divide_le_eq_1) - have "z \ {0..\Basis}" - unfolding z_def mem_interval + have "z \ unit_cube" + unfolding z_def mem_unit_cube using b'_Basis q(1)[rule_format,OF b'_im] `p > 0` by (auto simp add: inner_simps bij_betw_def zero_le_divide_iff divide_le_eq_1 less_imp_le) have *: "\x. 1 + real x = real (Suc x)" @@ -4118,7 +4145,7 @@ then have "\(f z - z) \ i\ < d / real n" using rs(3) i unfolding r'_def[symmetric] s'_def[symmetric] o_def bb' - by (intro e(2)[OF `r'\{0..\Basis}` `s'\{0..\Basis}` `z\{0..\Basis}`]) auto + by (intro e(2)[OF `r'\unit_cube` `s'\unit_cube` `z\unit_cube`]) auto then show False using i by auto qed @@ -4227,8 +4254,15 @@ subsection {* The Brouwer theorem for any set with nonempty interior *} +lemma convex_unit_cube: "convex unit_cube" + apply (rule is_interval_convex) + apply (clarsimp simp add: is_interval_def mem_unit_cube) + apply (drule (1) bspec)+ + apply auto + done + lemma brouwer_weak: - fixes f :: "'a::ordered_euclidean_space \ 'a::ordered_euclidean_space" + fixes f :: "'a::euclidean_space \ 'a" assumes "compact s" and "convex s" and "interior s \ {}" @@ -4236,13 +4270,22 @@ and "f ` s \ s" obtains x where "x \ s" and "f x = x" proof - - have *: "interior {0::'a..\Basis} \ {}" - unfolding interior_closed_interval interval_eq_empty - by auto - have *: "{0::'a..\Basis} homeomorphic s" - using homeomorphic_convex_compact[OF convex_interval(1) compact_interval * assms(2,1,3)] . - have "\f. continuous_on {0::'a..\Basis} f \ f ` {0::'a..\Basis} \ {0::'a..\Basis} \ - (\x\{0::'a..\Basis}. f x = x)" + let ?U = "unit_cube :: 'a set" + have "\Basis /\<^sub>R 2 \ interior ?U" + proof (rule interiorI) + let ?I = "(\i\Basis. {x::'a. 0 < x \ i} \ {x. x \ i < 1})" + show "open ?I" + by (intro open_INT finite_Basis ballI open_Int, auto intro: open_Collect_less) + show "\Basis /\<^sub>R 2 \ ?I" + by simp + show "?I \ unit_cube" + unfolding unit_cube_def by force + qed + then have *: "interior ?U \ {}" by fast + have *: "?U homeomorphic s" + using homeomorphic_convex_compact[OF convex_unit_cube compact_unit_cube * assms(2,1,3)] . + have "\f. continuous_on ?U f \ f ` ?U \ ?U \ + (\x\?U. f x = x)" using brouwer_cube by auto then show ?thesis unfolding homeomorphic_fixpoint_property[OF *] @@ -4260,7 +4303,7 @@ text {* And in particular for a closed ball. *} lemma brouwer_ball: - fixes f :: "'a::ordered_euclidean_space \ 'a" + fixes f :: "'a::euclidean_space \ 'a" assumes "e > 0" and "continuous_on (cball a e) f" and "f ` cball a e \ cball a e" @@ -4274,7 +4317,7 @@ a scaling and translation to put the set inside the unit cube. *} lemma brouwer: - fixes f :: "'a::ordered_euclidean_space \ 'a" + fixes f :: "'a::euclidean_space \ 'a" assumes "compact s" and "convex s" and "s \ {}" @@ -4324,7 +4367,7 @@ text {*So we get the no-retraction theorem. *} lemma no_retraction_cball: - fixes a :: "'a::ordered_euclidean_space" + fixes a :: "'a::euclidean_space" assumes "e > 0" shows "\ (frontier (cball a e) retract_of (cball a e))" proof @@ -4363,7 +4406,7 @@ subsection {*Bijections between intervals. *} -definition interval_bij :: "'a \ 'a \ 'a \ 'a \ 'a \ 'a::ordered_euclidean_space" +definition interval_bij :: "'a \ 'a \ 'a \ 'a \ 'a \ 'a::euclidean_space" where "interval_bij = (\(a, b) (u, v) x. (\i\Basis. (u\i + (x\i - a\i) / (b\i - a\i) * (v\i - u\i)) *\<^sub>R i))" @@ -4374,7 +4417,7 @@ field_simps inner_simps add_divide_distrib[symmetric] intro!: setsum_cong) lemma continuous_interval_bij: - fixes a b :: "'a::ordered_euclidean_space" + fixes a b :: "'a::euclidean_space" shows "continuous (at x) (interval_bij (a, b) (u, v))" by (auto simp add: divide_inverse interval_bij_def intro!: continuous_setsum continuous_intros) @@ -4414,7 +4457,7 @@ qed lemma interval_bij_bij: - "\(i::'a::ordered_euclidean_space)\Basis. a\i < b\i \ u\i < v\i \ + "\(i::'a::euclidean_space)\Basis. a\i < b\i \ u\i < v\i \ interval_bij (a, b) (u, v) (interval_bij (u, v) (a, b) x) = x" by (auto simp: interval_bij_def euclidean_eq_iff[where 'a='a]) diff -r bdc03e91684a -r 2dbf84ee3deb src/HOL/Multivariate_Analysis/Derivative.thy --- a/src/HOL/Multivariate_Analysis/Derivative.thy Thu Mar 13 17:36:56 2014 +0100 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy Thu Mar 13 16:07:27 2014 -0700 @@ -1245,7 +1245,7 @@ subsection {* Proving surjectivity via Brouwer fixpoint theorem *} lemma brouwer_surjective: - fixes f :: "'n::ordered_euclidean_space \ 'n" + fixes f :: "'n::euclidean_space \ 'n" assumes "compact t" and "convex t" and "t \ {}" @@ -1266,7 +1266,7 @@ qed lemma brouwer_surjective_cball: - fixes f :: "'n::ordered_euclidean_space \ 'n" + fixes f :: "'n::euclidean_space \ 'n" assumes "e > 0" and "continuous_on (cball a e) f" and "\x\s. \y\cball a e. x + (y - f y) \ cball a e" @@ -1282,7 +1282,7 @@ text {* See Sussmann: "Multidifferential calculus", Theorem 2.1.1 *} lemma sussmann_open_mapping: - fixes f :: "'a::euclidean_space \ 'b::ordered_euclidean_space" + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "open s" and "continuous_on s f" and "x \ s" @@ -1469,7 +1469,7 @@ qed lemma has_derivative_inverse_strong: - fixes f :: "'n::ordered_euclidean_space \ 'n" + fixes f :: "'n::euclidean_space \ 'n" assumes "open s" and "x \ s" and "continuous_on s f" @@ -1548,7 +1548,7 @@ text {* A rewrite based on the other domain. *} lemma has_derivative_inverse_strong_x: - fixes f :: "'a::ordered_euclidean_space \ 'a" + fixes f :: "'a::euclidean_space \ 'a" assumes "open s" and "g y \ s" and "continuous_on s f" @@ -1564,7 +1564,7 @@ text {* On a region. *} lemma has_derivative_inverse_on: - fixes f :: "'n::ordered_euclidean_space \ 'n" + fixes f :: "'n::euclidean_space \ 'n" assumes "open s" and "\x\s. (f has_derivative f'(x)) (at x)" and "\x\s. g (f x) = x"