# HG changeset patch # User immler # Date 1360773687 -3600 # Node ID fa66ed645b7f2256f431a034539cd134bb227527 # Parent 3f9dbd2cc4751ae75ccc0d5ed2a8fa0f8b523e72# Parent 66d0298fc554afb54eac93656ae34e9bd4d1093f merged diff -r 66d0298fc554 -r fa66ed645b7f src/HOL/Library/Formal_Power_Series.thy --- a/src/HOL/Library/Formal_Power_Series.thy Wed Feb 13 16:30:34 2013 +0100 +++ b/src/HOL/Library/Formal_Power_Series.thy Wed Feb 13 17:41:27 2013 +0100 @@ -3368,4 +3368,80 @@ foldr (%c r. (k c + of_nat n) * r) cs (g c0 a $ n)" by (induct cs arbitrary: c0) (auto simp add: algebra_simps f) +lemma dist_less_imp_nth_equal: + assumes "dist f g < inverse (2 ^ i)" + assumes "j \ i" + shows "f $ j = g $ j" +proof cases + assume "f \ g" + hence "\n. f $ n \ g $ n" by (simp add: fps_eq_iff) + with assms have "i < The (leastP (\n. f $ n \ g $ n))" + by (simp add: split_if_asm dist_fps_def) + moreover + from fps_eq_least_unique[OF `f \ g`] + obtain n where "leastP (\n. f$n \ g$n) n" "The (leastP (\n. f $ n \ g $ n)) = n" by blast + moreover hence "\m. m < n \ f$m = g$m" "f$n \ g$n" + by (auto simp add: leastP_def setge_def) + ultimately show ?thesis using `j \ i` by simp +qed simp + +lemma nth_equal_imp_dist_less: + assumes "\j. j \ i \ f $ j = g $ j" + shows "dist f g < inverse (2 ^ i)" +proof cases + assume "f \ g" + hence "\n. f $ n \ g $ n" by (simp add: fps_eq_iff) + with assms have "dist f g = inverse (2 ^ (The (leastP (\n. f $ n \ g $ n))))" + by (simp add: split_if_asm dist_fps_def) + moreover + from fps_eq_least_unique[OF `f \ g`] + obtain n where "leastP (\n. f$n \ g$n) n" "The (leastP (\n. f $ n \ g $ n)) = n" by blast + with assms have "i < The (leastP (\n. f $ n \ g $ n))" + by (metis (full_types) leastPD1 not_le) + ultimately show ?thesis by simp +qed simp + +lemma dist_less_eq_nth_equal: + shows "dist f g < inverse (2 ^ i) \ (\j \ i. f $ j = g $ j)" + using dist_less_imp_nth_equal nth_equal_imp_dist_less by blast + +instance fps :: (comm_ring_1) complete_space +proof + fix X::"nat \ 'a fps" + assume "Cauchy X" + { + fix i + have "0 < inverse ((2::real)^i)" by simp + from metric_CauchyD[OF `Cauchy X` this] dist_less_imp_nth_equal + have "\M. \m \ M. \j\i. X M $ j = X m $ j" by blast + } + then obtain M where M: "\i. \m \ M i. \j \ i. X (M i) $ j = X m $ j" by metis + hence "\i. \m \ M i. \j \ i. X (M i) $ j = X m $ j" by metis + show "convergent X" + proof (rule convergentI) + show "X ----> Abs_fps (\i. X (M i) $ i)" + unfolding tendsto_iff + proof safe + fix e::real assume "0 < e" + with LIMSEQ_inverse_realpow_zero[of 2, simplified, simplified filterlim_iff, + THEN spec, of "\x. x < e"] + have "eventually (\i. inverse (2 ^ i) < e) sequentially" + by safe (auto simp: eventually_nhds) + then obtain i where "inverse (2 ^ i) < e" by (auto simp: eventually_sequentially) + have "eventually (\x. M i \ x) sequentially" by (auto simp: eventually_sequentially) + thus "eventually (\x. dist (X x) (Abs_fps (\i. X (M i) $ i)) < e) sequentially" + proof eventually_elim + fix x assume "M i \ x" + moreover + have "\j. j \ i \ X (M i) $ j = X (M j) $ j" + using M by (metis nat_le_linear) + ultimately have "dist (X x) (Abs_fps (\j. X (M j) $ j)) < inverse (2 ^ i)" + using M by (force simp: dist_less_eq_nth_equal) + also note `inverse (2 ^ i) < e` + finally show "dist (X x) (Abs_fps (\j. X (M j) $ j)) < e" . + qed + qed + qed +qed + end diff -r 66d0298fc554 -r fa66ed645b7f src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Wed Feb 13 16:30:34 2013 +0100 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Wed Feb 13 17:41:27 2013 +0100 @@ -170,99 +170,6 @@ where "countable D" "\X. open X \ X \ {} \ \d \ D. d \ X" using countable_dense_exists by blast -text {* Construction of an increasing sequence approximating open sets, - therefore basis which is closed under union. *} - -definition union_closed_basis::"'a set set" where - "union_closed_basis = (\l. \set l) ` lists B" - -lemma basis_union_closed_basis: "topological_basis union_closed_basis" -proof (rule topological_basisI) - fix O' and x::'a assume "open O'" "x \ O'" - from topological_basisE[OF is_basis this] guess B' . note B' = this - thus "\B'\union_closed_basis. x \ B' \ B' \ O'" unfolding union_closed_basis_def - by (auto intro!: bexI[where x="[B']"]) -next - fix B' assume "B' \ union_closed_basis" - thus "open B'" - using topological_basis_open[OF is_basis] - by (auto simp: union_closed_basis_def) -qed - -lemma countable_union_closed_basis: "countable union_closed_basis" - unfolding union_closed_basis_def using countable_basis by simp - -lemmas open_union_closed_basis = topological_basis_open[OF basis_union_closed_basis] - -lemma union_closed_basis_ex: - assumes X: "X \ union_closed_basis" - shows "\B'. finite B' \ X = \B' \ B' \ B" -proof - - from X obtain l where "\x. x\set l \ x\B" "X = \set l" by (auto simp: union_closed_basis_def) - thus ?thesis by auto -qed - -lemma union_closed_basisE: - assumes "X \ union_closed_basis" - obtains B' where "finite B'" "X = \B'" "B' \ B" using union_closed_basis_ex[OF assms] by blast - -lemma union_closed_basisI: - assumes "finite B'" "X = \B'" "B' \ B" - shows "X \ union_closed_basis" -proof - - from finite_list[OF `finite B'`] guess l .. - thus ?thesis using assms unfolding union_closed_basis_def by (auto intro!: image_eqI[where x=l]) -qed - -lemma empty_basisI[intro]: "{} \ union_closed_basis" - by (rule union_closed_basisI[of "{}"]) auto - -lemma union_basisI[intro]: - assumes "X \ union_closed_basis" "Y \ union_closed_basis" - shows "X \ Y \ union_closed_basis" - using assms by (auto intro: union_closed_basisI elim!:union_closed_basisE) - -lemma open_imp_Union_of_incseq: - assumes "open X" - shows "\S. incseq S \ (\j. S j) = X \ range S \ union_closed_basis" -proof - - from open_countable_basis_ex[OF `open X`] - obtain B' where B': "B'\B" "X = \B'" by auto - from this(1) countable_basis have "countable B'" by (rule countable_subset) - show ?thesis - proof cases - assume "B' \ {}" - def S \ "\n. \i\{0..n}. from_nat_into B' i" - have S:"\n. S n = \{from_nat_into B' i|i. i\{0..n}}" unfolding S_def by force - have "incseq S" by (force simp: S_def incseq_Suc_iff) - moreover - have "(\j. S j) = X" unfolding B' - proof safe - fix x X assume "X \ B'" "x \ X" - then obtain n where "X = from_nat_into B' n" - by (metis `countable B'` from_nat_into_surj) - also have "\ \ S n" by (auto simp: S_def) - finally show "x \ (\j. S j)" using `x \ X` by auto - next - fix x n - assume "x \ S n" - also have "\ = (\i\{0..n}. from_nat_into B' i)" - by (simp add: S_def) - also have "\ \ (\i. from_nat_into B' i)" by auto - also have "\ \ \B'" using `B' \ {}` by (auto intro: from_nat_into) - finally show "x \ \B'" . - qed - moreover have "range S \ union_closed_basis" using B' - by (auto intro!: union_closed_basisI[OF _ S] simp: from_nat_into `B' \ {}`) - ultimately show ?thesis by auto - qed (auto simp: B') -qed - -lemma open_incseqE: - assumes "open X" - obtains S where "incseq S" "(\j. S j) = X" "range S \ union_closed_basis" - using open_imp_Union_of_incseq assms by atomize_elim - end class first_countable_topology = topological_space + @@ -304,6 +211,31 @@ using first_countable_basis[of x] by atomize_elim auto +lemma (in first_countable_topology) first_countable_basis_Int_stableE: + obtains A where "countable A" "\a. a \ A \ x \ a" "\a. a \ A \ open a" + "\S. open S \ x \ S \ (\a\A. a \ S)" + "\a b. a \ A \ b \ A \ a \ b \ A" +proof atomize_elim + from first_countable_basisE[of x] guess A' . note A' = this + def A \ "(\N. \((\n. from_nat_into A' n) ` N)) ` (Collect finite::nat set set)" + thus "\A. countable A \ (\a. a \ A \ x \ a) \ (\a. a \ A \ open a) \ + (\S. open S \ x \ S \ (\a\A. a \ S)) \ (\a b. a \ A \ b \ A \ a \ b \ A)" + proof (safe intro!: exI[where x=A]) + show "countable A" unfolding A_def by (intro countable_image countable_Collect_finite) + fix a assume "a \ A" + thus "x \ a" "open a" using A'(4)[OF open_UNIV] by (auto simp: A_def intro: A' from_nat_into) + next + let ?int = "\N. \from_nat_into A' ` N" + fix a b assume "a \ A" "b \ A" + then obtain N M where "a = ?int N" "b = ?int M" "finite (N \ M)" by (auto simp: A_def) + thus "a \ b \ A" by (auto simp: A_def intro!: image_eqI[where x="N \ M"]) + next + fix S assume "open S" "x \ S" then obtain a where a: "a\A'" "a \ S" using A' by blast + thus "\a\A. a \ S" using a A' + by (intro bexI[where x=a]) (auto simp: A_def intro: image_eqI[where x="{to_nat_on A' a}"]) + qed +qed + instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology proof fix x :: "'a \ 'b" @@ -794,7 +726,7 @@ finally show "y \ ball x e" by (auto simp: ball_def) qed (insert a b, auto simp: box_def) qed - + lemma open_UNION_box: fixes M :: "'a\euclidean_space set" assumes "open M" @@ -3704,7 +3636,7 @@ text{* Cauchy-type criteria for uniform convergence. *} -lemma uniformly_convergent_eq_cauchy: fixes s::"nat \ 'b \ 'a::heine_borel" shows +lemma uniformly_convergent_eq_cauchy: fixes s::"nat \ 'b \ 'a::complete_space" shows "(\l. \e>0. \N. \n x. N \ n \ P x --> dist(s n x)(l x) < e) \ (\e>0. \N. \m n x. N \ m \ N \ n \ P x --> dist (s m x) (s n x) < e)" (is "?lhs = ?rhs") proof(rule) @@ -3738,7 +3670,7 @@ qed lemma uniformly_cauchy_imp_uniformly_convergent: - fixes s :: "nat \ 'a \ 'b::heine_borel" + fixes s :: "nat \ 'a \ 'b::complete_space" assumes "\e>0.\N. \m (n::nat) x. N \ m \ N \ n \ P x --> dist(s m x)(s n x) < e" "\x. P x --> (\e>0. \N. \n. N \ n --> dist(s n x)(l x) < e)" shows "\e>0. \N. \n x. N \ n \ P x --> dist(s n x)(l x) < e" @@ -5796,7 +5728,7 @@ show "\B::'a set set. countable B \ topological_basis B" unfolding topological_basis_def by blast qed -instance ordered_euclidean_space \ polish_space .. +instance euclidean_space \ polish_space .. text {* Intervals in general, including infinite and mixtures of open and closed. *} diff -r 66d0298fc554 -r fa66ed645b7f src/HOL/Probability/Borel_Space.thy --- a/src/HOL/Probability/Borel_Space.thy Wed Feb 13 16:30:34 2013 +0100 +++ b/src/HOL/Probability/Borel_Space.thy Wed Feb 13 17:41:27 2013 +0100 @@ -149,10 +149,6 @@ thus "b \ sigma_sets UNIV (Collect open)" by auto qed simp_all -lemma borel_eq_union_closed_basis: - "borel = sigma UNIV union_closed_basis" - by (rule borel_eq_countable_basis[OF countable_union_closed_basis basis_union_closed_basis]) - lemma borel_measurable_Pair[measurable (raw)]: fixes f :: "'a \ 'b::second_countable_topology" and g :: "'a \ 'c::second_countable_topology" assumes f[measurable]: "f \ borel_measurable M" diff -r 66d0298fc554 -r fa66ed645b7f src/HOL/Probability/Fin_Map.thy --- a/src/HOL/Probability/Fin_Map.thy Wed Feb 13 16:30:34 2013 +0100 +++ b/src/HOL/Probability/Fin_Map.thy Wed Feb 13 17:41:27 2013 +0100 @@ -76,9 +76,8 @@ lemma finmap_of_eq_iff[simp]: assumes "finite i" "finite j" - shows "finmap_of i m = finmap_of j n \ i = j \ restrict m i = restrict n i" - using assms - apply (auto simp: finmap_eq_iff restrict_def) by metis + shows "finmap_of i m = finmap_of j n \ i = j \ (\k\i. m k= n k)" + using assms by (auto simp: finmap_eq_iff) lemma finmap_of_inj_on_extensional_finite: assumes "finite K" @@ -94,17 +93,6 @@ show "x = y" using assms by (simp add: extensional_restrict) qed -lemma finmap_choice: - assumes *: "\i. i \ I \ \x. P i x" and I: "finite I" - shows "\fm. domain fm = I \ (\i\I. P i (fm i))" -proof - - have "\f. \i\I. P i (f i)" - unfolding bchoice_iff[symmetric] using * by auto - then guess f .. - with I show ?thesis - by (intro exI[of _ "finmap_of I f"]) auto -qed - subsection {* Product set of Finite Maps *} text {* This is @{term Pi} for Finite Maps, most of this is copied *} @@ -163,128 +151,19 @@ apply auto done -subsection {* Metric Space of Finite Maps *} - -instantiation finmap :: (type, metric_space) metric_space -begin +subsection {* Topological Space of Finite Maps *} -definition dist_finmap where - "dist P Q = (\i\domain P \ domain Q. dist ((P)\<^isub>F i) ((Q)\<^isub>F i)) + - card ((domain P - domain Q) \ (domain Q - domain P))" - -lemma dist_finmap_extend: - assumes "finite X" - shows "dist P Q = (\i\domain P \ domain Q \ X. dist ((P)\<^isub>F i) ((Q)\<^isub>F i)) + - card ((domain P - domain Q) \ (domain Q - domain P))" - unfolding dist_finmap_def add_right_cancel - using assms extensional_arb[of "(P)\<^isub>F"] extensional_arb[of "(Q)\<^isub>F" "domain Q"] - by (intro setsum_mono_zero_cong_left) auto +instantiation finmap :: (type, topological_space) topological_space +begin definition open_finmap :: "('a \\<^isub>F 'b) set \ bool" where - "open_finmap S = (\x\S. \e>0. \y. dist y x < e \ y \ S)" - -lemma add_eq_zero_iff[simp]: - fixes a b::real - assumes "a \ 0" "b \ 0" - shows "a + b = 0 \ a = 0 \ b = 0" -using assms by auto - -lemma dist_le_1_imp_domain_eq: - assumes "dist P Q < 1" - shows "domain P = domain Q" -proof - - have "0 \ (\i\domain P \ domain Q. dist (P i) (Q i))" - by (simp add: setsum_nonneg) - with assms have "card (domain P - domain Q \ (domain Q - domain P)) = 0" - unfolding dist_finmap_def by arith - thus "domain P = domain Q" by auto -qed - -lemma dist_proj: - shows "dist ((x)\<^isub>F i) ((y)\<^isub>F i) \ dist x y" -proof - - have "dist (x i) (y i) = (\i\{i}. dist (x i) (y i))" by simp - also have "\ \ (\i\domain x \ domain y \ {i}. dist (x i) (y i))" - by (intro setsum_mono2) auto - also have "\ \ dist x y" by (simp add: dist_finmap_extend[of "{i}"]) - finally show ?thesis by simp -qed + "open_finmap = generate_topology {Pi' a b|a b. \i\a. open (b i)}" -lemma open_Pi'I: - assumes open_component: "\i. i \ I \ open (A i)" - shows "open (Pi' I A)" -proof (subst open_finmap_def, safe) - fix x assume x: "x \ Pi' I A" - hence dim_x: "domain x = I" by (simp add: Pi'_def) - hence [simp]: "finite I" unfolding dim_x[symmetric] by simp - have "\ei. \i\I. 0 < ei i \ (\y. dist y (x i) < ei i \ y \ A i)" - proof (safe intro!: bchoice) - fix i assume i: "i \ I" - moreover with open_component have "open (A i)" by simp - moreover have "x i \ A i" using x i - by (auto simp: proj_def) - ultimately show "\e>0. \y. dist y (x i) < e \ y \ A i" - using x by (auto simp: open_dist Ball_def) - qed - then guess ei .. note ei = this - def es \ "ei ` I" - def e \ "if es = {} then 0.5 else min 0.5 (Min es)" - from ei have "e > 0" using x - by (auto simp add: e_def es_def Pi'_def Ball_def) - moreover have "\y. dist y x < e \ y \ Pi' I A" - proof (intro allI impI) - fix y - assume "dist y x < e" - also have "\ < 1" by (auto simp: e_def) - finally have "domain y = domain x" by (rule dist_le_1_imp_domain_eq) - with dim_x have dims: "domain y = domain x" "domain x = I" by auto - show "y \ Pi' I A" - proof - show "domain y = I" using dims by simp - next - fix i - assume "i \ I" - have "dist (y i) (x i) \ dist y x" using dims `i \ I` - by (auto intro: dist_proj) - also have "\ < e" using `dist y x < e` dims - by (simp add: dist_finmap_def) - also have "e \ Min (ei ` I)" using dims `i \ I` - by (auto simp: e_def es_def) - also have "\ \ ei i" using `i \ I` by (simp add: e_def) - finally have "dist (y i) (x i) < ei i" . - with ei `i \ I` show "y i \ A i" by simp - qed - qed - ultimately - show "\e>0. \y. dist y x < e \ y \ Pi' I A" by blast -qed +lemma open_Pi'I: "(\i. i \ I \ open (A i)) \ open (Pi' I A)" + by (auto intro: generate_topology.Basis simp: open_finmap_def) -instance -proof - fix S::"('a \\<^isub>F 'b) set" - show "open S = (\x\S. \e>0. \y. dist y x < e \ y \ S)" - unfolding open_finmap_def .. -next - fix P Q::"'a \\<^isub>F 'b" - show "dist P Q = 0 \ P = Q" - by (auto simp: finmap_eq_iff dist_finmap_def setsum_nonneg setsum_nonneg_eq_0_iff) -next - fix P Q R::"'a \\<^isub>F 'b" - let ?symdiff = "\a b. domain a - domain b \ (domain b - domain a)" - def E \ "domain P \ domain Q \ domain R" - hence "finite E" by (simp add: E_def) - have "card (?symdiff P Q) \ card (?symdiff P R \ ?symdiff Q R)" - by (auto intro: card_mono) - also have "\ \ card (?symdiff P R) + card (?symdiff Q R)" - by (subst card_Un_Int) auto - finally have "dist P Q \ (\i\E. dist (P i) (R i) + dist (Q i) (R i)) + - real (card (?symdiff P R) + card (?symdiff Q R))" - unfolding dist_finmap_extend[OF `finite E`] - by (intro add_mono) (auto simp: E_def intro: setsum_mono dist_triangle_le) - also have "\ \ dist P R + dist Q R" - unfolding dist_finmap_extend[OF `finite E`] by (simp add: ac_simps E_def setsum_addf[symmetric]) - finally show "dist P Q \ dist P R + dist Q R" by simp -qed +instance using topological_space_generate_topology + by intro_classes (auto simp: open_finmap_def class.topological_space_def) end @@ -310,69 +189,268 @@ lemma closed_restricted_space: shows "closed {m. P (domain m)}" -proof - - have "{m. P (domain m)} = - (\i \ - Collect P. {m. domain m = i})" by auto - also have "closed \" - proof (rule, rule, rule, cases) - fix i::"'a set" - assume "finite i" - hence "{m. domain m = i} = Pi' i (\_. UNIV)" by (auto simp: Pi'_def) - also have "open \" by (auto intro: open_Pi'I simp: `finite i`) - finally show "open {m. domain m = i}" . - next - fix i::"'a set" - assume "\ finite i" hence "{m. domain m = i} = {}" by auto - also have "open \" by simp - finally show "open {m. domain m = i}" . - qed - finally show ?thesis . + using open_restricted_space[of "\x. \ P x"] + unfolding closed_def by (rule back_subst) auto + +lemma tendsto_proj: "((\x. x) ---> a) F \ ((\x. (x)\<^isub>F i) ---> (a)\<^isub>F i) F" + unfolding tendsto_def +proof safe + fix S::"'b set" + let ?S = "Pi' (domain a) (\x. if x = i then S else UNIV)" + assume "open S" hence "open ?S" by (auto intro!: open_Pi'I) + moreover assume "\S. open S \ a \ S \ eventually (\x. x \ S) F" "a i \ S" + ultimately have "eventually (\x. x \ ?S) F" by auto + thus "eventually (\x. (x)\<^isub>F i \ S) F" + by eventually_elim (insert `a i \ S`, force simp: Pi'_iff split: split_if_asm) qed lemma continuous_proj: shows "continuous_on s (\x. (x)\<^isub>F i)" - unfolding continuous_on_topological -proof safe - fix x B assume "x \ s" "open B" "x i \ B" - let ?A = "Pi' (domain x) (\j. if i = j then B else UNIV)" - have "open ?A" using `open B` by (auto intro: open_Pi'I) - moreover have "x \ ?A" using `x i \ B` by auto - moreover have "(\y\s. y \ ?A \ y i \ B)" - proof (cases, safe) - fix y assume "y \ s" - assume "i \ domain x" hence "undefined \ B" using `x i \ B` - by simp - moreover - assume "y \ ?A" hence "domain y = domain x" by (simp add: Pi'_def) - hence "y i = undefined" using `i \ domain x` by simp - ultimately - show "y i \ B" by simp - qed force - ultimately - show "\A. open A \ x \ A \ (\y\s. y \ A \ y i \ B)" by blast + unfolding continuous_on_def + by (safe intro!: tendsto_proj tendsto_ident_at_within) + +instance finmap :: (type, first_countable_topology) first_countable_topology +proof + fix x::"'a\\<^isub>F'b" + have "\i. \A. countable A \ (\a\A. x i \ a) \ (\a\A. open a) \ + (\S. open S \ x i \ S \ (\a\A. a \ S)) \ (\a b. a \ A \ b \ A \ a \ b \ A)" (is "\i. ?th i") + proof + fix i from first_countable_basis_Int_stableE[of "x i"] guess A . + thus "?th i" by (intro exI[where x=A]) simp + qed + then guess A unfolding choice_iff .. note A = this + hence open_sub: "\i S. i\domain x \ open (S i) \ x i\(S i) \ (\a\A i. a\(S i))" by auto + have A_notempty: "\i. i \ domain x \ A i \ {}" using open_sub[of _ "\_. UNIV"] by auto + let ?A = "(\f. Pi' (domain x) f) ` (Pi\<^isub>E (domain x) A)" + show "\A. countable A \ (\a\A. x \ a \ open a) \ (\S. open S \ x \ S \ (\a\A. a \ S))" + proof (rule exI[where x="?A"], safe) + show "countable ?A" using A by (simp add: countable_PiE) + next + fix S::"('a \\<^isub>F 'b) set" assume "open S" "x \ S" + thus "\a\?A. a \ S" unfolding open_finmap_def + proof (induct rule: generate_topology.induct) + case UNIV thus ?case by (auto simp add: ex_in_conv PiE_eq_empty_iff A_notempty) + next + case (Int a b) + then obtain f g where + "f \ Pi\<^isub>E (domain x) A" "Pi' (domain x) f \ a" "g \ Pi\<^isub>E (domain x) A" "Pi' (domain x) g \ b" + by auto + thus ?case using A + by (auto simp: Pi'_iff PiE_iff extensional_def Int_stable_def + intro!: bexI[where x="\i. f i \ g i"]) + next + case (UN B) + then obtain b where "x \ b" "b \ B" by auto + hence "\a\?A. a \ b" using UN by simp + thus ?case using `b \ B` by blast + next + case (Basis s) + then obtain a b where xs: "x\ Pi' a b" "s = Pi' a b" "\i. i\a \ open (b i)" by auto + have "\i. \a. (i \ domain x \ open (b i) \ (x)\<^isub>F i \ b i) \ (a\A i \ a \ b i)" + using open_sub[of _ b] by auto + then obtain b' + where "\i. i \ domain x \ open (b i) \ (x)\<^isub>F i \ b i \ (b' i \A i \ b' i \ b i)" + unfolding choice_iff by auto + with xs have "\i. i \ a \ (b' i \A i \ b' i \ b i)" "Pi' a b' \ Pi' a b" + by (auto simp: Pi'_iff intro!: Pi'_mono) + thus ?case using xs + by (intro bexI[where x="Pi' a b'"]) + (auto simp: Pi'_iff intro!: image_eqI[where x="restrict b' (domain x)"]) + qed + qed (insert A,auto simp: PiE_iff intro!: open_Pi'I) +qed + +subsection {* Metric Space of Finite Maps *} + +instantiation finmap :: (type, metric_space) metric_space +begin + +definition dist_finmap where + "dist P Q = Max (range (\i. dist ((P)\<^isub>F i) ((Q)\<^isub>F i))) + (if domain P = domain Q then 0 else 1)" + +lemma add_eq_zero_iff[simp]: + fixes a b::real + assumes "a \ 0" "b \ 0" + shows "a + b = 0 \ a = 0 \ b = 0" +using assms by auto + +lemma finite_proj_image': "x \ domain P \ finite ((P)\<^isub>F ` S)" + by (rule finite_subset[of _ "proj P ` (domain P \ S \ {x})"]) auto + +lemma finite_proj_image: "finite ((P)\<^isub>F ` S)" + by (cases "\x. x \ domain P") (auto intro: finite_proj_image' finite_subset[where B="domain P"]) + +lemma finite_proj_diag: "finite ((\i. d ((P)\<^isub>F i) ((Q)\<^isub>F i)) ` S)" +proof - + have "(\i. d ((P)\<^isub>F i) ((Q)\<^isub>F i)) ` S = (\(i, j). d i j) ` ((\i. ((P)\<^isub>F i, (Q)\<^isub>F i)) ` S)" by auto + moreover have "((\i. ((P)\<^isub>F i, (Q)\<^isub>F i)) ` S) \ (\i. (P)\<^isub>F i) ` S \ (\i. (Q)\<^isub>F i) ` S" by auto + moreover have "finite \" using finite_proj_image[of P S] finite_proj_image[of Q S] + by (intro finite_cartesian_product) simp_all + ultimately show ?thesis by (simp add: finite_subset) +qed + +lemma dist_le_1_imp_domain_eq: + shows "dist P Q < 1 \ domain P = domain Q" + by (simp add: dist_finmap_def finite_proj_diag split: split_if_asm) + +lemma dist_proj: + shows "dist ((x)\<^isub>F i) ((y)\<^isub>F i) \ dist x y" +proof - + have "dist (x i) (y i) \ Max (range (\i. dist (x i) (y i)))" + by (simp add: Max_ge_iff finite_proj_diag) + also have "\ \ dist x y" by (simp add: dist_finmap_def) + finally show ?thesis . qed -subsection {* Complete Space of Finite Maps *} +lemma dist_finmap_lessI: + assumes "domain P = domain Q" + assumes "0 < e" + assumes "\i. i \ domain P \ dist (P i) (Q i) < e" + shows "dist P Q < e" +proof - + have "dist P Q = Max (range (\i. dist (P i) (Q i)))" + using assms by (simp add: dist_finmap_def finite_proj_diag) + also have "\ < e" + proof (subst Max_less_iff, safe) + fix i + show "dist ((P)\<^isub>F i) ((Q)\<^isub>F i) < e" using assms + by (cases "i \ domain P") simp_all + qed (simp add: finite_proj_diag) + finally show ?thesis . +qed -lemma tendsto_dist_zero: - assumes "(\i. dist (f i) g) ----> 0" - shows "f ----> g" - using assms by (auto simp: tendsto_iff dist_real_def) +instance +proof + fix S::"('a \\<^isub>F 'b) set" + show "open S = (\x\S. \e>0. \y. dist y x < e \ y \ S)" (is "_ = ?od") + proof + assume "open S" + thus ?od + unfolding open_finmap_def + proof (induct rule: generate_topology.induct) + case UNIV thus ?case by (auto intro: zero_less_one) + next + case (Int a b) + show ?case + proof safe + fix x assume x: "x \ a" "x \ b" + with Int x obtain e1 e2 where + "e1>0" "\y. dist y x < e1 \ y \ a" "e2>0" "\y. dist y x < e2 \ y \ b" by force + thus "\e>0. \y. dist y x < e \ y \ a \ b" + by (auto intro!: exI[where x="min e1 e2"]) + qed + next + case (UN K) + show ?case + proof safe + fix x X assume "x \ X" "X \ K" + moreover with UN obtain e where "e>0" "\y. dist y x < e \ y \ X" by force + ultimately show "\e>0. \y. dist y x < e \ y \ \K" by auto + qed + next + case (Basis s) then obtain a b where s: "s = Pi' a b" and b: "\i. i\a \ open (b i)" by auto + show ?case + proof safe + fix x assume "x \ s" + hence [simp]: "finite a" and a_dom: "a = domain x" using s by (auto simp: Pi'_iff) + obtain es where es: "\i \ a. es i > 0 \ (\y. dist y (proj x i) < es i \ y \ b i)" + using b `x \ s` by atomize_elim (intro bchoice, auto simp: open_dist s) + hence in_b: "\i y. i \ a \ dist y (proj x i) < es i \ y \ b i" by auto + show "\e>0. \y. dist y x < e \ y \ s" + proof (cases, rule, safe) + assume "a \ {}" + show "0 < min 1 (Min (es ` a))" using es by (auto simp: `a \ {}`) + fix y assume d: "dist y x < min 1 (Min (es ` a))" + show "y \ s" unfolding s + proof + show "domain y = a" using d s `a \ {}` by (auto simp: dist_le_1_imp_domain_eq a_dom) + fix i assume "i \ a" + moreover + hence "dist ((y)\<^isub>F i) ((x)\<^isub>F i) < es i" using d + by (auto simp: dist_finmap_def `a \ {}` intro!: le_less_trans[OF dist_proj]) + ultimately + show "y i \ b i" by (rule in_b) + qed + next + assume "\a \ {}" + thus "\e>0. \y. dist y x < e \ y \ s" + using s `x \ s` by (auto simp: Pi'_def dist_le_1_imp_domain_eq intro!: exI[where x=1]) + qed + qed + qed + next + assume "\x\S. \e>0. \y. dist y x < e \ y \ S" + then obtain e where e_pos: "\x. x \ S \ e x > 0" and + e_in: "\x y . x \ S \ dist y x < e x \ y \ S" + unfolding bchoice_iff + by auto + have S_eq: "S = \{Pi' a b| a b. \x\S. domain x = a \ b = (\i. ball (x i) (e x))}" + proof safe + fix x assume "x \ S" + thus "x \ \{Pi' a b| a b. \x\S. domain x = a \ b = (\i. ball (x i) (e x))}" + using e_pos by (auto intro!: exI[where x="Pi' (domain x) (\i. ball (x i) (e x))"]) + next + fix x y + assume "y \ S" + moreover + assume "x \ (\' i\domain y. ball (y i) (e y))" + hence "dist x y < e y" using e_pos `y \ S` + by (auto simp: dist_finmap_def Pi'_iff finite_proj_diag dist_commute) + ultimately show "x \ S" by (rule e_in) + qed + also have "open \" + unfolding open_finmap_def + by (intro generate_topology.UN) (auto intro: generate_topology.Basis) + finally show "open S" . + qed +next + fix P Q::"'a \\<^isub>F 'b" + have Max_eq_iff: "\A m. finite A \ A \ {} \ (Max A = m) = (m \ A \ (\a\A. a \ m))" + by (metis Max.in_idem Max_in max_def min_max.sup.commute order_refl) + show "dist P Q = 0 \ P = Q" + by (auto simp: finmap_eq_iff dist_finmap_def Max_ge_iff finite_proj_diag Max_eq_iff + intro!: Max_eqI image_eqI[where x=undefined]) +next + fix P Q R::"'a \\<^isub>F 'b" + let ?dists = "\P Q i. dist ((P)\<^isub>F i) ((Q)\<^isub>F i)" + let ?dpq = "?dists P Q" and ?dpr = "?dists P R" and ?dqr = "?dists Q R" + let ?dom = "\P Q. (if domain P = domain Q then 0 else 1::real)" + have "dist P Q = Max (range ?dpq) + ?dom P Q" + by (simp add: dist_finmap_def) + also obtain t where "t \ range ?dpq" "t = Max (range ?dpq)" by (simp add: finite_proj_diag) + then obtain i where "Max (range ?dpq) = ?dpq i" by auto + also have "?dpq i \ ?dpr i + ?dqr i" by (rule dist_triangle2) + also have "?dpr i \ Max (range ?dpr)" by (simp add: finite_proj_diag) + also have "?dqr i \ Max (range ?dqr)" by (simp add: finite_proj_diag) + also have "?dom P Q \ ?dom P R + ?dom Q R" by simp + finally show "dist P Q \ dist P R + dist Q R" by (simp add: dist_finmap_def ac_simps) +qed -lemma tendsto_dist_zero': - assumes "(\i. dist (f i) g) ----> x" - assumes "0 = x" - shows "f ----> g" - using assms tendsto_dist_zero by simp +end + +subsection {* Complete Space of Finite Maps *} lemma tendsto_finmap: fixes f::"nat \ ('i \\<^isub>F ('a::metric_space))" assumes ind_f: "\n. domain (f n) = domain g" assumes proj_g: "\i. i \ domain g \ (\n. (f n) i) ----> g i" shows "f ----> g" - apply (rule tendsto_dist_zero') - unfolding dist_finmap_def assms - apply (rule tendsto_intros proj_g | simp)+ - done + unfolding tendsto_iff +proof safe + fix e::real assume "0 < e" + let ?dists = "\x i. dist ((f x)\<^isub>F i) ((g)\<^isub>F i)" + have "eventually (\x. \i\domain g. ?dists x i < e) sequentially" + using finite_domain[of g] proj_g + proof induct + case (insert i G) + with `0 < e` have "eventually (\x. ?dists x i < e) sequentially" by (auto simp add: tendsto_iff) + moreover + from insert have "eventually (\x. \i\G. dist ((f x)\<^isub>F i) ((g)\<^isub>F i) < e) sequentially" by simp + ultimately show ?case by eventually_elim auto + qed simp + thus "eventually (\x. dist (f x) g < e) sequentially" + by eventually_elim (auto simp add: dist_finmap_def finite_proj_diag ind_f `0 < e`) +qed instance finmap :: (type, complete_space) complete_space proof @@ -412,123 +490,114 @@ have "P ----> Q" proof (rule metric_LIMSEQ_I) fix e::real assume "0 < e" - def e' \ "min 1 (e / (card d + 1))" - hence "0 < e'" using `0 < e` by (auto simp: e'_def intro: divide_pos_pos) - have "\ni. \i\d. \n\ni i. dist (p i n) (q i) < e'" + have "\ni. \i\d. \n\ni i. dist (p i n) (q i) < e" proof (safe intro!: bchoice) fix i assume "i \ d" - from p[OF `i \ d`, THEN metric_LIMSEQ_D, OF `0 < e'`] - show "\no. \n\no. dist (p i n) (q i) < e'" . + from p[OF `i \ d`, THEN metric_LIMSEQ_D, OF `0 < e`] + show "\no. \n\no. dist (p i n) (q i) < e" . qed then guess ni .. note ni = this def N \ "max Nd (Max (ni ` d))" show "\N. \n\N. dist (P n) Q < e" proof (safe intro!: exI[where x="N"]) fix n assume "N \ n" - hence "domain (P n) = d" "domain Q = d" "domain (P n) = domain Q" + hence dom: "domain (P n) = d" "domain Q = d" "domain (P n) = domain Q" using dim by (simp_all add: N_def Q_def dim_def Abs_finmap_inverse) - hence "dist (P n) Q = (\i\d. dist ((P n) i) (Q i))" by (simp add: dist_finmap_def) - also have "\ \ (\i\d. e')" - proof (intro setsum_mono less_imp_le) - fix i assume "i \ d" - hence "ni i \ Max (ni ` d)" by simp + show "dist (P n) Q < e" + proof (rule dist_finmap_lessI[OF dom(3) `0 < e`]) + fix i + assume "i \ domain (P n)" + hence "ni i \ Max (ni ` d)" using dom by simp also have "\ \ N" by (simp add: N_def) - also have "\ \ n" using `N \ n` . - finally - show "dist ((P n) i) (Q i) < e'" - using ni `i \ d` by (auto simp: p_def q N_def) + finally show "dist ((P n)\<^isub>F i) ((Q)\<^isub>F i) < e" using ni `i \ domain (P n)` `N \ n` dom + by (auto simp: p_def q N_def less_imp_le) qed - also have "\ = card d * e'" by (simp add: real_eq_of_nat) - also have "\ < e" using `0 < e` by (simp add: e'_def field_simps min_def) - finally show "dist (P n) Q < e" . qed qed thus "convergent P" by (auto simp: convergent_def) qed -subsection {* Polish Space of Finite Maps *} +subsection {* Second Countable Space of Finite Maps *} -instantiation finmap :: (countable, polish_space) polish_space +instantiation finmap :: (countable, second_countable_topology) second_countable_topology begin +definition basis_proj::"'b set set" + where "basis_proj = (SOME B. countable B \ topological_basis B)" + +lemma countable_basis_proj: "countable basis_proj" and basis_proj: "topological_basis basis_proj" + unfolding basis_proj_def by (intro is_basis countable_basis)+ + definition basis_finmap::"('a \\<^isub>F 'b) set set" - where "basis_finmap = {Pi' I S|I S. finite I \ (\i \ I. S i \ union_closed_basis)}" + where "basis_finmap = {Pi' I S|I S. finite I \ (\i \ I. S i \ basis_proj)}" lemma in_basis_finmapI: - assumes "finite I" assumes "\i. i \ I \ S i \ union_closed_basis" + assumes "finite I" assumes "\i. i \ I \ S i \ basis_proj" shows "Pi' I S \ basis_finmap" using assms unfolding basis_finmap_def by auto -lemma in_basis_finmapE: - assumes "x \ basis_finmap" - obtains I S where "x = Pi' I S" "finite I" "\i. i \ I \ S i \ union_closed_basis" - using assms unfolding basis_finmap_def by auto - lemma basis_finmap_eq: - "basis_finmap = (\f. Pi' (domain f) (\i. from_nat_into union_closed_basis ((f)\<^isub>F i))) ` + assumes "basis_proj \ {}" + shows "basis_finmap = (\f. Pi' (domain f) (\i. from_nat_into basis_proj ((f)\<^isub>F i))) ` (UNIV::('a \\<^isub>F nat) set)" (is "_ = ?f ` _") unfolding basis_finmap_def proof safe fix I::"'a set" and S::"'a \ 'b set" - assume "finite I" "\i\I. S i \ union_closed_basis" - hence "Pi' I S = ?f (finmap_of I (\x. to_nat_on union_closed_basis (S x)))" - by (force simp: Pi'_def countable_union_closed_basis) + assume "finite I" "\i\I. S i \ basis_proj" + hence "Pi' I S = ?f (finmap_of I (\x. to_nat_on basis_proj (S x)))" + by (force simp: Pi'_def countable_basis_proj) thus "Pi' I S \ range ?f" by simp -qed (metis (mono_tags) empty_basisI equals0D finite_domain from_nat_into) +next + fix x and f::"'a \\<^isub>F nat" + show "\I S. (\' i\domain f. from_nat_into local.basis_proj ((f)\<^isub>F i)) = Pi' I S \ + finite I \ (\i\I. S i \ local.basis_proj)" + using assms by (auto intro: from_nat_into) +qed + +lemma basis_finmap_eq_empty: "basis_proj = {} \ basis_finmap = {Pi' {} undefined}" + by (auto simp: Pi'_iff basis_finmap_def) lemma countable_basis_finmap: "countable basis_finmap" - unfolding basis_finmap_eq by simp + by (cases "basis_proj = {}") (auto simp: basis_finmap_eq basis_finmap_eq_empty) lemma finmap_topological_basis: "topological_basis basis_finmap" proof (subst topological_basis_iff, safe) fix B' assume "B' \ basis_finmap" thus "open B'" - by (auto intro!: open_Pi'I topological_basis_open[OF basis_union_closed_basis] + by (auto intro!: open_Pi'I topological_basis_open[OF basis_proj] simp: topological_basis_def basis_finmap_def Let_def) next fix O'::"('a \\<^isub>F 'b) set" and x - assume "open O'" "x \ O'" - then obtain e where e: "e > 0" "\y. dist y x < e \ y \ O'" unfolding open_dist by blast - def e' \ "e / (card (domain x) + 1)" - + assume O': "open O'" "x \ O'" + then obtain a where a: + "x \ Pi' (domain x) a" "Pi' (domain x) a \ O'" "\i. i\domain x \ open (a i)" + unfolding open_finmap_def + proof (atomize_elim, induct rule: generate_topology.induct) + case (Int a b) + let ?p="\a f. x \ Pi' (domain x) f \ Pi' (domain x) f \ a \ (\i. i \ domain x \ open (f i))" + from Int obtain f g where "?p a f" "?p b g" by auto + thus ?case by (force intro!: exI[where x="\i. f i \ g i"] simp: Pi'_def) + next + case (UN k) + then obtain kk a where "x \ kk" "kk \ k" "x \ Pi' (domain x) a" "Pi' (domain x) a \ kk" + "\i. i\domain x \ open (a i)" + by force + thus ?case by blast + qed (auto simp: Pi'_def) have "\B. - (\i\domain x. x i \ B i \ B i \ ball (x i) e' \ B i \ union_closed_basis)" + (\i\domain x. x i \ B i \ B i \ a i \ B i \ basis_proj)" proof (rule bchoice, safe) fix i assume "i \ domain x" - have "open (ball (x i) e')" "x i \ ball (x i) e'" using e - by (auto simp add: e'_def intro!: divide_pos_pos) - from topological_basisE[OF basis_union_closed_basis this] guess b' . - thus "\y. x i \ y \ y \ ball (x i) e' \ y \ union_closed_basis" by auto + hence "open (a i)" "x i \ a i" using a by auto + from topological_basisE[OF basis_proj this] guess b' . + thus "\y. x i \ y \ y \ a i \ y \ basis_proj" by auto qed then guess B .. note B = this def B' \ "Pi' (domain x) (\i. (B i)::'b set)" - hence "B' \ basis_finmap" unfolding B'_def using B - by (intro in_basis_finmapI) auto - moreover have "x \ B'" unfolding B'_def using B by auto - moreover have "B' \ O'" - proof - fix y assume "y \ B'" with B have "domain y = domain x" unfolding B'_def - by (simp add: Pi'_def) - show "y \ O'" - proof (rule e) - have "dist y x = (\i \ domain x. dist (y i) (x i))" - using `domain y = domain x` by (simp add: dist_finmap_def) - also have "\ \ (\i \ domain x. e')" - proof (rule setsum_mono) - fix i assume "i \ domain x" - with `y \ B'` B have "y i \ B i" - by (simp add: Pi'_def B'_def) - hence "y i \ ball (x i) e'" using B `domain y = domain x` `i \ domain x` - by force - thus "dist (y i) (x i) \ e'" by (simp add: dist_commute) - qed - also have "\ = card (domain x) * e'" by (simp add: real_eq_of_nat) - also have "\ < e" using e by (simp add: e'_def field_simps) - finally show "dist y x < e" . - qed - qed - ultimately - show "\B'\basis_finmap. x \ B' \ B' \ O'" by blast + have "B' \ Pi' (domain x) a" using B by (auto intro!: Pi'_mono simp: B'_def) + also note `\ \ O'` + finally show "\B'\basis_finmap. x \ B' \ B' \ O'" using B + by (auto intro!: bexI[where x=B'] Pi'_mono in_basis_finmapI simp: B'_def) qed lemma range_enum_basis_finmap_imp_open: @@ -540,6 +609,11 @@ end +subsection {* Polish Space of Finite Maps *} + +instance finmap :: (countable, polish_space) polish_space proof qed + + subsection {* Product Measurable Space of Finite Maps *} definition "PiF I M \ @@ -942,9 +1016,8 @@ text {* adapted from @{thm sigma_prod_algebra_sigma_eq} *} lemma sigma_fprod_algebra_sigma_eq: - fixes E :: "'i \ 'a set set" + fixes E :: "'i \ 'a set set" and S :: "'i \ nat \ 'a set" assumes [simp]: "finite I" "I \ {}" - assumes S_mono: "\i. i \ I \ incseq (S i)" and S_union: "\i. i \ I \ (\j. S i j) = space (M i)" and S_in_E: "\i. i \ I \ range (S i) \ E i" assumes E_closed: "\i. i \ I \ E i \ Pow (space (M i))" @@ -953,6 +1026,9 @@ shows "sets (PiF {I} M) = sigma_sets (space (PiF {I} M)) P" proof let ?P = "sigma (space (Pi\<^isub>F {I} M)) P" + from `finite I`[THEN ex_bij_betw_finite_nat] guess T .. + then have T: "\i. i \ I \ T i < card I" "\i. i\I \ the_inv_into I T (T i) = i" + by (auto simp add: bij_betw_def set_eq_iff image_iff the_inv_into_f_f simp del: `finite I`) have P_closed: "P \ Pow (space (Pi\<^isub>F {I} M))" using E_closed by (auto simp: space_PiF P_def Pi'_iff subset_eq) then have space_P: "space ?P = (\' i\I. space (M i))" @@ -975,15 +1051,20 @@ using E_closed `i \ I` by (auto simp: space_P Pi_iff subset_eq split: split_if_asm) also have "\ = (\' j\I. \n. if i = j then A else S j n)" by (intro Pi'_cong) (simp_all add: S_union) - also have "\ = (\n. \' j\I. if i = j then A else S j n)" - using S_mono - by (subst Pi'_UN[symmetric, OF `finite I`]) (auto simp: incseq_def) + also have "\ = (\xs\{xs. length xs = card I}. \' j\I. if i = j then A else S j (xs ! T j))" + using T + apply auto + apply (simp_all add: Pi'_iff bchoice_iff) + apply (erule conjE exE)+ + apply (rule_tac x="map (\n. f (the_inv_into I T n)) [0.. \ sets ?P" proof (safe intro!: sets.countable_UN) - fix n show "(\' j\I. if i = j then A else S j n) \ sets ?P" + fix xs show "(\' j\I. if i = j then A else S j (xs ! T j)) \ sets ?P" using A S_in_E by (simp add: P_closed) - (auto simp: P_def subset_eq intro!: exI[of _ "\j. if i = j then A else S j n"]) + (auto simp: P_def subset_eq intro!: exI[of _ "\j. if i = j then A else S j (xs ! T j)"]) qed finally show "(\x. (x)\<^isub>F i) -` A \ space ?P \ sets ?P" using P_closed by simp @@ -1003,76 +1084,28 @@ by (auto intro!: sets.sigma_sets_subset product_in_sets_PiFI simp: E_generates P_def) qed -lemma sets_PiF_eq_sigma_union_closed_basis_single: - assumes "I \ {}" - assumes [simp]: "finite I" - shows "sets (PiF {I} (\_. borel)) = sigma_sets (space (PiF {I} (\_. borel))) - {Pi' I F |F. (\i\I. F i \ union_closed_basis)}" -proof - - from open_incseqE[OF open_UNIV] guess S::"nat \ 'b set" . note S = this - show ?thesis - proof (rule sigma_fprod_algebra_sigma_eq) - show "finite I" by simp - show "I \ {}" by fact - show "incseq S" "(\j. S j) = space borel" "range S \ union_closed_basis" - using S by simp_all - show "union_closed_basis \ Pow (space borel)" by simp - show "sets borel = sigma_sets (space borel) union_closed_basis" - by (simp add: borel_eq_union_closed_basis) - qed -qed - -text {* adapted from @{thm sets_PiF_eq_sigma_union_closed_basis_single} *} - -lemma sets_PiM_eq_sigma_union_closed_basis: - assumes "I \ {}" - assumes [simp]: "finite I" - shows "sets (PiM I (\_. borel)) = sigma_sets (space (PiM I (\_. borel))) - {Pi\<^isub>E I F |F. \i\I. F i \ union_closed_basis}" -proof - - from open_incseqE[OF open_UNIV] guess S::"nat \ 'b set" . note S = this - show ?thesis - proof (rule sigma_prod_algebra_sigma_eq) - show "finite I" by simp note[[show_types]] - fix i show "(\j. S j) = space borel" "range S \ union_closed_basis" - using S by simp_all - show "union_closed_basis \ Pow (space borel)" by simp - show "sets borel = sigma_sets (space borel) union_closed_basis" - by (simp add: borel_eq_union_closed_basis) - qed -qed - lemma product_open_generates_sets_PiF_single: assumes "I \ {}" assumes [simp]: "finite I" shows "sets (PiF {I} (\_. borel::'b::second_countable_topology measure)) = sigma_sets (space (PiF {I} (\_. borel))) {Pi' I F |F. (\i\I. F i \ Collect open)}" proof - - from open_incseqE[OF open_UNIV] guess S::"nat \ 'b set" . note S = this + from open_countable_basisE[OF open_UNIV] guess S::"'b set set" . note S = this show ?thesis proof (rule sigma_fprod_algebra_sigma_eq) show "finite I" by simp show "I \ {}" by fact - show "incseq S" "(\j. S j) = space borel" "range S \ Collect open" - using S by (auto simp: open_union_closed_basis) - show "Collect open \ Pow (space borel)" by simp - show "sets borel = sigma_sets (space borel) (Collect open)" - by (simp add: borel_def) - qed -qed - -lemma product_open_generates_sets_PiM: - assumes "I \ {}" - assumes [simp]: "finite I" - shows "sets (PiM I (\_. borel::'b::second_countable_topology measure)) = - sigma_sets (space (PiM I (\_. borel))) {Pi\<^isub>E I F |F. \i\I. F i \ Collect open}" -proof - - from open_incseqE[OF open_UNIV] guess S::"nat \ 'b set" . note S = this - show ?thesis - proof (rule sigma_prod_algebra_sigma_eq) - show "finite I" by simp note[[show_types]] - fix i show "(\j. S j) = space borel" "range S \ Collect open" - using S by (auto simp: open_union_closed_basis) + def S'\"from_nat_into S" + show "(\j. S' j) = space borel" + using S + apply (auto simp add: from_nat_into countable_basis_proj S'_def basis_proj_def) + apply (metis (lifting, mono_tags) UNIV_I UnionE basis_proj_def countable_basis_proj countable_subset from_nat_into_surj) + done + show "range S' \ Collect open" + using S + apply (auto simp add: from_nat_into countable_basis_proj S'_def) + apply (metis UNIV_not_empty Union_empty from_nat_into set_mp topological_basis_open[OF basis_proj] basis_proj_def) + done show "Collect open \ Pow (space borel)" by simp show "sets borel = sigma_sets (space borel) (Collect open)" by (simp add: borel_def) @@ -1099,7 +1132,7 @@ proof fix x assume "x \ B'" with B' have "x \ basis_finmap" by auto then obtain J X where "x = Pi' J X" "finite J" "X \ J \ sigma_sets UNIV (Collect open)" - by (auto simp: basis_finmap_def open_union_closed_basis) + by (auto simp: basis_finmap_def topological_basis_open[OF basis_proj]) thus "x \ sets ?s" by auto qed qed