# HG changeset patch # User huffman # Date 1278024058 25200 # Node ID 40424fc83cc1dfa5922bced3785a91bb40b2db9d # Parent f86de9c00c474c84529b845408ea4ee40a282a41# Parent 645eb9fec7940d1db4ce035168a5182f7850890d merged diff -r 645eb9fec794 -r 40424fc83cc1 src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Thu Jul 01 19:14:54 2010 +0200 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Thu Jul 01 15:40:58 2010 -0700 @@ -1998,7 +1998,7 @@ *) subsection {* Another intermediate value theorem formulation. *} -lemma ivt_increasing_component_on_1: fixes f::"real \ 'a::ordered_euclidean_space" +lemma ivt_increasing_component_on_1: fixes f::"real \ 'a::euclidean_space" assumes "a \ b" "continuous_on {a .. b} f" "(f a)$$k \ y" "y \ (f b)$$k" shows "\x\{a..b}. (f x)$$k = y" proof- have "f a \ f ` {a..b}" "f b \ f ` {a..b}" apply(rule_tac[!] imageI) @@ -2007,20 +2007,20 @@ using connected_continuous_image[OF assms(2) convex_connected[OF convex_real_interval(5)]] using assms by(auto intro!: imageI) qed -lemma ivt_increasing_component_1: fixes f::"real \ 'a::ordered_euclidean_space" +lemma ivt_increasing_component_1: fixes f::"real \ 'a::euclidean_space" shows "a \ b \ \x\{a .. b}. continuous (at x) f \ f a$$k \ y \ y \ f b$$k \ \x\{a..b}. (f x)$$k = y" by(rule ivt_increasing_component_on_1) (auto simp add: continuous_at_imp_continuous_on) -lemma ivt_decreasing_component_on_1: fixes f::"real \ 'a::ordered_euclidean_space" +lemma ivt_decreasing_component_on_1: fixes f::"real \ 'a::euclidean_space" assumes "a \ b" "continuous_on {a .. b} f" "(f b)$$k \ y" "y \ (f a)$$k" shows "\x\{a..b}. (f x)$$k = y" apply(subst neg_equal_iff_equal[THEN sym]) using ivt_increasing_component_on_1[of a b "\x. - f x" k "- y"] using assms using continuous_on_neg by (auto simp add:euclidean_simps) -lemma ivt_decreasing_component_1: fixes f::"real \ 'a::ordered_euclidean_space" +lemma ivt_decreasing_component_1: fixes f::"real \ 'a::euclidean_space" shows "a \ b \ \x\{a .. b}. continuous (at x) f \ f b$$k \ y \ y \ f a$$k \ \x\{a..b}. (f x)$$k = y" by(rule ivt_decreasing_component_on_1) @@ -2212,6 +2212,7 @@ lemma convex_on_continuous: assumes "open (s::('a::ordered_euclidean_space) set)" "convex_on s f" + (* FIXME: generalize to euclidean_space *) shows "continuous_on s f" unfolding continuous_on_eq_continuous_at[OF assms(1)] proof note dimge1 = DIM_positive[where 'a='a] diff -r 645eb9fec794 -r 40424fc83cc1 src/HOL/Multivariate_Analysis/Fashoda.thy --- a/src/HOL/Multivariate_Analysis/Fashoda.thy Thu Jul 01 19:14:54 2010 +0200 +++ b/src/HOL/Multivariate_Analysis/Fashoda.thy Thu Jul 01 15:40:58 2010 -0700 @@ -4,7 +4,7 @@ header {* Fashoda meet theorem. *} theory Fashoda -imports Brouwer_Fixpoint Path_Connected +imports Brouwer_Fixpoint Path_Connected Cartesian_Euclidean_Space begin subsection {*Fashoda meet theorem. *} diff -r 645eb9fec794 -r 40424fc83cc1 src/HOL/Multivariate_Analysis/Path_Connected.thy --- a/src/HOL/Multivariate_Analysis/Path_Connected.thy Thu Jul 01 19:14:54 2010 +0200 +++ b/src/HOL/Multivariate_Analysis/Path_Connected.thy Thu Jul 01 15:40:58 2010 -0700 @@ -5,7 +5,7 @@ header {* Continuous paths and path-connected sets *} theory Path_Connected -imports Cartesian_Euclidean_Space +imports Convex_Euclidean_Space begin subsection {* Paths. *} @@ -502,71 +502,80 @@ apply(erule_tac[!] UnE)+ apply(rule_tac[2-3] path_component_trans[of _ _ z]) by(auto simp add:path_component_of_subset [OF Un_upper1] path_component_of_subset[OF Un_upper2]) qed -subsection {* sphere is path-connected. *} +lemma path_connected_UNION: + assumes "\i. i \ A \ path_connected (S i)" + assumes "\i. i \ A \ z \ S i" + shows "path_connected (\i\A. S i)" +unfolding path_connected_component proof(clarify) + fix x i y j + assume *: "i \ A" "x \ S i" "j \ A" "y \ S j" + hence "path_component (S i) x z" and "path_component (S j) z y" + using assms by (simp_all add: path_connected_component) + hence "path_component (\i\A. S i) x z" and "path_component (\i\A. S i) z y" + using *(1,3) by (auto elim!: path_component_of_subset [COMP swap_prems_rl]) + thus "path_component (\i\A. S i) x y" + by (rule path_component_trans) +qed -(** TODO covert this to ordered_euclidean_space **) +subsection {* sphere is path-connected. *} lemma path_connected_punctured_universe: - assumes "2 \ CARD('n::finite)" shows "path_connected((UNIV::(real^'n) set) - {a})" proof- - obtain \ where \:"bij_betw \ {1..CARD('n)} (UNIV::'n set)" using ex_bij_betw_nat_finite_1[OF finite_UNIV] by auto - let ?U = "UNIV::(real^'n) set" let ?u = "?U - {0}" - let ?basis = "\k. cart_basis (\ k)" - let ?A = "\k. {x::real^'n. \i\{1..k}. inner (cart_basis (\ i)) x \ 0}" - have "\k\{2..CARD('n)}. path_connected (?A k)" proof - have *:"\k. ?A (Suc k) = {x. inner (?basis (Suc k)) x < 0} \ {x. inner (?basis (Suc k)) x > 0} \ ?A k" apply(rule set_ext,rule) defer - apply(erule UnE)+ unfolding mem_Collect_eq apply(rule_tac[1-2] x="Suc k" in bexI) - by(auto elim!: ballE simp add: not_less le_Suc_eq) - fix k assume "k \ {2..CARD('n)}" thus "path_connected (?A k)" proof(induct k) - case (Suc k) show ?case proof(cases "k = 1") - case False from Suc have d:"k \ {1..CARD('n)}" "Suc k \ {1..CARD('n)}" by auto - hence "\ k \ \ (Suc k)" using \[unfolded bij_betw_def inj_on_def, THEN conjunct1, THEN bspec[where x=k]] by auto - hence **:"?basis k + ?basis (Suc k) \ {x. 0 < inner (?basis (Suc k)) x} \ (?A k)" - "?basis k - ?basis (Suc k) \ {x. 0 > inner (?basis (Suc k)) x} \ ({x. 0 < inner (?basis (Suc k)) x} \ (?A k))" using d - by(auto simp add: inner_basis intro!:bexI[where x=k]) - show ?thesis unfolding * Un_assoc apply(rule path_connected_Un) defer apply(rule path_connected_Un) - prefer 5 apply(rule_tac[1-2] convex_imp_path_connected, rule convex_halfspace_lt, rule convex_halfspace_gt) - apply(rule Suc(1)) using d ** False by auto - next case True hence d:"1\{1..CARD('n)}" "2\{1..CARD('n)}" using Suc(2) by auto - have ***:"Suc 1 = 2" by auto - have **:"\s t P Q. s \ t \ {x. P x \ Q x} = (s \ {x. P x}) \ (t \ {x. Q x})" by auto - have nequals0I:"\x A. x\A \ A \ {}" by auto - have "\ 2 \ \ (Suc 0)" using \[unfolded bij_betw_def inj_on_def, THEN conjunct1, THEN bspec[where x=2]] using assms by auto - thus ?thesis unfolding * True unfolding ** neq_iff bex_disj_distrib apply - - apply(rule path_connected_Un, rule_tac[1-2] path_connected_Un) defer 3 apply(rule_tac[1-4] convex_imp_path_connected) - apply(rule_tac[5] x=" ?basis 1 + ?basis 2" in nequals0I) - apply(rule_tac[6] x="-?basis 1 + ?basis 2" in nequals0I) - apply(rule_tac[7] x="-?basis 1 - ?basis 2" in nequals0I) - using d unfolding *** by(auto intro!: convex_halfspace_gt convex_halfspace_lt, auto simp add: inner_basis) - qed qed auto qed note lem = this + assumes "2 \ DIM('a::euclidean_space)" + shows "path_connected((UNIV::'a::euclidean_space set) - {a})" +proof- + let ?A = "{x::'a. \i\{..x::real^'n. (\i\{1..CARD('n)}. inner (cart_basis (\ i)) x \ 0) \ (\i. inner (cart_basis i) x \ 0)" - apply rule apply(erule bexE) apply(rule_tac x="\ i" in exI) defer apply(erule exE) proof- - fix x::"real^'n" and i assume as:"inner (cart_basis i) x \ 0" - have "i\\ ` {1..CARD('n)}" using \[unfolded bij_betw_def, THEN conjunct2] by auto - then obtain j where "j\{1..CARD('n)}" "\ j = i" by auto - thus "\i\{1..CARD('n)}. inner (cart_basis (\ i)) x \ 0" apply(rule_tac x=j in bexI) using as by auto qed auto - have *:"?U - {a} = (\x. x + a) ` {x. x \ 0}" apply(rule set_ext) unfolding image_iff - apply rule apply(rule_tac x="x - a" in bexI) by auto - have **:"\x::real^'n. x\0 \ (\i. inner (cart_basis i) x \ 0)" unfolding Cart_eq by(auto simp add: inner_basis) - show ?thesis unfolding * apply(rule path_connected_continuous_image) apply(rule continuous_on_intros)+ - unfolding ** apply(rule lem[THEN bspec[where x="CARD('n)"], unfolded ***]) using assms by auto qed + have A: "path_connected ?A" unfolding Collect_bex_eq + proof (rule path_connected_UNION) + fix i assume "i \ {..\ i. a $$ i - 1) \ {x::'a. x $$ i < a $$ i}" by simp + show "path_connected {x. x $$ i < a $$ i}" unfolding euclidean_component_def + by (rule convex_imp_path_connected [OF convex_halfspace_lt]) + qed + have B: "path_connected ?B" unfolding Collect_bex_eq + proof (rule path_connected_UNION) + fix i assume "i \ {..\ i. a $$ i + 1) \ {x::'a. a $$ i < x $$ i}" by simp + show "path_connected {x. a $$ i < x $$ i}" unfolding euclidean_component_def + by (rule convex_imp_path_connected [OF convex_halfspace_gt]) + qed + from assms have "1 < DIM('a)" by auto + hence "a + basis 0 - basis 1 \ ?A \ ?B" by auto + hence "?A \ ?B \ {}" by fast + with A B have "path_connected (?A \ ?B)" + by (rule path_connected_Un) + also have "?A \ ?B = {x. \i\{.. a $$ i}" + unfolding neq_iff bex_disj_distrib Collect_disj_eq .. + also have "\ = {x. x \ a}" + unfolding Bex_def euclidean_eq [where 'a='a] by simp + also have "\ = UNIV - {a}" by auto + finally show ?thesis . +qed -lemma path_connected_sphere: assumes "2 \ CARD('n::finite)" shows "path_connected {x::real^'n. norm(x - a) = r}" proof(cases "r\0") - case True thus ?thesis proof(cases "r=0") - case False hence "{x::real^'n. norm(x - a) = r} = {}" using True by auto - thus ?thesis using path_connected_empty by auto - qed(auto intro!:path_connected_singleton) next - case False hence *:"{x::real^'n. norm(x - a) = r} = (\x. a + r *\<^sub>R x) ` {x. norm x = 1}" unfolding not_le apply -apply(rule set_ext,rule) +lemma path_connected_sphere: + assumes "2 \ DIM('a::euclidean_space)" + shows "path_connected {x::'a::euclidean_space. norm(x - a) = r}" +proof (rule linorder_cases [of r 0]) + assume "r < 0" hence "{x::'a. norm(x - a) = r} = {}" by auto + thus ?thesis using path_connected_empty by simp +next + assume "r = 0" + thus ?thesis using path_connected_singleton by simp +next + assume r: "0 < r" + hence *:"{x::'a. norm(x - a) = r} = (\x. a + r *\<^sub>R x) ` {x. norm x = 1}" apply -apply(rule set_ext,rule) unfolding image_iff apply(rule_tac x="(1/r) *\<^sub>R (x - a)" in bexI) unfolding mem_Collect_eq norm_scaleR by (auto simp add: scaleR_right_diff_distrib) - have **:"{x::real^'n. norm x = 1} = (\x. (1/norm x) *\<^sub>R x) ` (UNIV - {0})" apply(rule set_ext,rule) + have **:"{x::'a. norm x = 1} = (\x. (1/norm x) *\<^sub>R x) ` (UNIV - {0})" apply(rule set_ext,rule) unfolding image_iff apply(rule_tac x=x in bexI) unfolding mem_Collect_eq by(auto split:split_if_asm) - have "continuous_on (UNIV - {0}) (\x::real^'n. 1 / norm x)" unfolding o_def continuous_on_eq_continuous_within + have "continuous_on (UNIV - {0}) (\x::'a. 1 / norm x)" unfolding o_def continuous_on_eq_continuous_within apply(rule, rule continuous_at_within_inv[unfolded o_def inverse_eq_divide]) apply(rule continuous_at_within) apply(rule continuous_at_norm[unfolded o_def]) by auto thus ?thesis unfolding * ** using path_connected_punctured_universe[OF assms] - by(auto intro!: path_connected_continuous_image continuous_on_intros) qed + by(auto intro!: path_connected_continuous_image continuous_on_intros) +qed -lemma connected_sphere: "2 \ CARD('n) \ connected {x::real^'n. norm(x - a) = r}" +lemma connected_sphere: "2 \ DIM('a::euclidean_space) \ connected {x::'a. norm(x - a) = r}" using path_connected_sphere path_connected_imp_connected by auto end diff -r 645eb9fec794 -r 40424fc83cc1 src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Thu Jul 01 19:14:54 2010 +0200 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Thu Jul 01 15:40:58 2010 -0700 @@ -4994,7 +4994,7 @@ (* Some stuff for half-infinite intervals too; FIXME: notation? *) -lemma closed_interval_left: fixes b::"'a::ordered_euclidean_space" +lemma closed_interval_left: fixes b::"'a::euclidean_space" shows "closed {x::'a. \i b$$i}" proof- { fix i assume i:"ii x$$i}" proof- { fix i assume i:"i a}" + shows "closed {x::'a::euclidean_space. x$$i \ a}" using closed_halfspace_le[of "(basis i)::'a" a] unfolding euclidean_component_def . lemma closed_halfspace_component_ge: - shows "closed {x::'a::ordered_euclidean_space. x$$i \ a}" + shows "closed {x::'a::euclidean_space. x$$i \ a}" using closed_halfspace_ge[of a "(basis i)::'a"] unfolding euclidean_component_def . text{* Openness of halfspaces. *} @@ -5098,16 +5098,16 @@ qed lemma open_halfspace_component_lt: - shows "open {x::'a::ordered_euclidean_space. x$$i < a}" + shows "open {x::'a::euclidean_space. x$$i < a}" using open_halfspace_lt[of "(basis i)::'a" a] unfolding euclidean_component_def . lemma open_halfspace_component_gt: - shows "open {x::'a::ordered_euclidean_space. x$$i > a}" + shows "open {x::'a::euclidean_space. x$$i > a}" using open_halfspace_gt[of a "(basis i)::'a"] unfolding euclidean_component_def . text{* This gives a simple derivation of limit component bounds. *} -lemma Lim_component_le: fixes f :: "'a \ 'b::ordered_euclidean_space" +lemma Lim_component_le: fixes f :: "'a \ 'b::euclidean_space" assumes "(f ---> l) net" "\ (trivial_limit net)" "eventually (\x. f(x)$$i \ b) net" shows "l$$i \ b" proof- @@ -5117,7 +5117,7 @@ using closed_halfspace_le[of "(basis i)::'b" b] and assms(1,2,3) by auto qed -lemma Lim_component_ge: fixes f :: "'a \ 'b::ordered_euclidean_space" +lemma Lim_component_ge: fixes f :: "'a \ 'b::euclidean_space" assumes "(f ---> l) net" "\ (trivial_limit net)" "eventually (\x. b \ (f x)$$i) net" shows "b \ l$$i" proof- @@ -5127,7 +5127,7 @@ using closed_halfspace_ge[of b "(basis i)"] and assms(1,2,3) by auto qed -lemma Lim_component_eq: fixes f :: "'a \ 'b::ordered_euclidean_space" +lemma Lim_component_eq: fixes f :: "'a \ 'b::euclidean_space" assumes net:"(f ---> l) net" "~(trivial_limit net)" and ev:"eventually (\x. f(x)$$i = b) net" shows "l$$i = b" using ev[unfolded order_eq_iff eventually_and] using Lim_component_ge[OF net, of b i] and Lim_component_le[OF net, of i b] by auto @@ -5187,7 +5187,7 @@ ultimately show False using assms(1)[unfolded connected_def not_ex, THEN spec[where x="?A"], THEN spec[where x="?B"]] and assms(2-5) by auto qed -lemma connected_ivt_component: fixes x::"'a::ordered_euclidean_space" shows +lemma connected_ivt_component: fixes x::"'a::euclidean_space" shows "connected s \ x \ s \ y \ s \ x$$k \ a \ a \ y$$k \ (\z\s. z$$k = a)" using connected_ivt_hyperplane[of s x y "(basis k)::'a" a] unfolding euclidean_component_def by auto