diff -r eddcc7c726f3 -r 4a9167f377b0 src/HOL/Analysis/Function_Topology.thy --- a/src/HOL/Analysis/Function_Topology.thy Mon Mar 18 15:35:34 2019 +0000 +++ b/src/HOL/Analysis/Function_Topology.thy Tue Mar 19 16:14:51 2019 +0000 @@ -7,9 +7,9 @@ begin -section \Product Topology\ (* FIX see comments by the author *) +section \Function Topology\ -text \We want to define the product topology. +text \We want to define the general product topology. The product topology on a product of topological spaces is generated by the sets which are products of open sets along finitely many coordinates, and the whole @@ -48,7 +48,7 @@ be the natural continuity definition of a map from the topology \T1\ to the topology \T2\. Then the current \continuous_on\ (with type classes) can be redefined as @{text [display] \continuous_on s f = - continuous_on_topo (subtopology euclidean s) (topology euclidean) f\} + continuous_on_topo (top_of_set s) (topology euclidean) f\} In fact, I need \continuous_on_topo\ to express the continuity of the projection on subfactors for the product topology, in Lemma~\continuous_on_restrict_product_topology\, and I show @@ -61,369 +61,6 @@ I realized afterwards that this theory has a lot in common with \<^file>\~~/src/HOL/Library/Finite_Map.thy\. \ -subsection \Topology without type classes\ - -subsubsection%important \The topology generated by some (open) subsets\ - -text \In the definition below of a generated topology, the \Empty\ case is not necessary, -as it follows from \UN\ taking for \K\ the empty set. However, it is convenient to have, -and is never a problem in proofs, so I prefer to write it down explicitly. - -We do not require \UNIV\ to be an open set, as this will not be the case in applications. (We are -thinking of a topology on a subset of \UNIV\, the remaining part of \UNIV\ being irrelevant.)\ - -inductive generate_topology_on for S where - Empty: "generate_topology_on S {}" -| Int: "generate_topology_on S a \ generate_topology_on S b \ generate_topology_on S (a \ b)" -| 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: - "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: - assumes "istopology T" - "\s. s \ S \ T s" - "generate_topology_on S s0" - shows "T s0" -using assms(3) apply (induct rule: generate_topology_on.induct) -using assms(1) assms(2) unfolding istopology_def by auto - -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: - "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: - "openin (topology_generated_by S) s \ generate_topology_on S s" -using openin_topology_generated_by_iff by auto - -lemma topology_generated_by_topspace: - "topspace (topology_generated_by S) = (\S)" -proof - { - fix s assume "openin (topology_generated_by S) s" - then have "generate_topology_on S s" by (rule openin_topology_generated_by) - then have "s \ (\S)" by (induct, auto) - } - then show "topspace (topology_generated_by S) \ (\S)" - unfolding topspace_def by auto -next - have "generate_topology_on S (\S)" - using generate_topology_on.UN[OF generate_topology_on.Basis, of S S] by simp - then show "(\S) \ topspace (topology_generated_by S)" - unfolding topspace_def using openin_topology_generated_by_iff by auto -qed - -lemma 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) - -lemma generate_topology_on_Inter: - "\finite \; \K. K \ \ \ generate_topology_on \ K; \ \ {}\ \ generate_topology_on \ (\\)" - by (induction \ rule: finite_induct; force intro: generate_topology_on.intros) - -subsection\Topology bases and sub-bases\ - -lemma istopology_base_alt: - "istopology (arbitrary union_of P) \ - (\S T. (arbitrary union_of P) S \ (arbitrary union_of P) T - \ (arbitrary union_of P) (S \ T))" - by (simp add: istopology_def) (blast intro: arbitrary_union_of_Union) - -lemma istopology_base_eq: - "istopology (arbitrary union_of P) \ - (\S T. P S \ P T \ (arbitrary union_of P) (S \ T))" - by (simp add: istopology_base_alt arbitrary_union_of_Int_eq) - -lemma istopology_base: - "(\S T. \P S; P T\ \ P(S \ T)) \ istopology (arbitrary union_of P)" - by (simp add: arbitrary_def istopology_base_eq union_of_inc) - -lemma openin_topology_base_unique: - "openin X = arbitrary union_of P \ - (\V. P V \ openin X V) \ (\U x. openin X U \ x \ U \ (\V. P V \ x \ V \ V \ U))" - (is "?lhs = ?rhs") -proof - assume ?lhs - then show ?rhs - by (auto simp: union_of_def arbitrary_def) -next - assume R: ?rhs - then have *: "\\\Collect P. \\ = S" if "openin X S" for S - using that by (rule_tac x="{V. P V \ V \ S}" in exI) fastforce - from R show ?lhs - by (fastforce simp add: union_of_def arbitrary_def intro: *) -qed - -lemma topology_base_unique: - "\\S. P S \ openin X S; - \U x. \openin X U; x \ U\ \ \B. P B \ x \ B \ B \ U\ - \ topology(arbitrary union_of P) = X" - by (metis openin_topology_base_unique openin_inverse [of X]) - -lemma topology_bases_eq_aux: - "\(arbitrary union_of P) S; - \U x. \P U; x \ U\ \ \V. Q V \ x \ V \ V \ U\ - \ (arbitrary union_of Q) S" - by (metis arbitrary_union_of_alt arbitrary_union_of_idempot) - -lemma topology_bases_eq: - "\\U x. \P U; x \ U\ \ \V. Q V \ x \ V \ V \ U; - \V x. \Q V; x \ V\ \ \U. P U \ x \ U \ U \ V\ - \ topology (arbitrary union_of P) = - topology (arbitrary union_of Q)" - by (fastforce intro: arg_cong [where f=topology] elim: topology_bases_eq_aux) - -lemma istopology_subbase: - "istopology (arbitrary union_of (finite intersection_of P relative_to S))" - by (simp add: finite_intersection_of_Int istopology_base relative_to_Int) - -lemma openin_subbase: - "openin (topology (arbitrary union_of (finite intersection_of B relative_to U))) S - \ (arbitrary union_of (finite intersection_of B relative_to U)) S" - by (simp add: istopology_subbase topology_inverse') - -lemma topspace_subbase [simp]: - "topspace(topology (arbitrary union_of (finite intersection_of B relative_to U))) = U" (is "?lhs = _") -proof - show "?lhs \ U" - by (metis arbitrary_union_of_relative_to openin_subbase openin_topspace relative_to_imp_subset) - show "U \ ?lhs" - by (metis arbitrary_union_of_inc finite_intersection_of_empty inf.orderE istopology_subbase - openin_subset relative_to_inc subset_UNIV topology_inverse') -qed - -lemma minimal_topology_subbase: - "\\S. P S \ openin X S; openin X U; - openin(topology(arbitrary union_of (finite intersection_of P relative_to U))) S\ - \ openin X S" - apply (simp add: istopology_subbase topology_inverse) - apply (simp add: union_of_def intersection_of_def relative_to_def) - apply (blast intro: openin_Int_Inter) - done - -lemma istopology_subbase_UNIV: - "istopology (arbitrary union_of (finite intersection_of P))" - by (simp add: istopology_base finite_intersection_of_Int) - - -lemma generate_topology_on_eq: - "generate_topology_on S = arbitrary union_of finite' intersection_of (\x. x \ S)" (is "?lhs = ?rhs") -proof (intro ext iffI) - fix A - assume "?lhs A" - then show "?rhs A" - proof induction - case (Int a b) - then show ?case - by (metis (mono_tags, lifting) istopology_base_alt finite'_intersection_of_Int istopology_base) - next - case (UN K) - then show ?case - by (simp add: arbitrary_union_of_Union) - next - case (Basis s) - then show ?case - by (simp add: Sup_upper arbitrary_union_of_inc finite'_intersection_of_inc relative_to_subset) - qed auto -next - fix A - assume "?rhs A" - then obtain \ where \: "\T. T \ \ \ \\. finite' \ \ \ \ S \ \\ = T" and eq: "A = \\" - unfolding union_of_def intersection_of_def by auto - show "?lhs A" - unfolding eq - proof (rule generate_topology_on.UN) - fix T - assume "T \ \" - with \ obtain \ where "finite' \" "\ \ S" "\\ = T" - by blast - have "generate_topology_on S (\\)" - proof (rule generate_topology_on_Inter) - show "finite \" "\ \ {}" - by (auto simp: \finite' \\) - show "\K. K \ \ \ generate_topology_on S K" - by (metis \\ \ S\ generate_topology_on.simps subset_iff) - qed - then show "generate_topology_on S T" - using \\\ = T\ by blast - qed -qed - -subsubsection%important \Continuity\ - -text \We will need to deal with continuous maps in terms of topologies and not in terms -of type classes, as defined below.\ - -definition%important continuous_on_topo::"'a topology \ 'b topology \ ('a \ 'b) \ bool" - 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: - "continuous_on s f \ continuous_on_topo (subtopology euclidean s) euclidean f" - by (auto simp: continuous_on_topo_def Int_commute continuous_openin_preimage_eq) - -lemma 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]: - "continuous_on_topo T1 T2 f \ openin T2 U \ openin T1 (f-`U \ topspace(T1))" - unfolding continuous_on_topo_def by auto - -lemma 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: - "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) - 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) - then show "openin T1 (f -` U \ topspace T1)" - proof (induct) - fix a b - assume H: "openin T1 (f -` a \ topspace T1)" "openin T1 (f -` b \ topspace T1)" - have "f -` (a \ b) \ topspace T1 = (f-`a \ topspace T1) \ (f-`b \ topspace T1)" - by auto - then show "openin T1 (f -` (a \ b) \ topspace T1)" using H by auto - next - fix K - assume H: "openin T1 (f -` k \ topspace T1)" if "k\ K" for k - define L where "L = {f -` k \ topspace T1|k. k \ K}" - have *: "openin T1 l" if "l \L" for l using that H unfolding L_def by auto - have "openin T1 (\L)" using openin_Union[OF *] by simp - moreover have "(\L) = (f -` \K \ topspace T1)" unfolding L_def by auto - ultimately show "openin T1 (f -` \K \ topspace T1)" by simp - qed (auto simp add: H) -qed - -lemma 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 - -proposition 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) - fix U :: "'c set" - assume H: "openin T3 U" - have "openin T1 (f -` (g -` U \ topspace T2) \ topspace T1)" - using H assms by blast - moreover have "f -` (g -` U \ topspace T2) \ topspace T1 = (g \ f) -` U \ topspace T1" - using H assms continuous_on_topo_topspace by fastforce - ultimately show "openin T1 ((g \ f) -` U \ topspace T1)" - by simp -qed (blast) - -lemma 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 - - -subsubsection%important \Pullback topology\ - -text \Pulling back a topology by map gives again a topology. \subtopology\ is -a special case of this notion, pulling back by the identity. We introduce the general notion as -we will need it to define the strong operator topology on the space of continuous linear operators, -by pulling back the product topology on the space of all functions.\ - -text \\pullback_topology A f T\ is the pullback of the topology \T\ by the map \f\ on -the set \A\.\ - -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: - "istopology (\S. \U. openin T U \ S = f-`U \ A)" - unfolding 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) - then obtain U where U: "\S\K. openin T (U S) \ S = f-`(U S) \ A" - by blast - define V where "V = (\S\K. U S)" - have "openin T V" "\K = f -` V \ A" unfolding V_def using U by auto - then show "\V. openin T V \ \K = f -` V \ A" by auto -qed - -lemma 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: - "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]: - 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) - 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 - have "(g o f)-`U \ topspace (pullback_topology A f T1) = (g o f)-`U \ A \ f-`(topspace T1)" - unfolding topspace_pullback_topology by auto - also have "... = f-`(g-`U \ topspace T1) \ A " - by auto - also have "openin (pullback_topology A f T1) (...)" - unfolding openin_pullback_topology using \openin T1 (g-`U \ topspace T1)\ by auto - finally show "openin (pullback_topology A f T1) ((g \ f) -` U \ topspace (pullback_topology A f T1))" - by auto -next - fix x assume "x \ topspace (pullback_topology A f T1)" - then have "f x \ topspace T1" - unfolding topspace_pullback_topology by auto - then show "g (f x) \ topspace T2" - using assms unfolding continuous_on_topo_def by auto -qed - -proposition 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) - 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 - then obtain V where "openin T2 V" "U = f-`V \ A" - by blast - then have "g -` U \ topspace T1 = g-`(f-`V \ A) \ topspace T1" - by blast - also have "... = (f o g)-`V \ (g-`A \ topspace T1)" - by auto - also have "... = (f o g)-`V \ topspace T1" - using assms(2) by auto - also have "openin T1 (...)" - using assms(1) \openin T2 V\ by auto - finally show "openin T1 (g -` U \ topspace T1)" by simp -next - fix x assume "x \ topspace T1" - have "(f o g) x \ topspace T2" - using assms(1) \x \ topspace T1\ unfolding continuous_on_topo_def by auto - then have "g x \ f-`(topspace T2)" - unfolding comp_def by blast - moreover have "g x \ A" using assms(2) \x \ topspace T1\ by blast - ultimately show "g x \ topspace (pullback_topology A f T2)" - unfolding topspace_pullback_topology by blast -qed - - subsection \The product topology\ text \We can now define the product topology, as generated by @@ -605,6 +242,9 @@ then show ?thesis using \x \ U\ by auto qed +lemma product_topology_empty_discrete: + "product_topology T {} = discrete_topology {(\x. undefined)}" + by (simp add: subtopology_eq_discrete_topology_sing) lemma openin_product_topology: "openin (product_topology X I) = @@ -793,6 +433,15 @@ using PiE_singleton closedin_product_topology [of X I] by (metis (no_types, lifting) all_not_in_conv insertI1) +lemma product_topology_empty: + "product_topology X {} = topology (\S. S \ {{},{\k. undefined}})" + unfolding product_topology union_of_def intersection_of_def arbitrary_def relative_to_def + by (auto intro: arg_cong [where f=topology]) + +lemma openin_product_topology_empty: "openin (product_topology X {}) S \ S \ {{},{\k. undefined}}" + unfolding union_of_def intersection_of_def arbitrary_def relative_to_def openin_product_topology + by auto + subsubsection \The basic property of the product topology is the continuity of projections:\ @@ -949,10 +598,10 @@ by (rule continuous_on_topo_product_coordinates, simp) lemma continuous_on_coordinatewise_then_product [intro, continuous_intros]: - fixes f :: "('a \ real) \ 'b \ real" + fixes f :: "'a::topological_space \ 'b \ 'c::topological_space" 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"] + using continuous_on_topo_coordinatewise_then_product [of UNIV, where T = "\i. euclidean"] by (metis UNIV_I assms continuous_on_continuous_on_topo euclidean_product_topology) lemma continuous_on_product_then_coordinatewise_UNIV: @@ -1583,4 +1232,354 @@ instance "fun" :: (countable, polish_space) polish_space by standard + +subsection\The Alexander subbase theorem\ + +theorem Alexander_subbase: + assumes X: "topology (arbitrary union_of (finite intersection_of (\x. x \ \) relative_to \\)) = X" + and fin: "\C. \C \ \; \C = topspace X\ \ \C'. finite C' \ C' \ C \ \C' = topspace X" + shows "compact_space X" +proof - + have U\: "\\ = topspace X" + by (simp flip: X) + have False if \: "\U\\. openin X U" and sub: "topspace X \ \\" + and neg: "\\. \\ \ \; finite \\ \ \ topspace X \ \\" for \ + proof - + define \ where "\ \ {\. (\U \ \. openin X U) \ topspace X \ \\ \ (\\. finite \ \ \ \ \ \ ~(topspace X \ \\))}" + have 1: "\ \ {}" + unfolding \_def using sub \ neg by force + have 2: "\\ \ \" if "\\{}" and \: "subset.chain \ \" for \ + unfolding \_def + proof (intro CollectI conjI ballI allI impI notI) + show "openin X U" if U: "U \ \\" for U + using U \ unfolding \_def subset_chain_def by force + have "\ \ \" + using subset_chain_def \ by blast + with that \_def show UUC: "topspace X \ \(\\)" + by blast + show "False" if "finite \" and "\ \ \\" and "topspace X \ \\" for \ + proof - + obtain \ where "\ \ \" "\ \ \" + by (metis Sup_empty \ \\ \ \\\ \finite \\ UUC empty_subsetI finite.emptyI finite_subset_Union_chain neg) + then show False + using \_def \\ \ \\ \finite \\ \topspace X \ \\\ by blast + qed + qed + obtain \ where "\ \ \" and "\X. \X\\; \ \ X\ \ X = \" + using subset_Zorn_nonempty [OF 1 2] by metis + then have *: "\\. \\W. W\\ \ openin X W; topspace X \ \\; \ \ \; + \\. \finite \; \ \ \; topspace X \ \\\ \ False\ + \ \ = \" + and ope: "\U\\. openin X U" and top: "topspace X \ \\" + and non: "\\. \finite \; \ \ \; topspace X \ \\\ \ False" + unfolding \_def by simp_all metis+ + then obtain x where "x \ topspace X" "x \ \(\ \ \)" + proof - + have "\(\ \ \) \ \\" + by (metis \\\ = topspace X\ fin inf.bounded_iff non order_refl) + then have "\a. a \ \(\ \ \) \ a \ \\" + by blast + then show ?thesis + using that by (metis U\) + qed + obtain C where C: "openin X C" "C \ \" "x \ C" + using \x \ topspace X\ ope top by auto + then have "C \ topspace X" + by (metis openin_subset) + then have "(arbitrary union_of (finite intersection_of (\x. x \ \) relative_to \\)) C" + using openin_subbase C unfolding X [symmetric] by blast + moreover have "C \ topspace X" + using \\ \ \\ \C \ \\ unfolding \_def by blast + ultimately obtain \ W where W: "(finite intersection_of (\x. x \ \) relative_to topspace X) W" + and "x \ W" "W \ \" "\\ \ topspace X" "C = \\" + using C by (auto simp: union_of_def U\) + then have "\\ \ topspace X" + by (metis \C \ topspace X\) + then have "topspace X \ \" + using \\\ \ topspace X\ by blast + then obtain \' where \': "finite \'" "\' \ \" "x \ \\'" "W = topspace X \ \\'" + using W \x \ W\ unfolding relative_to_def intersection_of_def by auto + then have "\\' \ \\" + using \W \ \\ \\\ \ topspace X\ \\\ \ topspace X\ by blast + then have "\\' \ C" + using U\ \C = \\\ \W = topspace X \ \\'\ \W \ \\ by auto + have "\b \ \'. \C'. finite C' \ C' \ \ \ topspace X \ \(insert b C')" + proof + fix b + assume "b \ \'" + have "insert b \ = \" if neg: "\ (\C'. finite C' \ C' \ \ \ topspace X \ \(insert b C'))" + proof (rule *) + show "openin X W" if "W \ insert b \" for W + using that + proof + have "b \ \" + using \b \ \'\ \\' \ \\ by blast + then have "\\. finite \ \ \ \ \ \ \\ = b" + by (rule_tac x="{b}" in exI) auto + moreover have "\\ \ b = b" + using \'(2) \b \ \'\ by auto + ultimately show "openin X W" if "W = b" + using that \b \ \'\ + apply (simp add: openin_subbase flip: X) + apply (auto simp: arbitrary_def intersection_of_def relative_to_def intro!: union_of_inc) + done + show "openin X W" if "W \ \" + by (simp add: \W \ \\ ope) + qed + next + show "topspace X \ \ (insert b \)" + using top by auto + next + show False if "finite \" and "\ \ insert b \" "topspace X \ \\" for \ + proof - + have "insert b (\ \ \) = \" + using non that by blast + then show False + by (metis Int_lower2 finite_insert neg that(1) that(3)) + qed + qed auto + then show "\C'. finite C' \ C' \ \ \ topspace X \ \(insert b C')" + using \b \ \'\ \x \ \(\ \ \)\ \' + by (metis IntI InterE Union_iff subsetD insertI1) + qed + then obtain F where F: "\b \ \'. finite (F b) \ F b \ \ \ topspace X \ \(insert b (F b))" + by metis + let ?\ = "insert C (\(F ` \'))" + show False + proof (rule non) + have "topspace X \ (\b \ \'. \(insert b (F b)))" + using F by (simp add: INT_greatest) + also have "\ \ \?\" + using \\\' \ C\ by force + finally show "topspace X \ \?\" . + show "?\ \ \" + using \C \ \\ F by auto + show "finite ?\" + using \finite \'\ F by auto + qed + qed + then show ?thesis + by (force simp: compact_space_def compactin_def) +qed + + +corollary Alexander_subbase_alt: + assumes "U \ \\" + and fin: "\C. \C \ \; U \ \C\ \ \C'. finite C' \ C' \ C \ U \ \C'" + and X: "topology + (arbitrary union_of + (finite intersection_of (\x. x \ \) relative_to U)) = X" + shows "compact_space X" +proof - + have "topspace X = U" + using X topspace_subbase by fastforce + have eq: "\ (Collect ((\x. x \ \) relative_to U)) = U" + unfolding relative_to_def + using \U \ \\\ by blast + have *: "\\. finite \ \ \ \ \ \ \\ = topspace X" + if "\ \ Collect ((\x. x \ \) relative_to topspace X)" and UC: "\\ = topspace X" for \ + proof - + have "\ \ (\U. topspace X \ U) ` \" + using that by (auto simp: relative_to_def) + then obtain \' where "\' \ \" and \': "\ = (\) (topspace X) ` \'" + by (auto simp: subset_image_iff) + moreover have "U \ \\'" + using \' \topspace X = U\ UC by auto + ultimately obtain \' where "finite \'" "\' \ \'" "U \ \\'" + using fin [of \'] \topspace X = U\ \U \ \\\ by blast + then show ?thesis + unfolding \' exists_finite_subset_image \topspace X = U\ by auto + qed + show ?thesis + apply (rule Alexander_subbase [where \ = "Collect ((\x. x \ \) relative_to (topspace X))"]) + apply (simp flip: X) + apply (metis finite_intersection_of_relative_to eq) + apply (blast intro: *) + done +qed + +proposition continuous_map_componentwise: + "continuous_map X (product_topology Y I) f \ + f ` (topspace X) \ extensional I \ (\k \ I. continuous_map X (Y k) (\x. f x k))" + (is "?lhs \ _ \ ?rhs") +proof (cases "\x \ topspace X. f x \ extensional I") + case True + then have "f ` (topspace X) \ extensional I" + by force + moreover have ?rhs if L: ?lhs + proof - + have "openin X {x \ topspace X. f x k \ U}" if "k \ I" and "openin (Y k) U" for k U + proof - + have "openin (product_topology Y I) ({Y. Y k \ U} \ (\\<^sub>E i\I. topspace (Y i)))" + apply (simp add: openin_product_topology flip: arbitrary_union_of_relative_to) + apply (simp add: relative_to_def) + using that apply (blast intro: arbitrary_union_of_inc finite_intersection_of_inc) + done + with that have "openin X {x \ topspace X. f x \ ({Y. Y k \ U} \ (\\<^sub>E i\I. topspace (Y i)))}" + using L unfolding continuous_map_def by blast + moreover have "{x \ topspace X. f x \ ({Y. Y k \ U} \ (\\<^sub>E i\I. topspace (Y i)))} = {x \ topspace X. f x k \ U}" + using L by (auto simp: continuous_map_def) + ultimately show ?thesis + by metis + qed + with that + show ?thesis + by (auto simp: continuous_map_def) + qed + moreover have ?lhs if ?rhs + proof - + have 1: "\x. x \ topspace X \ f x \ (\\<^sub>E i\I. topspace (Y i))" + using that True by (auto simp: continuous_map_def PiE_iff) + have 2: "{x \ S. \T\\. f x \ T} = (\T\\. {x \ S. f x \ T})" for S \ + by blast + have 3: "{x \ S. \U\\. f x \ U} = (\ (insert S ((\U. {x \ S. f x \ U}) ` \)))" for S \ + by blast + show ?thesis + unfolding continuous_map_def openin_product_topology arbitrary_def + proof (clarsimp simp: all_union_of 1 2) + fix \ + assume \: "\ \ Collect (finite intersection_of (\F. \i U. F = {f. f i \ U} \ i \ I \ openin (Y i) U) + relative_to (\\<^sub>E i\I. topspace (Y i)))" + show "openin X (\T\\. {x \ topspace X. f x \ T})" + proof (rule openin_Union; clarify) + fix S T + assume "T \ \" + obtain \ where "T = (\\<^sub>E i\I. topspace (Y i)) \ \\" and "finite \" + "\ \ {{f. f i \ U} |i U. i \ I \ openin (Y i) U}" + using subsetD [OF \ \T \ \\] by (auto simp: intersection_of_def relative_to_def) + with that show "openin X {x \ topspace X. f x \ T}" + apply (simp add: continuous_map_def 1 cong: conj_cong) + unfolding 3 + apply (rule openin_Inter; auto) + done + qed + qed + qed + ultimately show ?thesis + by metis +next + case False + then show ?thesis + by (auto simp: continuous_map_def PiE_def) +qed + + +lemma continuous_map_componentwise_UNIV: + "continuous_map X (product_topology Y UNIV) f \ (\k. continuous_map X (Y k) (\x. f x k))" + by (simp add: continuous_map_componentwise) + +lemma continuous_map_product_projection [continuous_intros]: + "k \ I \ continuous_map (product_topology X I) (X k) (\x. x k)" + using continuous_map_componentwise [of "product_topology X I" X I id] by simp + +proposition open_map_product_projection: + assumes "i \ I" + shows "open_map (product_topology Y I) (Y i) (\f. f i)" + unfolding openin_product_topology all_union_of arbitrary_def open_map_def image_Union +proof clarify + fix \ + assume \: "\ \ Collect + (finite intersection_of + (\F. \i U. F = {f. f i \ U} \ i \ I \ openin (Y i) U) relative_to + topspace (product_topology Y I))" + show "openin (Y i) (\x\\. (\f. f i) ` x)" + proof (rule openin_Union, clarify) + fix S V + assume "V \ \" + obtain \ where "finite \" + and V: "V = (\\<^sub>E i\I. topspace (Y i)) \ \\" + and \: "\ \ {{f. f i \ U} |i U. i \ I \ openin (Y i) U}" + using subsetD [OF \ \V \ \\] + by (auto simp: intersection_of_def relative_to_def) + show "openin (Y i) ((\f. f i) ` V)" + proof (subst openin_subopen; clarify) + fix x f + assume "f \ V" + let ?T = "{a \ topspace(Y i). + (\j. if j = i then a + else if j \ I then f j else undefined) \ (\\<^sub>E i\I. topspace (Y i)) \ \\}" + show "\T. openin (Y i) T \ f i \ T \ T \ (\f. f i) ` V" + proof (intro exI conjI) + show "openin (Y i) ?T" + proof (rule openin_continuous_map_preimage) + have "continuous_map (Y i) (Y k) (\x. if k = i then x else f k)" if "k \ I" for k + proof (cases "k=i") + case True + then show ?thesis + by (metis (mono_tags) continuous_map_id eq_id_iff) + next + case False + then show ?thesis + by simp (metis IntD1 PiE_iff V \f \ V\ that) + qed + then show "continuous_map (Y i) (product_topology Y I) + (\x j. if j = i then x else if j \ I then f j else undefined)" + by (auto simp: continuous_map_componentwise assms extensional_def) + next + have "openin (product_topology Y I) (\\<^sub>E i\I. topspace (Y i))" + by (metis openin_topspace topspace_product_topology) + moreover have "openin (product_topology Y I) (\B\\. (\\<^sub>E i\I. topspace (Y i)) \ B)" + if "\ \ {}" + proof - + show ?thesis + proof (rule openin_Inter) + show "\X. X \ (\) (\\<^sub>E i\I. topspace (Y i)) ` \ \ openin (product_topology Y I) X" + unfolding openin_product_topology relative_to_def + apply (clarify intro!: arbitrary_union_of_inc) + apply (rename_tac F) + apply (rule_tac x=F in exI) + using subsetD [OF \] + apply (force intro: finite_intersection_of_inc) + done + qed (use \finite \\ \\ \ {}\ in auto) + qed + ultimately show "openin (product_topology Y I) ((\\<^sub>E i\I. topspace (Y i)) \ \\)" + by (auto simp only: Int_Inter_eq split: if_split) + qed + next + have eqf: "(\j. if j = i then f i else if j \ I then f j else undefined) = f" + using PiE_arb V \f \ V\ by force + show "f i \ ?T" + using V assms \f \ V\ by (auto simp: PiE_iff eqf) + next + show "?T \ (\f. f i) ` V" + unfolding V by (auto simp: intro!: rev_image_eqI) + qed + qed + qed +qed + +lemma retraction_map_product_projection: + assumes "i \ I" + shows "(retraction_map (product_topology X I) (X i) (\x. x i) \ + (topspace (product_topology X I) = {}) \ topspace (X i) = {})" + (is "?lhs = ?rhs") +proof + assume ?lhs + then show ?rhs + using retraction_imp_surjective_map by force +next + assume R: ?rhs + show ?lhs + proof (cases "topspace (product_topology X I) = {}") + case True + then show ?thesis + using R by (auto simp: retraction_map_def retraction_maps_def continuous_map_on_empty) + next + case False + have *: "\g. continuous_map (X i) (product_topology X I) g \ (\x\topspace (X i). g x i = x)" + if z: "z \ (\\<^sub>E i\I. topspace (X i))" for z + proof - + have cm: "continuous_map (X i) (X j) (\x. if j = i then x else z j)" if "j \ I" for j + using \j \ I\ z by (case_tac "j = i") auto + show ?thesis + using \i \ I\ that + by (rule_tac x="\x j. if j = i then x else z j" in exI) (auto simp: continuous_map_componentwise PiE_iff extensional_def cm) + qed + show ?thesis + using \i \ I\ False + by (auto simp: retraction_map_def retraction_maps_def assms continuous_map_product_projection *) + qed +qed + end