diff -r a8faf6f15da7 -r 96a43caa4902 src/HOL/Analysis/Function_Topology.thy --- a/src/HOL/Analysis/Function_Topology.thy Thu Jan 17 16:08:41 2019 +0000 +++ b/src/HOL/Analysis/Function_Topology.thy Thu Jan 17 16:22:21 2019 -0500 @@ -61,8 +61,6 @@ I realized afterwards that this theory has a lot in common with \<^file>\~~/src/HOL/Library/Finite_Map.thy\. \ - - subsection%important \Topology without type classes\ subsubsection%important \The topology generated by some (open) subsets\ @@ -80,14 +78,14 @@ | UN: "(\k. k \ K \ generate_topology_on S k) \ generate_topology_on S (\K)" | Basis: "s \ S \ generate_topology_on S s" -lemma istopology_generate_topology_on: +lemma%unimportant istopology_generate_topology_on: "istopology (generate_topology_on S)" unfolding istopology_def by (auto intro: generate_topology_on.intros) text \The basic property of the topology generated by a set \S\ is that it is the smallest topology containing all the elements of \S\:\ -lemma generate_topology_on_coarsest: +lemma%unimportant generate_topology_on_coarsest: assumes "istopology T" "\s. s \ S \ T s" "generate_topology_on S s0" @@ -98,17 +96,17 @@ abbreviation%unimportant topology_generated_by::"('a set set) \ ('a topology)" where "topology_generated_by S \ topology (generate_topology_on S)" -lemma openin_topology_generated_by_iff: +lemma%unimportant openin_topology_generated_by_iff: "openin (topology_generated_by S) s \ generate_topology_on S s" using topology_inverse'[OF istopology_generate_topology_on[of S]] by simp -lemma openin_topology_generated_by: +lemma%unimportant openin_topology_generated_by: "openin (topology_generated_by S) s \ generate_topology_on S s" using openin_topology_generated_by_iff by auto -lemma topology_generated_by_topspace: +lemma%important topology_generated_by_topspace: "topspace (topology_generated_by S) = (\S)" -proof +proof%unimportant { fix s assume "openin (topology_generated_by S) s" then have "generate_topology_on S s" by (rule openin_topology_generated_by) @@ -123,9 +121,9 @@ unfolding topspace_def using openin_topology_generated_by_iff by auto qed -lemma topology_generated_by_Basis: +lemma%important topology_generated_by_Basis: "s \ S \ openin (topology_generated_by S) s" - by (simp only: openin_topology_generated_by_iff, auto simp: generate_topology_on.Basis) +by%unimportant (simp only: openin_topology_generated_by_iff, auto simp: generate_topology_on.Basis) lemma generate_topology_on_Inter: "\finite \; \K. K \ \ \ generate_topology_on \ K; \ \ {}\ \ generate_topology_on \ (\\)" @@ -268,28 +266,28 @@ where "continuous_on_topo T1 T2 f = ((\ U. openin T2 U \ openin T1 (f-`U \ topspace(T1))) \ (f`(topspace T1) \ (topspace T2)))" -lemma continuous_on_continuous_on_topo: +lemma%important continuous_on_continuous_on_topo: "continuous_on s f \ continuous_on_topo (subtopology euclidean s) euclidean f" - unfolding continuous_on_open_invariant openin_open vimage_def continuous_on_topo_def +unfolding%unimportant continuous_on_open_invariant openin_open vimage_def continuous_on_topo_def topspace_euclidean_subtopology open_openin topspace_euclidean by fast -lemma continuous_on_topo_UNIV: +lemma%unimportant continuous_on_topo_UNIV: "continuous_on UNIV f \ continuous_on_topo euclidean euclidean f" using continuous_on_continuous_on_topo[of UNIV f] subtopology_UNIV[of euclidean] by auto -lemma continuous_on_topo_open [intro]: +lemma%important continuous_on_topo_open [intro]: "continuous_on_topo T1 T2 f \ openin T2 U \ openin T1 (f-`U \ topspace(T1))" - unfolding continuous_on_topo_def by auto +unfolding%unimportant continuous_on_topo_def by auto -lemma continuous_on_topo_topspace [intro]: +lemma%unimportant continuous_on_topo_topspace [intro]: "continuous_on_topo T1 T2 f \ f`(topspace T1) \ (topspace T2)" unfolding continuous_on_topo_def by auto -lemma continuous_on_generated_topo_iff: +lemma%important continuous_on_generated_topo_iff: "continuous_on_topo T1 (topology_generated_by S) f \ ((\U. U \ S \ openin T1 (f-`U \ topspace(T1))) \ (f`(topspace T1) \ (\ S)))" unfolding continuous_on_topo_def topology_generated_by_topspace -proof (auto simp add: topology_generated_by_Basis) +proof%unimportant (auto simp add: topology_generated_by_Basis) assume H: "\U. U \ S \ openin T1 (f -` U \ topspace T1)" fix U assume "openin (topology_generated_by S) U" then have "generate_topology_on S U" by (rule openin_topology_generated_by) @@ -311,17 +309,17 @@ qed (auto simp add: H) qed -lemma continuous_on_generated_topo: +lemma%important continuous_on_generated_topo: assumes "\U. U \S \ openin T1 (f-`U \ topspace(T1))" "f`(topspace T1) \ (\ S)" shows "continuous_on_topo T1 (topology_generated_by S) f" - using assms continuous_on_generated_topo_iff by blast +using%unimportant assms continuous_on_generated_topo_iff by blast -proposition continuous_on_topo_compose: +lemma%important continuous_on_topo_compose: assumes "continuous_on_topo T1 T2 f" "continuous_on_topo T2 T3 g" shows "continuous_on_topo T1 T3 (g o f)" - using assms unfolding continuous_on_topo_def -proof (auto) +using%unimportant assms unfolding continuous_on_topo_def +proof%unimportant (auto) fix U :: "'c set" assume H: "openin T3 U" have "openin T1 (f -` (g -` U \ topspace T2) \ topspace T1)" @@ -332,7 +330,7 @@ by simp qed (blast) -lemma continuous_on_topo_preimage_topspace [intro]: +lemma%unimportant continuous_on_topo_preimage_topspace [intro]: assumes "continuous_on_topo T1 T2 f" shows "f-`(topspace T2) \ topspace T1 = topspace T1" using assms unfolding continuous_on_topo_def by auto @@ -351,9 +349,9 @@ definition%important pullback_topology::"('a set) \ ('a \ 'b) \ ('b topology) \ ('a topology)" where "pullback_topology A f T = topology (\S. \U. openin T U \ S = f-`U \ A)" -lemma istopology_pullback_topology: +lemma%important istopology_pullback_topology: "istopology (\S. \U. openin T U \ S = f-`U \ A)" - unfolding istopology_def proof (auto) +unfolding%unimportant istopology_def proof (auto) fix K assume "\S\K. \U. openin T U \ S = f -` U \ A" then have "\U. \S\K. openin T (U S) \ S = f-`(U S) \ A" by (rule bchoice) @@ -364,19 +362,19 @@ then show "\V. openin T V \ \K = f -` V \ A" by auto qed -lemma openin_pullback_topology: +lemma%unimportant openin_pullback_topology: "openin (pullback_topology A f T) S \ (\U. openin T U \ S = f-`U \ A)" unfolding pullback_topology_def topology_inverse'[OF istopology_pullback_topology] by auto -lemma topspace_pullback_topology: +lemma%unimportant topspace_pullback_topology: "topspace (pullback_topology A f T) = f-`(topspace T) \ A" by (auto simp add: topspace_def openin_pullback_topology) -proposition continuous_on_topo_pullback [intro]: +lemma%important continuous_on_topo_pullback [intro]: assumes "continuous_on_topo T1 T2 g" shows "continuous_on_topo (pullback_topology A f T1) T2 (g o f)" unfolding continuous_on_topo_def -proof (auto) +proof%unimportant (auto) fix U::"'b set" assume "openin T2 U" then have "openin T1 (g-`U \ topspace T1)" using assms unfolding continuous_on_topo_def by auto @@ -396,11 +394,11 @@ using assms unfolding continuous_on_topo_def by auto qed -proposition continuous_on_topo_pullback' [intro]: +lemma%important continuous_on_topo_pullback' [intro]: assumes "continuous_on_topo T1 T2 (f o g)" "topspace T1 \ g-`A" shows "continuous_on_topo T1 (pullback_topology A f T2) g" unfolding continuous_on_topo_def -proof (auto) +proof%unimportant (auto) fix U assume "openin (pullback_topology A f T2) U" then have "\V. openin T2 V \ U = f-`V \ A" unfolding openin_pullback_topology by auto @@ -549,9 +547,9 @@ done qed -lemma topspace_product_topology: +lemma%important topspace_product_topology: "topspace (product_topology T I) = (\\<^sub>E i\I. topspace(T i))" -proof +proof%unimportant show "topspace (product_topology T I) \ (\\<^sub>E i\I. topspace (T i))" unfolding product_topology_def topology_generated_by_topspace unfolding topspace_def by auto @@ -561,16 +559,16 @@ unfolding product_topology_def using PiE_def by (auto simp add: topology_generated_by_topspace) qed -lemma product_topology_basis: +lemma%unimportant product_topology_basis: assumes "\i. openin (T i) (X i)" "finite {i. X i \ topspace (T i)}" shows "openin (product_topology T I) (\\<^sub>E i\I. X i)" unfolding product_topology_def by (rule topology_generated_by_Basis) (use assms in auto) -proposition product_topology_open_contains_basis: +lemma%important product_topology_open_contains_basis: assumes "openin (product_topology T I) U" "x \ U" shows "\X. x \ (\\<^sub>E i\I. X i) \ (\i. openin (T i) (X i)) \ finite {i. X i \ topspace (T i)} \ (\\<^sub>E i\I. X i) \ U" -proof - +proof%unimportant - have "generate_topology_on {(\\<^sub>E i\I. X i) |X. (\i. openin (T i) (X i)) \ finite {i. X i \ topspace (T i)}} U" using assms unfolding product_topology_def by (intro openin_topology_generated_by) auto then have "\x. x\U \ \X. x \ (\\<^sub>E i\I. X i) \ (\i. openin (T i) (X i)) \ finite {i. X i \ topspace (T i)} \ (\\<^sub>E i\I. X i) \ U" @@ -719,7 +717,7 @@ text \The basic property of the product topology is the continuity of projections:\ -lemma continuous_on_topo_product_coordinates [simp]: +lemma%unimportant continuous_on_topo_product_coordinates [simp]: assumes "i \ I" shows "continuous_on_topo (product_topology T I) (T i) (\x. x i)" proof - @@ -741,12 +739,12 @@ by (auto simp add: assms topspace_product_topology PiE_iff) qed -lemma continuous_on_topo_coordinatewise_then_product [intro]: +lemma%important continuous_on_topo_coordinatewise_then_product [intro]: assumes "\i. i \ I \ continuous_on_topo T1 (T i) (\x. f x i)" "\i x. i \ I \ x \ topspace T1 \ f x i = undefined" shows "continuous_on_topo T1 (product_topology T I) f" unfolding product_topology_def -proof (rule continuous_on_generated_topo) +proof%unimportant (rule continuous_on_generated_topo) fix U assume "U \ {Pi\<^sub>E I X |X. (\i. openin (T i) (X i)) \ finite {i. X i \ topspace (T i)}}" then obtain X where H: "U = Pi\<^sub>E I X" "\i. openin (T i) (X i)" "finite {i. X i \ topspace (T i)}" by blast @@ -774,7 +772,7 @@ using assms unfolding continuous_on_topo_def by auto qed -lemma continuous_on_topo_product_then_coordinatewise [intro]: +lemma%unimportant continuous_on_topo_product_then_coordinatewise [intro]: assumes "continuous_on_topo T1 (product_topology T I) f" shows "\i. i \ I \ continuous_on_topo T1 (T i) (\x. f x i)" "\i x. i \ I \ x \ topspace T1 \ f x i = undefined" @@ -796,7 +794,7 @@ using \i \ I\ by (auto simp add: PiE_iff extensional_def) qed -lemma continuous_on_restrict: +lemma%unimportant continuous_on_restrict: assumes "J \ I" shows "continuous_on_topo (product_topology T I) (product_topology T J) (\x. restrict x J)" proof (rule continuous_on_topo_coordinatewise_then_product) @@ -819,7 +817,7 @@ definition%important open_fun_def: "open U = openin (product_topology (\i. euclidean) UNIV) U" -instance proof +instance proof%unimportant have "topspace (product_topology (\(i::'a). euclidean::('b topology)) UNIV) = UNIV" unfolding topspace_product_topology topspace_euclidean by auto then show "open (UNIV::('a \ 'b) set)" @@ -828,15 +826,15 @@ end -lemma euclidean_product_topology: +lemma%unimportant euclidean_product_topology: "euclidean = product_topology (\i. euclidean::('b::topological_space) topology) UNIV" by (metis open_openin topology_eq open_fun_def) -proposition product_topology_basis': +lemma%important product_topology_basis': fixes x::"'i \ 'a" and U::"'i \ ('b::topological_space) set" assumes "finite I" "\i. i \ I \ open (U i)" shows "open {f. \i\I. f (x i) \ U i}" -proof - +proof%unimportant - define J where "J = x`I" define V where "V = (\y. if y \ J then \{U i|i. i\I \ x i = y} else UNIV)" define X where "X = (\y. if y \ J then V y else UNIV)" @@ -866,24 +864,24 @@ text \The results proved in the general situation of products of possibly different spaces have their counterparts in this simpler setting.\ -lemma continuous_on_product_coordinates [simp]: +lemma%unimportant 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) -lemma continuous_on_coordinatewise_then_product [intro, continuous_intros]: +lemma%unimportant 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) -lemma continuous_on_product_then_coordinatewise: +lemma%unimportant continuous_on_product_then_coordinatewise: 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: +lemma%unimportant 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) @@ -893,7 +891,7 @@ of product spaces, but they have more to do with countability and could be put in the corresponding theory.\ -lemma countable_nat_product_event_const: +lemma%unimportant countable_nat_product_event_const: fixes F::"'a set" and a::'a assumes "a \ F" "countable F" shows "countable {x::(nat \ 'a). (\i. x i \ F) \ finite {i. x i \ a}}" @@ -930,7 +928,7 @@ then show ?thesis using countable_subset[OF *] by auto qed -lemma countable_product_event_const: +lemma%unimportant countable_product_event_const: fixes F::"('a::countable) \ 'b set" and b::'b assumes "\i. countable (F i)" shows "countable {f::('a \ 'b). (\i. f i \ F i) \ (finite {i. f i \ b})}" @@ -963,7 +961,7 @@ qed instance "fun" :: (countable, first_countable_topology) first_countable_topology -proof +proof%unimportant fix x::"'a \ 'b" have "\A::('b \ nat \ 'b set). \x. (\i. x \ A x i \ open (A x i)) \ (\S. open S \ x \ S \ (\i. A x i \ S))" apply (rule choice) using first_countable_basis by auto @@ -1035,11 +1033,11 @@ using \countable K\ \\k. k \ K \ x \ k\ \\k. k \ K \ open k\ Inc by auto qed -proposition product_topology_countable_basis: +lemma%important product_topology_countable_basis: shows "\K::(('a::countable \ 'b::second_countable_topology) set set). topological_basis K \ countable K \ (\k\K. \X. (k = Pi\<^sub>E UNIV X) \ (\i. open (X i)) \ finite {i. X i \ UNIV})" -proof - +proof%unimportant - obtain B::"'b set set" where B: "countable B \ topological_basis B" using ex_countable_basis by auto then have "B \ {}" by (meson UNIV_I empty_iff open_UNIV topological_basisE) @@ -1142,15 +1140,15 @@ 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: +lemma%unimportant 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: +lemma%important 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 - +proof%unimportant - 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} @@ -1160,16 +1158,16 @@ unfolding strong_operator_topology_def open_openin apply (subst openin_pullback_topology) by auto qed -lemma strong_operator_topology_continuous_evaluation: +lemma%important strong_operator_topology_continuous_evaluation: "continuous_on_topo strong_operator_topology euclidean (\f. blinfun_apply f x)" -proof - +proof%unimportant - 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: +lemma%unimportant 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) @@ -1192,9 +1190,9 @@ by (auto simp add: \continuous_on_topo T euclidean (blinfun_apply o f)\) qed -lemma strong_operator_topology_weaker_than_euclidean: +lemma%important strong_operator_topology_weaker_than_euclidean: "continuous_on_topo euclidean strong_operator_topology (\f. f)" - by (subst continuous_on_strong_operator_topo_iff_coordinatewise, +by%unimportant (subst continuous_on_strong_operator_topo_iff_coordinatewise, auto simp add: continuous_on_topo_UNIV[symmetric] linear_continuous_on) @@ -1228,9 +1226,9 @@ spaces. It would thus be desirable to hide them once the instance is proved, but I do not know how to do this.\ -lemma dist_fun_le_dist_first_terms: +lemma%important dist_fun_le_dist_first_terms: "dist x y \ 2 * Max {dist (x (from_nat n)) (y (from_nat n))|n. n \ N} + (1/2)^N" -proof - +proof%unimportant - have "(\n. (1 / 2) ^ (n+Suc N) * min (dist (x (from_nat (n+Suc N))) (y (from_nat (n+Suc N)))) 1) = (\n. (1 / 2) ^ (Suc N) * ((1/2) ^ n * min (dist (x (from_nat (n+Suc N))) (y (from_nat (n+Suc N)))) 1))" by (rule suminf_cong, simp add: power_add) @@ -1278,7 +1276,7 @@ finally show ?thesis unfolding M_def by simp qed -lemma open_fun_contains_ball_aux: +lemma%unimportant open_fun_contains_ball_aux: assumes "open (U::(('a \ 'b) set))" "x \ U" shows "\e>0. {y. dist x y < e} \ U" @@ -1341,7 +1339,7 @@ then show "\m>0. {y. dist x y < m} \ U" using * by blast qed -lemma ball_fun_contains_open_aux: +lemma%unimportant ball_fun_contains_open_aux: fixes x::"('a \ 'b)" and e::real assumes "e>0" shows "\U. open U \ x \ U \ U \ {y. dist x y < e}" @@ -1388,7 +1386,7 @@ ultimately show ?thesis by auto qed -lemma fun_open_ball_aux: +lemma%unimportant fun_open_ball_aux: fixes U::"('a \ 'b) set" shows "open U \ (\x\U. \e>0. \y. dist x y < e \ y \ U)" proof (auto) @@ -1577,7 +1575,7 @@ -subsection%important \Measurability\ (*FIX ME move? *) +subsection%important \Measurability\ (*FIX ME mv *) 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 @@ -1595,11 +1593,11 @@ compare it with the product sigma algebra as explained above. \ -lemma measurable_product_coordinates [measurable (raw)]: +lemma%unimportant 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: +lemma%unimportant 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" @@ -1613,10 +1611,10 @@ of the product sigma algebra that is more similar to the one we used above for the product topology.\ -lemma sets_PiM_finite: +lemma%important 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 +proof%unimportant 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)}" @@ -1656,9 +1654,9 @@ done qed -lemma sets_PiM_subset_borel: +lemma%important sets_PiM_subset_borel: "sets (Pi\<^sub>M UNIV (\_. borel)) \ sets borel" -proof - +proof%unimportant - 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}" @@ -1675,9 +1673,9 @@ by (simp add: * sets.sigma_sets_subset') qed -proposition sets_PiM_equal_borel: +lemma%important sets_PiM_equal_borel: "sets (Pi\<^sub>M UNIV (\i::('a::countable). borel::('b::second_countable_topology measure))) = sets borel" -proof +proof%unimportant 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 @@ -1702,11 +1700,11 @@ unfolding borel_def by auto qed (simp add: sets_PiM_subset_borel) -lemma measurable_coordinatewise_then_product: +lemma%important 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 - +proof%unimportant - 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