# HG changeset patch # User wenzelm # Date 1552942251 -3600 # Node ID 5f67c5e457e34034ba91b3175ca77103416783de # Parent eddcc7c726f3e57e73c59d328e19a3455874f457# Parent 79c8ff387ed1cdc380fb52da194db022aa59ac51 merged diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Abstract_Topology.thy --- a/src/HOL/Analysis/Abstract_Topology.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Abstract_Topology.thy Mon Mar 18 21:50:51 2019 +0100 @@ -403,8 +403,12 @@ \ closedin (subtopology X (T \ U)) S" by (simp add: closedin_subtopology) blast - -subsection \The standard Euclidean topology\ +lemma openin_trans_full: + "\openin (subtopology X U) S; openin X U\ \ openin X S" + by (simp add: openin_open_subtopology) + + +subsection \The canonical topology from the underlying type class\ abbreviation%important euclidean :: "'a::topological_space topology" where "euclidean \ topology open" @@ -1269,6 +1273,144 @@ by (simp add: Diff_eq discrete_topology_closure_of frontier_of_closures) +subsection\Locally finite collections\ + +definition locally_finite_in + where + "locally_finite_in X \ \ + (\\ \ topspace X) \ + (\x \ topspace X. \V. openin X V \ x \ V \ finite {U \ \. U \ V \ {}})" + +lemma finite_imp_locally_finite_in: + "\finite \; \\ \ topspace X\ \ locally_finite_in X \" + by (auto simp: locally_finite_in_def) + +lemma locally_finite_in_subset: + assumes "locally_finite_in X \" "\ \ \" + shows "locally_finite_in X \" +proof - + have "finite {U \ \. U \ V \ {}} \ finite {U \ \. U \ V \ {}}" for V + apply (erule rev_finite_subset) using \\ \ \\ by blast + then show ?thesis + using assms unfolding locally_finite_in_def by (fastforce simp add:) +qed + +lemma locally_finite_in_refinement: + assumes \: "locally_finite_in X \" and f: "\S. S \ \ \ f S \ S" + shows "locally_finite_in X (f ` \)" +proof - + show ?thesis + unfolding locally_finite_in_def + proof safe + fix x + assume "x \ topspace X" + then obtain V where "openin X V" "x \ V" "finite {U \ \. U \ V \ {}}" + using \ unfolding locally_finite_in_def by blast + moreover have "{U \ \. f U \ V \ {}} \ {U \ \. U \ V \ {}}" for V + using f by blast + ultimately have "finite {U \ \. f U \ V \ {}}" + using finite_subset by blast + moreover have "f ` {U \ \. f U \ V \ {}} = {U \ f ` \. U \ V \ {}}" + by blast + ultimately have "finite {U \ f ` \. U \ V \ {}}" + by (metis (no_types, lifting) finite_imageI) + then show "\V. openin X V \ x \ V \ finite {U \ f ` \. U \ V \ {}}" + using \openin X V\ \x \ V\ by blast + next + show "\x xa. \xa \ \; x \ f xa\ \ x \ topspace X" + by (meson Sup_upper \ f locally_finite_in_def subset_iff) + qed +qed + +lemma locally_finite_in_subtopology: + assumes \: "locally_finite_in X \" "\\ \ S" + shows "locally_finite_in (subtopology X S) \" + unfolding locally_finite_in_def +proof safe + fix x + assume x: "x \ topspace (subtopology X S)" + then obtain V where "openin X V" "x \ V" and fin: "finite {U \ \. U \ V \ {}}" + using \ unfolding locally_finite_in_def topspace_subtopology by blast + show "\V. openin (subtopology X S) V \ x \ V \ finite {U \ \. U \ V \ {}}" + proof (intro exI conjI) + show "openin (subtopology X S) (S \ V)" + by (simp add: \openin X V\ openin_subtopology_Int2) + have "{U \ \. U \ (S \ V) \ {}} \ {U \ \. U \ V \ {}}" + by auto + with fin show "finite {U \ \. U \ (S \ V) \ {}}" + using finite_subset by auto + show "x \ S \ V" + using x \x \ V\ by (simp add: topspace_subtopology) + qed +next + show "\x A. \x \ A; A \ \\ \ x \ topspace (subtopology X S)" + using assms unfolding locally_finite_in_def topspace_subtopology by blast +qed + + +lemma closedin_locally_finite_Union: + assumes clo: "\S. S \ \ \ closedin X S" and \: "locally_finite_in X \" + shows "closedin X (\\)" + using \ unfolding locally_finite_in_def closedin_def +proof clarify + show "openin X (topspace X - \\)" + proof (subst openin_subopen, clarify) + fix x + assume "x \ topspace X" and "x \ \\" + then obtain V where "openin X V" "x \ V" and fin: "finite {U \ \. U \ V \ {}}" + using \ unfolding locally_finite_in_def by blast + let ?T = "V - \{S \ \. S \ V \ {}}" + show "\T. openin X T \ x \ T \ T \ topspace X - \\" + proof (intro exI conjI) + show "openin X ?T" + by (metis (no_types, lifting) fin \openin X V\ clo closedin_Union mem_Collect_eq openin_diff) + show "x \ ?T" + using \x \ \\\ \x \ V\ by auto + show "?T \ topspace X - \\" + using \openin X V\ openin_subset by auto + qed + qed +qed + +lemma locally_finite_in_closure: + assumes \: "locally_finite_in X \" + shows "locally_finite_in X ((\S. X closure_of S) ` \)" + using \ unfolding locally_finite_in_def +proof (intro conjI; clarsimp) + fix x A + assume "x \ X closure_of A" + then show "x \ topspace X" + by (meson in_closure_of) +next + fix x + assume "x \ topspace X" and "\\ \ topspace X" + then obtain V where V: "openin X V" "x \ V" and fin: "finite {U \ \. U \ V \ {}}" + using \ unfolding locally_finite_in_def by blast + have eq: "{y \ f ` \. Q y} = f ` {x. x \ \ \ Q(f x)}" for f Q + by blast + have eq2: "{A \ \. X closure_of A \ V \ {}} = {A \ \. A \ V \ {}}" + using openin_Int_closure_of_eq_empty V by blast + have "finite {U \ (closure_of) X ` \. U \ V \ {}}" + by (simp add: eq eq2 fin) + with V show "\V. openin X V \ x \ V \ finite {U \ (closure_of) X ` \. U \ V \ {}}" + by blast +qed + +lemma closedin_Union_locally_finite_closure: + "locally_finite_in X \ \ closedin X (\((\S. X closure_of S) ` \))" + by (metis (mono_tags) closedin_closure_of closedin_locally_finite_Union imageE locally_finite_in_closure) + +lemma closure_of_Union_subset: "\((\S. X closure_of S) ` \) \ X closure_of (\\)" + by clarify (meson Union_upper closure_of_mono subsetD) + +lemma closure_of_locally_finite_Union: + "locally_finite_in X \ \ X closure_of (\\) = \((\S. X closure_of S) ` \)" + apply (rule closure_of_unique) + apply (simp add: SUP_upper2 Sup_le_iff closure_of_subset locally_finite_in_def) + apply (simp add: closedin_Union_locally_finite_closure) + by (simp add: Sup_le_iff closure_of_minimal) + + subsection\Continuous maps\ definition continuous_map where diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Bounded_Linear_Function.thy --- a/src/HOL/Analysis/Bounded_Linear_Function.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Bounded_Linear_Function.thy Mon Mar 18 21:50:51 2019 +0100 @@ -9,6 +9,8 @@ Topology_Euclidean_Space Operator_Norm Uniform_Limit + Function_Topology + begin lemma onorm_componentwise: @@ -733,4 +735,86 @@ bounded_linear.uniform_limit[OF bounded_linear_blinfun_apply] bounded_linear.uniform_limit[OF bounded_linear_blinfun_matrix] + +subsection \The strong operator topology on continuous linear operators\ + +text \Let \'a\ and \'b\ be two normed real vector spaces. Then the space of linear continuous +operators from \'a\ to \'b\ has a canonical norm, and therefore a canonical corresponding topology +(the type classes instantiation are given in \<^file>\Bounded_Linear_Function.thy\). + +However, there is another topology on this space, the strong operator topology, where \T\<^sub>n\ tends to +\T\ iff, for all \x\ in \'a\, then \T\<^sub>n x\ tends to \T x\. This is precisely the product topology +where the target space is endowed with the norm topology. It is especially useful when \'b\ is the set +of real numbers, since then this topology is compact. + +We can not implement it using type classes as there is already a topology, but at least we +can define it as a topology. + +Note that there is yet another (common and useful) topology on operator spaces, the weak operator +topology, defined analogously using the product topology, but where the target space is given the +weak-* topology, i.e., the pullback of the weak topology on the bidual of the space under the +canonical embedding of a space into its bidual. We do not define it there, although it could also be +defined analogously. +\ + +definition%important strong_operator_topology::"('a::real_normed_vector \\<^sub>L'b::real_normed_vector) topology" +where "strong_operator_topology = pullback_topology UNIV blinfun_apply euclidean" + +lemma strong_operator_topology_topspace: + "topspace strong_operator_topology = UNIV" +unfolding strong_operator_topology_def topspace_pullback_topology topspace_euclidean by auto + +lemma strong_operator_topology_basis: + fixes f::"('a::real_normed_vector \\<^sub>L'b::real_normed_vector)" and U::"'i \ 'b set" and x::"'i \ 'a" + assumes "finite I" "\i. i \ I \ open (U i)" + shows "openin strong_operator_topology {f. \i\I. blinfun_apply f (x i) \ U i}" +proof - + have "open {g::('a\'b). \i\I. g (x i) \ U i}" + by (rule product_topology_basis'[OF assms]) + moreover have "{f. \i\I. blinfun_apply f (x i) \ U i} + = blinfun_apply-`{g::('a\'b). \i\I. g (x i) \ U i} \ UNIV" + by auto + ultimately show ?thesis + unfolding strong_operator_topology_def by (subst openin_pullback_topology) auto +qed + +lemma strong_operator_topology_continuous_evaluation: + "continuous_on_topo strong_operator_topology euclidean (\f. blinfun_apply f x)" +proof - + have "continuous_on_topo strong_operator_topology euclidean ((\f. f x) o blinfun_apply)" + unfolding strong_operator_topology_def apply (rule continuous_on_topo_pullback) + using continuous_on_topo_UNIV continuous_on_product_coordinates by fastforce + then show ?thesis unfolding comp_def by simp +qed + +lemma continuous_on_strong_operator_topo_iff_coordinatewise: + "continuous_on_topo T strong_operator_topology f + \ (\x. continuous_on_topo T euclidean (\y. blinfun_apply (f y) x))" +proof (auto) + fix x::"'b" + assume "continuous_on_topo T strong_operator_topology f" + with continuous_on_topo_compose[OF this strong_operator_topology_continuous_evaluation] + have "continuous_on_topo T euclidean ((\z. blinfun_apply z x) o f)" + by simp + then show "continuous_on_topo T euclidean (\y. blinfun_apply (f y) x)" + unfolding comp_def by auto +next + assume *: "\x. continuous_on_topo T euclidean (\y. blinfun_apply (f y) x)" + have "continuous_on_topo T euclidean (blinfun_apply o f)" + unfolding euclidean_product_topology + apply (rule continuous_on_topo_coordinatewise_then_product, auto) + using * unfolding comp_def by auto + show "continuous_on_topo T strong_operator_topology f" + unfolding strong_operator_topology_def + apply (rule continuous_on_topo_pullback') + by (auto simp add: \continuous_on_topo T euclidean (blinfun_apply o f)\) +qed + +lemma strong_operator_topology_weaker_than_euclidean: + "continuous_on_topo euclidean strong_operator_topology (\f. f)" + by (subst continuous_on_strong_operator_topo_iff_coordinatewise, + auto simp add: continuous_on_topo_UNIV[symmetric] linear_continuous_on) + + + end diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Cartesian_Space.thy --- a/src/HOL/Analysis/Cartesian_Space.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Cartesian_Space.thy Mon Mar 18 21:50:51 2019 +0100 @@ -671,7 +671,7 @@ by (metis matrix_transpose_mul rank_mul_le_right rank_transpose) -subsection%unimportant \Lemmas for working on \real^1/2/3\\ +subsection%unimportant \Lemmas for working on \real^1/2/3/4\\ lemma exhaust_2: fixes x :: 2 @@ -699,6 +699,19 @@ lemma forall_3: "(\i::3. P i) \ P 1 \ P 2 \ P 3" by (metis exhaust_3) +lemma exhaust_4: + fixes x :: 4 + shows "x = 1 \ x = 2 \ x = 3 \ x = 4" +proof (induct x) + case (of_int z) + then have "0 \ z" and "z < 4" by simp_all + then have "z = 0 \ z = 1 \ z = 2 \ z = 3" by arith + then show ?case by auto +qed + +lemma forall_4: "(\i::4. P i) \ P 1 \ P 2 \ P 3 \ P 4" + by (metis exhaust_4) + lemma UNIV_1 [simp]: "UNIV = {1::1}" by (auto simp add: num1_eq_iff) @@ -708,6 +721,9 @@ lemma UNIV_3: "UNIV = {1::3, 2::3, 3::3}" using exhaust_3 by auto +lemma UNIV_4: "UNIV = {1::4, 2::4, 3::4, 4::4}" + using exhaust_4 by auto + lemma sum_1: "sum f (UNIV::1 set) = f 1" unfolding UNIV_1 by simp @@ -717,6 +733,9 @@ lemma sum_3: "sum f (UNIV::3 set) = f 1 + f 2 + f 3" unfolding UNIV_3 by (simp add: ac_simps) +lemma sum_4: "sum f (UNIV::4 set) = f 1 + f 2 + f 3 + f 4" + unfolding UNIV_4 by (simp add: ac_simps) + subsection%unimportant\The collapse of the general concepts to dimension one\ lemma vector_one: "(x::'a ^1) = (\ i. (x$1))" diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Continuous_Extension.thy --- a/src/HOL/Analysis/Continuous_Extension.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Continuous_Extension.thy Mon Mar 18 21:50:51 2019 +0100 @@ -14,7 +14,7 @@ so the "support" must be made explicit in the summation below!\ proposition subordinate_partition_of_unity: - fixes S :: "'a :: euclidean_space set" + fixes S :: "'a::metric_space set" assumes "S \ \\" and opC: "\T. T \ \ \ open T" and fin: "\x. x \ S \ \V. open V \ x \ V \ finite {U \ \. U \ V \ {}}" obtains F :: "['a set, 'a] \ real" @@ -26,9 +26,7 @@ case True then obtain W where "W \ \" "S \ W" by metis then show ?thesis - apply (rule_tac F = "\V x. if V = W then 1 else 0" in that) - apply (auto simp: continuous_on_const supp_sum_def support_on_def) - done + by (rule_tac F = "\V x. if V = W then 1 else 0" in that) (auto simp: supp_sum_def support_on_def) next case False have nonneg: "0 \ supp_sum (\V. setdist {x} (S - V)) \" for x @@ -37,9 +35,9 @@ proof - have "closedin (subtopology euclidean S) (S - V)" by (simp add: Diff_Diff_Int closedin_def opC openin_open_Int \V \ \\) - with that False setdist_eq_0_closedin [of S "S-V" x] setdist_pos_le [of "{x}" "S - V"] - show ?thesis - by (simp add: order_class.order.order_iff_strict) + with that False setdist_pos_le [of "{x}" "S - V"] + show ?thesis + using setdist_gt_0_closedin by fastforce qed have ss_pos: "0 < supp_sum (\V. setdist {x} (S - V)) \" if "x \ S" for x proof - @@ -50,17 +48,16 @@ then have *: "finite {A \ \. \ S \ A \ x \ closure (S - A)}" using closure_def that by (blast intro: rev_finite_subset) have "x \ closure (S - U)" - by (metis \U \ \\ \x \ U\ less_irrefl sd_pos setdist_eq_0_sing_1 that) + using \U \ \\ \x \ U\ opC open_Int_closure_eq_empty by fastforce then show ?thesis apply (simp add: setdist_eq_0_sing_1 supp_sum_def support_on_def) apply (rule ordered_comm_monoid_add_class.sum_pos2 [OF *, of U]) using \U \ \\ \x \ U\ False - apply (auto simp: setdist_pos_le sd_pos that) + apply (auto simp: sd_pos that) done qed define F where - "F \ \W x. if x \ S then setdist {x} (S - W) / supp_sum (\V. setdist {x} (S - V)) \ - else 0" + "F \ \W x. if x \ S then setdist {x} (S - W) / supp_sum (\V. setdist {x} (S - V)) \ else 0" show ?thesis proof (rule_tac F = F in that) have "continuous_on S (F U)" if "U \ \" for U @@ -302,7 +299,7 @@ text \See \cite{dugundji}.\ theorem Dugundji: - fixes f :: "'a::euclidean_space \ 'b::real_inner" + fixes f :: "'a::{metric_space,second_countable_topology} \ 'b::real_inner" assumes "convex C" "C \ {}" and cloin: "closedin (subtopology euclidean U) S" and contf: "continuous_on S f" and "f ` S \ C" @@ -325,9 +322,8 @@ by (auto simp: sd_pos \_def) obtain \ where USsub: "U - S \ \\" and nbrhd: "\U. U \ \ \ open U \ (\T. T \ \ \ U \ T)" - and fin: "\x. x \ U - S - \ \V. open V \ x \ V \ finite {U. U \ \ \ U \ V \ {}}" - using paracompact [OF USS] by auto + and fin: "\x. x \ U - S \ \V. open V \ x \ V \ finite {U. U \ \ \ U \ V \ {}}" + by (rule paracompact [OF USS]) auto have "\v a. v \ U \ v \ S \ a \ S \ T \ ball v (setdist {v} S / 2) \ dist v a \ 2 * setdist {v} S" if "T \ \" for T @@ -353,7 +349,7 @@ proof - have "dist (\ T) v < setdist {\ T} S / 2" using that VA mem_ball by blast - also have "... \ setdist {v} S" + also have "\ \ setdist {v} S" using sdle [OF \T \ \\ \v \ T\] by simp also have vS: "setdist {v} S \ dist a v" by (simp add: setdist_le_dist setdist_sym \a \ S\) @@ -362,9 +358,9 @@ using sdle that vS by force have "dist a (\ T) \ dist a v + dist v (\ T) + dist (\ T) (\ T)" by (metis add.commute add_le_cancel_left dist_commute dist_triangle2 dist_triangle_le) - also have "... \ dist a v + dist a v + dist (\ T) (\ T)" + also have "\ \ dist a v + dist a v + dist (\ T) (\ T)" using VTV by (simp add: dist_commute) - also have "... \ 2 * dist a v + 2 * setdist {\ T} S" + also have "\ \ 2 * dist a v + 2 * setdist {\ T} S" using VA [OF \T \ \\] by auto finally show ?thesis using VTS by linarith @@ -477,66 +473,65 @@ corollary Tietze: - fixes f :: "'a::euclidean_space \ 'b::real_inner" + fixes f :: "'a::{metric_space,second_countable_topology} \ 'b::real_inner" assumes "continuous_on S f" - and "closedin (subtopology euclidean U) S" - and "0 \ B" - and "\x. x \ S \ norm(f x) \ B" + and "closedin (subtopology euclidean U) S" + and "0 \ B" + and "\x. x \ S \ norm(f x) \ B" obtains g where "continuous_on U g" "\x. x \ S \ g x = f x" - "\x. x \ U \ norm(g x) \ B" - using assms -by (auto simp: image_subset_iff intro: Dugundji [of "cball 0 B" U S f]) + "\x. x \ U \ norm(g x) \ B" + using assms by (auto simp: image_subset_iff intro: Dugundji [of "cball 0 B" U S f]) corollary%unimportant Tietze_closed_interval: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + fixes f :: "'a::{metric_space,second_countable_topology} \ 'b::euclidean_space" assumes "continuous_on S f" - and "closedin (subtopology euclidean U) S" - and "cbox a b \ {}" - and "\x. x \ S \ f x \ cbox a b" + and "closedin (subtopology euclidean U) S" + and "cbox a b \ {}" + and "\x. x \ S \ f x \ cbox a b" obtains g where "continuous_on U g" "\x. x \ S \ g x = f x" - "\x. x \ U \ g x \ cbox a b" -apply (rule Dugundji [of "cbox a b" U S f]) -using assms by auto + "\x. x \ U \ g x \ cbox a b" + apply (rule Dugundji [of "cbox a b" U S f]) + using assms by auto corollary%unimportant Tietze_closed_interval_1: - fixes f :: "'a::euclidean_space \ real" + fixes f :: "'a::{metric_space,second_countable_topology} \ real" assumes "continuous_on S f" - and "closedin (subtopology euclidean U) S" - and "a \ b" - and "\x. x \ S \ f x \ cbox a b" + and "closedin (subtopology euclidean U) S" + and "a \ b" + and "\x. x \ S \ f x \ cbox a b" obtains g where "continuous_on U g" "\x. x \ S \ g x = f x" - "\x. x \ U \ g x \ cbox a b" -apply (rule Dugundji [of "cbox a b" U S f]) -using assms by (auto simp: image_subset_iff) + "\x. x \ U \ g x \ cbox a b" + apply (rule Dugundji [of "cbox a b" U S f]) + using assms by (auto simp: image_subset_iff) corollary%unimportant Tietze_open_interval: - fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + fixes f :: "'a::{metric_space,second_countable_topology} \ 'b::euclidean_space" assumes "continuous_on S f" - and "closedin (subtopology euclidean U) S" - and "box a b \ {}" - and "\x. x \ S \ f x \ box a b" + and "closedin (subtopology euclidean U) S" + and "box a b \ {}" + and "\x. x \ S \ f x \ box a b" obtains g where "continuous_on U g" "\x. x \ S \ g x = f x" - "\x. x \ U \ g x \ box a b" -apply (rule Dugundji [of "box a b" U S f]) -using assms by auto + "\x. x \ U \ g x \ box a b" + apply (rule Dugundji [of "box a b" U S f]) + using assms by auto corollary%unimportant Tietze_open_interval_1: - fixes f :: "'a::euclidean_space \ real" + fixes f :: "'a::{metric_space,second_countable_topology} \ real" assumes "continuous_on S f" - and "closedin (subtopology euclidean U) S" - and "a < b" - and no: "\x. x \ S \ f x \ box a b" + and "closedin (subtopology euclidean U) S" + and "a < b" + and no: "\x. x \ S \ f x \ box a b" obtains g where "continuous_on U g" "\x. x \ S \ g x = f x" - "\x. x \ U \ g x \ box a b" -apply (rule Dugundji [of "box a b" U S f]) -using assms by (auto simp: image_subset_iff) + "\x. x \ U \ g x \ box a b" + apply (rule Dugundji [of "box a b" U S f]) + using assms by (auto simp: image_subset_iff) corollary%unimportant Tietze_unbounded: - fixes f :: "'a::euclidean_space \ 'b::real_inner" + fixes f :: "'a::{metric_space,second_countable_topology} \ 'b::real_inner" assumes "continuous_on S f" - and "closedin (subtopology euclidean U) S" + and "closedin (subtopology euclidean U) S" obtains g where "continuous_on U g" "\x. x \ S \ g x = f x" -apply (rule Dugundji [of UNIV U S f]) -using assms by auto + apply (rule Dugundji [of UNIV U S f]) + using assms by auto end diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Elementary_Metric_Spaces.thy --- a/src/HOL/Analysis/Elementary_Metric_Spaces.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Elementary_Metric_Spaces.thy Mon Mar 18 21:50:51 2019 +0100 @@ -3170,4 +3170,71 @@ lemma setdist_le_sing: "x \ S ==> setdist S T \ setdist {x} T" using setdist_subset_left by auto +lemma infdist_eq_setdist: "infdist x A = setdist {x} A" + by (simp add: infdist_def setdist_def Setcompr_eq_image) + +lemma setdist_eq_infdist: "setdist A B = (if A = {} then 0 else INF a\A. infdist a B)" +proof - + have "Inf {dist x y |x y. x \ A \ y \ B} = (INF x\A. Inf (dist x ` B))" + if "b \ B" "a \ A" for a b + proof (rule order_antisym) + have "Inf {dist x y |x y. x \ A \ y \ B} \ Inf (dist x ` B)" + if "b \ B" "a \ A" "x \ A" for x + proof - + have *: "\b'. b' \ B \ Inf {dist x y |x y. x \ A \ y \ B} \ dist x b'" + by (metis (mono_tags, lifting) ex_in_conv setdist_def setdist_le_dist that(3)) + show ?thesis + using that by (subst conditionally_complete_lattice_class.le_cInf_iff) (auto simp: *)+ + qed + then show "Inf {dist x y |x y. x \ A \ y \ B} \ (INF x\A. Inf (dist x ` B))" + using that + by (subst conditionally_complete_lattice_class.le_cInf_iff) (auto simp: bdd_below_def) + next + have *: "\x y. \b \ B; a \ A; x \ A; y \ B\ \ \a\A. Inf (dist a ` B) \ dist x y" + by (meson bdd_below_image_dist cINF_lower) + show "(INF x\A. Inf (dist x ` B)) \ Inf {dist x y |x y. x \ A \ y \ B}" + proof (rule conditionally_complete_lattice_class.cInf_mono) + show "bdd_below ((\x. Inf (dist x ` B)) ` A)" + by (metis (no_types, lifting) bdd_belowI2 ex_in_conv infdist_def infdist_nonneg that(1)) + qed (use that in \auto simp: *\) + qed + then show ?thesis + by (auto simp: setdist_def infdist_def) +qed + +lemma continuous_on_infdist [continuous_intros]: "continuous_on B (\y. infdist y A)" + by (simp add: continuous_on_setdist infdist_eq_setdist) + +proposition setdist_attains_inf: + assumes "compact B" "B \ {}" + obtains y where "y \ B" "setdist A B = infdist y A" +proof (cases "A = {}") + case True + then show thesis + by (metis assms diameter_compact_attained infdist_def setdist_def that) +next + case False + obtain y where "y \ B" and min: "\y'. y' \ B \ infdist y A \ infdist y' A" + using continuous_attains_inf [OF assms continuous_on_infdist] by blast + show thesis + proof + have "setdist A B = (INF y\B. infdist y A)" + by (metis \B \ {}\ setdist_eq_infdist setdist_sym) + also have "\ = infdist y A" + proof (rule order_antisym) + show "(INF y\B. infdist y A) \ infdist y A" + proof (rule cInf_lower) + show "infdist y A \ (\y. infdist y A) ` B" + using \y \ B\ by blast + show "bdd_below ((\y. infdist y A) ` B)" + by (meson bdd_belowI2 infdist_nonneg) + qed + next + show "infdist y A \ (INF y\B. infdist y A)" + by (simp add: \B \ {}\ cINF_greatest min) + qed + finally show "setdist A B = infdist y A" . + qed (fact \y \ B\) +qed + end \ No newline at end of file diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Elementary_Normed_Spaces.thy --- a/src/HOL/Analysis/Elementary_Normed_Spaces.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Elementary_Normed_Spaces.thy Mon Mar 18 21:50:51 2019 +0100 @@ -810,6 +810,9 @@ shows "\ compact (UNIV::'a set)" by (simp add: compact_eq_bounded_closed) +lemma not_compact_space_euclideanreal [simp]: "\ compact_space euclideanreal" + by (simp add: compact_space_def) + text\Representing sets as the union of a chain of compact sets.\ lemma closed_Union_compact_subsets: fixes S :: "'a::{heine_borel,real_normed_vector} set" diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Finite_Product_Measure.thy --- a/src/HOL/Analysis/Finite_Product_Measure.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Finite_Product_Measure.thy Mon Mar 18 21:50:51 2019 +0100 @@ -5,7 +5,7 @@ section \Finite Product Measure\ theory Finite_Product_Measure -imports Binary_Product_Measure +imports Binary_Product_Measure Function_Topology begin lemma PiE_choice: "(\f\Pi\<^sub>E I F. \i\I. P i (f i)) \ (\i\I. \x\F i. P i x)" @@ -1202,4 +1202,142 @@ with E show ?thesis by auto qed + + +subsection \Measurability\ + +text \There are two natural sigma-algebras on a product space: the borel sigma algebra, +generated by open sets in the product, and the product sigma algebra, countably generated by +products of measurable sets along finitely many coordinates. The second one is defined and studied +in \<^file>\Finite_Product_Measure.thy\. + +These sigma-algebra share a lot of natural properties (measurability of coordinates, for instance), +but there is a fundamental difference: open sets are generated by arbitrary unions, not only +countable ones, so typically many open sets will not be measurable with respect to the product sigma +algebra (while all sets in the product sigma algebra are borel). The two sigma algebras coincide +only when everything is countable (i.e., the product is countable, and the borel sigma algebra in +the factor is countably generated). + +In this paragraph, we develop basic measurability properties for the borel sigma algebra, and +compare it with the product sigma algebra as explained above. +\ + +lemma measurable_product_coordinates [measurable (raw)]: + "(\x. x i) \ measurable borel borel" +by (rule borel_measurable_continuous_on1[OF continuous_on_product_coordinates]) + +lemma measurable_product_then_coordinatewise: + fixes f::"'a \ 'b \ ('c::topological_space)" + assumes [measurable]: "f \ borel_measurable M" + shows "(\x. f x i) \ borel_measurable M" +proof - + have "(\x. f x i) = (\y. y i) o f" + unfolding comp_def by auto + then show ?thesis by simp +qed + +text \To compare the Borel sigma algebra with the product sigma algebra, we give a presentation +of the product sigma algebra that is more similar to the one we used above for the product +topology.\ + +lemma sets_PiM_finite: + "sets (Pi\<^sub>M I M) = sigma_sets (\\<^sub>E i\I. space (M i)) + {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}}" +proof + have "{(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}} \ sets (Pi\<^sub>M I M)" + proof (auto) + fix X assume H: "\i. X i \ sets (M i)" "finite {i. X i \ space (M i)}" + then have *: "X i \ sets (M i)" for i by simp + define J where "J = {i \ I. X i \ space (M i)}" + have "finite J" "J \ I" unfolding J_def using H by auto + define Y where "Y = (\\<^sub>E j\J. X j)" + have "prod_emb I M J Y \ sets (Pi\<^sub>M I M)" + unfolding Y_def apply (rule sets_PiM_I) using \finite J\ \J \ I\ * by auto + moreover have "prod_emb I M J Y = (\\<^sub>E i\I. X i)" + unfolding prod_emb_def Y_def J_def using H sets.sets_into_space[OF *] + by (auto simp add: PiE_iff, blast) + ultimately show "Pi\<^sub>E I X \ sets (Pi\<^sub>M I M)" by simp + qed + then show "sigma_sets (\\<^sub>E i\I. space (M i)) {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}} + \ sets (Pi\<^sub>M I M)" + by (metis (mono_tags, lifting) sets.sigma_sets_subset' sets.top space_PiM) + + have *: "\X. {f. (\i\I. f i \ space (M i)) \ f \ extensional I \ f i \ A} = Pi\<^sub>E I X \ + (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}" + if "i \ I" "A \ sets (M i)" for i A + proof - + define X where "X = (\j. if j = i then A else space (M j))" + have "{f. (\i\I. f i \ space (M i)) \ f \ extensional I \ f i \ A} = Pi\<^sub>E I X" + unfolding X_def using sets.sets_into_space[OF \A \ sets (M i)\] \i \ I\ + by (auto simp add: PiE_iff extensional_def, metis subsetCE, metis) + moreover have "X j \ sets (M j)" for j + unfolding X_def using \A \ sets (M i)\ by auto + moreover have "finite {j. X j \ space (M j)}" + unfolding X_def by simp + ultimately show ?thesis by auto + qed + show "sets (Pi\<^sub>M I M) \ sigma_sets (\\<^sub>E i\I. space (M i)) {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}}" + unfolding sets_PiM_single + apply (rule sigma_sets_mono') + apply (auto simp add: PiE_iff *) + done +qed + +lemma sets_PiM_subset_borel: + "sets (Pi\<^sub>M UNIV (\_. borel)) \ sets borel" +proof - + have *: "Pi\<^sub>E UNIV X \ sets borel" if [measurable]: "\i. X i \ sets borel" "finite {i. X i \ UNIV}" for X::"'a \ 'b set" + proof - + define I where "I = {i. X i \ UNIV}" + have "finite I" unfolding I_def using that by simp + have "Pi\<^sub>E UNIV X = (\i\I. (\x. x i)-`(X i) \ space borel) \ space borel" + unfolding I_def by auto + also have "... \ sets borel" + using that \finite I\ by measurable + finally show ?thesis by simp + qed + then have "{(\\<^sub>E i\UNIV. X i) |X::('a \ 'b set). (\i. X i \ sets borel) \ finite {i. X i \ space borel}} \ sets borel" + by auto + then show ?thesis unfolding sets_PiM_finite space_borel + by (simp add: * sets.sigma_sets_subset') +qed + +proposition sets_PiM_equal_borel: + "sets (Pi\<^sub>M UNIV (\i::('a::countable). borel::('b::second_countable_topology measure))) = sets borel" +proof + obtain K::"('a \ 'b) set set" where K: "topological_basis K" "countable K" + "\k. k \ K \ \X. (k = Pi\<^sub>E UNIV X) \ (\i. open (X i)) \ finite {i. X i \ UNIV}" + using product_topology_countable_basis by fast + have *: "k \ sets (Pi\<^sub>M UNIV (\_. borel))" if "k \ K" for k + proof - + obtain X where H: "k = Pi\<^sub>E UNIV X" "\i. open (X i)" "finite {i. X i \ UNIV}" + using K(3)[OF \k \ K\] by blast + show ?thesis unfolding H(1) sets_PiM_finite space_borel using borel_open[OF H(2)] H(3) by auto + qed + have **: "U \ sets (Pi\<^sub>M UNIV (\_. borel))" if "open U" for U::"('a \ 'b) set" + proof - + obtain B where "B \ K" "U = (\B)" + using \open U\ \topological_basis K\ by (metis topological_basis_def) + have "countable B" using \B \ K\ \countable K\ countable_subset by blast + moreover have "k \ sets (Pi\<^sub>M UNIV (\_. borel))" if "k \ B" for k + using \B \ K\ * that by auto + ultimately show ?thesis unfolding \U = (\B)\ by auto + qed + have "sigma_sets UNIV (Collect open) \ sets (Pi\<^sub>M UNIV (\i::'a. (borel::('b measure))))" + apply (rule sets.sigma_sets_subset') using ** by auto + then show "sets (borel::('a \ 'b) measure) \ sets (Pi\<^sub>M UNIV (\_. borel))" + unfolding borel_def by auto +qed (simp add: sets_PiM_subset_borel) + +lemma measurable_coordinatewise_then_product: + fixes f::"'a \ ('b::countable) \ ('c::second_countable_topology)" + assumes [measurable]: "\i. (\x. f x i) \ borel_measurable M" + shows "f \ borel_measurable M" +proof - + have "f \ measurable M (Pi\<^sub>M UNIV (\_. borel))" + by (rule measurable_PiM_single', auto simp add: assms) + then show ?thesis using sets_PiM_equal_borel measurable_cong_sets by blast +qed + + end diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Function_Topology.thy --- a/src/HOL/Analysis/Function_Topology.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Function_Topology.thy Mon Mar 18 21:50:51 2019 +0100 @@ -3,7 +3,7 @@ *) theory Function_Topology -imports Topology_Euclidean_Space Bounded_Linear_Function Finite_Product_Measure +imports Topology_Euclidean_Space begin @@ -945,24 +945,37 @@ lemma continuous_on_product_coordinates [simp]: "continuous_on UNIV (\x. x i::('b::topological_space))" -unfolding continuous_on_topo_UNIV euclidean_product_topology -by (rule continuous_on_topo_product_coordinates, simp) + unfolding continuous_on_topo_UNIV euclidean_product_topology + by (rule continuous_on_topo_product_coordinates, simp) lemma continuous_on_coordinatewise_then_product [intro, continuous_intros]: - assumes "\i. continuous_on UNIV (\x. f x i)" - shows "continuous_on UNIV f" -using assms unfolding continuous_on_topo_UNIV euclidean_product_topology -by (rule continuous_on_topo_coordinatewise_then_product, simp) + fixes f :: "('a \ real) \ 'b \ real" + assumes "\i. continuous_on S (\x. f x i)" + shows "continuous_on S f" + using continuous_on_topo_coordinatewise_then_product [of UNIV, where T = "\i. euclideanreal"] + by (metis UNIV_I assms continuous_on_continuous_on_topo euclidean_product_topology) -lemma continuous_on_product_then_coordinatewise: +lemma continuous_on_product_then_coordinatewise_UNIV: assumes "continuous_on UNIV f" shows "continuous_on UNIV (\x. f x i)" using assms unfolding continuous_on_topo_UNIV euclidean_product_topology by (rule continuous_on_topo_product_then_coordinatewise(1), simp) -lemma continuous_on_product_coordinatewise_iff: - "continuous_on UNIV f \ (\i. continuous_on UNIV (\x. f x i))" -by (auto intro: continuous_on_product_then_coordinatewise) +lemma continuous_on_product_then_coordinatewise: + assumes "continuous_on S f" + shows "continuous_on S (\x. f x i)" +proof - + have "continuous_on S ((\q. q i) \ f)" + by (metis assms continuous_on_compose continuous_on_id + continuous_on_product_then_coordinatewise_UNIV continuous_on_subset subset_UNIV) + then show ?thesis + by auto +qed + +lemma continuous_on_coordinatewise_iff: + fixes f :: "('a \ real) \ 'b \ real" + shows "continuous_on (A \ S) f \ (\i. continuous_on (A \ S) (\x. f x i))" + by (auto simp: continuous_on_product_then_coordinatewise) subsubsection%important \Topological countability for product spaces\ @@ -1194,86 +1207,6 @@ using product_topology_countable_basis topological_basis_imp_subbasis by auto -subsection \The strong operator topology on continuous linear operators\ (* FIX ME mv*) - -text \Let \'a\ and \'b\ be two normed real vector spaces. Then the space of linear continuous -operators from \'a\ to \'b\ has a canonical norm, and therefore a canonical corresponding topology -(the type classes instantiation are given in \<^file>\Bounded_Linear_Function.thy\). - -However, there is another topology on this space, the strong operator topology, where \T\<^sub>n\ tends to -\T\ iff, for all \x\ in \'a\, then \T\<^sub>n x\ tends to \T x\. This is precisely the product topology -where the target space is endowed with the norm topology. It is especially useful when \'b\ is the set -of real numbers, since then this topology is compact. - -We can not implement it using type classes as there is already a topology, but at least we -can define it as a topology. - -Note that there is yet another (common and useful) topology on operator spaces, the weak operator -topology, defined analogously using the product topology, but where the target space is given the -weak-* topology, i.e., the pullback of the weak topology on the bidual of the space under the -canonical embedding of a space into its bidual. We do not define it there, although it could also be -defined analogously. -\ - -definition%important strong_operator_topology::"('a::real_normed_vector \\<^sub>L'b::real_normed_vector) topology" -where "strong_operator_topology = pullback_topology UNIV blinfun_apply euclidean" - -lemma strong_operator_topology_topspace: - "topspace strong_operator_topology = UNIV" -unfolding strong_operator_topology_def topspace_pullback_topology topspace_euclidean by auto - -lemma strong_operator_topology_basis: - fixes f::"('a::real_normed_vector \\<^sub>L'b::real_normed_vector)" and U::"'i \ 'b set" and x::"'i \ 'a" - assumes "finite I" "\i. i \ I \ open (U i)" - shows "openin strong_operator_topology {f. \i\I. blinfun_apply f (x i) \ U i}" -proof - - have "open {g::('a\'b). \i\I. g (x i) \ U i}" - by (rule product_topology_basis'[OF assms]) - moreover have "{f. \i\I. blinfun_apply f (x i) \ U i} - = blinfun_apply-`{g::('a\'b). \i\I. g (x i) \ U i} \ UNIV" - by auto - ultimately show ?thesis - unfolding strong_operator_topology_def by (subst openin_pullback_topology) auto -qed - -lemma strong_operator_topology_continuous_evaluation: - "continuous_on_topo strong_operator_topology euclidean (\f. blinfun_apply f x)" -proof - - have "continuous_on_topo strong_operator_topology euclidean ((\f. f x) o blinfun_apply)" - unfolding strong_operator_topology_def apply (rule continuous_on_topo_pullback) - using continuous_on_topo_UNIV continuous_on_product_coordinates by fastforce - then show ?thesis unfolding comp_def by simp -qed - -lemma continuous_on_strong_operator_topo_iff_coordinatewise: - "continuous_on_topo T strong_operator_topology f - \ (\x. continuous_on_topo T euclidean (\y. blinfun_apply (f y) x))" -proof (auto) - fix x::"'b" - assume "continuous_on_topo T strong_operator_topology f" - with continuous_on_topo_compose[OF this strong_operator_topology_continuous_evaluation] - have "continuous_on_topo T euclidean ((\z. blinfun_apply z x) o f)" - by simp - then show "continuous_on_topo T euclidean (\y. blinfun_apply (f y) x)" - unfolding comp_def by auto -next - assume *: "\x. continuous_on_topo T euclidean (\y. blinfun_apply (f y) x)" - have "continuous_on_topo T euclidean (blinfun_apply o f)" - unfolding euclidean_product_topology - apply (rule continuous_on_topo_coordinatewise_then_product, auto) - using * unfolding comp_def by auto - show "continuous_on_topo T strong_operator_topology f" - unfolding strong_operator_topology_def - apply (rule continuous_on_topo_pullback') - by (auto simp add: \continuous_on_topo T euclidean (blinfun_apply o f)\) -qed - -lemma strong_operator_topology_weaker_than_euclidean: - "continuous_on_topo euclidean strong_operator_topology (\f. f)" - by (subst continuous_on_strong_operator_topo_iff_coordinatewise, - auto simp add: continuous_on_topo_UNIV[symmetric] linear_continuous_on) - - subsection \Metrics on product spaces\ @@ -1650,142 +1583,4 @@ instance "fun" :: (countable, polish_space) polish_space by standard - - - -subsection \Measurability\ (*FIX ME move? *) - -text \There are two natural sigma-algebras on a product space: the borel sigma algebra, -generated by open sets in the product, and the product sigma algebra, countably generated by -products of measurable sets along finitely many coordinates. The second one is defined and studied -in \<^file>\Finite_Product_Measure.thy\. - -These sigma-algebra share a lot of natural properties (measurability of coordinates, for instance), -but there is a fundamental difference: open sets are generated by arbitrary unions, not only -countable ones, so typically many open sets will not be measurable with respect to the product sigma -algebra (while all sets in the product sigma algebra are borel). The two sigma algebras coincide -only when everything is countable (i.e., the product is countable, and the borel sigma algebra in -the factor is countably generated). - -In this paragraph, we develop basic measurability properties for the borel sigma algebra, and -compare it with the product sigma algebra as explained above. -\ - -lemma measurable_product_coordinates [measurable (raw)]: - "(\x. x i) \ measurable borel borel" -by (rule borel_measurable_continuous_on1[OF continuous_on_product_coordinates]) - -lemma measurable_product_then_coordinatewise: - fixes f::"'a \ 'b \ ('c::topological_space)" - assumes [measurable]: "f \ borel_measurable M" - shows "(\x. f x i) \ borel_measurable M" -proof - - have "(\x. f x i) = (\y. y i) o f" - unfolding comp_def by auto - then show ?thesis by simp -qed - -text \To compare the Borel sigma algebra with the product sigma algebra, we give a presentation -of the product sigma algebra that is more similar to the one we used above for the product -topology.\ - -lemma sets_PiM_finite: - "sets (Pi\<^sub>M I M) = sigma_sets (\\<^sub>E i\I. space (M i)) - {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}}" -proof - have "{(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}} \ sets (Pi\<^sub>M I M)" - proof (auto) - fix X assume H: "\i. X i \ sets (M i)" "finite {i. X i \ space (M i)}" - then have *: "X i \ sets (M i)" for i by simp - define J where "J = {i \ I. X i \ space (M i)}" - have "finite J" "J \ I" unfolding J_def using H by auto - define Y where "Y = (\\<^sub>E j\J. X j)" - have "prod_emb I M J Y \ sets (Pi\<^sub>M I M)" - unfolding Y_def apply (rule sets_PiM_I) using \finite J\ \J \ I\ * by auto - moreover have "prod_emb I M J Y = (\\<^sub>E i\I. X i)" - unfolding prod_emb_def Y_def J_def using H sets.sets_into_space[OF *] - by (auto simp add: PiE_iff, blast) - ultimately show "Pi\<^sub>E I X \ sets (Pi\<^sub>M I M)" by simp - qed - then show "sigma_sets (\\<^sub>E i\I. space (M i)) {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}} - \ sets (Pi\<^sub>M I M)" - by (metis (mono_tags, lifting) sets.sigma_sets_subset' sets.top space_PiM) - - have *: "\X. {f. (\i\I. f i \ space (M i)) \ f \ extensional I \ f i \ A} = Pi\<^sub>E I X \ - (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}" - if "i \ I" "A \ sets (M i)" for i A - proof - - define X where "X = (\j. if j = i then A else space (M j))" - have "{f. (\i\I. f i \ space (M i)) \ f \ extensional I \ f i \ A} = Pi\<^sub>E I X" - unfolding X_def using sets.sets_into_space[OF \A \ sets (M i)\] \i \ I\ - by (auto simp add: PiE_iff extensional_def, metis subsetCE, metis) - moreover have "X j \ sets (M j)" for j - unfolding X_def using \A \ sets (M i)\ by auto - moreover have "finite {j. X j \ space (M j)}" - unfolding X_def by simp - ultimately show ?thesis by auto - qed - show "sets (Pi\<^sub>M I M) \ sigma_sets (\\<^sub>E i\I. space (M i)) {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}}" - unfolding sets_PiM_single - apply (rule sigma_sets_mono') - apply (auto simp add: PiE_iff *) - done -qed - -lemma sets_PiM_subset_borel: - "sets (Pi\<^sub>M UNIV (\_. borel)) \ sets borel" -proof - - have *: "Pi\<^sub>E UNIV X \ sets borel" if [measurable]: "\i. X i \ sets borel" "finite {i. X i \ UNIV}" for X::"'a \ 'b set" - proof - - define I where "I = {i. X i \ UNIV}" - have "finite I" unfolding I_def using that by simp - have "Pi\<^sub>E UNIV X = (\i\I. (\x. x i)-`(X i) \ space borel) \ space borel" - unfolding I_def by auto - also have "... \ sets borel" - using that \finite I\ by measurable - finally show ?thesis by simp - qed - then have "{(\\<^sub>E i\UNIV. X i) |X::('a \ 'b set). (\i. X i \ sets borel) \ finite {i. X i \ space borel}} \ sets borel" - by auto - then show ?thesis unfolding sets_PiM_finite space_borel - by (simp add: * sets.sigma_sets_subset') -qed - -proposition sets_PiM_equal_borel: - "sets (Pi\<^sub>M UNIV (\i::('a::countable). borel::('b::second_countable_topology measure))) = sets borel" -proof - obtain K::"('a \ 'b) set set" where K: "topological_basis K" "countable K" - "\k. k \ K \ \X. (k = Pi\<^sub>E UNIV X) \ (\i. open (X i)) \ finite {i. X i \ UNIV}" - using product_topology_countable_basis by fast - have *: "k \ sets (Pi\<^sub>M UNIV (\_. borel))" if "k \ K" for k - proof - - obtain X where H: "k = Pi\<^sub>E UNIV X" "\i. open (X i)" "finite {i. X i \ UNIV}" - using K(3)[OF \k \ K\] by blast - show ?thesis unfolding H(1) sets_PiM_finite space_borel using borel_open[OF H(2)] H(3) by auto - qed - have **: "U \ sets (Pi\<^sub>M UNIV (\_. borel))" if "open U" for U::"('a \ 'b) set" - proof - - obtain B where "B \ K" "U = (\B)" - using \open U\ \topological_basis K\ by (metis topological_basis_def) - have "countable B" using \B \ K\ \countable K\ countable_subset by blast - moreover have "k \ sets (Pi\<^sub>M UNIV (\_. borel))" if "k \ B" for k - using \B \ K\ * that by auto - ultimately show ?thesis unfolding \U = (\B)\ by auto - qed - have "sigma_sets UNIV (Collect open) \ sets (Pi\<^sub>M UNIV (\i::'a. (borel::('b measure))))" - apply (rule sets.sigma_sets_subset') using ** by auto - then show "sets (borel::('a \ 'b) measure) \ sets (Pi\<^sub>M UNIV (\_. borel))" - unfolding borel_def by auto -qed (simp add: sets_PiM_subset_borel) - -lemma measurable_coordinatewise_then_product: - fixes f::"'a \ ('b::countable) \ ('c::second_countable_topology)" - assumes [measurable]: "\i. (\x. f x i) \ borel_measurable M" - shows "f \ borel_measurable M" -proof - - have "f \ measurable M (Pi\<^sub>M UNIV (\_. borel))" - by (rule measurable_PiM_single', auto simp add: assms) - then show ?thesis using sets_PiM_equal_borel measurable_cong_sets by blast -qed - end diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Homotopy.thy --- a/src/HOL/Analysis/Homotopy.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Homotopy.thy Mon Mar 18 21:50:51 2019 +0100 @@ -3652,6 +3652,11 @@ using \S \ box a b\ by auto qed +corollary bounded_path_connected_Compl_real: + fixes S :: "real set" + assumes "bounded S" "path_connected(- S)" shows "S = {}" + by (simp add: assms bounded_connected_Compl_real path_connected_imp_connected) + lemma bounded_connected_Compl_1: fixes S :: "'a::{euclidean_space} set" assumes "bounded S" and conn: "connected(- S)" and 1: "DIM('a) = 1" diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Starlike.thy --- a/src/HOL/Analysis/Starlike.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Starlike.thy Mon Mar 18 21:50:51 2019 +0100 @@ -6715,13 +6715,12 @@ subsection\Paracompactness\ proposition paracompact: - fixes S :: "'a :: euclidean_space set" + fixes S :: "'a :: {metric_space,second_countable_topology} set" assumes "S \ \\" and opC: "\T. T \ \ \ open T" obtains \' where "S \ \ \'" and "\U. U \ \' \ open U \ (\T. T \ \ \ U \ T)" and "\x. x \ S - \ \V. open V \ x \ V \ - finite {U. U \ \' \ (U \ V \ {})}" + \ \V. open V \ x \ V \ finite {U. U \ \' \ (U \ V \ {})}" proof (cases "S = {}") case True with that show ?thesis by blast next @@ -6737,7 +6736,7 @@ apply (rule_tac x = "ball x e" in exI) using \T \ \\ apply (simp add: closure_minimal) - done + using closed_cball closure_minimal by blast qed then obtain F G where Gin: "x \ G x" and oG: "open (G x)" and clos: "closure (G x) \ F x" and Fin: "F x \ \" @@ -6802,7 +6801,7 @@ qed corollary paracompact_closedin: - fixes S :: "'a :: euclidean_space set" + fixes S :: "'a :: {metric_space,second_countable_topology} set" assumes cin: "closedin (subtopology euclidean U) S" and oin: "\T. T \ \ \ openin (subtopology euclidean U) T" and "S \ \\" @@ -6825,7 +6824,7 @@ obtain \ where "U \ \\" and D1: "\U. U \ \ \ open U \ (\T. T \ insert (- K) (F ` \) \ U \ T)" and D2: "\x. x \ U \ \V. open V \ x \ V \ finite {U \ \. U \ V \ {}}" - using paracompact [OF 1 2] by auto + by (blast intro: paracompact [OF 1 2]) let ?C = "{U \ V |V. V \ \ \ (V \ K \ {})}" show ?thesis proof (rule_tac \' = "{U \ V |V. V \ \ \ (V \ K \ {})}" in that) @@ -6847,7 +6846,7 @@ qed corollary%unimportant paracompact_closed: - fixes S :: "'a :: euclidean_space set" + fixes S :: "'a :: {metric_space,second_countable_topology} set" assumes "closed S" and opC: "\T. T \ \ \ open T" and "S \ \\" @@ -6855,7 +6854,7 @@ and "\U. U \ \' \ open U \ (\T. T \ \ \ U \ T)" and "\x. \V. open V \ x \ V \ finite {U. U \ \' \ (U \ V \ {})}" -using paracompact_closedin [of UNIV S \] assms by auto + by (rule paracompact_closedin [of UNIV S \]) (auto simp: assms) subsection%unimportant\Closed-graph characterization of continuity\ diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Mon Mar 18 21:50:51 2019 +0100 @@ -2241,24 +2241,22 @@ subsection \Set Distance\ lemma setdist_compact_closed: - fixes S :: "'a::{heine_borel,real_normed_vector} set" - assumes S: "compact S" and T: "closed T" - and "S \ {}" "T \ {}" - shows "\x \ S. \y \ T. dist x y = setdist S T" + fixes A :: "'a::heine_borel set" + assumes A: "compact A" and B: "closed B" + and "A \ {}" "B \ {}" + shows "\x \ A. \y \ B. dist x y = setdist A B" proof - - have "(\x\ S. \y \ T. {x - y}) \ {}" - using assms by blast - then have "\x \ S. \y \ T. dist x y \ setdist S T" - apply (rule distance_attains_inf [where a=0, OF compact_closed_differences [OF S T]]) - apply (simp add: dist_norm le_setdist_iff) - apply blast - done - then show ?thesis - by (blast intro!: antisym [OF _ setdist_le_dist] ) + obtain x where "x \ A" "setdist A B = infdist x B" + by (metis A assms(3) setdist_attains_inf setdist_sym) + moreover + obtain y where"y \ B" "infdist x B = dist x y" + using B \B \ {}\ infdist_attains_inf by blast + ultimately show ?thesis + using \x \ A\ \y \ B\ by auto qed lemma setdist_closed_compact: - fixes S :: "'a::{heine_borel,real_normed_vector} set" + fixes S :: "'a::heine_borel set" assumes S: "closed S" and T: "compact T" and "S \ {}" "T \ {}" shows "\x \ S. \y \ T. dist x y = setdist S T" @@ -2266,76 +2264,71 @@ by (metis dist_commute setdist_sym) lemma setdist_eq_0_compact_closed: - fixes S :: "'a::{heine_borel,real_normed_vector} set" assumes S: "compact S" and T: "closed T" shows "setdist S T = 0 \ S = {} \ T = {} \ S \ T \ {}" - apply (cases "S = {} \ T = {}", force) - using setdist_compact_closed [OF S T] - apply (force intro: setdist_eq_0I ) - done +proof (cases "S = {} \ T = {}") + case True + then show ?thesis + by force +next + case False + then show ?thesis + by (metis S T disjoint_iff_not_equal in_closed_iff_infdist_zero setdist_attains_inf setdist_eq_0I setdist_sym) +qed corollary setdist_gt_0_compact_closed: - fixes S :: "'a::{heine_borel,real_normed_vector} set" assumes S: "compact S" and T: "closed T" shows "setdist S T > 0 \ (S \ {} \ T \ {} \ S \ T = {})" - using setdist_pos_le [of S T] setdist_eq_0_compact_closed [OF assms] - by linarith + using setdist_pos_le [of S T] setdist_eq_0_compact_closed [OF assms] by linarith lemma setdist_eq_0_closed_compact: - fixes S :: "'a::{heine_borel,real_normed_vector} set" assumes S: "closed S" and T: "compact T" shows "setdist S T = 0 \ S = {} \ T = {} \ S \ T \ {}" using setdist_eq_0_compact_closed [OF T S] by (metis Int_commute setdist_sym) lemma setdist_eq_0_bounded: - fixes S :: "'a::{heine_borel,real_normed_vector} set" + fixes S :: "'a::heine_borel set" assumes "bounded S \ bounded T" - shows "setdist S T = 0 \ S = {} \ T = {} \ closure S \ closure T \ {}" - apply (cases "S = {} \ T = {}", force) - using setdist_eq_0_compact_closed [of "closure S" "closure T"] - setdist_eq_0_closed_compact [of "closure S" "closure T"] assms - apply (force simp add: bounded_closure compact_eq_bounded_closed) - done + shows "setdist S T = 0 \ S = {} \ T = {} \ closure S \ closure T \ {}" +proof (cases "S = {} \ T = {}") + case False + then show ?thesis + using setdist_eq_0_compact_closed [of "closure S" "closure T"] + setdist_eq_0_closed_compact [of "closure S" "closure T"] assms + by (force simp: bounded_closure compact_eq_bounded_closed) +qed force lemma setdist_eq_0_sing_1: - fixes S :: "'a::{heine_borel,real_normed_vector} set" - shows "setdist {x} S = 0 \ S = {} \ x \ closure S" - by (auto simp: setdist_eq_0_bounded) + "setdist {x} S = 0 \ S = {} \ x \ closure S" + by (metis in_closure_iff_infdist_zero infdist_def infdist_eq_setdist) lemma setdist_eq_0_sing_2: - fixes S :: "'a::{heine_borel,real_normed_vector} set" - shows "setdist S {x} = 0 \ S = {} \ x \ closure S" - by (auto simp: setdist_eq_0_bounded) + "setdist S {x} = 0 \ S = {} \ x \ closure S" + by (metis setdist_eq_0_sing_1 setdist_sym) lemma setdist_neq_0_sing_1: - fixes S :: "'a::{heine_borel,real_normed_vector} set" - shows "\setdist {x} S = a; a \ 0\ \ S \ {} \ x \ closure S" - by (auto simp: setdist_eq_0_sing_1) + "\setdist {x} S = a; a \ 0\ \ S \ {} \ x \ closure S" + by (metis setdist_closure_2 setdist_empty2 setdist_eq_0I singletonI) lemma setdist_neq_0_sing_2: - fixes S :: "'a::{heine_borel,real_normed_vector} set" - shows "\setdist S {x} = a; a \ 0\ \ S \ {} \ x \ closure S" - by (auto simp: setdist_eq_0_sing_2) + "\setdist S {x} = a; a \ 0\ \ S \ {} \ x \ closure S" + by (simp add: setdist_neq_0_sing_1 setdist_sym) lemma setdist_sing_in_set: - fixes S :: "'a::{heine_borel,real_normed_vector} set" - shows "x \ S \ setdist {x} S = 0" - using closure_subset by (auto simp: setdist_eq_0_sing_1) + "x \ S \ setdist {x} S = 0" + by (simp add: setdist_eq_0I) lemma setdist_eq_0_closed: - fixes S :: "'a::{heine_borel,real_normed_vector} set" - shows "closed S \ (setdist {x} S = 0 \ S = {} \ x \ S)" + "closed S \ (setdist {x} S = 0 \ S = {} \ x \ S)" by (simp add: setdist_eq_0_sing_1) lemma setdist_eq_0_closedin: - fixes S :: "'a::{heine_borel,real_normed_vector} set" shows "\closedin (subtopology euclidean U) S; x \ U\ \ (setdist {x} S = 0 \ S = {} \ x \ S)" by (auto simp: closedin_limpt setdist_eq_0_sing_1 closure_def) lemma setdist_gt_0_closedin: - fixes S :: "'a::{heine_borel,real_normed_vector} set" shows "\closedin (subtopology euclidean U) S; x \ U; S \ {}; x \ S\ \ setdist {x} S > 0" using less_eq_real_def setdist_eq_0_closedin by fastforce diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Analysis/Winding_Numbers.thy --- a/src/HOL/Analysis/Winding_Numbers.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Analysis/Winding_Numbers.thy Mon Mar 18 21:50:51 2019 +0100 @@ -935,11 +935,10 @@ proof - obtain e where "0 < e" and e: "\t. t \ {0..1} \ e \ norm(exp(p t))" proof - have "closed (path_image (exp \ p))" - by (simp add: assms closed_path_image holomorphic_on_exp holomorphic_on_imp_continuous_on path_continuous_image) + have "closed (path_image (exp \ p))" + by (simp add: assms closed_path_image holomorphic_on_exp holomorphic_on_imp_continuous_on path_continuous_image) then show "0 < setdist {0} (path_image (exp \ p))" - by (metis (mono_tags, lifting) compact_sing exp_not_eq_zero imageE path_image_compose - path_image_nonempty setdist_eq_0_compact_closed setdist_gt_0_compact_closed setdist_eq_0_closed) + by (metis exp_not_eq_zero imageE image_comp infdist_eq_setdist infdist_pos_not_in_closed path_defs(4) path_image_nonempty) next fix t::real assume "t \ {0..1}" diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Library/Set_Idioms.thy --- a/src/HOL/Library/Set_Idioms.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Library/Set_Idioms.thy Mon Mar 18 21:50:51 2019 +0100 @@ -44,6 +44,10 @@ lemma all_intersection_of: "(\S. (P intersection_of Q) S \ R S) \ (\T. P T \ T \ Collect Q \ R(\T))" by (auto simp: intersection_of_def) + +lemma intersection_ofE: + "\(P intersection_of Q) S; \T. \P T; T \ Collect Q\ \ R(\T)\ \ R S" + by (auto simp: intersection_of_def) lemma union_of_empty: "P {} \ (P union_of Q) {}" @@ -319,6 +323,9 @@ lemma all_relative_to: "(\S. (P relative_to U) S \ Q S) \ (\S. P S \ Q(U \ S))" by (auto simp: relative_to_def) +lemma relative_toE: "\(P relative_to U) S; \S. P S \ Q(U \ S)\ \ Q S" + by (auto simp: relative_to_def) + lemma relative_to_inc: "P S \ (P relative_to U) (U \ S)" by (auto simp: relative_to_def) diff -r 79c8ff387ed1 -r 5f67c5e457e3 src/HOL/Limits.thy --- a/src/HOL/Limits.thy Mon Mar 18 21:06:26 2019 +0100 +++ b/src/HOL/Limits.thy Mon Mar 18 21:50:51 2019 +0100 @@ -532,6 +532,9 @@ shows "continuous_on s f \ continuous_on s g \ continuous_on s (\x. dist (f x) (g x))" unfolding continuous_on_def by (auto intro: tendsto_dist) +lemma continuous_at_dist: "isCont (dist a) b" + using continuous_on_dist [OF continuous_on_const continuous_on_id] continuous_on_eq_continuous_within by blast + lemma tendsto_norm [tendsto_intros]: "(f \ a) F \ ((\x. norm (f x)) \ norm a) F" unfolding norm_conv_dist by (intro tendsto_intros)