src/HOL/Analysis/Function_Topology.thy
changeset 64911 f0e07600de47
parent 64910 6108dddad9f0
child 65036 ab7e11730ad8
equal deleted inserted replaced
64910:6108dddad9f0 64911:f0e07600de47
     5 theory Function_Topology
     5 theory Function_Topology
     6 imports Topology_Euclidean_Space Bounded_Linear_Function Finite_Product_Measure
     6 imports Topology_Euclidean_Space Bounded_Linear_Function Finite_Product_Measure
     7 begin
     7 begin
     8 
     8 
     9 
     9 
    10 section {*Product topology*}
    10 section \<open>Product topology\<close>
    11 
    11 
    12 text {*We want to define the product topology.
    12 text \<open>We want to define the product topology.
    13 
    13 
    14 The product topology on a product of topological spaces is generated by
    14 The product topology on a product of topological spaces is generated by
    15 the sets which are products of open sets along finitely many coordinates, and the whole
    15 the sets which are products of open sets along finitely many coordinates, and the whole
    16 space along the other coordinates. This is the coarsest topology for which the projection
    16 space along the other coordinates. This is the coarsest topology for which the projection
    17 to each factor is continuous.
    17 to each factor is continuous.
    58 I only develop the basics of the product topology in this theory. The most important missing piece
    58 I only develop the basics of the product topology in this theory. The most important missing piece
    59 is Tychonov theorem, stating that a product of compact spaces is always compact for the product
    59 is Tychonov theorem, stating that a product of compact spaces is always compact for the product
    60 topology, even when the product is not finite (or even countable).
    60 topology, even when the product is not finite (or even countable).
    61 
    61 
    62 I realized afterwards that this theory has a lot in common with \verb+Fin_Map.thy+.
    62 I realized afterwards that this theory has a lot in common with \verb+Fin_Map.thy+.
    63 *}
    63 \<close>
    64 
    64 
    65 subsection {*Topology without type classes*}
    65 subsection \<open>Topology without type classes\<close>
    66 
    66 
    67 subsubsection {*The topology generated by some (open) subsets*}
    67 subsubsection \<open>The topology generated by some (open) subsets\<close>
    68 
    68 
    69 text {* In the definition below of a generated topology, the \<open>Empty\<close> case is not necessary,
    69 text \<open>In the definition below of a generated topology, the \<open>Empty\<close> case is not necessary,
    70 as it follows from \<open>UN\<close> taking for $K$ the empty set. However, it is convenient to have,
    70 as it follows from \<open>UN\<close> taking for $K$ the empty set. However, it is convenient to have,
    71 and is never a problem in proofs, so I prefer to write it down explicitly.
    71 and is never a problem in proofs, so I prefer to write it down explicitly.
    72 
    72 
    73 We do not require UNIV to be an open set, as this will not be the case in applications. (We are
    73 We do not require UNIV to be an open set, as this will not be the case in applications. (We are
    74 thinking of a topology on a subset of UNIV, the remaining part of UNIV being irrelevant.)*}
    74 thinking of a topology on a subset of UNIV, the remaining part of UNIV being irrelevant.)\<close>
    75 
    75 
    76 inductive generate_topology_on for S where
    76 inductive generate_topology_on for S where
    77 Empty: "generate_topology_on S {}"
    77 Empty: "generate_topology_on S {}"
    78 |Int: "generate_topology_on S a \<Longrightarrow> generate_topology_on S b \<Longrightarrow> generate_topology_on S (a \<inter> b)"
    78 |Int: "generate_topology_on S a \<Longrightarrow> generate_topology_on S b \<Longrightarrow> generate_topology_on S (a \<inter> b)"
    79 | UN: "(\<And>k. k \<in> K \<Longrightarrow> generate_topology_on S k) \<Longrightarrow> generate_topology_on S (\<Union>K)"
    79 | UN: "(\<And>k. k \<in> K \<Longrightarrow> generate_topology_on S k) \<Longrightarrow> generate_topology_on S (\<Union>K)"
    81 
    81 
    82 lemma istopology_generate_topology_on:
    82 lemma istopology_generate_topology_on:
    83   "istopology (generate_topology_on S)"
    83   "istopology (generate_topology_on S)"
    84 unfolding istopology_def by (auto intro: generate_topology_on.intros)
    84 unfolding istopology_def by (auto intro: generate_topology_on.intros)
    85 
    85 
    86 text {*The basic property of the topology generated by a set $S$ is that it is the
    86 text \<open>The basic property of the topology generated by a set $S$ is that it is the
    87 smallest topology containing all the elements of $S$:*}
    87 smallest topology containing all the elements of $S$:\<close>
    88 
    88 
    89 lemma generate_topology_on_coarsest:
    89 lemma generate_topology_on_coarsest:
    90   assumes "istopology T"
    90   assumes "istopology T"
    91           "\<And>s. s \<in> S \<Longrightarrow> T s"
    91           "\<And>s. s \<in> S \<Longrightarrow> T s"
    92           "generate_topology_on S s0"
    92           "generate_topology_on S s0"
   125 
   125 
   126 lemma topology_generated_by_Basis:
   126 lemma topology_generated_by_Basis:
   127   "s \<in> S \<Longrightarrow> openin (topology_generated_by S) s"
   127   "s \<in> S \<Longrightarrow> openin (topology_generated_by S) s"
   128 by (simp only: openin_topology_generated_by_iff, auto simp: generate_topology_on.Basis)
   128 by (simp only: openin_topology_generated_by_iff, auto simp: generate_topology_on.Basis)
   129 
   129 
   130 subsubsection {*Continuity*}
   130 subsubsection \<open>Continuity\<close>
   131 
   131 
   132 text {*We will need to deal with continuous maps in terms of topologies and not in terms
   132 text \<open>We will need to deal with continuous maps in terms of topologies and not in terms
   133 of type classes, as defined below.*}
   133 of type classes, as defined below.\<close>
   134 
   134 
   135 definition continuous_on_topo::"'a topology \<Rightarrow> 'b topology \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool"
   135 definition continuous_on_topo::"'a topology \<Rightarrow> 'b topology \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool"
   136   where "continuous_on_topo T1 T2 f = ((\<forall> U. openin T2 U \<longrightarrow> openin T1 (f-`U \<inter> topspace(T1)))
   136   where "continuous_on_topo T1 T2 f = ((\<forall> U. openin T2 U \<longrightarrow> openin T1 (f-`U \<inter> topspace(T1)))
   137                                       \<and> (f`(topspace T1) \<subseteq> (topspace T2)))"
   137                                       \<and> (f`(topspace T1) \<subseteq> (topspace T2)))"
   138 
   138 
   204   assumes "continuous_on_topo T1 T2 f"
   204   assumes "continuous_on_topo T1 T2 f"
   205   shows "f-`(topspace T2) \<inter> topspace T1 = topspace T1"
   205   shows "f-`(topspace T2) \<inter> topspace T1 = topspace T1"
   206 using assms unfolding continuous_on_topo_def by auto
   206 using assms unfolding continuous_on_topo_def by auto
   207 
   207 
   208 
   208 
   209 subsubsection {*Pullback topology*}
   209 subsubsection \<open>Pullback topology\<close>
   210 
   210 
   211 text {*Pulling back a topology by map gives again a topology. \<open>subtopology\<close> is
   211 text \<open>Pulling back a topology by map gives again a topology. \<open>subtopology\<close> is
   212 a special case of this notion, pulling back by the identity. We introduce the general notion as
   212 a special case of this notion, pulling back by the identity. We introduce the general notion as
   213 we will need it to define the strong operator topology on the space of continuous linear operators,
   213 we will need it to define the strong operator topology on the space of continuous linear operators,
   214 by pulling back the product topology on the space of all functions.*}
   214 by pulling back the product topology on the space of all functions.\<close>
   215 
   215 
   216 text {*\verb+pullback_topology A f T+ is the pullback of the topology $T$ by the map $f$ on
   216 text \<open>\verb+pullback_topology A f T+ is the pullback of the topology $T$ by the map $f$ on
   217 the set $A$.*}
   217 the set $A$.\<close>
   218 
   218 
   219 definition pullback_topology::"('a set) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b topology) \<Rightarrow> ('a topology)"
   219 definition pullback_topology::"('a set) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b topology) \<Rightarrow> ('a topology)"
   220   where "pullback_topology A f T = topology (\<lambda>S. \<exists>U. openin T U \<and> S = f-`U \<inter> A)"
   220   where "pullback_topology A f T = topology (\<lambda>S. \<exists>U. openin T U \<and> S = f-`U \<inter> A)"
   221 
   221 
   222 lemma istopology_pullback_topology:
   222 lemma istopology_pullback_topology:
   251   have "(g o f)-`U \<inter> topspace (pullback_topology A f T1) = (g o f)-`U \<inter> A \<inter> f-`(topspace T1)"
   251   have "(g o f)-`U \<inter> topspace (pullback_topology A f T1) = (g o f)-`U \<inter> A \<inter> f-`(topspace T1)"
   252     unfolding topspace_pullback_topology by auto
   252     unfolding topspace_pullback_topology by auto
   253   also have "... = f-`(g-`U \<inter> topspace T1) \<inter> A "
   253   also have "... = f-`(g-`U \<inter> topspace T1) \<inter> A "
   254     by auto
   254     by auto
   255   also have "openin (pullback_topology A f T1) (...)"
   255   also have "openin (pullback_topology A f T1) (...)"
   256     unfolding openin_pullback_topology using `openin T1 (g-\`U \<inter> topspace T1)` by auto
   256     unfolding openin_pullback_topology using \<open>openin T1 (g-`U \<inter> topspace T1)\<close> by auto
   257   finally show "openin (pullback_topology A f T1) ((g \<circ> f) -` U \<inter> topspace (pullback_topology A f T1))"
   257   finally show "openin (pullback_topology A f T1) ((g \<circ> f) -` U \<inter> topspace (pullback_topology A f T1))"
   258     by auto
   258     by auto
   259 next
   259 next
   260   fix x assume "x \<in> topspace (pullback_topology A f T1)"
   260   fix x assume "x \<in> topspace (pullback_topology A f T1)"
   261   then have "f x \<in> topspace T1"
   261   then have "f x \<in> topspace T1"
   279   also have "... = (f o g)-`V \<inter> (g-`A \<inter> topspace T1)"
   279   also have "... = (f o g)-`V \<inter> (g-`A \<inter> topspace T1)"
   280     by auto
   280     by auto
   281   also have "... = (f o g)-`V \<inter> topspace T1"
   281   also have "... = (f o g)-`V \<inter> topspace T1"
   282     using assms(2) by auto
   282     using assms(2) by auto
   283   also have "openin T1 (...)"
   283   also have "openin T1 (...)"
   284     using assms(1) `openin T2 V` by auto
   284     using assms(1) \<open>openin T2 V\<close> by auto
   285   finally show "openin T1 (g -` U \<inter> topspace T1)" by simp
   285   finally show "openin T1 (g -` U \<inter> topspace T1)" by simp
   286 next
   286 next
   287   fix x assume "x \<in> topspace T1"
   287   fix x assume "x \<in> topspace T1"
   288   have "(f o g) x \<in> topspace T2"
   288   have "(f o g) x \<in> topspace T2"
   289     using assms(1) `x \<in> topspace T1` unfolding continuous_on_topo_def by auto
   289     using assms(1) \<open>x \<in> topspace T1\<close> unfolding continuous_on_topo_def by auto
   290   then have "g x \<in> f-`(topspace T2)"
   290   then have "g x \<in> f-`(topspace T2)"
   291     unfolding comp_def by blast
   291     unfolding comp_def by blast
   292   moreover have "g x \<in> A" using assms(2) `x \<in> topspace T1` by blast
   292   moreover have "g x \<in> A" using assms(2) \<open>x \<in> topspace T1\<close> by blast
   293   ultimately show "g x \<in> topspace (pullback_topology A f T2)"
   293   ultimately show "g x \<in> topspace (pullback_topology A f T2)"
   294     unfolding topspace_pullback_topology by blast
   294     unfolding topspace_pullback_topology by blast
   295 qed
   295 qed
   296 
   296 
   297 
   297 
   298 subsection {*The product topology*}
   298 subsection \<open>The product topology\<close>
   299 
   299 
   300 text {*We can now define the product topology, as generated by
   300 text \<open>We can now define the product topology, as generated by
   301 the sets which are products of open sets along finitely many coordinates, and the whole
   301 the sets which are products of open sets along finitely many coordinates, and the whole
   302 space along the other coordinates. Equivalently, it is generated by sets which are one open
   302 space along the other coordinates. Equivalently, it is generated by sets which are one open
   303 set along one single coordinate, and the whole space along other coordinates. In fact, this is only
   303 set along one single coordinate, and the whole space along other coordinates. In fact, this is only
   304 equivalent for nonempty products, but for the empty product the first formulation is better
   304 equivalent for nonempty products, but for the empty product the first formulation is better
   305 (the second one gives an empty product space, while an empty product should have exactly one
   305 (the second one gives an empty product space, while an empty product should have exactly one
   306 point, equal to \verb+undefined+ along all coordinates.
   306 point, equal to \verb+undefined+ along all coordinates.
   307 
   307 
   308 So, we use the first formulation, which moreover seems to give rise to more straightforward proofs.
   308 So, we use the first formulation, which moreover seems to give rise to more straightforward proofs.
   309 *}
   309 \<close>
   310 
   310 
   311 definition product_topology::"('i \<Rightarrow> ('a topology)) \<Rightarrow> ('i set) \<Rightarrow> (('i \<Rightarrow> 'a) topology)"
   311 definition product_topology::"('i \<Rightarrow> ('a topology)) \<Rightarrow> ('i set) \<Rightarrow> (('i \<Rightarrow> 'a) topology)"
   312   where "product_topology T I =
   312   where "product_topology T I =
   313     topology_generated_by {(\<Pi>\<^sub>E i\<in>I. X i) |X. (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)}}"
   313     topology_generated_by {(\<Pi>\<^sub>E i\<in>I. X i) |X. (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)}}"
   314 
   314 
   315 text {*The total set of the product topology is the product of the total sets
   315 text \<open>The total set of the product topology is the product of the total sets
   316 along each coordinate.*}
   316 along each coordinate.\<close>
   317 
   317 
   318 lemma product_topology_topspace:
   318 lemma product_topology_topspace:
   319   "topspace (product_topology T I) = (\<Pi>\<^sub>E i\<in>I. topspace(T i))"
   319   "topspace (product_topology T I) = (\<Pi>\<^sub>E i\<in>I. topspace(T i))"
   320 proof
   320 proof
   321   show "topspace (product_topology T I) \<subseteq> (\<Pi>\<^sub>E i\<in>I. topspace (T i))"
   321   show "topspace (product_topology T I) \<subseteq> (\<Pi>\<^sub>E i\<in>I. topspace (T i))"
   365     with UN have "\<exists>X. x \<in> Pi\<^sub>E I X \<and> (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)} \<and> Pi\<^sub>E I X \<subseteq> k"
   365     with UN have "\<exists>X. x \<in> Pi\<^sub>E I X \<and> (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)} \<and> Pi\<^sub>E I X \<subseteq> k"
   366       by simp
   366       by simp
   367     then obtain X where "x \<in> Pi\<^sub>E I X \<and> (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)} \<and> Pi\<^sub>E I X \<subseteq> k"
   367     then obtain X where "x \<in> Pi\<^sub>E I X \<and> (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)} \<and> Pi\<^sub>E I X \<subseteq> k"
   368       by blast
   368       by blast
   369     then have "x \<in> Pi\<^sub>E I X \<and> (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)} \<and> Pi\<^sub>E I X \<subseteq> (\<Union>K)"
   369     then have "x \<in> Pi\<^sub>E I X \<and> (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)} \<and> Pi\<^sub>E I X \<subseteq> (\<Union>K)"
   370       using `k \<in> K` by auto
   370       using \<open>k \<in> K\<close> by auto
   371     then show ?case
   371     then show ?case
   372       by auto
   372       by auto
   373   qed auto
   373   qed auto
   374   then show ?thesis using `x \<in> U` by auto
   374   then show ?thesis using \<open>x \<in> U\<close> by auto
   375 qed
   375 qed
   376 
   376 
   377 
   377 
   378 text {*The basic property of the product topology is the continuity of projections:*}
   378 text \<open>The basic property of the product topology is the continuity of projections:\<close>
   379 
   379 
   380 lemma continuous_on_topo_product_coordinates [simp]:
   380 lemma continuous_on_topo_product_coordinates [simp]:
   381   assumes "i \<in> I"
   381   assumes "i \<in> I"
   382   shows "continuous_on_topo (product_topology T I) (T i) (\<lambda>x. x i)"
   382   shows "continuous_on_topo (product_topology T I) (T i) (\<lambda>x. x i)"
   383 proof -
   383 proof -
   384   {
   384   {
   385     fix U assume "openin (T i) U"
   385     fix U assume "openin (T i) U"
   386     define X where "X = (\<lambda>j. if j = i then U else topspace (T j))"
   386     define X where "X = (\<lambda>j. if j = i then U else topspace (T j))"
   387     then have *: "(\<lambda>x. x i) -` U \<inter> (\<Pi>\<^sub>E i\<in>I. topspace (T i)) = (\<Pi>\<^sub>E j\<in>I. X j)"
   387     then have *: "(\<lambda>x. x i) -` U \<inter> (\<Pi>\<^sub>E i\<in>I. topspace (T i)) = (\<Pi>\<^sub>E j\<in>I. X j)"
   388       unfolding X_def using assms openin_subset[OF `openin (T i) U`]
   388       unfolding X_def using assms openin_subset[OF \<open>openin (T i) U\<close>]
   389       by (auto simp add: PiE_iff, auto, metis subsetCE)
   389       by (auto simp add: PiE_iff, auto, metis subsetCE)
   390     have **: "(\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)}"
   390     have **: "(\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)}"
   391       unfolding X_def using `openin (T i) U` by auto
   391       unfolding X_def using \<open>openin (T i) U\<close> by auto
   392     have "openin (product_topology T I) ((\<lambda>x. x i) -` U \<inter> (\<Pi>\<^sub>E i\<in>I. topspace (T i)))"
   392     have "openin (product_topology T I) ((\<lambda>x. x i) -` U \<inter> (\<Pi>\<^sub>E i\<in>I. topspace (T i)))"
   393       unfolding product_topology_def
   393       unfolding product_topology_def
   394       apply (rule topology_generated_by_Basis)
   394       apply (rule topology_generated_by_Basis)
   395       apply (subst *)
   395       apply (subst *)
   396       using ** by auto
   396       using ** by auto
   415   then have *: "(\<lambda>x. f x i)-`(X i) \<inter> topspace T1 = topspace T1" if "i \<in> I-J" for i
   415   then have *: "(\<lambda>x. f x i)-`(X i) \<inter> topspace T1 = topspace T1" if "i \<in> I-J" for i
   416     using that unfolding J_def by auto
   416     using that unfolding J_def by auto
   417   have "f-`U \<inter> topspace T1 = (\<Inter>i\<in>I. (\<lambda>x. f x i)-`(X i) \<inter> topspace T1) \<inter> (topspace T1)"
   417   have "f-`U \<inter> topspace T1 = (\<Inter>i\<in>I. (\<lambda>x. f x i)-`(X i) \<inter> topspace T1) \<inter> (topspace T1)"
   418     by (subst H(1), auto simp add: PiE_iff assms)
   418     by (subst H(1), auto simp add: PiE_iff assms)
   419   also have "... = (\<Inter>i\<in>J. (\<lambda>x. f x i)-`(X i) \<inter> topspace T1) \<inter> (topspace T1)"
   419   also have "... = (\<Inter>i\<in>J. (\<lambda>x. f x i)-`(X i) \<inter> topspace T1) \<inter> (topspace T1)"
   420     using * `J \<subseteq> I` by auto
   420     using * \<open>J \<subseteq> I\<close> by auto
   421   also have "openin T1 (...)"
   421   also have "openin T1 (...)"
   422     apply (rule openin_INT)
   422     apply (rule openin_INT)
   423     apply (simp add: `finite J`)
   423     apply (simp add: \<open>finite J\<close>)
   424     using H(2) assms(1) `J \<subseteq> I` by auto
   424     using H(2) assms(1) \<open>J \<subseteq> I\<close> by auto
   425   ultimately show "openin T1 (f-`U \<inter> topspace T1)" by simp
   425   ultimately show "openin T1 (f-`U \<inter> topspace T1)" by simp
   426 next
   426 next
   427   show "f `topspace T1 \<subseteq> \<Union>{Pi\<^sub>E I X |X. (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)}}"
   427   show "f `topspace T1 \<subseteq> \<Union>{Pi\<^sub>E I X |X. (\<forall>i. openin (T i) (X i)) \<and> finite {i. X i \<noteq> topspace (T i)}}"
   428     apply (subst topology_generated_by_topspace[symmetric])
   428     apply (subst topology_generated_by_topspace[symmetric])
   429     apply (subst product_topology_def[symmetric])
   429     apply (subst product_topology_def[symmetric])
   439 proof -
   439 proof -
   440   fix i assume "i \<in> I"
   440   fix i assume "i \<in> I"
   441   have "(\<lambda>x. f x i) = (\<lambda>y. y i) o f" by auto
   441   have "(\<lambda>x. f x i) = (\<lambda>y. y i) o f" by auto
   442   also have "continuous_on_topo T1 (T i) (...)"
   442   also have "continuous_on_topo T1 (T i) (...)"
   443     apply (rule continuous_on_topo_compose[of _ "product_topology T I"])
   443     apply (rule continuous_on_topo_compose[of _ "product_topology T I"])
   444     using assms `i \<in> I` by auto
   444     using assms \<open>i \<in> I\<close> by auto
   445   ultimately show "continuous_on_topo T1 (T i) (\<lambda>x. f x i)"
   445   ultimately show "continuous_on_topo T1 (T i) (\<lambda>x. f x i)"
   446     by simp
   446     by simp
   447 next
   447 next
   448   fix i x assume "i \<notin> I" "x \<in> topspace T1"
   448   fix i x assume "i \<notin> I" "x \<in> topspace T1"
   449   have "f x \<in> topspace (product_topology T I)"
   449   have "f x \<in> topspace (product_topology T I)"
   450     using assms `x \<in> topspace T1` unfolding continuous_on_topo_def by auto
   450     using assms \<open>x \<in> topspace T1\<close> unfolding continuous_on_topo_def by auto
   451   then have "f x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (T i))"
   451   then have "f x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (T i))"
   452     using product_topology_topspace by metis
   452     using product_topology_topspace by metis
   453   then show "f x i = undefined"
   453   then show "f x i = undefined"
   454     using `i \<notin> I` by (auto simp add: PiE_iff extensional_def)
   454     using \<open>i \<notin> I\<close> by (auto simp add: PiE_iff extensional_def)
   455 qed
   455 qed
   456 
   456 
   457 lemma continuous_on_restrict:
   457 lemma continuous_on_restrict:
   458   assumes "J \<subseteq> I"
   458   assumes "J \<subseteq> I"
   459   shows "continuous_on_topo (product_topology T I) (product_topology T J) (\<lambda>x. restrict x J)"
   459   shows "continuous_on_topo (product_topology T I) (product_topology T J) (\<lambda>x. restrict x J)"
   460 proof (rule continuous_on_topo_coordinatewise_then_product)
   460 proof (rule continuous_on_topo_coordinatewise_then_product)
   461   fix i assume "i \<in> J"
   461   fix i assume "i \<in> J"
   462   then have "(\<lambda>x. restrict x J i) = (\<lambda>x. x i)" unfolding restrict_def by auto
   462   then have "(\<lambda>x. restrict x J i) = (\<lambda>x. x i)" unfolding restrict_def by auto
   463   then show "continuous_on_topo (product_topology T I) (T i) (\<lambda>x. restrict x J i)"
   463   then show "continuous_on_topo (product_topology T I) (T i) (\<lambda>x. restrict x J i)"
   464     using `i \<in> J` `J \<subseteq> I` by auto
   464     using \<open>i \<in> J\<close> \<open>J \<subseteq> I\<close> by auto
   465 next
   465 next
   466   fix i assume "i \<notin> J"
   466   fix i assume "i \<notin> J"
   467   then show "restrict x J i = undefined" for x::"'a \<Rightarrow> 'b"
   467   then show "restrict x J i = undefined" for x::"'a \<Rightarrow> 'b"
   468     unfolding restrict_def by auto
   468     unfolding restrict_def by auto
   469 qed
   469 qed
   470 
   470 
   471 
   471 
   472 subsubsection {*Powers of a single topological space as a topological space, using type classes*}
   472 subsubsection \<open>Powers of a single topological space as a topological space, using type classes\<close>
   473 
   473 
   474 instantiation "fun" :: (type, topological_space) topological_space
   474 instantiation "fun" :: (type, topological_space) topological_space
   475 begin
   475 begin
   476 
   476 
   477 definition open_fun_def:
   477 definition open_fun_def:
   519         using f3 a2 by (meson Inter_iff)
   519         using f3 a2 by (meson Inter_iff)
   520     qed
   520     qed
   521   ultimately show ?thesis by simp
   521   ultimately show ?thesis by simp
   522 qed
   522 qed
   523 
   523 
   524 text {*The results proved in the general situation of products of possibly different
   524 text \<open>The results proved in the general situation of products of possibly different
   525 spaces have their counterparts in this simpler setting.*}
   525 spaces have their counterparts in this simpler setting.\<close>
   526 
   526 
   527 lemma continuous_on_product_coordinates [simp]:
   527 lemma continuous_on_product_coordinates [simp]:
   528   "continuous_on UNIV (\<lambda>x. x i::('b::topological_space))"
   528   "continuous_on UNIV (\<lambda>x. x i::('b::topological_space))"
   529 unfolding continuous_on_topo_UNIV euclidean_product_topology
   529 unfolding continuous_on_topo_UNIV euclidean_product_topology
   530 by (rule continuous_on_topo_product_coordinates, simp)
   530 by (rule continuous_on_topo_product_coordinates, simp)
   543 
   543 
   544 lemma continuous_on_product_coordinatewise_iff:
   544 lemma continuous_on_product_coordinatewise_iff:
   545   "continuous_on UNIV f \<longleftrightarrow> (\<forall>i. continuous_on UNIV (\<lambda>x. f x i))"
   545   "continuous_on UNIV f \<longleftrightarrow> (\<forall>i. continuous_on UNIV (\<lambda>x. f x i))"
   546 by (auto intro: continuous_on_product_then_coordinatewise)
   546 by (auto intro: continuous_on_product_then_coordinatewise)
   547 
   547 
   548 subsubsection {*Topological countability for product spaces*}
   548 subsubsection \<open>Topological countability for product spaces\<close>
   549 
   549 
   550 text {*The next two lemmas are useful to prove first or second countability
   550 text \<open>The next two lemmas are useful to prove first or second countability
   551 of product spaces, but they have more to do with countability and could
   551 of product spaces, but they have more to do with countability and could
   552 be put in the corresponding theory.*}
   552 be put in the corresponding theory.\<close>
   553 
   553 
   554 lemma countable_nat_product_event_const:
   554 lemma countable_nat_product_event_const:
   555   fixes F::"'a set" and a::'a
   555   fixes F::"'a set" and a::'a
   556   assumes "a \<in> F" "countable F"
   556   assumes "a \<in> F" "countable F"
   557   shows "countable {x::(nat \<Rightarrow> 'a). (\<forall>i. x i \<in> F) \<and> finite {i. x i \<noteq> a}}"
   557   shows "countable {x::(nat \<Rightarrow> 'a). (\<forall>i. x i \<in> F) \<and> finite {i. x i \<noteq> a}}"
   561     using infinite_nat_iff_unbounded_le by fastforce
   561     using infinite_nat_iff_unbounded_le by fastforce
   562   have "countable {x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)}" for N::nat
   562   have "countable {x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)}" for N::nat
   563   proof (induction N)
   563   proof (induction N)
   564     case 0
   564     case 0
   565     have "{x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>(0::nat). x i = a)} = {(\<lambda>i. a)}"
   565     have "{x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>(0::nat). x i = a)} = {(\<lambda>i. a)}"
   566       using `a \<in> F` by auto
   566       using \<open>a \<in> F\<close> by auto
   567     then show ?case by auto
   567     then show ?case by auto
   568   next
   568   next
   569     case (Suc N)
   569     case (Suc N)
   570     define f::"((nat \<Rightarrow> 'a) \<times> 'a) \<Rightarrow> (nat \<Rightarrow> 'a)"
   570     define f::"((nat \<Rightarrow> 'a) \<times> 'a) \<Rightarrow> (nat \<Rightarrow> 'a)"
   571       where "f = (\<lambda>(x, b). (\<lambda>i. if i = N then b else x i))"
   571       where "f = (\<lambda>(x, b). (\<lambda>i. if i = N then b else x i))"
   574       fix x assume H: "\<forall>i::nat. x i \<in> F" "\<forall>i\<ge>Suc N. x i = a"
   574       fix x assume H: "\<forall>i::nat. x i \<in> F" "\<forall>i\<ge>Suc N. x i = a"
   575       define y where "y = (\<lambda>i. if i = N then a else x i)"
   575       define y where "y = (\<lambda>i. if i = N then a else x i)"
   576       have "f (y, x N) = x"
   576       have "f (y, x N) = x"
   577         unfolding f_def y_def by auto
   577         unfolding f_def y_def by auto
   578       moreover have "(y, x N) \<in> {x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)} \<times> F"
   578       moreover have "(y, x N) \<in> {x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)} \<times> F"
   579         unfolding y_def using H `a \<in> F` by auto
   579         unfolding y_def using H \<open>a \<in> F\<close> by auto
   580       ultimately show "x \<in> f`({x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)} \<times> F)"
   580       ultimately show "x \<in> f`({x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)} \<times> F)"
   581         by (metis (no_types, lifting) image_eqI)
   581         by (metis (no_types, lifting) image_eqI)
   582     qed
   582     qed
   583     moreover have "countable ({x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)} \<times> F)"
   583     moreover have "countable ({x. (\<forall>i. x i \<in> F) \<and> (\<forall>i\<ge>N. x i = a)} \<times> F)"
   584       using Suc.IH assms(2) by auto
   584       using Suc.IH assms(2) by auto
   614       unfolding pi_def g_def I_def using H by fastforce
   614       unfolding pi_def g_def I_def using H by fastforce
   615     ultimately show "f \<in> pi`{g. (\<forall>j. g j \<in> G) \<and> finite {j. g j \<noteq> b}}"
   615     ultimately show "f \<in> pi`{g. (\<forall>j. g j \<in> G) \<and> finite {j. g j \<noteq> b}}"
   616       by auto
   616       by auto
   617   qed
   617   qed
   618   then show ?thesis
   618   then show ?thesis
   619     using countable_nat_product_event_const[OF `b \<in> G` `countable G`]
   619     using countable_nat_product_event_const[OF \<open>b \<in> G\<close> \<open>countable G\<close>]
   620     by (meson countable_image countable_subset)
   620     by (meson countable_image countable_subset)
   621 qed
   621 qed
   622 
   622 
   623 instance "fun" :: (countable, first_countable_topology) first_countable_topology
   623 instance "fun" :: (countable, first_countable_topology) first_countable_topology
   624 proof
   624 proof
   627     apply (rule choice) using first_countable_basis by auto
   627     apply (rule choice) using first_countable_basis by auto
   628   then obtain A::"('b \<Rightarrow> nat \<Rightarrow> 'b set)" where A: "\<And>x i. x \<in> A x i"
   628   then obtain A::"('b \<Rightarrow> nat \<Rightarrow> 'b set)" where A: "\<And>x i. x \<in> A x i"
   629                                                   "\<And>x i. open (A x i)"
   629                                                   "\<And>x i. open (A x i)"
   630                                                   "\<And>x S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> (\<exists>i. A x i \<subseteq> S)"
   630                                                   "\<And>x S. open S \<Longrightarrow> x \<in> S \<Longrightarrow> (\<exists>i. A x i \<subseteq> S)"
   631     by metis
   631     by metis
   632   text {*$B i$ is a countable basis of neighborhoods of $x_i$.*}
   632   text \<open>$B i$ is a countable basis of neighborhoods of $x_i$.\<close>
   633   define B where "B = (\<lambda>i. (A (x i))`UNIV \<union> {UNIV})"
   633   define B where "B = (\<lambda>i. (A (x i))`UNIV \<union> {UNIV})"
   634   have "countable (B i)" for i unfolding B_def by auto
   634   have "countable (B i)" for i unfolding B_def by auto
   635 
   635 
   636   define K where "K = {Pi\<^sub>E UNIV X | X. (\<forall>i. X i \<in> B i) \<and> finite {i. X i \<noteq> UNIV}}"
   636   define K where "K = {Pi\<^sub>E UNIV X | X. (\<forall>i. X i \<in> B i) \<and> finite {i. X i \<noteq> UNIV}}"
   637   have "Pi\<^sub>E UNIV (\<lambda>i. UNIV) \<in> K"
   637   have "Pi\<^sub>E UNIV (\<lambda>i. UNIV) \<in> K"
   638     unfolding K_def B_def by auto
   638     unfolding K_def B_def by auto
   639   then have "K \<noteq> {}" by auto
   639   then have "K \<noteq> {}" by auto
   640   have "countable {X. (\<forall>i. X i \<in> B i) \<and> finite {i. X i \<noteq> UNIV}}"
   640   have "countable {X. (\<forall>i. X i \<in> B i) \<and> finite {i. X i \<noteq> UNIV}}"
   641     apply (rule countable_product_event_const) using `\<And>i. countable (B i)` by auto
   641     apply (rule countable_product_event_const) using \<open>\<And>i. countable (B i)\<close> by auto
   642   moreover have "K = (\<lambda>X. Pi\<^sub>E UNIV X)`{X. (\<forall>i. X i \<in> B i) \<and> finite {i. X i \<noteq> UNIV}}"
   642   moreover have "K = (\<lambda>X. Pi\<^sub>E UNIV X)`{X. (\<forall>i. X i \<in> B i) \<and> finite {i. X i \<noteq> UNIV}}"
   643     unfolding K_def by auto
   643     unfolding K_def by auto
   644   ultimately have "countable K" by auto
   644   ultimately have "countable K" by auto
   645   have "x \<in> k" if "k \<in> K" for k
   645   have "x \<in> k" if "k \<in> K" for k
   646     using that unfolding K_def B_def apply auto using A(1) by auto
   646     using that unfolding K_def B_def apply auto using A(1) by auto
   650     unfolding topspace_euclidean by (auto, metis imageE open_UNIV A(2))
   650     unfolding topspace_euclidean by (auto, metis imageE open_UNIV A(2))
   651 
   651 
   652   have Inc: "\<exists>k\<in>K. k \<subseteq> U" if "open U \<and> x \<in> U" for U
   652   have Inc: "\<exists>k\<in>K. k \<subseteq> U" if "open U \<and> x \<in> U" for U
   653   proof -
   653   proof -
   654     have "openin (product_topology (\<lambda>i. euclidean) UNIV) U" "x \<in> U"
   654     have "openin (product_topology (\<lambda>i. euclidean) UNIV) U" "x \<in> U"
   655       using `open U \<and> x \<in> U` unfolding open_fun_def by auto
   655       using \<open>open U \<and> x \<in> U\<close> unfolding open_fun_def by auto
   656     with product_topology_open_contains_basis[OF this]
   656     with product_topology_open_contains_basis[OF this]
   657     have "\<exists>X. x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV} \<and> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<subseteq> U"
   657     have "\<exists>X. x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV} \<and> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<subseteq> U"
   658       unfolding topspace_euclidean open_openin by simp
   658       unfolding topspace_euclidean open_openin by simp
   659     then obtain X where H: "x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i)"
   659     then obtain X where H: "x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i)"
   660                            "\<And>i. open (X i)"
   660                            "\<And>i. open (X i)"
   683 
   683 
   684     have "Y i \<subseteq> X i" for i
   684     have "Y i \<subseteq> X i" for i
   685       apply (cases "i \<in> I") using ** apply simp unfolding Y_def I_def by auto
   685       apply (cases "i \<in> I") using ** apply simp unfolding Y_def I_def by auto
   686     then have "Pi\<^sub>E UNIV Y \<subseteq> Pi\<^sub>E UNIV X" by auto
   686     then have "Pi\<^sub>E UNIV Y \<subseteq> Pi\<^sub>E UNIV X" by auto
   687     then have "Pi\<^sub>E UNIV Y \<subseteq> U" using H(4) by auto
   687     then have "Pi\<^sub>E UNIV Y \<subseteq> U" using H(4) by auto
   688     then show ?thesis using `Pi\<^sub>E UNIV Y \<in> K` by auto
   688     then show ?thesis using \<open>Pi\<^sub>E UNIV Y \<in> K\<close> by auto
   689   qed
   689   qed
   690 
   690 
   691   show "\<exists>L. (\<forall>(i::nat). x \<in> L i \<and> open (L i)) \<and> (\<forall>U. open U \<and> x \<in> U \<longrightarrow> (\<exists>i. L i \<subseteq> U))"
   691   show "\<exists>L. (\<forall>(i::nat). x \<in> L i \<and> open (L i)) \<and> (\<forall>U. open U \<and> x \<in> U \<longrightarrow> (\<exists>i. L i \<subseteq> U))"
   692     apply (rule first_countableI[of K])
   692     apply (rule first_countableI[of K])
   693     using `countable K` `\<And>k. k \<in> K \<Longrightarrow> x \<in> k` `\<And>k. k \<in> K \<Longrightarrow> open k` Inc by auto
   693     using \<open>countable K\<close> \<open>\<And>k. k \<in> K \<Longrightarrow> x \<in> k\<close> \<open>\<And>k. k \<in> K \<Longrightarrow> open k\<close> Inc by auto
   694 qed
   694 qed
   695 
   695 
   696 lemma product_topology_countable_basis:
   696 lemma product_topology_countable_basis:
   697   shows "\<exists>K::(('a::countable \<Rightarrow> 'b::second_countable_topology) set set).
   697   shows "\<exists>K::(('a::countable \<Rightarrow> 'b::second_countable_topology) set set).
   698           topological_basis K \<and> countable K \<and>
   698           topological_basis K \<and> countable K \<and>
   707   have "open U" if "U \<in> B2" for U
   707   have "open U" if "U \<in> B2" for U
   708     using that unfolding B2_def using B topological_basis_open by auto
   708     using that unfolding B2_def using B topological_basis_open by auto
   709 
   709 
   710   define K where "K = {Pi\<^sub>E UNIV X | X. (\<forall>i::'a. X i \<in> B2) \<and> finite {i. X i \<noteq> UNIV}}"
   710   define K where "K = {Pi\<^sub>E UNIV X | X. (\<forall>i::'a. X i \<in> B2) \<and> finite {i. X i \<noteq> UNIV}}"
   711   have i: "\<forall>k\<in>K. \<exists>X. (k = Pi\<^sub>E UNIV X) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV}"
   711   have i: "\<forall>k\<in>K. \<exists>X. (k = Pi\<^sub>E UNIV X) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV}"
   712     unfolding K_def using `\<And>U. U \<in> B2 \<Longrightarrow> open U` by auto
   712     unfolding K_def using \<open>\<And>U. U \<in> B2 \<Longrightarrow> open U\<close> by auto
   713 
   713 
   714   have "countable {X. (\<forall>(i::'a). X i \<in> B2) \<and> finite {i. X i \<noteq> UNIV}}"
   714   have "countable {X. (\<forall>(i::'a). X i \<in> B2) \<and> finite {i. X i \<noteq> UNIV}}"
   715     apply (rule countable_product_event_const) using `countable B2` by auto
   715     apply (rule countable_product_event_const) using \<open>countable B2\<close> by auto
   716   moreover have "K = (\<lambda>X. Pi\<^sub>E UNIV X)`{X. (\<forall>i. X i \<in> B2) \<and> finite {i. X i \<noteq> UNIV}}"
   716   moreover have "K = (\<lambda>X. Pi\<^sub>E UNIV X)`{X. (\<forall>i. X i \<in> B2) \<and> finite {i. X i \<noteq> UNIV}}"
   717     unfolding K_def by auto
   717     unfolding K_def by auto
   718   ultimately have ii: "countable K" by auto
   718   ultimately have ii: "countable K" by auto
   719 
   719 
   720   have iii: "topological_basis K"
   720   have iii: "topological_basis K"
   721   proof (rule topological_basisI)
   721   proof (rule topological_basisI)
   722     fix U and x::"'a\<Rightarrow>'b" assume "open U" "x \<in> U"
   722     fix U and x::"'a\<Rightarrow>'b" assume "open U" "x \<in> U"
   723     then have "openin (product_topology (\<lambda>i. euclidean) UNIV) U"
   723     then have "openin (product_topology (\<lambda>i. euclidean) UNIV) U"
   724       unfolding open_fun_def by auto
   724       unfolding open_fun_def by auto
   725     with product_topology_open_contains_basis[OF this `x \<in> U`]
   725     with product_topology_open_contains_basis[OF this \<open>x \<in> U\<close>]
   726     have "\<exists>X. x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV} \<and> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<subseteq> U"
   726     have "\<exists>X. x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV} \<and> (\<Pi>\<^sub>E i\<in>UNIV. X i) \<subseteq> U"
   727       unfolding topspace_euclidean open_openin by simp
   727       unfolding topspace_euclidean open_openin by simp
   728     then obtain X where H: "x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i)"
   728     then obtain X where H: "x \<in> (\<Pi>\<^sub>E i\<in>UNIV. X i)"
   729                            "\<And>i. open (X i)"
   729                            "\<And>i. open (X i)"
   730                            "finite {i. X i \<noteq> UNIV}"
   730                            "finite {i. X i \<noteq> UNIV}"
   732       by auto
   732       by auto
   733     then have "x i \<in> X i" for i by auto
   733     then have "x i \<in> X i" for i by auto
   734     define I where "I = {i. X i \<noteq> UNIV}"
   734     define I where "I = {i. X i \<noteq> UNIV}"
   735     define Y where "Y = (\<lambda>i. if i \<in> I then (SOME y. y \<in> B2 \<and> y \<subseteq> X i \<and> x i \<in> y) else UNIV)"
   735     define Y where "Y = (\<lambda>i. if i \<in> I then (SOME y. y \<in> B2 \<and> y \<subseteq> X i \<and> x i \<in> y) else UNIV)"
   736     have *: "\<exists>y. y \<in> B2 \<and> y \<subseteq> X i \<and> x i \<in> y" for i
   736     have *: "\<exists>y. y \<in> B2 \<and> y \<subseteq> X i \<and> x i \<in> y" for i
   737       unfolding B2_def using B `open (X i)` `x i \<in> X i` by (meson UnCI topological_basisE)
   737       unfolding B2_def using B \<open>open (X i)\<close> \<open>x i \<in> X i\<close> by (meson UnCI topological_basisE)
   738     have **: "Y i \<in> B2 \<and> Y i \<subseteq> X i \<and> x i \<in> Y i" for i
   738     have **: "Y i \<in> B2 \<and> Y i \<subseteq> X i \<and> x i \<in> Y i" for i
   739       using someI_ex[OF *]
   739       using someI_ex[OF *]
   740       apply (cases "i \<in> I")
   740       apply (cases "i \<in> I")
   741       unfolding Y_def using * apply (auto)
   741       unfolding Y_def using * apply (auto)
   742       unfolding B2_def I_def by auto
   742       unfolding B2_def I_def by auto
   756 
   756 
   757     have "x \<in> Pi\<^sub>E UNIV Y"
   757     have "x \<in> Pi\<^sub>E UNIV Y"
   758       using ** by auto
   758       using ** by auto
   759 
   759 
   760     show "\<exists>V\<in>K. x \<in> V \<and> V \<subseteq> U"
   760     show "\<exists>V\<in>K. x \<in> V \<and> V \<subseteq> U"
   761       using `Pi\<^sub>E UNIV Y \<in> K` `Pi\<^sub>E UNIV Y \<subseteq> U` `x \<in> Pi\<^sub>E UNIV Y` by auto
   761       using \<open>Pi\<^sub>E UNIV Y \<in> K\<close> \<open>Pi\<^sub>E UNIV Y \<subseteq> U\<close> \<open>x \<in> Pi\<^sub>E UNIV Y\<close> by auto
   762   next
   762   next
   763     fix U assume "U \<in> K"
   763     fix U assume "U \<in> K"
   764     show "open U"
   764     show "open U"
   765       using `U \<in> K` unfolding open_fun_def K_def apply (auto)
   765       using \<open>U \<in> K\<close> unfolding open_fun_def K_def apply (auto)
   766       apply (rule product_topology_basis)
   766       apply (rule product_topology_basis)
   767       using `\<And>V. V \<in> B2 \<Longrightarrow> open V` open_UNIV unfolding topspace_euclidean open_openin[symmetric]
   767       using \<open>\<And>V. V \<in> B2 \<Longrightarrow> open V\<close> open_UNIV unfolding topspace_euclidean open_openin[symmetric]
   768       by auto
   768       by auto
   769   qed
   769   qed
   770 
   770 
   771   show ?thesis using i ii iii by auto
   771   show ?thesis using i ii iii by auto
   772 qed
   772 qed
   774 instance "fun" :: (countable, second_countable_topology) second_countable_topology
   774 instance "fun" :: (countable, second_countable_topology) second_countable_topology
   775   apply standard
   775   apply standard
   776   using product_topology_countable_basis topological_basis_imp_subbasis by auto
   776   using product_topology_countable_basis topological_basis_imp_subbasis by auto
   777 
   777 
   778 
   778 
   779 subsection {*The strong operator topology on continuous linear operators*}
   779 subsection \<open>The strong operator topology on continuous linear operators\<close>
   780 
   780 
   781 text {*Let 'a and 'b be two normed real vector spaces. Then the space of linear continuous
   781 text \<open>Let 'a and 'b be two normed real vector spaces. Then the space of linear continuous
   782 operators from 'a to 'b has a canonical norm, and therefore a canonical corresponding topology
   782 operators from 'a to 'b has a canonical norm, and therefore a canonical corresponding topology
   783 (the type classes instantiation are given in \verb+Bounded_Linear_Function.thy+).
   783 (the type classes instantiation are given in \verb+Bounded_Linear_Function.thy+).
   784 
   784 
   785 However, there is another topology on this space, the strong operator topology, where $T_n$ tends to
   785 However, there is another topology on this space, the strong operator topology, where $T_n$ tends to
   786 $T$ iff, for all $x$ in 'a, then $T_n x$ tends to $T x$. This is precisely the product topology
   786 $T$ iff, for all $x$ in 'a, then $T_n x$ tends to $T x$. This is precisely the product topology
   793 Note that there is yet another (common and useful) topology on operator spaces, the weak operator
   793 Note that there is yet another (common and useful) topology on operator spaces, the weak operator
   794 topology, defined analogously using the product topology, but where the target space is given the
   794 topology, defined analogously using the product topology, but where the target space is given the
   795 weak-* topology, i.e., the pullback of the weak topology on the bidual of the space under the
   795 weak-* topology, i.e., the pullback of the weak topology on the bidual of the space under the
   796 canonical embedding of a space into its bidual. We do not define it there, although it could also be
   796 canonical embedding of a space into its bidual. We do not define it there, although it could also be
   797 defined analogously.
   797 defined analogously.
   798 *}
   798 \<close>
   799 
   799 
   800 definition strong_operator_topology::"('a::real_normed_vector \<Rightarrow>\<^sub>L'b::real_normed_vector) topology"
   800 definition strong_operator_topology::"('a::real_normed_vector \<Rightarrow>\<^sub>L'b::real_normed_vector) topology"
   801 where "strong_operator_topology = pullback_topology UNIV blinfun_apply euclidean"
   801 where "strong_operator_topology = pullback_topology UNIV blinfun_apply euclidean"
   802 
   802 
   803 lemma strong_operator_topology_topspace:
   803 lemma strong_operator_topology_topspace:
   845     apply (rule continuous_on_topo_coordinatewise_then_product, auto)
   845     apply (rule continuous_on_topo_coordinatewise_then_product, auto)
   846     using * unfolding comp_def by auto
   846     using * unfolding comp_def by auto
   847   show "continuous_on_topo T strong_operator_topology f"
   847   show "continuous_on_topo T strong_operator_topology f"
   848     unfolding strong_operator_topology_def
   848     unfolding strong_operator_topology_def
   849     apply (rule continuous_on_topo_pullback')
   849     apply (rule continuous_on_topo_pullback')
   850     by (auto simp add: `continuous_on_topo T euclidean (blinfun_apply o f)`)
   850     by (auto simp add: \<open>continuous_on_topo T euclidean (blinfun_apply o f)\<close>)
   851 qed
   851 qed
   852 
   852 
   853 lemma strong_operator_topology_weaker_than_euclidean:
   853 lemma strong_operator_topology_weaker_than_euclidean:
   854   "continuous_on_topo euclidean strong_operator_topology (\<lambda>f. f)"
   854   "continuous_on_topo euclidean strong_operator_topology (\<lambda>f. f)"
   855 by (subst continuous_on_strong_operator_topo_iff_coordinatewise,
   855 by (subst continuous_on_strong_operator_topo_iff_coordinatewise,
   856     auto simp add: continuous_on_topo_UNIV[symmetric] linear_continuous_on)
   856     auto simp add: continuous_on_topo_UNIV[symmetric] linear_continuous_on)
   857 
   857 
   858 
   858 
   859 subsection {*Metrics on product spaces*}
   859 subsection \<open>Metrics on product spaces\<close>
   860 
   860 
   861 
   861 
   862 text {*In general, the product topology is not metrizable, unless the index set is countable.
   862 text \<open>In general, the product topology is not metrizable, unless the index set is countable.
   863 When the index set is countable, essentially any (convergent) combination of the metrics on the
   863 When the index set is countable, essentially any (convergent) combination of the metrics on the
   864 factors will do. We use below the simplest one, based on $L^1$, but $L^2$ would also work,
   864 factors will do. We use below the simplest one, based on $L^1$, but $L^2$ would also work,
   865 for instance.
   865 for instance.
   866 
   866 
   867 What is not completely trivial is that the distance thus defined induces the same topology
   867 What is not completely trivial is that the distance thus defined induces the same topology
   868 as the product topology. This is what we have to prove to show that we have an instance
   868 as the product topology. This is what we have to prove to show that we have an instance
   869 of \verb+metric_space+.
   869 of \verb+metric_space+.
   870 
   870 
   871 The proofs below would work verbatim for general countable products of metric spaces. However,
   871 The proofs below would work verbatim for general countable products of metric spaces. However,
   872 since distances are only implemented in terms of type classes, we only develop the theory
   872 since distances are only implemented in terms of type classes, we only develop the theory
   873 for countable products of the same space.*}
   873 for countable products of the same space.\<close>
   874 
   874 
   875 instantiation "fun" :: (countable, metric_space) metric_space
   875 instantiation "fun" :: (countable, metric_space) metric_space
   876 begin
   876 begin
   877 
   877 
   878 definition dist_fun_def:
   878 definition dist_fun_def:
   879   "dist x y = (\<Sum>n. (1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1)"
   879   "dist x y = (\<Sum>n. (1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1)"
   880 
   880 
   881 definition uniformity_fun_def:
   881 definition uniformity_fun_def:
   882   "(uniformity::(('a \<Rightarrow> 'b) \<times> ('a \<Rightarrow> 'b)) filter) = (INF e:{0<..}. principal {(x, y). dist (x::('a\<Rightarrow>'b)) y < e})"
   882   "(uniformity::(('a \<Rightarrow> 'b) \<times> ('a \<Rightarrow> 'b)) filter) = (INF e:{0<..}. principal {(x, y). dist (x::('a\<Rightarrow>'b)) y < e})"
   883 
   883 
   884 text {*Except for the first one, the auxiliary lemmas below are only useful when proving the
   884 text \<open>Except for the first one, the auxiliary lemmas below are only useful when proving the
   885 instance: once it is proved, they become trivial consequences of the general theory of metric
   885 instance: once it is proved, they become trivial consequences of the general theory of metric
   886 spaces. It would thus be desirable to hide them once the instance is proved, but I do not know how
   886 spaces. It would thus be desirable to hide them once the instance is proved, but I do not know how
   887 to do this.*}
   887 to do this.\<close>
   888 
   888 
   889 lemma dist_fun_le_dist_first_terms:
   889 lemma dist_fun_le_dist_first_terms:
   890   "dist x y \<le> 2 * Max {dist (x (from_nat n)) (y (from_nat n))|n. n \<le> N} + (1/2)^N"
   890   "dist x y \<le> 2 * Max {dist (x (from_nat n)) (y (from_nat n))|n. n \<le> N} + (1/2)^N"
   891 proof -
   891 proof -
   892   have "(\<Sum>n. (1 / 2) ^ (n+Suc N) * min (dist (x (from_nat (n+Suc N))) (y (from_nat (n+Suc N)))) 1)
   892   have "(\<Sum>n. (1 / 2) ^ (n+Suc N) * min (dist (x (from_nat (n+Suc N))) (y (from_nat (n+Suc N)))) 1)
   945     using open_fun_def assms by auto
   945     using open_fun_def assms by auto
   946   obtain X where H: "Pi\<^sub>E UNIV X \<subseteq> U"
   946   obtain X where H: "Pi\<^sub>E UNIV X \<subseteq> U"
   947                     "\<And>i. openin euclidean (X i)"
   947                     "\<And>i. openin euclidean (X i)"
   948                     "finite {i. X i \<noteq> topspace euclidean}"
   948                     "finite {i. X i \<noteq> topspace euclidean}"
   949                     "x \<in> Pi\<^sub>E UNIV X"
   949                     "x \<in> Pi\<^sub>E UNIV X"
   950     using product_topology_open_contains_basis[OF * `x \<in> U`] by auto
   950     using product_topology_open_contains_basis[OF * \<open>x \<in> U\<close>] by auto
   951   define I where "I = {i. X i \<noteq> topspace euclidean}"
   951   define I where "I = {i. X i \<noteq> topspace euclidean}"
   952   have "finite I" unfolding I_def using H(3) by auto
   952   have "finite I" unfolding I_def using H(3) by auto
   953   {
   953   {
   954     fix i
   954     fix i
   955     have "x i \<in> X i" using `x \<in> U` H by auto
   955     have "x i \<in> X i" using \<open>x \<in> U\<close> H by auto
   956     then have "\<exists>e. e>0 \<and> ball (x i) e \<subseteq> X i"
   956     then have "\<exists>e. e>0 \<and> ball (x i) e \<subseteq> X i"
   957       using `openin euclidean (X i)` open_openin open_contains_ball by blast
   957       using \<open>openin euclidean (X i)\<close> open_openin open_contains_ball by blast
   958     then obtain e where "e>0" "ball (x i) e \<subseteq> X i" by blast
   958     then obtain e where "e>0" "ball (x i) e \<subseteq> X i" by blast
   959     define f where "f = min e (1/2)"
   959     define f where "f = min e (1/2)"
   960     have "f>0" "f<1" unfolding f_def using `e>0` by auto
   960     have "f>0" "f<1" unfolding f_def using \<open>e>0\<close> by auto
   961     moreover have "ball (x i) f \<subseteq> X i" unfolding f_def using `ball (x i) e \<subseteq> X i` by auto
   961     moreover have "ball (x i) f \<subseteq> X i" unfolding f_def using \<open>ball (x i) e \<subseteq> X i\<close> by auto
   962     ultimately have "\<exists>f. f > 0 \<and> f < 1 \<and> ball (x i) f \<subseteq> X i" by auto
   962     ultimately have "\<exists>f. f > 0 \<and> f < 1 \<and> ball (x i) f \<subseteq> X i" by auto
   963   } note * = this
   963   } note * = this
   964   have "\<exists>e. \<forall>i. e i > 0 \<and> e i < 1 \<and> ball (x i) (e i) \<subseteq> X i"
   964   have "\<exists>e. \<forall>i. e i > 0 \<and> e i < 1 \<and> ball (x i) (e i) \<subseteq> X i"
   965     by (rule choice, auto simp add: *)
   965     by (rule choice, auto simp add: *)
   966   then obtain e where "\<And>i. e i > 0" "\<And>i. e i < 1" "\<And>i. ball (x i) (e i) \<subseteq> X i"
   966   then obtain e where "\<And>i. e i > 0" "\<And>i. e i < 1" "\<And>i. ball (x i) (e i) \<subseteq> X i"
   967     by blast
   967     by blast
   968   define m where "m = Min {(1/2)^(to_nat i) * e i|i. i \<in> I}"
   968   define m where "m = Min {(1/2)^(to_nat i) * e i|i. i \<in> I}"
   969   have "m > 0" if "I\<noteq>{}"
   969   have "m > 0" if "I\<noteq>{}"
   970     unfolding m_def apply (rule Min_grI) using `finite I` `I \<noteq> {}` `\<And>i. e i > 0` by auto
   970     unfolding m_def apply (rule Min_grI) using \<open>finite I\<close> \<open>I \<noteq> {}\<close> \<open>\<And>i. e i > 0\<close> by auto
   971   moreover have "{y. dist x y < m} \<subseteq> U"
   971   moreover have "{y. dist x y < m} \<subseteq> U"
   972   proof (auto)
   972   proof (auto)
   973     fix y assume "dist x y < m"
   973     fix y assume "dist x y < m"
   974     have "y i \<in> X i" if "i \<in> I" for i
   974     have "y i \<in> X i" if "i \<in> I" for i
   975     proof -
   975     proof -
   976       have *: "summable (\<lambda>n. (1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1)"
   976       have *: "summable (\<lambda>n. (1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1)"
   977         by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
   977         by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
   978       define n where "n = to_nat i"
   978       define n where "n = to_nat i"
   979       have "(1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1 < m"
   979       have "(1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1 < m"
   980         using `dist x y < m` unfolding dist_fun_def using sum_le_suminf[OF *, of "{n}"] by auto
   980         using \<open>dist x y < m\<close> unfolding dist_fun_def using sum_le_suminf[OF *, of "{n}"] by auto
   981       then have "(1/2)^(to_nat i) * min (dist (x i) (y i)) 1 < m"
   981       then have "(1/2)^(to_nat i) * min (dist (x i) (y i)) 1 < m"
   982         using `n = to_nat i` by auto
   982         using \<open>n = to_nat i\<close> by auto
   983       also have "... \<le> (1/2)^(to_nat i) * e i"
   983       also have "... \<le> (1/2)^(to_nat i) * e i"
   984         unfolding m_def apply (rule Min_le) using `finite I` `i \<in> I` by auto
   984         unfolding m_def apply (rule Min_le) using \<open>finite I\<close> \<open>i \<in> I\<close> by auto
   985       ultimately have "min (dist (x i) (y i)) 1 < e i"
   985       ultimately have "min (dist (x i) (y i)) 1 < e i"
   986         by (auto simp add: divide_simps)
   986         by (auto simp add: divide_simps)
   987       then have "dist (x i) (y i) < e i"
   987       then have "dist (x i) (y i) < e i"
   988         using `e i < 1` by auto
   988         using \<open>e i < 1\<close> by auto
   989       then show "y i \<in> X i" using `ball (x i) (e i) \<subseteq> X i` by auto
   989       then show "y i \<in> X i" using \<open>ball (x i) (e i) \<subseteq> X i\<close> by auto
   990     qed
   990     qed
   991     then have "y \<in> Pi\<^sub>E UNIV X" using H(1) unfolding I_def topspace_euclidean by (auto simp add: PiE_iff)
   991     then have "y \<in> Pi\<^sub>E UNIV X" using H(1) unfolding I_def topspace_euclidean by (auto simp add: PiE_iff)
   992     then show "y \<in> U" using `Pi\<^sub>E UNIV X \<subseteq> U` by auto
   992     then show "y \<in> U" using \<open>Pi\<^sub>E UNIV X \<subseteq> U\<close> by auto
   993   qed
   993   qed
   994   ultimately have *: "\<exists>m>0. {y. dist x y < m} \<subseteq> U" if "I \<noteq> {}" using that by auto
   994   ultimately have *: "\<exists>m>0. {y. dist x y < m} \<subseteq> U" if "I \<noteq> {}" using that by auto
   995 
   995 
   996   have "U = UNIV" if "I = {}"
   996   have "U = UNIV" if "I = {}"
   997     using that H(1) unfolding I_def topspace_euclidean by (auto simp add: PiE_iff)
   997     using that H(1) unfolding I_def topspace_euclidean by (auto simp add: PiE_iff)
  1019   then have "\<And>i. openin euclidean (X i)"
  1019   then have "\<And>i. openin euclidean (X i)"
  1020     using open_openin by auto
  1020     using open_openin by auto
  1021   define U where "U = Pi\<^sub>E UNIV X"
  1021   define U where "U = Pi\<^sub>E UNIV X"
  1022   have "open U"
  1022   have "open U"
  1023     unfolding open_fun_def product_topology_def apply (rule topology_generated_by_Basis)
  1023     unfolding open_fun_def product_topology_def apply (rule topology_generated_by_Basis)
  1024     unfolding U_def using `\<And>i. openin euclidean (X i)` `finite {i. X i \<noteq> topspace euclidean}`
  1024     unfolding U_def using \<open>\<And>i. openin euclidean (X i)\<close> \<open>finite {i. X i \<noteq> topspace euclidean}\<close>
  1025     by auto
  1025     by auto
  1026   moreover have "x \<in> U"
  1026   moreover have "x \<in> U"
  1027     unfolding U_def X_def by (auto simp add: PiE_iff)
  1027     unfolding U_def X_def by (auto simp add: PiE_iff)
  1028   moreover have "dist x y < e" if "y \<in> U" for y
  1028   moreover have "dist x y < e" if "y \<in> U" for y
  1029   proof -
  1029   proof -
  1030     have *: "dist (x (from_nat n)) (y (from_nat n)) \<le> f" if "n \<le> N" for n
  1030     have *: "dist (x (from_nat n)) (y (from_nat n)) \<le> f" if "n \<le> N" for n
  1031       using `y \<in> U` unfolding U_def apply (auto simp add: PiE_iff)
  1031       using \<open>y \<in> U\<close> unfolding U_def apply (auto simp add: PiE_iff)
  1032       unfolding X_def using that by (metis less_imp_le mem_Collect_eq)
  1032       unfolding X_def using that by (metis less_imp_le mem_Collect_eq)
  1033     have **: "Max {dist (x (from_nat n)) (y (from_nat n))|n. n \<le> N} \<le> f"
  1033     have **: "Max {dist (x (from_nat n)) (y (from_nat n))|n. n \<le> N} \<le> f"
  1034       apply (rule Max.boundedI) using * by auto
  1034       apply (rule Max.boundedI) using * by auto
  1035 
  1035 
  1036     have "dist x y \<le> 2 * Max {dist (x (from_nat n)) (y (from_nat n))|n. n \<le> N} + (1/2)^N"
  1036     have "dist x y \<le> 2 * Max {dist (x (from_nat n)) (y (from_nat n))|n. n \<le> N} + (1/2)^N"
  1037       by (rule dist_fun_le_dist_first_terms)
  1037       by (rule dist_fun_le_dist_first_terms)
  1038     also have "... \<le> 2 * f + e / 8"
  1038     also have "... \<le> 2 * f + e / 8"
  1039       apply (rule add_mono) using ** `2^N > 8/e` by(auto simp add: algebra_simps divide_simps)
  1039       apply (rule add_mono) using ** \<open>2^N > 8/e\<close> by(auto simp add: algebra_simps divide_simps)
  1040     also have "... \<le> e/2 + e/8"
  1040     also have "... \<le> e/2 + e/8"
  1041       unfolding f_def by auto
  1041       unfolding f_def by auto
  1042     also have "... < e"
  1042     also have "... < e"
  1043       by auto
  1043       by auto
  1044     finally show "dist x y < e" by simp
  1044     finally show "dist x y < e" by simp
  1051   shows "open U \<longleftrightarrow> (\<forall>x\<in>U. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> y \<in> U)"
  1051   shows "open U \<longleftrightarrow> (\<forall>x\<in>U. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> y \<in> U)"
  1052 proof (auto)
  1052 proof (auto)
  1053   assume "open U"
  1053   assume "open U"
  1054   fix x assume "x \<in> U"
  1054   fix x assume "x \<in> U"
  1055   then show "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> y \<in> U"
  1055   then show "\<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> y \<in> U"
  1056     using open_fun_contains_ball_aux[OF `open U` `x \<in> U`] by auto
  1056     using open_fun_contains_ball_aux[OF \<open>open U\<close> \<open>x \<in> U\<close>] by auto
  1057 next
  1057 next
  1058   assume H: "\<forall>x\<in>U. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> y \<in> U"
  1058   assume H: "\<forall>x\<in>U. \<exists>e>0. \<forall>y. dist x y < e \<longrightarrow> y \<in> U"
  1059   define K where "K = {V. open V \<and> V \<subseteq> U}"
  1059   define K where "K = {V. open V \<and> V \<subseteq> U}"
  1060   {
  1060   {
  1061     fix x assume "x \<in> U"
  1061     fix x assume "x \<in> U"
  1062     then obtain e where e: "e>0" "{y. dist x y < e} \<subseteq> U" using H by blast
  1062     then obtain e where e: "e>0" "{y. dist x y < e} \<subseteq> U" using H by blast
  1063     then obtain V where V: "open V" "x \<in> V" "V \<subseteq> {y. dist x y < e}"
  1063     then obtain V where V: "open V" "x \<in> V" "V \<subseteq> {y. dist x y < e}"
  1064       using ball_fun_contains_open_aux[OF `e>0`, of x] by auto
  1064       using ball_fun_contains_open_aux[OF \<open>e>0\<close>, of x] by auto
  1065     have "V \<in> K"
  1065     have "V \<in> K"
  1066       unfolding K_def using e(2) V(1) V(3) by auto
  1066       unfolding K_def using e(2) V(1) V(3) by auto
  1067     then have "x \<in> (\<Union>K)" using `x \<in> V` by auto
  1067     then have "x \<in> (\<Union>K)" using \<open>x \<in> V\<close> by auto
  1068   }
  1068   }
  1069   then have "(\<Union>K) = U"
  1069   then have "(\<Union>K) = U"
  1070     unfolding K_def by auto
  1070     unfolding K_def by auto
  1071   moreover have "open (\<Union>K)"
  1071   moreover have "open (\<Union>K)"
  1072     unfolding K_def by auto
  1072     unfolding K_def by auto
  1075 
  1075 
  1076 instance proof
  1076 instance proof
  1077   fix x y::"'a \<Rightarrow> 'b" show "(dist x y = 0) = (x = y)"
  1077   fix x y::"'a \<Rightarrow> 'b" show "(dist x y = 0) = (x = y)"
  1078   proof
  1078   proof
  1079     assume "x = y"
  1079     assume "x = y"
  1080     then show "dist x y = 0" unfolding dist_fun_def using `x = y` by auto
  1080     then show "dist x y = 0" unfolding dist_fun_def using \<open>x = y\<close> by auto
  1081   next
  1081   next
  1082     assume "dist x y = 0"
  1082     assume "dist x y = 0"
  1083     have *: "summable (\<lambda>n. (1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1)"
  1083     have *: "summable (\<lambda>n. (1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1)"
  1084       by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
  1084       by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
  1085     have "(1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1 = 0" for n
  1085     have "(1/2)^n * min (dist (x (from_nat n)) (y (from_nat n))) 1 = 0" for n
  1086       using `dist x y = 0` unfolding dist_fun_def by (simp add: "*" suminf_eq_zero_iff)
  1086       using \<open>dist x y = 0\<close> unfolding dist_fun_def by (simp add: "*" suminf_eq_zero_iff)
  1087     then have "dist (x (from_nat n)) (y (from_nat n)) = 0" for n
  1087     then have "dist (x (from_nat n)) (y (from_nat n)) = 0" for n
  1088       by (metis div_0 min_def nonzero_mult_div_cancel_left power_eq_0_iff
  1088       by (metis div_0 min_def nonzero_mult_div_cancel_left power_eq_0_iff
  1089                 zero_eq_1_divide_iff zero_neq_numeral)
  1089                 zero_eq_1_divide_iff zero_neq_numeral)
  1090     then have "x (from_nat n) = y (from_nat n)" for n
  1090     then have "x (from_nat n) = y (from_nat n)" for n
  1091       by auto
  1091       by auto
  1093       by (metis from_nat_to_nat)
  1093       by (metis from_nat_to_nat)
  1094     then show "x = y"
  1094     then show "x = y"
  1095       by auto
  1095       by auto
  1096   qed
  1096   qed
  1097 next
  1097 next
  1098   text{*The proof of the triangular inequality is trivial, modulo the fact that we are dealing
  1098   text\<open>The proof of the triangular inequality is trivial, modulo the fact that we are dealing
  1099         with infinite series, hence we should justify the convergence at each step. In this
  1099         with infinite series, hence we should justify the convergence at each step. In this
  1100         respect, the following simplification rule is extremely handy.*}
  1100         respect, the following simplification rule is extremely handy.\<close>
  1101   have [simp]: "summable (\<lambda>n. (1/2)^n * min (dist (u (from_nat n)) (v (from_nat n))) 1)" for u v::"'a \<Rightarrow> 'b"
  1101   have [simp]: "summable (\<lambda>n. (1/2)^n * min (dist (u (from_nat n)) (v (from_nat n))) 1)" for u v::"'a \<Rightarrow> 'b"
  1102     by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
  1102     by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
  1103   fix x y z::"'a \<Rightarrow> 'b"
  1103   fix x y z::"'a \<Rightarrow> 'b"
  1104   {
  1104   {
  1105     fix n
  1105     fix n
  1132   also have "... = dist x z + dist y z"
  1132   also have "... = dist x z + dist y z"
  1133     unfolding dist_fun_def by simp
  1133     unfolding dist_fun_def by simp
  1134   finally show "dist x y \<le> dist x z + dist y z"
  1134   finally show "dist x y \<le> dist x z + dist y z"
  1135     by simp
  1135     by simp
  1136 next
  1136 next
  1137   text{*Finally, we show that the topology generated by the distance and the product
  1137   text\<open>Finally, we show that the topology generated by the distance and the product
  1138         topology coincide. This is essentially contained in Lemma \verb+fun_open_ball_aux+,
  1138         topology coincide. This is essentially contained in Lemma \verb+fun_open_ball_aux+,
  1139         except that the condition to prove is expressed with filters. To deal with this,
  1139         except that the condition to prove is expressed with filters. To deal with this,
  1140         we copy some mumbo jumbo from Lemma \verb+eventually_uniformity_metric+ in
  1140         we copy some mumbo jumbo from Lemma \verb+eventually_uniformity_metric+ in
  1141         \verb+Real_Vector_Spaces.thy+*}
  1141         \verb+Real_Vector_Spaces.thy+\<close>
  1142   fix U::"('a \<Rightarrow> 'b) set"
  1142   fix U::"('a \<Rightarrow> 'b) set"
  1143   have "eventually P uniformity \<longleftrightarrow> (\<exists>e>0. \<forall>x (y::('a \<Rightarrow> 'b)). dist x y < e \<longrightarrow> P (x, y))" for P
  1143   have "eventually P uniformity \<longleftrightarrow> (\<exists>e>0. \<forall>x (y::('a \<Rightarrow> 'b)). dist x y < e \<longrightarrow> P (x, y))" for P
  1144   unfolding uniformity_fun_def apply (subst eventually_INF_base)
  1144   unfolding uniformity_fun_def apply (subst eventually_INF_base)
  1145     by (auto simp: eventually_principal subset_eq intro: bexI[of _ "min _ _"])
  1145     by (auto simp: eventually_principal subset_eq intro: bexI[of _ "min _ _"])
  1146   then show "open U = (\<forall>x\<in>U. \<forall>\<^sub>F (x', y) in uniformity. x' = x \<longrightarrow> y \<in> U)"
  1146   then show "open U = (\<forall>x\<in>U. \<forall>\<^sub>F (x', y) in uniformity. x' = x \<longrightarrow> y \<in> U)"
  1147     unfolding fun_open_ball_aux by simp
  1147     unfolding fun_open_ball_aux by simp
  1148 qed (simp add: uniformity_fun_def)
  1148 qed (simp add: uniformity_fun_def)
  1149 
  1149 
  1150 end
  1150 end
  1151 
  1151 
  1152 text {*Nice properties of spaces are preserved under countable products. In addition
  1152 text \<open>Nice properties of spaces are preserved under countable products. In addition
  1153 to first countability, second countability and metrizability, as we have seen above,
  1153 to first countability, second countability and metrizability, as we have seen above,
  1154 completeness is also preserved, and therefore being Polish.*}
  1154 completeness is also preserved, and therefore being Polish.\<close>
  1155 
  1155 
  1156 instance "fun" :: (countable, complete_space) complete_space
  1156 instance "fun" :: (countable, complete_space) complete_space
  1157 proof
  1157 proof
  1158   fix u::"nat \<Rightarrow> ('a \<Rightarrow> 'b)" assume "Cauchy u"
  1158   fix u::"nat \<Rightarrow> ('a \<Rightarrow> 'b)" assume "Cauchy u"
  1159   have "Cauchy (\<lambda>n. u n i)" for i
  1159   have "Cauchy (\<lambda>n. u n i)" for i
  1160   unfolding cauchy_def proof (intro impI allI)
  1160   unfolding cauchy_def proof (intro impI allI)
  1161     fix e assume "e>(0::real)"
  1161     fix e assume "e>(0::real)"
  1162     obtain k where "i = from_nat k"
  1162     obtain k where "i = from_nat k"
  1163       using from_nat_to_nat[of i] by metis
  1163       using from_nat_to_nat[of i] by metis
  1164     have "(1/2)^k * min e 1 > 0" using `e>0` by auto
  1164     have "(1/2)^k * min e 1 > 0" using \<open>e>0\<close> by auto
  1165     then have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m) (u n) < (1/2)^k * min e 1"
  1165     then have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m) (u n) < (1/2)^k * min e 1"
  1166       using `Cauchy u` unfolding cauchy_def by blast
  1166       using \<open>Cauchy u\<close> unfolding cauchy_def by blast
  1167     then obtain N::nat where C: "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m) (u n) < (1/2)^k * min e 1"
  1167     then obtain N::nat where C: "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m) (u n) < (1/2)^k * min e 1"
  1168       by blast
  1168       by blast
  1169     have "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m i) (u n i) < e"
  1169     have "\<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m i) (u n i) < e"
  1170     proof (auto)
  1170     proof (auto)
  1171       fix m n::nat assume "m \<ge> N" "n \<ge> N"
  1171       fix m n::nat assume "m \<ge> N" "n \<ge> N"
  1172       have "(1/2)^k * min (dist (u m i) (u n i)) 1
  1172       have "(1/2)^k * min (dist (u m i) (u n i)) 1
  1173               = sum (\<lambda>p. (1/2)^p * min (dist (u m (from_nat p)) (u n (from_nat p))) 1) {k}"
  1173               = sum (\<lambda>p. (1/2)^p * min (dist (u m (from_nat p)) (u n (from_nat p))) 1) {k}"
  1174         using `i = from_nat k` by auto
  1174         using \<open>i = from_nat k\<close> by auto
  1175       also have "... \<le> (\<Sum>p. (1/2)^p * min (dist (u m (from_nat p)) (u n (from_nat p))) 1)"
  1175       also have "... \<le> (\<Sum>p. (1/2)^p * min (dist (u m (from_nat p)) (u n (from_nat p))) 1)"
  1176         apply (rule sum_le_suminf)
  1176         apply (rule sum_le_suminf)
  1177         by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
  1177         by (rule summable_comparison_test'[of "\<lambda>n. (1/2)^n"], auto simp add: summable_geometric_iff)
  1178       also have "... = dist (u m) (u n)"
  1178       also have "... = dist (u m) (u n)"
  1179         unfolding dist_fun_def by auto
  1179         unfolding dist_fun_def by auto
  1180       also have "... < (1/2)^k * min e 1"
  1180       also have "... < (1/2)^k * min e 1"
  1181         using C `m \<ge> N` `n \<ge> N` by auto
  1181         using C \<open>m \<ge> N\<close> \<open>n \<ge> N\<close> by auto
  1182       finally have "min (dist (u m i) (u n i)) 1 < min e 1"
  1182       finally have "min (dist (u m i) (u n i)) 1 < min e 1"
  1183         by (auto simp add: algebra_simps divide_simps)
  1183         by (auto simp add: algebra_simps divide_simps)
  1184       then show "dist (u m i) (u n i) < e" by auto
  1184       then show "dist (u m i) (u n i) < e" by auto
  1185     qed
  1185     qed
  1186     then show "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m i) (u n i) < e"
  1186     then show "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (u m i) (u n i) < e"
  1208     have "dist (u k) x < e" if "k \<ge> L" for k
  1208     have "dist (u k) x < e" if "k \<ge> L" for k
  1209     proof -
  1209     proof -
  1210       have *: "dist (u k (from_nat n)) (x (from_nat n)) \<le> e / 4" if "n \<le> N" for n
  1210       have *: "dist (u k (from_nat n)) (x (from_nat n)) \<le> e / 4" if "n \<le> N" for n
  1211       proof -
  1211       proof -
  1212         have "K (from_nat n) \<le> L"
  1212         have "K (from_nat n) \<le> L"
  1213           unfolding L_def apply (rule Max_ge) using `n \<le> N` by auto
  1213           unfolding L_def apply (rule Max_ge) using \<open>n \<le> N\<close> by auto
  1214         then have "k \<ge> K (from_nat n)" using `k \<ge> L` by auto
  1214         then have "k \<ge> K (from_nat n)" using \<open>k \<ge> L\<close> by auto
  1215         then show ?thesis using K less_imp_le by auto
  1215         then show ?thesis using K less_imp_le by auto
  1216       qed
  1216       qed
  1217       have **: "Max {dist (u k (from_nat n)) (x (from_nat n)) |n. n \<le> N} \<le> e/4"
  1217       have **: "Max {dist (u k (from_nat n)) (x (from_nat n)) |n. n \<le> N} \<le> e/4"
  1218         apply (rule Max.boundedI) using * by auto
  1218         apply (rule Max.boundedI) using * by auto
  1219       have "dist (u k) x \<le> 2 * Max {dist (u k (from_nat n)) (x (from_nat n)) |n. n \<le> N} + (1/2)^N"
  1219       have "dist (u k) x \<le> 2 * Max {dist (u k (from_nat n)) (x (from_nat n)) |n. n \<le> N} + (1/2)^N"
  1220         using dist_fun_le_dist_first_terms by auto
  1220         using dist_fun_le_dist_first_terms by auto
  1221       also have "... \<le> 2 * e/4 + e/4"
  1221       also have "... \<le> 2 * e/4 + e/4"
  1222         apply (rule add_mono)
  1222         apply (rule add_mono)
  1223         using ** `2^N > 4/e` less_imp_le by (auto simp add: algebra_simps divide_simps)
  1223         using ** \<open>2^N > 4/e\<close> less_imp_le by (auto simp add: algebra_simps divide_simps)
  1224       also have "... < e" by auto
  1224       also have "... < e" by auto
  1225       finally show ?thesis by simp
  1225       finally show ?thesis by simp
  1226     qed
  1226     qed
  1227     then show "\<exists>L. \<forall>k\<ge>L. dist (u k) x < e" by blast
  1227     then show "\<exists>L. \<forall>k\<ge>L. dist (u k) x < e" by blast
  1228   qed
  1228   qed
  1231 
  1231 
  1232 instance "fun" :: (countable, polish_space) polish_space
  1232 instance "fun" :: (countable, polish_space) polish_space
  1233 by standard
  1233 by standard
  1234 
  1234 
  1235 
  1235 
  1236 subsection {*Measurability*}
  1236 subsection \<open>Measurability\<close>
  1237 
  1237 
  1238 text {*There are two natural sigma-algebras on a product space: the borel sigma algebra,
  1238 text \<open>There are two natural sigma-algebras on a product space: the borel sigma algebra,
  1239 generated by open sets in the product, and the product sigma algebra, countably generated by
  1239 generated by open sets in the product, and the product sigma algebra, countably generated by
  1240 products of measurable sets along finitely many coordinates. The second one is defined and studied
  1240 products of measurable sets along finitely many coordinates. The second one is defined and studied
  1241 in \verb+Finite_Product_Measure.thy+.
  1241 in \verb+Finite_Product_Measure.thy+.
  1242 
  1242 
  1243 These sigma-algebra share a lot of natural properties (measurability of coordinates, for instance),
  1243 These sigma-algebra share a lot of natural properties (measurability of coordinates, for instance),
  1247 only when everything is countable (i.e., the product is countable, and the borel sigma algebra in
  1247 only when everything is countable (i.e., the product is countable, and the borel sigma algebra in
  1248 the factor is countably generated).
  1248 the factor is countably generated).
  1249 
  1249 
  1250 In this paragraph, we develop basic measurability properties for the borel sigma algebra, and
  1250 In this paragraph, we develop basic measurability properties for the borel sigma algebra, and
  1251 compare it with the product sigma algebra as explained above.
  1251 compare it with the product sigma algebra as explained above.
  1252 *}
  1252 \<close>
  1253 
  1253 
  1254 lemma measurable_product_coordinates [measurable (raw)]:
  1254 lemma measurable_product_coordinates [measurable (raw)]:
  1255   "(\<lambda>x. x i) \<in> measurable borel borel"
  1255   "(\<lambda>x. x i) \<in> measurable borel borel"
  1256 by (rule borel_measurable_continuous_on1[OF continuous_on_product_coordinates])
  1256 by (rule borel_measurable_continuous_on1[OF continuous_on_product_coordinates])
  1257 
  1257 
  1263   have "(\<lambda>x. f x i) = (\<lambda>y. y i) o f"
  1263   have "(\<lambda>x. f x i) = (\<lambda>y. y i) o f"
  1264     unfolding comp_def by auto
  1264     unfolding comp_def by auto
  1265   then show ?thesis by simp
  1265   then show ?thesis by simp
  1266 qed
  1266 qed
  1267 
  1267 
  1268 text {*To compare the Borel sigma algebra with the product sigma algebra, we give a presentation
  1268 text \<open>To compare the Borel sigma algebra with the product sigma algebra, we give a presentation
  1269 of the product sigma algebra that is more similar to the one we used above for the product
  1269 of the product sigma algebra that is more similar to the one we used above for the product
  1270 topology.*}
  1270 topology.\<close>
  1271 
  1271 
  1272 lemma sets_PiM_finite:
  1272 lemma sets_PiM_finite:
  1273   "sets (Pi\<^sub>M I M) = sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i))
  1273   "sets (Pi\<^sub>M I M) = sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i))
  1274         {(\<Pi>\<^sub>E i\<in>I. X i) |X. (\<forall>i. X i \<in> sets (M i)) \<and> finite {i. X i \<noteq> space (M i)}}"
  1274         {(\<Pi>\<^sub>E i\<in>I. X i) |X. (\<forall>i. X i \<in> sets (M i)) \<and> finite {i. X i \<noteq> space (M i)}}"
  1275 proof
  1275 proof
  1279     then have *: "X i \<in> sets (M i)" for i by simp
  1279     then have *: "X i \<in> sets (M i)" for i by simp
  1280     define J where "J = {i \<in> I. X i \<noteq> space (M i)}"
  1280     define J where "J = {i \<in> I. X i \<noteq> space (M i)}"
  1281     have "finite J" "J \<subseteq> I" unfolding J_def using H by auto
  1281     have "finite J" "J \<subseteq> I" unfolding J_def using H by auto
  1282     define Y where "Y = (\<Pi>\<^sub>E j\<in>J. X j)"
  1282     define Y where "Y = (\<Pi>\<^sub>E j\<in>J. X j)"
  1283     have "prod_emb I M J Y \<in> sets (Pi\<^sub>M I M)"
  1283     have "prod_emb I M J Y \<in> sets (Pi\<^sub>M I M)"
  1284       unfolding Y_def apply (rule sets_PiM_I) using `finite J` `J \<subseteq> I` * by auto
  1284       unfolding Y_def apply (rule sets_PiM_I) using \<open>finite J\<close> \<open>J \<subseteq> I\<close> * by auto
  1285     moreover have "prod_emb I M J Y = (\<Pi>\<^sub>E i\<in>I. X i)"
  1285     moreover have "prod_emb I M J Y = (\<Pi>\<^sub>E i\<in>I. X i)"
  1286       unfolding prod_emb_def Y_def J_def using H sets.sets_into_space[OF *]
  1286       unfolding prod_emb_def Y_def J_def using H sets.sets_into_space[OF *]
  1287       by (auto simp add: PiE_iff, blast)
  1287       by (auto simp add: PiE_iff, blast)
  1288     ultimately show "Pi\<^sub>E I X \<in> sets (Pi\<^sub>M I M)" by simp
  1288     ultimately show "Pi\<^sub>E I X \<in> sets (Pi\<^sub>M I M)" by simp
  1289   qed
  1289   qed
  1295                 (\<forall>i. X i \<in> sets (M i)) \<and> finite {i. X i \<noteq> space (M i)}"
  1295                 (\<forall>i. X i \<in> sets (M i)) \<and> finite {i. X i \<noteq> space (M i)}"
  1296     if "i \<in> I" "A \<in> sets (M i)" for i A
  1296     if "i \<in> I" "A \<in> sets (M i)" for i A
  1297   proof -
  1297   proof -
  1298     define X where "X = (\<lambda>j. if j = i then A else space (M j))"
  1298     define X where "X = (\<lambda>j. if j = i then A else space (M j))"
  1299     have "{f. (\<forall>i\<in>I. f i \<in> space (M i)) \<and> f \<in> extensional I \<and> f i \<in> A} = Pi\<^sub>E I X"
  1299     have "{f. (\<forall>i\<in>I. f i \<in> space (M i)) \<and> f \<in> extensional I \<and> f i \<in> A} = Pi\<^sub>E I X"
  1300       unfolding X_def using sets.sets_into_space[OF `A \<in> sets (M i)`] `i \<in> I`
  1300       unfolding X_def using sets.sets_into_space[OF \<open>A \<in> sets (M i)\<close>] \<open>i \<in> I\<close>
  1301       by (auto simp add: PiE_iff extensional_def, metis subsetCE, metis)
  1301       by (auto simp add: PiE_iff extensional_def, metis subsetCE, metis)
  1302     moreover have "X j \<in> sets (M j)" for j
  1302     moreover have "X j \<in> sets (M j)" for j
  1303       unfolding X_def using `A \<in> sets (M i)` by auto
  1303       unfolding X_def using \<open>A \<in> sets (M i)\<close> by auto
  1304     moreover have "finite {j. X j \<noteq> space (M j)}"
  1304     moreover have "finite {j. X j \<noteq> space (M j)}"
  1305       unfolding X_def by simp
  1305       unfolding X_def by simp
  1306     ultimately show ?thesis by auto
  1306     ultimately show ?thesis by auto
  1307   qed
  1307   qed
  1308   show "sets (Pi\<^sub>M I M) \<subseteq> sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i)) {(\<Pi>\<^sub>E i\<in>I. X i) |X. (\<forall>i. X i \<in> sets (M i)) \<and> finite {i. X i \<noteq> space (M i)}}"
  1308   show "sets (Pi\<^sub>M I M) \<subseteq> sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i)) {(\<Pi>\<^sub>E i\<in>I. X i) |X. (\<forall>i. X i \<in> sets (M i)) \<and> finite {i. X i \<noteq> space (M i)}}"
  1320     define I where "I = {i. X i \<noteq> UNIV}"
  1320     define I where "I = {i. X i \<noteq> UNIV}"
  1321     have "finite I" unfolding I_def using that by simp
  1321     have "finite I" unfolding I_def using that by simp
  1322     have "Pi\<^sub>E UNIV X = (\<Inter>i\<in>I. (\<lambda>x. x i)-`(X i) \<inter> space borel) \<inter> space borel"
  1322     have "Pi\<^sub>E UNIV X = (\<Inter>i\<in>I. (\<lambda>x. x i)-`(X i) \<inter> space borel) \<inter> space borel"
  1323       unfolding I_def by auto
  1323       unfolding I_def by auto
  1324     also have "... \<in> sets borel"
  1324     also have "... \<in> sets borel"
  1325       using that `finite I` by measurable
  1325       using that \<open>finite I\<close> by measurable
  1326     finally show ?thesis by simp
  1326     finally show ?thesis by simp
  1327   qed
  1327   qed
  1328   then have "{(\<Pi>\<^sub>E i\<in>UNIV. X i) |X::('a \<Rightarrow> 'b set). (\<forall>i. X i \<in> sets borel) \<and> finite {i. X i \<noteq> space borel}} \<subseteq> sets borel"
  1328   then have "{(\<Pi>\<^sub>E i\<in>UNIV. X i) |X::('a \<Rightarrow> 'b set). (\<forall>i. X i \<in> sets borel) \<and> finite {i. X i \<noteq> space borel}} \<subseteq> sets borel"
  1329     by auto
  1329     by auto
  1330   then show ?thesis unfolding sets_PiM_finite space_borel
  1330   then show ?thesis unfolding sets_PiM_finite space_borel
  1338             "\<And>k. k \<in> K \<Longrightarrow> \<exists>X. (k = Pi\<^sub>E UNIV X) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV}"
  1338             "\<And>k. k \<in> K \<Longrightarrow> \<exists>X. (k = Pi\<^sub>E UNIV X) \<and> (\<forall>i. open (X i)) \<and> finite {i. X i \<noteq> UNIV}"
  1339     using product_topology_countable_basis by fast
  1339     using product_topology_countable_basis by fast
  1340   have *: "k \<in> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))" if "k \<in> K" for k
  1340   have *: "k \<in> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))" if "k \<in> K" for k
  1341   proof -
  1341   proof -
  1342     obtain X where H: "k = Pi\<^sub>E UNIV X" "\<And>i. open (X i)" "finite {i. X i \<noteq> UNIV}"
  1342     obtain X where H: "k = Pi\<^sub>E UNIV X" "\<And>i. open (X i)" "finite {i. X i \<noteq> UNIV}"
  1343       using K(3)[OF `k \<in> K`] by blast
  1343       using K(3)[OF \<open>k \<in> K\<close>] by blast
  1344     show ?thesis unfolding H(1) sets_PiM_finite space_borel using borel_open[OF H(2)] H(3) by auto
  1344     show ?thesis unfolding H(1) sets_PiM_finite space_borel using borel_open[OF H(2)] H(3) by auto
  1345   qed
  1345   qed
  1346   have **: "U \<in> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))" if "open U" for U::"('a \<Rightarrow> 'b) set"
  1346   have **: "U \<in> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))" if "open U" for U::"('a \<Rightarrow> 'b) set"
  1347   proof -
  1347   proof -
  1348     obtain B where "B \<subseteq> K" "U = (\<Union>B)"
  1348     obtain B where "B \<subseteq> K" "U = (\<Union>B)"
  1349       using `open U` `topological_basis K` by (metis topological_basis_def)
  1349       using \<open>open U\<close> \<open>topological_basis K\<close> by (metis topological_basis_def)
  1350     have "countable B" using `B \<subseteq> K` `countable K` countable_subset by blast
  1350     have "countable B" using \<open>B \<subseteq> K\<close> \<open>countable K\<close> countable_subset by blast
  1351     moreover have "k \<in> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))" if "k \<in> B" for k
  1351     moreover have "k \<in> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))" if "k \<in> B" for k
  1352       using `B \<subseteq> K` * that by auto
  1352       using \<open>B \<subseteq> K\<close> * that by auto
  1353     ultimately show ?thesis unfolding `U = (\<Union>B)` by auto
  1353     ultimately show ?thesis unfolding \<open>U = (\<Union>B)\<close> by auto
  1354   qed
  1354   qed
  1355   have "sigma_sets UNIV (Collect open) \<subseteq> sets (Pi\<^sub>M UNIV (\<lambda>i::'a. (borel::('b measure))))"
  1355   have "sigma_sets UNIV (Collect open) \<subseteq> sets (Pi\<^sub>M UNIV (\<lambda>i::'a. (borel::('b measure))))"
  1356     apply (rule sets.sigma_sets_subset') using ** by auto
  1356     apply (rule sets.sigma_sets_subset') using ** by auto
  1357   then show "sets (borel::('a \<Rightarrow> 'b) measure) \<subseteq> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))"
  1357   then show "sets (borel::('a \<Rightarrow> 'b) measure) \<subseteq> sets (Pi\<^sub>M UNIV (\<lambda>_. borel))"
  1358     unfolding borel_def by auto
  1358     unfolding borel_def by auto