# HG changeset patch # User paulson # Date 1474473591 -3600 # Node ID d81fb5b46a5c01c2eb35a8524a0229f1c9c3c565 # Parent 0efb482beb84e427fdfa37efb3df6fc3bf23fcbb new material about topological concepts, etc diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Analysis/Brouwer_Fixpoint.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Brouwer_Fixpoint.thy Wed Sep 21 16:59:51 2016 +0100 @@ -2794,6 +2794,14 @@ using ANR_imp_absolute_neighbourhood_retract [OF \ANR S\ hom] by (metis clo closed_closedin open_openin subtopology_UNIV) +corollary neighbourhood_extension_into_ANR: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes contf: "continuous_on S f" and fim: "f ` S \ T" and "ANR T" "closed S" + obtains V g where "S \ V" "open V" "continuous_on V g" + "g ` V \ T" "\x. x \ S \ g x = f x" + using ANR_imp_absolute_neighbourhood_extensor [OF \ANR T\ contf fim] + by (metis \closed S\ closed_closedin open_openin subtopology_UNIV) + lemma absolute_neighbourhood_extensor_imp_ANR: fixes S :: "'a::euclidean_space set" assumes "\f :: 'a * real \ 'a. @@ -3739,8 +3747,9 @@ apply (rule homeomorphic_closedin_convex [of S]) using aff_dim_le_DIM [of S] apply auto done - have "locally path_connected T" - by (meson ANR_imp_absolute_neighbourhood_retract \S homeomorphic T\ \closedin (subtopology euclidean U) T\ \convex U\ assms convex_imp_locally_path_connected locally_open_subset retract_of_locally_path_connected) + then have "locally path_connected T" + by (meson ANR_imp_absolute_neighbourhood_retract + assms convex_imp_locally_path_connected locally_open_subset retract_of_locally_path_connected) then have S: "locally path_connected S" if "openin (subtopology euclidean U) V" "T retract_of V" "U \ {}" for V using \S homeomorphic T\ homeomorphic_locally homeomorphic_path_connectedness by blast diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Cauchy_Integral_Theorem.thy --- a/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Wed Sep 21 16:59:51 2016 +0100 @@ -5420,10 +5420,6 @@ subsection\ General stepping result for derivative formulas.\ -lemma sum_sqs_eq: - fixes x::"'a::idom" shows "x * x + y * y = x * (y * 2) \ y = x" - by algebra - proposition Cauchy_next_derivative: assumes "continuous_on (path_image \) f'" and leB: "\t. t \ {0..1} \ norm (vector_derivative \ (at t)) \ B" diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Conformal_Mappings.thy --- a/src/HOL/Analysis/Conformal_Mappings.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Conformal_Mappings.thy Wed Sep 21 16:59:51 2016 +0100 @@ -1027,7 +1027,7 @@ using polyfun_extremal [where c=c and B="B+1", OF c] by (auto simp: bounded_pos eventually_at_infinity_pos *) moreover have "closed {z. (\i\n. c i * z ^ i) \ K}" - apply (rule allI continuous_closed_preimage_univ continuous_intros)+ + apply (intro allI continuous_closed_preimage_univ continuous_intros) using \compact K\ compact_eq_bounded_closed by blast ultimately show ?thesis using closed_Int_compact [OF \closed S\] compact_eq_bounded_closed by blast diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Wed Sep 21 16:59:51 2016 +0100 @@ -5554,6 +5554,31 @@ apply auto done +text\A non-singleton connected set is perfect (i.e. has no isolated points). \ +lemma connected_imp_perfect: + fixes a :: "'a::metric_space" + assumes "connected S" "a \ S" and S: "\x. S \ {x}" + shows "a islimpt S" +proof - + have False if "a \ T" "open T" "\y. \y \ S; y \ T\ \ y = a" for T + proof - + obtain e where "e > 0" and e: "cball a e \ T" + using \open T\ \a \ T\ by (auto simp: open_contains_cball) + have "openin (subtopology euclidean S) {a}" + unfolding openin_open using that \a \ S\ by blast + moreover have "closedin (subtopology euclidean S) {a}" + by (simp add: assms) + ultimately show "False" + using \connected S\ connected_clopen S by blast + qed + then show ?thesis + unfolding islimpt_def by blast +qed + +lemma connected_imp_perfect_aff_dim: + "\connected S; aff_dim S \ 0; a \ S\ \ a islimpt S" + using aff_dim_sing connected_imp_perfect by blast + subsection \On \real\, \is_interval\, \convex\ and \connected\ are all equivalent.\ lemma is_interval_1: @@ -10406,7 +10431,7 @@ lemma collinear_3_expand: "collinear{a,b,c} \ a = c \ (\u. b = u *\<^sub>R a + (1 - u) *\<^sub>R c)" -proof - +proof - have "collinear{a,b,c} = collinear{a,c,b}" by (simp add: insert_commute) also have "... = collinear {0, a - c, b - c}" @@ -10418,6 +10443,27 @@ finally show ?thesis . qed +lemma collinear_aff_dim: "collinear S \ aff_dim S \ 1" +proof + assume "collinear S" + then obtain u and v :: "'a" where "aff_dim S \ aff_dim {u,v}" + by (metis \collinear S\ aff_dim_affine_hull aff_dim_subset collinear_affine_hull) + then show "aff_dim S \ 1" + using order_trans by fastforce +next + assume "aff_dim S \ 1" + then have le1: "aff_dim (affine hull S) \ 1" + by simp + obtain B where "B \ S" and B: "\ affine_dependent B" "affine hull S = affine hull B" + using affine_basis_exists [of S] by auto + then have "finite B" "card B \ 2" + using B le1 by (auto simp: affine_independent_iff_card) + then have "collinear B" + by (rule collinear_small) + then show "collinear S" + by (metis \affine hull S = affine hull B\ collinear_affine_hull_collinear) +qed + lemma collinear_midpoint: "collinear{a,midpoint a b,b}" apply (auto simp: collinear_3 collinear_lemma) apply (drule_tac x="-1" in spec) @@ -10443,6 +10489,35 @@ ultimately show ?thesis by blast qed +lemma between_imp_collinear: + fixes x :: "'a :: euclidean_space" + assumes "between (a,b) x" + shows "collinear {a,x,b}" +proof (cases "x = a \ x = b \ a = b") + case True with assms show ?thesis + by (auto simp: dist_commute) +next + case False with assms show ?thesis + apply (auto simp: collinear_3 collinear_lemma between_norm) + apply (drule_tac x="-(norm(b - x) / norm(x - a))" in spec) + apply (simp add: vector_add_divide_simps eq_vector_fraction_iff real_vector.scale_minus_right [symmetric]) + done +qed + +lemma midpoint_between: + fixes a b :: "'a::euclidean_space" + shows "b = midpoint a c \ between (a,c) b \ dist a b = dist b c" +proof (cases "a = c") + case True then show ?thesis + by (auto simp: dist_commute) +next + case False + show ?thesis + apply (rule iffI) + apply (simp add: between_midpoint(1) dist_midpoint) + using False between_imp_collinear midpoint_collinear by blast +qed + lemma collinear_triples: assumes "a \ b" shows "collinear(insert a (insert b S)) \ (\x \ S. collinear{a,b,x})" @@ -11157,7 +11232,7 @@ using assms unfolding openin_open by (metis affine_hull_convex_Int_open hull_subset inf.orderE inf_assoc) -corollary affine_hull_open_in: +corollary affine_hull_openin: fixes S :: "'a::real_normed_vector set" assumes "openin (subtopology euclidean (affine hull T)) S" "S \ {}" shows "affine hull S = affine hull T" @@ -11180,6 +11255,19 @@ shows "\convex S; open T; S \ T \ {}\ \ aff_dim(S \ T) = aff_dim S" using aff_dim_convex_Int_nonempty_interior interior_eq by blast +lemma affine_hull_Diff: + fixes S:: "'a::real_normed_vector set" + assumes ope: "openin (subtopology euclidean (affine hull S)) S" and "finite F" "F \ S" + shows "affine hull (S - F) = affine hull S" +proof - + have clo: "closedin (subtopology euclidean S) F" + using assms finite_imp_closedin by auto + moreover have "S - F \ {}" + using assms by auto + ultimately show ?thesis + by (metis ope closedin_def topspace_euclidean_subtopology affine_hull_openin openin_trans) +qed + lemma affine_hull_halfspace_lt: fixes a :: "'a::euclidean_space" shows "affine hull {x. a \ x < r} = (if a = 0 \ r \ 0 then {} else UNIV)" @@ -11963,6 +12051,44 @@ using in_convex_hull_exchange_unique assms apply blast by (metis hull_mono inf_le1 inf_le2 insert_inter_insert le_inf_iff) +lemma Int_closed_segment: + fixes b :: "'a::euclidean_space" + assumes "b \ closed_segment a c \ ~collinear{a,b,c}" + shows "closed_segment a b \ closed_segment b c = {b}" +proof (cases "c = a") + case True + then show ?thesis + using assms collinear_3_eq_affine_dependent by fastforce +next + case False + from assms show ?thesis + proof + assume "b \ closed_segment a c" + moreover have "\ affine_dependent {a, c}" + by (simp add: affine_independent_2) + ultimately show ?thesis + using False convex_hull_exchange_Int [of "{a,c}" b "{a}" "{c}"] + by (simp add: segment_convex_hull insert_commute) + next + assume ncoll: "\ collinear {a, b, c}" + have False if "closed_segment a b \ closed_segment b c \ {b}" + proof - + have "b \ closed_segment a b" and "b \ closed_segment b c" + by auto + with that obtain d where "b \ d" "d \ closed_segment a b" "d \ closed_segment b c" + by force + then have d: "collinear {a, d, b}" "collinear {b, d, c}" + by (auto simp: between_mem_segment between_imp_collinear) + have "collinear {a, b, c}" + apply (rule collinear_3_trans [OF _ _ \b \ d\]) + using d by (auto simp: insert_commute) + with ncoll show False .. + qed + then show ?thesis + by blast + qed +qed + lemma affine_hull_finite_intersection_hyperplanes: fixes s :: "'a::euclidean_space set" obtains f where @@ -12812,6 +12938,7 @@ finally show "aff_dim S \ aff_dim (f ` S)" . qed + text\Choosing a subspace of a given dimension\ proposition choose_subspace_of_subspace: fixes S :: "'n::euclidean_space set" diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Wed Sep 21 16:59:51 2016 +0100 @@ -5894,7 +5894,7 @@ assumes "0 < r" and "\x. h(g x) = x" and "\x. g(h x) = x" - and "\x. continuous (at x) g" + and contg: "\x. continuous (at x) g" and "\u v. \w z. g ` cbox u v = cbox w z" and "\u v. \w z. h ` cbox u v = cbox w z" and "\u v. content(g ` cbox u v) = r * content (cbox u v)" @@ -5947,7 +5947,7 @@ show "gauge d'" using d(1) unfolding gauge_def d' - using continuous_open_preimage_univ[OF assms(4)] + using continuous_open_preimage_univ[OF _ contg] by auto fix p assume as: "p tagged_division_of h ` cbox a b" "d' fine p" @@ -5985,7 +5985,7 @@ proof - assume as: "interior k \ interior k' = {}" have "z \ g ` (interior k \ interior k')" - using interior_image_subset[OF assms(4) inj(1)] z + using interior_image_subset[OF \inj g\ contg] z unfolding image_Int[OF inj(1)] by blast then show False using as by blast @@ -6178,20 +6178,13 @@ assumes "(f has_integral i) (cbox a b)" and "\k\Basis. m k \ 0" shows "((\x. f (\k\Basis. (m k * (x\k))*\<^sub>R k)) has_integral - ((1/ \setprod m Basis\) *\<^sub>R i)) ((\x. (\k\Basis. (1 / m k * (x\k))*\<^sub>R k)) ` cbox a b)" - apply (rule has_integral_twiddle[where f=f]) - unfolding zero_less_abs_iff content_image_stretch_interval - unfolding image_stretch_interval empty_as_interval euclidean_eq_iff[where 'a='a] - using assms -proof - - show "\y::'a. continuous (at y) (\x. (\k\Basis. (m k * (x\k))*\<^sub>R k))" - apply rule - apply (rule linear_continuous_at) - unfolding linear_linear - unfolding linear_iff inner_simps euclidean_eq_iff[where 'a='a] - apply (auto simp add: field_simps) - done -qed auto + ((1/ \setprod m Basis\) *\<^sub>R i)) ((\x. (\k\Basis. (1 / m k * (x\k))*\<^sub>R k)) ` cbox a b)" +apply (rule has_integral_twiddle[where f=f]) +unfolding zero_less_abs_iff content_image_stretch_interval +unfolding image_stretch_interval empty_as_interval euclidean_eq_iff[where 'a='a] +using assms +by auto + lemma integrable_stretch: fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" @@ -6199,14 +6192,9 @@ and "\k\Basis. m k \ 0" shows "(\x::'a. f (\k\Basis. (m k * (x\k))*\<^sub>R k)) integrable_on ((\x. \k\Basis. (1 / m k * (x\k))*\<^sub>R k) ` cbox a b)" - using assms - unfolding integrable_on_def - apply - - apply (erule exE) - apply (drule has_integral_stretch) - apply assumption - apply auto - done + using assms unfolding integrable_on_def + by (force dest: has_integral_stretch) + subsection \even more special cases.\ diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Norm_Arith.thy --- a/src/HOL/Analysis/Norm_Arith.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Norm_Arith.thy Wed Sep 21 16:59:51 2016 +0100 @@ -8,6 +8,11 @@ imports "~~/src/HOL/Library/Sum_of_Squares" begin +(* FIXME: move elsewhere *) +lemma sum_sqs_eq: + fixes x::"'a::idom" shows "x * x + y * y = x * (y * 2) \ y = x" + by algebra + lemma norm_cmul_rule_thm: fixes x :: "'a::real_normed_vector" shows "b \ norm x \ \c\ * b \ norm (scaleR c x)" diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Path_Connected.thy Wed Sep 21 16:59:51 2016 +0100 @@ -4746,19 +4746,17 @@ lemma connected_equivalence_relation: assumes "connected S" and etc: "a \ S" "b \ S" - and sym: "\x y z. R x y \ R y x" - and trans: "\x y z. R x y \ R y z \ R x z" - and opI: "\a. a \ S - \ \T. openin (subtopology euclidean S) T \ a \ T \ (\x \ T. R a x)" + and sym: "\x y. \R x y; x \ S; y \ S\ \ R y x" + and trans: "\x y z. \R x y; R y z; x \ S; y \ S; z \ S\ \ R x z" + and opI: "\a. a \ S \ \T. openin (subtopology euclidean S) T \ a \ T \ (\x \ T. R a x)" shows "R a b" proof - have "\a b c. \a \ S; b \ S; c \ S; R a b\ \ R a c" apply (rule connected_induction_simple [OF \connected S\], simp_all) - by (meson local.sym local.trans opI) + by (meson local.sym local.trans opI openin_imp_subset subsetCE) then show ?thesis by (metis etc opI) qed - lemma locally_constant_imp_constant: assumes "connected S" and opI: "\a. a \ S @@ -5270,6 +5268,12 @@ apply (force simp: convex_Int convex_imp_path_connected) done +lemma convex_imp_locally_connected: + fixes S :: "'a:: real_normed_vector set" + shows "convex S \ locally connected S" + by (simp add: locally_path_connected_imp_locally_connected convex_imp_locally_path_connected) + + subsection\Relations between components and path components\ lemma path_component_eq_connected_component: @@ -5741,7 +5745,7 @@ done qed -lemma isometry_subspaces: +corollary isometry_subspaces: fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" assumes S: "subspace S" @@ -5751,6 +5755,14 @@ using isometries_subspaces [OF assms] by metis +corollary isomorphisms_UNIV_UNIV: + assumes "DIM('M) = DIM('N)" + obtains f::"'M::euclidean_space \'N::euclidean_space" and g + where "linear f" "linear g" + "\x. norm(f x) = norm x" "\y. norm(g y) = norm y" + "\x. g(f x) = x" "\y. f(g y) = y" + using assms by (auto simp: dim_UNIV intro: isometries_subspaces [of "UNIV::'M set" "UNIV::'N set"]) + lemma homeomorphic_subspaces: fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Wed Sep 21 16:59:51 2016 +0100 @@ -17,6 +17,7 @@ (* FIXME: move elsewhere *) + definition (in monoid_add) support_on :: "'b set \ ('b \ 'a) \ 'b set" where "support_on s f = {x\s. f x \ 0}" @@ -766,6 +767,11 @@ lemma closed_subset: "S \ T \ closed S \ closedin (subtopology euclidean T) S" by (auto simp add: closedin_closed) +lemma finite_imp_closedin: + fixes S :: "'a::t1_space set" + shows "\finite S; S \ T\ \ closedin (subtopology euclidean T) S" + by (simp add: finite_imp_closed closed_subset) + lemma closedin_singleton [simp]: fixes a :: "'a::t1_space" shows "closedin (subtopology euclidean U) {a} \ a \ U" @@ -3611,6 +3617,9 @@ unfolding bounded_def by auto qed +lemma bounded_closure_image: "bounded (f ` closure S) \ bounded (f ` S)" + by (simp add: bounded_subset closure_subset image_mono) + lemma bounded_cball[simp,intro]: "bounded (cball x e)" apply (simp add: bounded_def) apply (rule_tac x=x in exI) @@ -3749,7 +3758,8 @@ shows "bounded (uminus ` X) \ bounded X" by (auto simp: bounded_def dist_norm; rule_tac x="-x" in exI; force simp add: add.commute norm_minus_commute) -text\Some theorems on sups and infs using the notion "bounded".\ + +subsection\Some theorems on sups and infs using the notion "bounded".\ lemma bounded_real: "bounded (S::real set) \ (\a. \x\S. \x\ \ a)" by (simp add: bounded_iff) @@ -6122,22 +6132,21 @@ qed lemma continuous_open_preimage_univ: - "\x. continuous (at x) f \ open s \ open {x. f x \ s}" + "open s \ (\x. continuous (at x) f) \ open {x. f x \ s}" using continuous_open_preimage[of UNIV f s] open_UNIV continuous_at_imp_continuous_on by auto lemma continuous_closed_preimage_univ: - "(\x. continuous (at x) f) \ closed s \ closed {x. f x \ s}" + "closed s \ (\x. continuous (at x) f) \ closed {x. f x \ s}" using continuous_closed_preimage[of UNIV f s] closed_UNIV continuous_at_imp_continuous_on by auto -lemma continuous_open_vimage: "\x. continuous (at x) f \ open s \ open (f -` s)" +lemma continuous_open_vimage: "open s \ (\x. continuous (at x) f) \ open (f -` s)" unfolding vimage_def by (rule continuous_open_preimage_univ) -lemma continuous_closed_vimage: "\x. continuous (at x) f \ closed s \ closed (f -` s)" +lemma continuous_closed_vimage: "closed s \ (\x. continuous (at x) f) \ closed (f -` s)" unfolding vimage_def by (rule continuous_closed_preimage_univ) lemma interior_image_subset: - assumes "\x. continuous (at x) f" - and "inj f" + assumes "inj f" "\x. continuous (at x) f" shows "interior (f ` s) \ f ` (interior s)" proof fix x assume "x \ interior (f ` s)" @@ -6145,7 +6154,7 @@ then have "x \ f ` s" by auto then obtain y where y: "y \ s" "x = f y" by auto have "open (vimage f T)" - using assms(1) \open T\ by (rule continuous_open_vimage) + using assms \open T\ by (metis continuous_open_vimage) moreover have "y \ vimage f T" using \x = f y\ \x \ T\ by simp moreover have "vimage f T \ s" @@ -6774,53 +6783,53 @@ by (auto intro!: image_eqI [where f="\x. - x"]) lemma open_negations: - fixes s :: "'a::real_normed_vector set" - shows "open s \ open ((\x. - x) ` s)" - using open_scaling [of "- 1" s] by simp + fixes S :: "'a::real_normed_vector set" + shows "open S \ open ((\x. - x) ` S)" + using open_scaling [of "- 1" S] by simp lemma open_translation: - fixes s :: "'a::real_normed_vector set" - assumes "open s" - shows "open((\x. a + x) ` s)" + fixes S :: "'a::real_normed_vector set" + assumes "open S" + shows "open((\x. a + x) ` S)" proof - { fix x have "continuous (at x) (\x. x - a)" by (intro continuous_diff continuous_ident continuous_const) } - moreover have "{x. x - a \ s} = op + a ` s" + moreover have "{x. x - a \ S} = op + a ` S" by force - ultimately show ?thesis using continuous_open_preimage_univ[of "\x. x - a" s] - using assms by auto + ultimately show ?thesis + by (metis assms continuous_open_vimage vimage_def) qed lemma open_affinity: - fixes s :: "'a::real_normed_vector set" - assumes "open s" "c \ 0" - shows "open ((\x. a + c *\<^sub>R x) ` s)" + fixes S :: "'a::real_normed_vector set" + assumes "open S" "c \ 0" + shows "open ((\x. a + c *\<^sub>R x) ` S)" proof - have *: "(\x. a + c *\<^sub>R x) = (\x. a + x) \ (\x. c *\<^sub>R x)" unfolding o_def .. - have "op + a ` op *\<^sub>R c ` s = (op + a \ op *\<^sub>R c) ` s" + have "op + a ` op *\<^sub>R c ` S = (op + a \ op *\<^sub>R c) ` S" by auto then show ?thesis - using assms open_translation[of "op *\<^sub>R c ` s" a] + using assms open_translation[of "op *\<^sub>R c ` S" a] unfolding * by auto qed lemma interior_translation: - fixes s :: "'a::real_normed_vector set" - shows "interior ((\x. a + x) ` s) = (\x. a + x) ` (interior s)" + fixes S :: "'a::real_normed_vector set" + shows "interior ((\x. a + x) ` S) = (\x. a + x) ` (interior S)" proof (rule set_eqI, rule) fix x - assume "x \ interior (op + a ` s)" - then obtain e where "e > 0" and e: "ball x e \ op + a ` s" + assume "x \ interior (op + a ` S)" + then obtain e where "e > 0" and e: "ball x e \ op + a ` S" unfolding mem_interior by auto - then have "ball (x - a) e \ s" + then have "ball (x - a) e \ S" unfolding subset_eq Ball_def mem_ball dist_norm by (auto simp add: diff_diff_eq) - then show "x \ op + a ` interior s" + then show "x \ op + a ` interior S" unfolding image_iff apply (rule_tac x="x - a" in bexI) unfolding mem_interior @@ -6829,27 +6838,27 @@ done next fix x - assume "x \ op + a ` interior s" - then obtain y e where "e > 0" and e: "ball y e \ s" and y: "x = a + y" + assume "x \ op + a ` interior S" + then obtain y e where "e > 0" and e: "ball y e \ S" and y: "x = a + y" unfolding image_iff Bex_def mem_interior by auto { fix z have *: "a + y - z = y + a - z" by auto assume "z \ ball x e" - then have "z - a \ s" + then have "z - a \ S" using e[unfolded subset_eq, THEN bspec[where x="z - a"]] unfolding mem_ball dist_norm y group_add_class.diff_diff_eq2 * by auto - then have "z \ op + a ` s" + then have "z \ op + a ` S" unfolding image_iff by (auto intro!: bexI[where x="z - a"]) } - then have "ball x e \ op + a ` s" + then have "ball x e \ op + a ` S" unfolding subset_eq by auto - then show "x \ interior (op + a ` s)" + then show "x \ interior (op + a ` S)" unfolding mem_interior using \e > 0\ by auto qed -text \Topological properties of linear functions.\ +subsection \Topological properties of linear functions.\ lemma linear_lim_0: assumes "bounded_linear f" @@ -6877,6 +6886,73 @@ "bounded_linear f \ continuous_on s f" using continuous_at_imp_continuous_on[of s f] using linear_continuous_at[of f] by auto +subsubsection\Relating linear images to open/closed/interior/closure.\ + +proposition open_surjective_linear_image: + fixes f :: "'a::real_normed_vector \ 'b::euclidean_space" + assumes "open A" "linear f" "surj f" + shows "open(f ` A)" +unfolding open_dist +proof clarify + fix x + assume "x \ A" + have "bounded (inv f ` Basis)" + by (simp add: finite_imp_bounded) + with bounded_pos obtain B where "B > 0" and B: "\x. x \ inv f ` Basis \ norm x \ B" + by metis + obtain e where "e > 0" and e: "\z. dist z x < e \ z \ A" + by (metis open_dist \x \ A\ \open A\) + define \ where "\ \ e / B / DIM('b)" + show "\e>0. \y. dist y (f x) < e \ y \ f ` A" + proof (intro exI conjI) + show "\ > 0" + using \e > 0\ \B > 0\ by (simp add: \_def divide_simps) (simp add: mult_less_0_iff) + have "y \ f ` A" if "dist y (f x) * (B * real DIM('b)) < e" for y + proof - + define u where "u \ y - f x" + show ?thesis + proof (rule image_eqI) + show "y = f (x + (\i\Basis. (u \ i) *\<^sub>R inv f i))" + apply (simp add: linear_add linear_setsum linear.scaleR \linear f\ surj_f_inv_f \surj f\) + apply (simp add: euclidean_representation u_def) + done + have "dist (x + (\i\Basis. (u \ i) *\<^sub>R inv f i)) x \ (\i\Basis. norm ((u \ i) *\<^sub>R inv f i))" + by (simp add: dist_norm setsum_norm_le) + also have "... = (\i\Basis. \u \ i\ * norm (inv f i))" + by (simp add: ) + also have "... \ (\i\Basis. \u \ i\) * B" + by (simp add: B setsum_distrib_right setsum_mono mult_left_mono) + also have "... \ DIM('b) * dist y (f x) * B" + apply (rule mult_right_mono [OF setsum_bounded_above]) + using \0 < B\ by (auto simp add: Basis_le_norm dist_norm u_def) + also have "... < e" + by (metis mult.commute mult.left_commute that) + finally show "x + (\i\Basis. (u \ i) *\<^sub>R inv f i) \ A" + by (rule e) + qed + qed + then show "\y. dist y (f x) < \ \ y \ f ` A" + using \e > 0\ \B > 0\ + by (auto simp: \_def divide_simps mult_less_0_iff) + qed +qed + +corollary open_bijective_linear_image_eq: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "linear f" "bij f" + shows "open(f ` A) \ open A" +proof + assume "open(f ` A)" + then have "open(f -` (f ` A))" + using assms by (force simp add: linear_continuous_at linear_conv_bounded_linear continuous_open_vimage) + then show "open A" + by (simp add: assms bij_is_inj inj_vimage_image_eq) +next + assume "open A" + then show "open(f ` A)" + by (simp add: assms bij_is_surj open_surjective_linear_image) +qed + text \Also bilinear functions, in composition form.\ lemma bilinear_continuous_at_compose: @@ -7957,7 +8033,7 @@ then show "?L \ ?R" .. qed -lemma bounded_cbox: +lemma bounded_cbox [simp]: fixes a :: "'a::euclidean_space" shows "bounded (cbox a b)" proof - @@ -8384,11 +8460,27 @@ (\x\s. (g(f x) = x)) \ (f ` s = t) \ continuous_on s f \ (\y\t. (f(g y) = y)) \ (g ` t = s) \ continuous_on t g" +lemma homeomorphismI [intro?]: + assumes "continuous_on S f" "continuous_on T g" + "f ` S \ T" "g ` T \ S" "\x. x \ S \ g(f x) = x" "\y. y \ T \ f(g y) = y" + shows "homeomorphism S T f g" + using assms by (force simp: homeomorphism_def) + lemma homeomorphism_translation: fixes a :: "'a :: real_normed_vector" shows "homeomorphism (op + a ` S) S (op + (- a)) (op + a)" unfolding homeomorphism_def by (auto simp: algebra_simps continuous_intros) +lemma homeomorphism_ident: "homeomorphism T T (\a. a) (\a. a)" + by (rule homeomorphismI) (auto simp: continuous_on_id) + +lemma homeomorphism_compose: + assumes "homeomorphism S T f g" "homeomorphism T U h k" + shows "homeomorphism S U (h o f) (g o k)" + using assms + unfolding homeomorphism_def + by (intro conjI ballI continuous_on_compose) (auto simp: image_comp [symmetric]) + lemma homeomorphism_symD: "homeomorphism S t f g \ homeomorphism t S g f" by (simp add: homeomorphism_def) @@ -8416,47 +8508,12 @@ by blast lemma homeomorphic_trans [trans]: - assumes "s homeomorphic t" - and "t homeomorphic u" - shows "s homeomorphic u" -proof - - obtain f1 g1 where fg1: "\x\s. g1 (f1 x) = x" "f1 ` s = t" - "continuous_on s f1" "\y\t. f1 (g1 y) = y" "g1 ` t = s" "continuous_on t g1" - using assms(1) unfolding homeomorphic_def homeomorphism_def by auto - obtain f2 g2 where fg2: "\x\t. g2 (f2 x) = x" "f2 ` t = u" "continuous_on t f2" - "\y\u. f2 (g2 y) = y" "g2 ` u = t" "continuous_on u g2" - using assms(2) unfolding homeomorphic_def homeomorphism_def by auto - { - fix x - assume "x\s" - then have "(g1 \ g2) ((f2 \ f1) x) = x" - using fg1(1)[THEN bspec[where x=x]] and fg2(1)[THEN bspec[where x="f1 x"]] and fg1(2) - by auto - } - moreover have "(f2 \ f1) ` s = u" - using fg1(2) fg2(2) by auto - moreover have "continuous_on s (f2 \ f1)" - using continuous_on_compose[OF fg1(3)] and fg2(3) unfolding fg1(2) by auto - moreover - { - fix y - assume "y\u" - then have "(f2 \ f1) ((g1 \ g2) y) = y" - using fg2(4)[THEN bspec[where x=y]] and fg1(4)[THEN bspec[where x="g2 y"]] and fg2(5) - by auto - } - moreover have "(g1 \ g2) ` u = s" using fg1(5) fg2(5) by auto - moreover have "continuous_on u (g1 \ g2)" - using continuous_on_compose[OF fg2(6)] and fg1(6) - unfolding fg2(5) - by auto - ultimately show ?thesis - unfolding homeomorphic_def homeomorphism_def - apply (rule_tac x="f2 \ f1" in exI) - apply (rule_tac x="g1 \ g2" in exI) - apply auto - done -qed + assumes "S homeomorphic T" + and "T homeomorphic U" + shows "S homeomorphic U" + using assms + unfolding homeomorphic_def +by (metis homeomorphism_compose) lemma homeomorphic_minimal: "s homeomorphic t \ diff -r 0efb482beb84 -r d81fb5b46a5c src/HOL/Library/Disjoint_Sets.thy --- a/src/HOL/Library/Disjoint_Sets.thy Wed Sep 21 14:20:07 2016 +0100 +++ b/src/HOL/Library/Disjoint_Sets.thy Wed Sep 21 16:59:51 2016 +0100 @@ -65,6 +65,26 @@ abbreviation "disjoint_family A \ disjoint_family_on A UNIV" +lemma disjoint_family_elem_disjnt: + assumes "infinite A" "finite C" + and df: "disjoint_family_on B A" + obtains x where "x \ A" "disjnt C (B x)" +proof - + have "False" if *: "\x \ A. \y. y \ C \ y \ B x" + proof - + obtain g where g: "\x \ A. g x \ C \ g x \ B x" + using * by metis + with df have "inj_on g A" + by (fastforce simp add: inj_on_def disjoint_family_on_def) + then have "infinite (g ` A)" + using \infinite A\ finite_image_iff by blast + then show False + by (meson \finite C\ finite_subset g image_subset_iff) + qed + then show ?thesis + by (force simp: disjnt_iff intro: that) +qed + lemma disjoint_family_onD: "disjoint_family_on A I \ i \ I \ j \ I \ i \ j \ A i \ A j = {}" by (auto simp: disjoint_family_on_def)