author | immler |
Wed, 13 Feb 2013 16:35:07 +0100 | |
changeset 51105 | a27fcd14c384 |
parent 51104 | 59b574c6f803 |
child 51106 | 5746e671ea70 |
permissions | -rw-r--r-- |
50091 | 1 |
(* Title: HOL/Probability/Fin_Map.thy |
50088 | 2 |
Author: Fabian Immler, TU München |
3 |
*) |
|
4 |
||
50091 | 5 |
header {* Finite Maps *} |
6 |
||
50088 | 7 |
theory Fin_Map |
8 |
imports Finite_Product_Measure |
|
9 |
begin |
|
10 |
||
11 |
text {* Auxiliary type that is instantiated to @{class polish_space}, needed for the proof of |
|
12 |
projective limit. @{const extensional} functions are used for the representation in order to |
|
13 |
stay close to the developments of (finite) products @{const Pi\<^isub>E} and their sigma-algebra |
|
14 |
@{const Pi\<^isub>M}. *} |
|
15 |
||
16 |
typedef ('i, 'a) finmap ("(_ \<Rightarrow>\<^isub>F /_)" [22, 21] 21) = |
|
17 |
"{(I::'i set, f::'i \<Rightarrow> 'a). finite I \<and> f \<in> extensional I}" by auto |
|
18 |
||
19 |
subsection {* Domain and Application *} |
|
20 |
||
21 |
definition domain where "domain P = fst (Rep_finmap P)" |
|
22 |
||
23 |
lemma finite_domain[simp, intro]: "finite (domain P)" |
|
24 |
by (cases P) (auto simp: domain_def Abs_finmap_inverse) |
|
25 |
||
50251 | 26 |
definition proj ("'((_)')\<^isub>F" [0] 1000) where "proj P i = snd (Rep_finmap P) i" |
50088 | 27 |
|
28 |
declare [[coercion proj]] |
|
29 |
||
30 |
lemma extensional_proj[simp, intro]: "(P)\<^isub>F \<in> extensional (domain P)" |
|
31 |
by (cases P) (auto simp: domain_def Abs_finmap_inverse proj_def[abs_def]) |
|
32 |
||
33 |
lemma proj_undefined[simp, intro]: "i \<notin> domain P \<Longrightarrow> P i = undefined" |
|
34 |
using extensional_proj[of P] unfolding extensional_def by auto |
|
35 |
||
36 |
lemma finmap_eq_iff: "P = Q \<longleftrightarrow> (domain P = domain Q \<and> (\<forall>i\<in>domain P. P i = Q i))" |
|
37 |
by (cases P, cases Q) |
|
38 |
(auto simp add: Abs_finmap_inject extensional_def domain_def proj_def Abs_finmap_inverse |
|
39 |
intro: extensionalityI) |
|
40 |
||
41 |
subsection {* Countable Finite Maps *} |
|
42 |
||
43 |
instance finmap :: (countable, countable) countable |
|
44 |
proof |
|
45 |
obtain mapper where mapper: "\<And>fm :: 'a \<Rightarrow>\<^isub>F 'b. set (mapper fm) = domain fm" |
|
46 |
by (metis finite_list[OF finite_domain]) |
|
47 |
have "inj (\<lambda>fm. map (\<lambda>i. (i, (fm)\<^isub>F i)) (mapper fm))" (is "inj ?F") |
|
48 |
proof (rule inj_onI) |
|
49 |
fix f1 f2 assume "?F f1 = ?F f2" |
|
50 |
then have "map fst (?F f1) = map fst (?F f2)" by simp |
|
51 |
then have "mapper f1 = mapper f2" by (simp add: comp_def) |
|
52 |
then have "domain f1 = domain f2" by (simp add: mapper[symmetric]) |
|
53 |
with `?F f1 = ?F f2` show "f1 = f2" |
|
54 |
unfolding `mapper f1 = mapper f2` map_eq_conv mapper |
|
55 |
by (simp add: finmap_eq_iff) |
|
56 |
qed |
|
57 |
then show "\<exists>to_nat :: 'a \<Rightarrow>\<^isub>F 'b \<Rightarrow> nat. inj to_nat" |
|
58 |
by (intro exI[of _ "to_nat \<circ> ?F"] inj_comp) auto |
|
59 |
qed |
|
60 |
||
61 |
subsection {* Constructor of Finite Maps *} |
|
62 |
||
63 |
definition "finmap_of inds f = Abs_finmap (inds, restrict f inds)" |
|
64 |
||
65 |
lemma proj_finmap_of[simp]: |
|
66 |
assumes "finite inds" |
|
67 |
shows "(finmap_of inds f)\<^isub>F = restrict f inds" |
|
68 |
using assms |
|
69 |
by (auto simp: Abs_finmap_inverse finmap_of_def proj_def) |
|
70 |
||
71 |
lemma domain_finmap_of[simp]: |
|
72 |
assumes "finite inds" |
|
73 |
shows "domain (finmap_of inds f) = inds" |
|
74 |
using assms |
|
75 |
by (auto simp: Abs_finmap_inverse finmap_of_def domain_def) |
|
76 |
||
77 |
lemma finmap_of_eq_iff[simp]: |
|
78 |
assumes "finite i" "finite j" |
|
51104 | 79 |
shows "finmap_of i m = finmap_of j n \<longleftrightarrow> i = j \<and> (\<forall>k\<in>i. m k= n k)" |
80 |
using assms by (auto simp: finmap_eq_iff) |
|
50088 | 81 |
|
50124 | 82 |
lemma finmap_of_inj_on_extensional_finite: |
50088 | 83 |
assumes "finite K" |
84 |
assumes "S \<subseteq> extensional K" |
|
85 |
shows "inj_on (finmap_of K) S" |
|
86 |
proof (rule inj_onI) |
|
87 |
fix x y::"'a \<Rightarrow> 'b" |
|
88 |
assume "finmap_of K x = finmap_of K y" |
|
89 |
hence "(finmap_of K x)\<^isub>F = (finmap_of K y)\<^isub>F" by simp |
|
90 |
moreover |
|
91 |
assume "x \<in> S" "y \<in> S" hence "x \<in> extensional K" "y \<in> extensional K" using assms by auto |
|
92 |
ultimately |
|
93 |
show "x = y" using assms by (simp add: extensional_restrict) |
|
94 |
qed |
|
95 |
||
96 |
lemma finmap_choice: |
|
97 |
assumes *: "\<And>i. i \<in> I \<Longrightarrow> \<exists>x. P i x" and I: "finite I" |
|
98 |
shows "\<exists>fm. domain fm = I \<and> (\<forall>i\<in>I. P i (fm i))" |
|
99 |
proof - |
|
100 |
have "\<exists>f. \<forall>i\<in>I. P i (f i)" |
|
101 |
unfolding bchoice_iff[symmetric] using * by auto |
|
102 |
then guess f .. |
|
103 |
with I show ?thesis |
|
104 |
by (intro exI[of _ "finmap_of I f"]) auto |
|
105 |
qed |
|
106 |
||
107 |
subsection {* Product set of Finite Maps *} |
|
108 |
||
109 |
text {* This is @{term Pi} for Finite Maps, most of this is copied *} |
|
110 |
||
111 |
definition Pi' :: "'i set \<Rightarrow> ('i \<Rightarrow> 'a set) \<Rightarrow> ('i \<Rightarrow>\<^isub>F 'a) set" where |
|
112 |
"Pi' I A = { P. domain P = I \<and> (\<forall>i. i \<in> I \<longrightarrow> (P)\<^isub>F i \<in> A i) } " |
|
113 |
||
114 |
syntax |
|
115 |
"_Pi'" :: "[pttrn, 'a set, 'b set] => ('a => 'b) set" ("(3PI' _:_./ _)" 10) |
|
116 |
||
117 |
syntax (xsymbols) |
|
118 |
"_Pi'" :: "[pttrn, 'a set, 'b set] => ('a => 'b) set" ("(3\<Pi>' _\<in>_./ _)" 10) |
|
119 |
||
120 |
syntax (HTML output) |
|
121 |
"_Pi'" :: "[pttrn, 'a set, 'b set] => ('a => 'b) set" ("(3\<Pi>' _\<in>_./ _)" 10) |
|
122 |
||
123 |
translations |
|
124 |
"PI' x:A. B" == "CONST Pi' A (%x. B)" |
|
125 |
||
126 |
subsubsection{*Basic Properties of @{term Pi'}*} |
|
127 |
||
128 |
lemma Pi'_I[intro!]: "domain f = A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<in> B x) \<Longrightarrow> f \<in> Pi' A B" |
|
129 |
by (simp add: Pi'_def) |
|
130 |
||
131 |
lemma Pi'_I'[simp]: "domain f = A \<Longrightarrow> (\<And>x. x \<in> A \<longrightarrow> f x \<in> B x) \<Longrightarrow> f \<in> Pi' A B" |
|
132 |
by (simp add:Pi'_def) |
|
133 |
||
134 |
lemma Pi'_mem: "f\<in> Pi' A B \<Longrightarrow> x \<in> A \<Longrightarrow> f x \<in> B x" |
|
135 |
by (simp add: Pi'_def) |
|
136 |
||
137 |
lemma Pi'_iff: "f \<in> Pi' I X \<longleftrightarrow> domain f = I \<and> (\<forall>i\<in>I. f i \<in> X i)" |
|
138 |
unfolding Pi'_def by auto |
|
139 |
||
140 |
lemma Pi'E [elim]: |
|
141 |
"f \<in> Pi' A B \<Longrightarrow> (f x \<in> B x \<Longrightarrow> domain f = A \<Longrightarrow> Q) \<Longrightarrow> (x \<notin> A \<Longrightarrow> Q) \<Longrightarrow> Q" |
|
142 |
by(auto simp: Pi'_def) |
|
143 |
||
144 |
lemma in_Pi'_cong: |
|
145 |
"domain f = domain g \<Longrightarrow> (\<And> w. w \<in> A \<Longrightarrow> f w = g w) \<Longrightarrow> f \<in> Pi' A B \<longleftrightarrow> g \<in> Pi' A B" |
|
146 |
by (auto simp: Pi'_def) |
|
147 |
||
148 |
lemma Pi'_eq_empty[simp]: |
|
149 |
assumes "finite A" shows "(Pi' A B) = {} \<longleftrightarrow> (\<exists>x\<in>A. B x = {})" |
|
150 |
using assms |
|
151 |
apply (simp add: Pi'_def, auto) |
|
152 |
apply (drule_tac x = "finmap_of A (\<lambda>u. SOME y. y \<in> B u)" in spec, auto) |
|
153 |
apply (cut_tac P= "%y. y \<in> B i" in some_eq_ex, auto) |
|
154 |
done |
|
155 |
||
156 |
lemma Pi'_mono: "(\<And>x. x \<in> A \<Longrightarrow> B x \<subseteq> C x) \<Longrightarrow> Pi' A B \<subseteq> Pi' A C" |
|
157 |
by (auto simp: Pi'_def) |
|
158 |
||
159 |
lemma Pi_Pi': "finite A \<Longrightarrow> (Pi\<^isub>E A B) = proj ` Pi' A B" |
|
160 |
apply (auto simp: Pi'_def Pi_def extensional_def) |
|
161 |
apply (rule_tac x = "finmap_of A (restrict x A)" in image_eqI) |
|
162 |
apply auto |
|
163 |
done |
|
164 |
||
51105 | 165 |
subsection {* Topological Space of Finite Maps *} |
166 |
||
167 |
instantiation finmap :: (type, topological_space) topological_space |
|
168 |
begin |
|
169 |
||
170 |
definition open_finmap :: "('a \<Rightarrow>\<^isub>F 'b) set \<Rightarrow> bool" where |
|
171 |
"open_finmap = generate_topology {Pi' a b|a b. \<forall>i\<in>a. open (b i)}" |
|
172 |
||
173 |
lemma open_Pi'I: "(\<And>i. i \<in> I \<Longrightarrow> open (A i)) \<Longrightarrow> open (Pi' I A)" |
|
174 |
by (auto intro: generate_topology.Basis simp: open_finmap_def) |
|
175 |
||
176 |
instance using topological_space_generate_topology |
|
177 |
by intro_classes (auto simp: open_finmap_def class.topological_space_def) |
|
178 |
||
179 |
end |
|
180 |
||
181 |
lemma open_restricted_space: |
|
182 |
shows "open {m. P (domain m)}" |
|
183 |
proof - |
|
184 |
have "{m. P (domain m)} = (\<Union>i \<in> Collect P. {m. domain m = i})" by auto |
|
185 |
also have "open \<dots>" |
|
186 |
proof (rule, safe, cases) |
|
187 |
fix i::"'a set" |
|
188 |
assume "finite i" |
|
189 |
hence "{m. domain m = i} = Pi' i (\<lambda>_. UNIV)" by (auto simp: Pi'_def) |
|
190 |
also have "open \<dots>" by (auto intro: open_Pi'I simp: `finite i`) |
|
191 |
finally show "open {m. domain m = i}" . |
|
192 |
next |
|
193 |
fix i::"'a set" |
|
194 |
assume "\<not> finite i" hence "{m. domain m = i} = {}" by auto |
|
195 |
also have "open \<dots>" by simp |
|
196 |
finally show "open {m. domain m = i}" . |
|
197 |
qed |
|
198 |
finally show ?thesis . |
|
199 |
qed |
|
200 |
||
201 |
lemma closed_restricted_space: |
|
202 |
shows "closed {m. P (domain m)}" |
|
203 |
using open_restricted_space[of "\<lambda>x. \<not> P x"] |
|
204 |
unfolding closed_def by (rule back_subst) auto |
|
205 |
||
206 |
lemma tendsto_proj: "((\<lambda>x. x) ---> a) F \<Longrightarrow> ((\<lambda>x. (x)\<^isub>F i) ---> (a)\<^isub>F i) F" |
|
207 |
unfolding tendsto_def |
|
208 |
proof safe |
|
209 |
fix S::"'b set" |
|
210 |
let ?S = "Pi' (domain a) (\<lambda>x. if x = i then S else UNIV)" |
|
211 |
assume "open S" hence "open ?S" by (auto intro!: open_Pi'I) |
|
212 |
moreover assume "\<forall>S. open S \<longrightarrow> a \<in> S \<longrightarrow> eventually (\<lambda>x. x \<in> S) F" "a i \<in> S" |
|
213 |
ultimately have "eventually (\<lambda>x. x \<in> ?S) F" by auto |
|
214 |
thus "eventually (\<lambda>x. (x)\<^isub>F i \<in> S) F" |
|
215 |
by eventually_elim (insert `a i \<in> S`, force simp: Pi'_iff split: split_if_asm) |
|
216 |
qed |
|
217 |
||
218 |
lemma continuous_proj: |
|
219 |
shows "continuous_on s (\<lambda>x. (x)\<^isub>F i)" |
|
220 |
unfolding continuous_on_def |
|
221 |
by (safe intro!: tendsto_proj tendsto_ident_at_within) |
|
222 |
||
223 |
instance finmap :: (type, first_countable_topology) first_countable_topology |
|
224 |
proof |
|
225 |
fix x::"'a\<Rightarrow>\<^isub>F'b" |
|
226 |
have "\<forall>i. \<exists>A. countable A \<and> (\<forall>a\<in>A. x i \<in> a) \<and> (\<forall>a\<in>A. open a) \<and> |
|
227 |
(\<forall>S. open S \<and> x i \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S)) \<and> (\<forall>a b. a \<in> A \<longrightarrow> b \<in> A \<longrightarrow> a \<inter> b \<in> A)" (is "\<forall>i. ?th i") |
|
228 |
proof |
|
229 |
fix i from first_countable_basis_Int_stableE[of "x i"] guess A . |
|
230 |
thus "?th i" by (intro exI[where x=A]) simp |
|
231 |
qed |
|
232 |
then guess A unfolding choice_iff .. note A = this |
|
233 |
hence open_sub: "\<And>i S. i\<in>domain x \<Longrightarrow> open (S i) \<Longrightarrow> x i\<in>(S i) \<Longrightarrow> (\<exists>a\<in>A i. a\<subseteq>(S i))" by auto |
|
234 |
have A_notempty: "\<And>i. i \<in> domain x \<Longrightarrow> A i \<noteq> {}" using open_sub[of _ "\<lambda>_. UNIV"] by auto |
|
235 |
let ?A = "(\<lambda>f. Pi' (domain x) f) ` (Pi\<^isub>E (domain x) A)" |
|
236 |
show "\<exists>A. countable A \<and> (\<forall>a\<in>A. x \<in> a \<and> open a) \<and> (\<forall>S. open S \<and> x \<in> S \<longrightarrow> (\<exists>a\<in>A. a \<subseteq> S))" |
|
237 |
proof (rule exI[where x="?A"], safe) |
|
238 |
show "countable ?A" using A by (simp add: countable_PiE) |
|
239 |
next |
|
240 |
fix S::"('a \<Rightarrow>\<^isub>F 'b) set" assume "open S" "x \<in> S" |
|
241 |
thus "\<exists>a\<in>?A. a \<subseteq> S" unfolding open_finmap_def |
|
242 |
proof (induct rule: generate_topology.induct) |
|
243 |
case UNIV thus ?case by (auto simp add: ex_in_conv PiE_eq_empty_iff A_notempty) |
|
244 |
next |
|
245 |
case (Int a b) |
|
246 |
then obtain f g where |
|
247 |
"f \<in> Pi\<^isub>E (domain x) A" "Pi' (domain x) f \<subseteq> a" "g \<in> Pi\<^isub>E (domain x) A" "Pi' (domain x) g \<subseteq> b" |
|
248 |
by auto |
|
249 |
thus ?case using A |
|
250 |
by (auto simp: Pi'_iff PiE_iff extensional_def Int_stable_def |
|
251 |
intro!: bexI[where x="\<lambda>i. f i \<inter> g i"]) |
|
252 |
next |
|
253 |
case (UN B) |
|
254 |
then obtain b where "x \<in> b" "b \<in> B" by auto |
|
255 |
hence "\<exists>a\<in>?A. a \<subseteq> b" using UN by simp |
|
256 |
thus ?case using `b \<in> B` by blast |
|
257 |
next |
|
258 |
case (Basis s) |
|
259 |
then obtain a b where xs: "x\<in> Pi' a b" "s = Pi' a b" "\<And>i. i\<in>a \<Longrightarrow> open (b i)" by auto |
|
260 |
have "\<forall>i. \<exists>a. (i \<in> domain x \<and> open (b i) \<and> (x)\<^isub>F i \<in> b i) \<longrightarrow> (a\<in>A i \<and> a \<subseteq> b i)" |
|
261 |
using open_sub[of _ b] by auto |
|
262 |
then obtain b' |
|
263 |
where "\<And>i. i \<in> domain x \<Longrightarrow> open (b i) \<Longrightarrow> (x)\<^isub>F i \<in> b i \<Longrightarrow> (b' i \<in>A i \<and> b' i \<subseteq> b i)" |
|
264 |
unfolding choice_iff by auto |
|
265 |
with xs have "\<And>i. i \<in> a \<Longrightarrow> (b' i \<in>A i \<and> b' i \<subseteq> b i)" "Pi' a b' \<subseteq> Pi' a b" |
|
266 |
by (auto simp: Pi'_iff intro!: Pi'_mono) |
|
267 |
thus ?case using xs |
|
268 |
by (intro bexI[where x="Pi' a b'"]) |
|
269 |
(auto simp: Pi'_iff intro!: image_eqI[where x="restrict b' (domain x)"]) |
|
270 |
qed |
|
271 |
qed (insert A,auto simp: PiE_iff intro!: open_Pi'I) |
|
272 |
qed |
|
273 |
||
50088 | 274 |
subsection {* Metric Space of Finite Maps *} |
275 |
||
276 |
instantiation finmap :: (type, metric_space) metric_space |
|
277 |
begin |
|
278 |
||
279 |
definition dist_finmap where |
|
51104 | 280 |
"dist P Q = Max (range (\<lambda>i. dist ((P)\<^isub>F i) ((Q)\<^isub>F i))) + (if domain P = domain Q then 0 else 1)" |
50088 | 281 |
|
282 |
lemma add_eq_zero_iff[simp]: |
|
283 |
fixes a b::real |
|
284 |
assumes "a \<ge> 0" "b \<ge> 0" |
|
285 |
shows "a + b = 0 \<longleftrightarrow> a = 0 \<and> b = 0" |
|
286 |
using assms by auto |
|
287 |
||
51104 | 288 |
lemma finite_proj_image': "x \<notin> domain P \<Longrightarrow> finite ((P)\<^isub>F ` S)" |
289 |
by (rule finite_subset[of _ "proj P ` (domain P \<inter> S \<union> {x})"]) auto |
|
290 |
||
291 |
lemma finite_proj_image: "finite ((P)\<^isub>F ` S)" |
|
292 |
by (cases "\<exists>x. x \<notin> domain P") (auto intro: finite_proj_image' finite_subset[where B="domain P"]) |
|
293 |
||
294 |
lemma finite_proj_diag: "finite ((\<lambda>i. d ((P)\<^isub>F i) ((Q)\<^isub>F i)) ` S)" |
|
50088 | 295 |
proof - |
51104 | 296 |
have "(\<lambda>i. d ((P)\<^isub>F i) ((Q)\<^isub>F i)) ` S = (\<lambda>(i, j). d i j) ` ((\<lambda>i. ((P)\<^isub>F i, (Q)\<^isub>F i)) ` S)" by auto |
297 |
moreover have "((\<lambda>i. ((P)\<^isub>F i, (Q)\<^isub>F i)) ` S) \<subseteq> (\<lambda>i. (P)\<^isub>F i) ` S \<times> (\<lambda>i. (Q)\<^isub>F i) ` S" by auto |
|
298 |
moreover have "finite \<dots>" using finite_proj_image[of P S] finite_proj_image[of Q S] |
|
299 |
by (intro finite_cartesian_product) simp_all |
|
300 |
ultimately show ?thesis by (simp add: finite_subset) |
|
50088 | 301 |
qed |
302 |
||
51104 | 303 |
lemma dist_le_1_imp_domain_eq: |
304 |
shows "dist P Q < 1 \<Longrightarrow> domain P = domain Q" |
|
305 |
by (simp add: dist_finmap_def finite_proj_diag split: split_if_asm) |
|
306 |
||
50088 | 307 |
lemma dist_proj: |
308 |
shows "dist ((x)\<^isub>F i) ((y)\<^isub>F i) \<le> dist x y" |
|
309 |
proof - |
|
51104 | 310 |
have "dist (x i) (y i) \<le> Max (range (\<lambda>i. dist (x i) (y i)))" |
311 |
by (simp add: Max_ge_iff finite_proj_diag) |
|
312 |
also have "\<dots> \<le> dist x y" by (simp add: dist_finmap_def) |
|
313 |
finally show ?thesis . |
|
314 |
qed |
|
315 |
||
316 |
lemma dist_finmap_lessI: |
|
51105 | 317 |
assumes "domain P = domain Q" |
318 |
assumes "0 < e" |
|
319 |
assumes "\<And>i. i \<in> domain P \<Longrightarrow> dist (P i) (Q i) < e" |
|
51104 | 320 |
shows "dist P Q < e" |
321 |
proof - |
|
322 |
have "dist P Q = Max (range (\<lambda>i. dist (P i) (Q i)))" |
|
323 |
using assms by (simp add: dist_finmap_def finite_proj_diag) |
|
324 |
also have "\<dots> < e" |
|
325 |
proof (subst Max_less_iff, safe) |
|
51105 | 326 |
fix i |
327 |
show "dist ((P)\<^isub>F i) ((Q)\<^isub>F i) < e" using assms |
|
328 |
by (cases "i \<in> domain P") simp_all |
|
51104 | 329 |
qed (simp add: finite_proj_diag) |
330 |
finally show ?thesis . |
|
50088 | 331 |
qed |
332 |
||
333 |
instance |
|
334 |
proof |
|
335 |
fix S::"('a \<Rightarrow>\<^isub>F 'b) set" |
|
51105 | 336 |
show "open S = (\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S)" (is "_ = ?od") |
337 |
proof |
|
338 |
assume "open S" |
|
339 |
thus ?od |
|
340 |
unfolding open_finmap_def |
|
341 |
proof (induct rule: generate_topology.induct) |
|
342 |
case UNIV thus ?case by (auto intro: zero_less_one) |
|
343 |
next |
|
344 |
case (Int a b) |
|
345 |
show ?case |
|
346 |
proof safe |
|
347 |
fix x assume x: "x \<in> a" "x \<in> b" |
|
348 |
with Int x obtain e1 e2 where |
|
349 |
"e1>0" "\<forall>y. dist y x < e1 \<longrightarrow> y \<in> a" "e2>0" "\<forall>y. dist y x < e2 \<longrightarrow> y \<in> b" by force |
|
350 |
thus "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> a \<inter> b" |
|
351 |
by (auto intro!: exI[where x="min e1 e2"]) |
|
352 |
qed |
|
353 |
next |
|
354 |
case (UN K) |
|
355 |
show ?case |
|
356 |
proof safe |
|
357 |
fix x X assume "x \<in> X" "X \<in> K" |
|
358 |
moreover with UN obtain e where "e>0" "\<And>y. dist y x < e \<longrightarrow> y \<in> X" by force |
|
359 |
ultimately show "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> \<Union>K" by auto |
|
360 |
qed |
|
361 |
next |
|
362 |
case (Basis s) then obtain a b where s: "s = Pi' a b" and b: "\<And>i. i\<in>a \<Longrightarrow> open (b i)" by auto |
|
363 |
show ?case |
|
364 |
proof safe |
|
365 |
fix x assume "x \<in> s" |
|
366 |
hence [simp]: "finite a" and a_dom: "a = domain x" using s by (auto simp: Pi'_iff) |
|
367 |
obtain es where es: "\<forall>i \<in> a. es i > 0 \<and> (\<forall>y. dist y (proj x i) < es i \<longrightarrow> y \<in> b i)" |
|
368 |
using b `x \<in> s` by atomize_elim (intro bchoice, auto simp: open_dist s) |
|
369 |
hence in_b: "\<And>i y. i \<in> a \<Longrightarrow> dist y (proj x i) < es i \<Longrightarrow> y \<in> b i" by auto |
|
370 |
show "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> s" |
|
371 |
proof (cases, rule, safe) |
|
372 |
assume "a \<noteq> {}" |
|
373 |
show "0 < min 1 (Min (es ` a))" using es by (auto simp: `a \<noteq> {}`) |
|
374 |
fix y assume d: "dist y x < min 1 (Min (es ` a))" |
|
375 |
show "y \<in> s" unfolding s |
|
376 |
proof |
|
377 |
show "domain y = a" using d s `a \<noteq> {}` by (auto simp: dist_le_1_imp_domain_eq a_dom) |
|
378 |
fix i assume "i \<in> a" |
|
379 |
moreover |
|
380 |
hence "dist ((y)\<^isub>F i) ((x)\<^isub>F i) < es i" using d |
|
381 |
by (auto simp: dist_finmap_def `a \<noteq> {}` intro!: le_less_trans[OF dist_proj]) |
|
382 |
ultimately |
|
383 |
show "y i \<in> b i" by (rule in_b) |
|
384 |
qed |
|
385 |
next |
|
386 |
assume "\<not>a \<noteq> {}" |
|
387 |
thus "\<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> s" |
|
388 |
using s `x \<in> s` by (auto simp: Pi'_def dist_le_1_imp_domain_eq intro!: exI[where x=1]) |
|
389 |
qed |
|
390 |
qed |
|
391 |
qed |
|
392 |
next |
|
393 |
assume "\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S" |
|
394 |
then obtain e where e_pos: "\<And>x. x \<in> S \<Longrightarrow> e x > 0" and |
|
395 |
e_in: "\<And>x y . x \<in> S \<Longrightarrow> dist y x < e x \<Longrightarrow> y \<in> S" |
|
396 |
unfolding bchoice_iff |
|
397 |
by auto |
|
398 |
have S_eq: "S = \<Union>{Pi' a b| a b. \<exists>x\<in>S. domain x = a \<and> b = (\<lambda>i. ball (x i) (e x))}" |
|
399 |
proof safe |
|
400 |
fix x assume "x \<in> S" |
|
401 |
thus "x \<in> \<Union>{Pi' a b| a b. \<exists>x\<in>S. domain x = a \<and> b = (\<lambda>i. ball (x i) (e x))}" |
|
402 |
using e_pos by (auto intro!: exI[where x="Pi' (domain x) (\<lambda>i. ball (x i) (e x))"]) |
|
403 |
next |
|
404 |
fix x y |
|
405 |
assume "y \<in> S" |
|
406 |
moreover |
|
407 |
assume "x \<in> (\<Pi>' i\<in>domain y. ball (y i) (e y))" |
|
408 |
hence "dist x y < e y" using e_pos `y \<in> S` |
|
409 |
by (auto simp: dist_finmap_def Pi'_iff finite_proj_diag dist_commute) |
|
410 |
ultimately show "x \<in> S" by (rule e_in) |
|
411 |
qed |
|
412 |
also have "open \<dots>" |
|
413 |
unfolding open_finmap_def |
|
414 |
by (intro generate_topology.UN) (auto intro: generate_topology.Basis) |
|
415 |
finally show "open S" . |
|
416 |
qed |
|
50088 | 417 |
next |
418 |
fix P Q::"'a \<Rightarrow>\<^isub>F 'b" |
|
51104 | 419 |
have Max_eq_iff: "\<And>A m. finite A \<Longrightarrow> A \<noteq> {} \<Longrightarrow> (Max A = m) = (m \<in> A \<and> (\<forall>a\<in>A. a \<le> m))" |
420 |
by (metis Max.in_idem Max_in max_def min_max.sup.commute order_refl) |
|
50088 | 421 |
show "dist P Q = 0 \<longleftrightarrow> P = Q" |
51104 | 422 |
by (auto simp: finmap_eq_iff dist_finmap_def Max_ge_iff finite_proj_diag Max_eq_iff |
423 |
intro!: Max_eqI image_eqI[where x=undefined]) |
|
50088 | 424 |
next |
425 |
fix P Q R::"'a \<Rightarrow>\<^isub>F 'b" |
|
51104 | 426 |
let ?dists = "\<lambda>P Q i. dist ((P)\<^isub>F i) ((Q)\<^isub>F i)" |
427 |
let ?dpq = "?dists P Q" and ?dpr = "?dists P R" and ?dqr = "?dists Q R" |
|
428 |
let ?dom = "\<lambda>P Q. (if domain P = domain Q then 0 else 1::real)" |
|
429 |
have "dist P Q = Max (range ?dpq) + ?dom P Q" |
|
430 |
by (simp add: dist_finmap_def) |
|
431 |
also obtain t where "t \<in> range ?dpq" "t = Max (range ?dpq)" by (simp add: finite_proj_diag) |
|
432 |
then obtain i where "Max (range ?dpq) = ?dpq i" by auto |
|
433 |
also have "?dpq i \<le> ?dpr i + ?dqr i" by (rule dist_triangle2) |
|
434 |
also have "?dpr i \<le> Max (range ?dpr)" by (simp add: finite_proj_diag) |
|
435 |
also have "?dqr i \<le> Max (range ?dqr)" by (simp add: finite_proj_diag) |
|
436 |
also have "?dom P Q \<le> ?dom P R + ?dom Q R" by simp |
|
437 |
finally show "dist P Q \<le> dist P R + dist Q R" by (simp add: dist_finmap_def ac_simps) |
|
50088 | 438 |
qed |
439 |
||
440 |
end |
|
441 |
||
442 |
subsection {* Complete Space of Finite Maps *} |
|
443 |
||
444 |
lemma tendsto_finmap: |
|
445 |
fixes f::"nat \<Rightarrow> ('i \<Rightarrow>\<^isub>F ('a::metric_space))" |
|
446 |
assumes ind_f: "\<And>n. domain (f n) = domain g" |
|
447 |
assumes proj_g: "\<And>i. i \<in> domain g \<Longrightarrow> (\<lambda>n. (f n) i) ----> g i" |
|
448 |
shows "f ----> g" |
|
51104 | 449 |
unfolding tendsto_iff |
450 |
proof safe |
|
451 |
fix e::real assume "0 < e" |
|
452 |
let ?dists = "\<lambda>x i. dist ((f x)\<^isub>F i) ((g)\<^isub>F i)" |
|
453 |
have "eventually (\<lambda>x. \<forall>i\<in>domain g. ?dists x i < e) sequentially" |
|
454 |
using finite_domain[of g] proj_g |
|
455 |
proof induct |
|
456 |
case (insert i G) |
|
457 |
with `0 < e` have "eventually (\<lambda>x. ?dists x i < e) sequentially" by (auto simp add: tendsto_iff) |
|
458 |
moreover |
|
459 |
from insert have "eventually (\<lambda>x. \<forall>i\<in>G. dist ((f x)\<^isub>F i) ((g)\<^isub>F i) < e) sequentially" by simp |
|
460 |
ultimately show ?case by eventually_elim auto |
|
461 |
qed simp |
|
462 |
thus "eventually (\<lambda>x. dist (f x) g < e) sequentially" |
|
463 |
by eventually_elim (auto simp add: dist_finmap_def finite_proj_diag ind_f `0 < e`) |
|
464 |
qed |
|
50088 | 465 |
|
466 |
instance finmap :: (type, complete_space) complete_space |
|
467 |
proof |
|
468 |
fix P::"nat \<Rightarrow> 'a \<Rightarrow>\<^isub>F 'b" |
|
469 |
assume "Cauchy P" |
|
470 |
then obtain Nd where Nd: "\<And>n. n \<ge> Nd \<Longrightarrow> dist (P n) (P Nd) < 1" |
|
471 |
by (force simp: cauchy) |
|
472 |
def d \<equiv> "domain (P Nd)" |
|
473 |
with Nd have dim: "\<And>n. n \<ge> Nd \<Longrightarrow> domain (P n) = d" using dist_le_1_imp_domain_eq by auto |
|
474 |
have [simp]: "finite d" unfolding d_def by simp |
|
475 |
def p \<equiv> "\<lambda>i n. (P n) i" |
|
476 |
def q \<equiv> "\<lambda>i. lim (p i)" |
|
477 |
def Q \<equiv> "finmap_of d q" |
|
478 |
have q: "\<And>i. i \<in> d \<Longrightarrow> q i = Q i" by (auto simp add: Q_def Abs_finmap_inverse) |
|
479 |
{ |
|
480 |
fix i assume "i \<in> d" |
|
481 |
have "Cauchy (p i)" unfolding cauchy p_def |
|
482 |
proof safe |
|
483 |
fix e::real assume "0 < e" |
|
484 |
with `Cauchy P` obtain N where N: "\<And>n. n\<ge>N \<Longrightarrow> dist (P n) (P N) < min e 1" |
|
485 |
by (force simp: cauchy min_def) |
|
486 |
hence "\<And>n. n \<ge> N \<Longrightarrow> domain (P n) = domain (P N)" using dist_le_1_imp_domain_eq by auto |
|
487 |
with dim have dim: "\<And>n. n \<ge> N \<Longrightarrow> domain (P n) = d" by (metis nat_le_linear) |
|
488 |
show "\<exists>N. \<forall>n\<ge>N. dist ((P n) i) ((P N) i) < e" |
|
489 |
proof (safe intro!: exI[where x="N"]) |
|
490 |
fix n assume "N \<le> n" have "N \<le> N" by simp |
|
491 |
have "dist ((P n) i) ((P N) i) \<le> dist (P n) (P N)" |
|
492 |
using dim[OF `N \<le> n`] dim[OF `N \<le> N`] `i \<in> d` |
|
493 |
by (auto intro!: dist_proj) |
|
494 |
also have "\<dots> < e" using N[OF `N \<le> n`] by simp |
|
495 |
finally show "dist ((P n) i) ((P N) i) < e" . |
|
496 |
qed |
|
497 |
qed |
|
498 |
hence "convergent (p i)" by (metis Cauchy_convergent_iff) |
|
499 |
hence "p i ----> q i" unfolding q_def convergent_def by (metis limI) |
|
500 |
} note p = this |
|
501 |
have "P ----> Q" |
|
502 |
proof (rule metric_LIMSEQ_I) |
|
503 |
fix e::real assume "0 < e" |
|
51104 | 504 |
have "\<exists>ni. \<forall>i\<in>d. \<forall>n\<ge>ni i. dist (p i n) (q i) < e" |
50088 | 505 |
proof (safe intro!: bchoice) |
506 |
fix i assume "i \<in> d" |
|
51104 | 507 |
from p[OF `i \<in> d`, THEN metric_LIMSEQ_D, OF `0 < e`] |
508 |
show "\<exists>no. \<forall>n\<ge>no. dist (p i n) (q i) < e" . |
|
50088 | 509 |
qed then guess ni .. note ni = this |
510 |
def N \<equiv> "max Nd (Max (ni ` d))" |
|
511 |
show "\<exists>N. \<forall>n\<ge>N. dist (P n) Q < e" |
|
512 |
proof (safe intro!: exI[where x="N"]) |
|
513 |
fix n assume "N \<le> n" |
|
51104 | 514 |
hence dom: "domain (P n) = d" "domain Q = d" "domain (P n) = domain Q" |
50088 | 515 |
using dim by (simp_all add: N_def Q_def dim_def Abs_finmap_inverse) |
51104 | 516 |
show "dist (P n) Q < e" |
517 |
proof (rule dist_finmap_lessI[OF dom(3) `0 < e`]) |
|
518 |
fix i |
|
519 |
assume "i \<in> domain (P n)" |
|
520 |
hence "ni i \<le> Max (ni ` d)" using dom by simp |
|
50088 | 521 |
also have "\<dots> \<le> N" by (simp add: N_def) |
51104 | 522 |
finally show "dist ((P n)\<^isub>F i) ((Q)\<^isub>F i) < e" using ni `i \<in> domain (P n)` `N \<le> n` dom |
523 |
by (auto simp: p_def q N_def less_imp_le) |
|
50088 | 524 |
qed |
525 |
qed |
|
526 |
qed |
|
527 |
thus "convergent P" by (auto simp: convergent_def) |
|
528 |
qed |
|
529 |
||
51105 | 530 |
subsection {* Second Countable Space of Finite Maps *} |
50088 | 531 |
|
51105 | 532 |
instantiation finmap :: (countable, second_countable_topology) second_countable_topology |
50088 | 533 |
begin |
534 |
||
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
535 |
definition basis_finmap::"('a \<Rightarrow>\<^isub>F 'b) set set" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
536 |
where "basis_finmap = {Pi' I S|I S. finite I \<and> (\<forall>i \<in> I. S i \<in> union_closed_basis)}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
537 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
538 |
lemma in_basis_finmapI: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
539 |
assumes "finite I" assumes "\<And>i. i \<in> I \<Longrightarrow> S i \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
540 |
shows "Pi' I S \<in> basis_finmap" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
541 |
using assms unfolding basis_finmap_def by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
542 |
|
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
543 |
lemma in_basis_finmapE: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
544 |
assumes "x \<in> basis_finmap" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
545 |
obtains I S where "x = Pi' I S" "finite I" "\<And>i. i \<in> I \<Longrightarrow> S i \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
546 |
using assms unfolding basis_finmap_def by auto |
50088 | 547 |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
548 |
lemma basis_finmap_eq: |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
549 |
"basis_finmap = (\<lambda>f. Pi' (domain f) (\<lambda>i. from_nat_into union_closed_basis ((f)\<^isub>F i))) ` |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
550 |
(UNIV::('a \<Rightarrow>\<^isub>F nat) set)" (is "_ = ?f ` _") |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
551 |
unfolding basis_finmap_def |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
552 |
proof safe |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
553 |
fix I::"'a set" and S::"'a \<Rightarrow> 'b set" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
554 |
assume "finite I" "\<forall>i\<in>I. S i \<in> union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
555 |
hence "Pi' I S = ?f (finmap_of I (\<lambda>x. to_nat_on union_closed_basis (S x)))" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
556 |
by (force simp: Pi'_def countable_union_closed_basis) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
557 |
thus "Pi' I S \<in> range ?f" by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
558 |
qed (metis (mono_tags) empty_basisI equals0D finite_domain from_nat_into) |
50088 | 559 |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
560 |
lemma countable_basis_finmap: "countable basis_finmap" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
561 |
unfolding basis_finmap_eq by simp |
50088 | 562 |
|
563 |
lemma finmap_topological_basis: |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
564 |
"topological_basis basis_finmap" |
50088 | 565 |
proof (subst topological_basis_iff, safe) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
566 |
fix B' assume "B' \<in> basis_finmap" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
567 |
thus "open B'" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
568 |
by (auto intro!: open_Pi'I topological_basis_open[OF basis_union_closed_basis] |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
569 |
simp: topological_basis_def basis_finmap_def Let_def) |
50088 | 570 |
next |
571 |
fix O'::"('a \<Rightarrow>\<^isub>F 'b) set" and x |
|
51105 | 572 |
assume O': "open O'" "x \<in> O'" |
573 |
then obtain a where a: |
|
574 |
"x \<in> Pi' (domain x) a" "Pi' (domain x) a \<subseteq> O'" "\<And>i. i\<in>domain x \<Longrightarrow> open (a i)" |
|
575 |
unfolding open_finmap_def |
|
576 |
proof (atomize_elim, induct rule: generate_topology.induct) |
|
577 |
case (Int a b) |
|
578 |
let ?p="\<lambda>a f. x \<in> Pi' (domain x) f \<and> Pi' (domain x) f \<subseteq> a \<and> (\<forall>i. i \<in> domain x \<longrightarrow> open (f i))" |
|
579 |
from Int obtain f g where "?p a f" "?p b g" by auto |
|
580 |
thus ?case by (force intro!: exI[where x="\<lambda>i. f i \<inter> g i"] simp: Pi'_def) |
|
581 |
next |
|
582 |
case (UN k) |
|
583 |
then obtain kk a where "x \<in> kk" "kk \<in> k" "x \<in> Pi' (domain x) a" "Pi' (domain x) a \<subseteq> kk" |
|
584 |
"\<And>i. i\<in>domain x \<Longrightarrow> open (a i)" |
|
585 |
by force |
|
586 |
thus ?case by blast |
|
587 |
qed (auto simp: Pi'_def) |
|
50088 | 588 |
have "\<exists>B. |
51105 | 589 |
(\<forall>i\<in>domain x. x i \<in> B i \<and> B i \<subseteq> a i \<and> B i \<in> union_closed_basis)" |
50088 | 590 |
proof (rule bchoice, safe) |
591 |
fix i assume "i \<in> domain x" |
|
51105 | 592 |
hence "open (a i)" "x i \<in> a i" using a by auto |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
593 |
from topological_basisE[OF basis_union_closed_basis this] guess b' . |
51105 | 594 |
thus "\<exists>y. x i \<in> y \<and> y \<subseteq> a i \<and> y \<in> union_closed_basis" by auto |
50088 | 595 |
qed |
596 |
then guess B .. note B = this |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
597 |
def B' \<equiv> "Pi' (domain x) (\<lambda>i. (B i)::'b set)" |
51105 | 598 |
have "B' \<subseteq> Pi' (domain x) a" using B by (auto intro!: Pi'_mono simp: B'_def) |
599 |
also note `\<dots> \<subseteq> O'` |
|
600 |
finally show "\<exists>B'\<in>basis_finmap. x \<in> B' \<and> B' \<subseteq> O'" using B |
|
601 |
by (auto intro!: bexI[where x=B'] Pi'_mono in_basis_finmapI simp: B'_def) |
|
50088 | 602 |
qed |
603 |
||
604 |
lemma range_enum_basis_finmap_imp_open: |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
605 |
assumes "x \<in> basis_finmap" |
50088 | 606 |
shows "open x" |
607 |
using finmap_topological_basis assms by (auto simp: topological_basis_def) |
|
608 |
||
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
609 |
instance proof qed (blast intro: finmap_topological_basis countable_basis_finmap) |
50088 | 610 |
|
611 |
end |
|
612 |
||
51105 | 613 |
subsection {* Polish Space of Finite Maps *} |
614 |
||
615 |
instance finmap :: (countable, polish_space) polish_space proof qed |
|
616 |
||
617 |
||
50088 | 618 |
subsection {* Product Measurable Space of Finite Maps *} |
619 |
||
620 |
definition "PiF I M \<equiv> |
|
50124 | 621 |
sigma (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j))) {(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}" |
50088 | 622 |
|
623 |
abbreviation |
|
624 |
"Pi\<^isub>F I M \<equiv> PiF I M" |
|
625 |
||
626 |
syntax |
|
627 |
"_PiF" :: "pttrn \<Rightarrow> 'i set \<Rightarrow> 'a measure \<Rightarrow> ('i => 'a) measure" ("(3PIF _:_./ _)" 10) |
|
628 |
||
629 |
syntax (xsymbols) |
|
630 |
"_PiF" :: "pttrn \<Rightarrow> 'i set \<Rightarrow> 'a measure \<Rightarrow> ('i => 'a) measure" ("(3\<Pi>\<^isub>F _\<in>_./ _)" 10) |
|
631 |
||
632 |
syntax (HTML output) |
|
633 |
"_PiF" :: "pttrn \<Rightarrow> 'i set \<Rightarrow> 'a measure \<Rightarrow> ('i => 'a) measure" ("(3\<Pi>\<^isub>F _\<in>_./ _)" 10) |
|
634 |
||
635 |
translations |
|
636 |
"PIF x:I. M" == "CONST PiF I (%x. M)" |
|
637 |
||
638 |
lemma PiF_gen_subset: "{(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))} \<subseteq> |
|
639 |
Pow (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j)))" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
640 |
by (auto simp: Pi'_def) (blast dest: sets.sets_into_space) |
50088 | 641 |
|
642 |
lemma space_PiF: "space (PiF I M) = (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j)))" |
|
643 |
unfolding PiF_def using PiF_gen_subset by (rule space_measure_of) |
|
644 |
||
645 |
lemma sets_PiF: |
|
646 |
"sets (PiF I M) = sigma_sets (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j))) |
|
647 |
{(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}" |
|
648 |
unfolding PiF_def using PiF_gen_subset by (rule sets_measure_of) |
|
649 |
||
650 |
lemma sets_PiF_singleton: |
|
651 |
"sets (PiF {I} M) = sigma_sets (\<Pi>' j\<in>I. space (M j)) |
|
652 |
{(\<Pi>' j\<in>I. X j) |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" |
|
653 |
unfolding sets_PiF by simp |
|
654 |
||
655 |
lemma in_sets_PiFI: |
|
656 |
assumes "X = (Pi' J S)" "J \<in> I" "\<And>i. i\<in>J \<Longrightarrow> S i \<in> sets (M i)" |
|
657 |
shows "X \<in> sets (PiF I M)" |
|
658 |
unfolding sets_PiF |
|
659 |
using assms by blast |
|
660 |
||
661 |
lemma product_in_sets_PiFI: |
|
662 |
assumes "J \<in> I" "\<And>i. i\<in>J \<Longrightarrow> S i \<in> sets (M i)" |
|
663 |
shows "(Pi' J S) \<in> sets (PiF I M)" |
|
664 |
unfolding sets_PiF |
|
665 |
using assms by blast |
|
666 |
||
667 |
lemma singleton_space_subset_in_sets: |
|
668 |
fixes J |
|
669 |
assumes "J \<in> I" |
|
670 |
assumes "finite J" |
|
671 |
shows "space (PiF {J} M) \<in> sets (PiF I M)" |
|
672 |
using assms |
|
673 |
by (intro in_sets_PiFI[where J=J and S="\<lambda>i. space (M i)"]) |
|
674 |
(auto simp: product_def space_PiF) |
|
675 |
||
676 |
lemma singleton_subspace_set_in_sets: |
|
677 |
assumes A: "A \<in> sets (PiF {J} M)" |
|
678 |
assumes "finite J" |
|
679 |
assumes "J \<in> I" |
|
680 |
shows "A \<in> sets (PiF I M)" |
|
681 |
using A[unfolded sets_PiF] |
|
682 |
apply (induct A) |
|
683 |
unfolding sets_PiF[symmetric] unfolding space_PiF[symmetric] |
|
684 |
using assms |
|
685 |
by (auto intro: in_sets_PiFI intro!: singleton_space_subset_in_sets) |
|
686 |
||
50124 | 687 |
lemma finite_measurable_singletonI: |
50088 | 688 |
assumes "finite I" |
689 |
assumes "\<And>J. J \<in> I \<Longrightarrow> finite J" |
|
690 |
assumes MN: "\<And>J. J \<in> I \<Longrightarrow> A \<in> measurable (PiF {J} M) N" |
|
691 |
shows "A \<in> measurable (PiF I M) N" |
|
692 |
unfolding measurable_def |
|
693 |
proof safe |
|
694 |
fix y assume "y \<in> sets N" |
|
695 |
have "A -` y \<inter> space (PiF I M) = (\<Union>J\<in>I. A -` y \<inter> space (PiF {J} M))" |
|
696 |
by (auto simp: space_PiF) |
|
697 |
also have "\<dots> \<in> sets (PiF I M)" |
|
698 |
proof |
|
699 |
show "finite I" by fact |
|
700 |
fix J assume "J \<in> I" |
|
701 |
with assms have "finite J" by simp |
|
702 |
show "A -` y \<inter> space (PiF {J} M) \<in> sets (PiF I M)" |
|
703 |
by (rule singleton_subspace_set_in_sets[OF measurable_sets[OF assms(3)]]) fact+ |
|
704 |
qed |
|
705 |
finally show "A -` y \<inter> space (PiF I M) \<in> sets (PiF I M)" . |
|
706 |
next |
|
707 |
fix x assume "x \<in> space (PiF I M)" thus "A x \<in> space N" |
|
708 |
using MN[of "domain x"] |
|
709 |
by (auto simp: space_PiF measurable_space Pi'_def) |
|
710 |
qed |
|
711 |
||
50124 | 712 |
lemma countable_finite_comprehension: |
50088 | 713 |
fixes f :: "'a::countable set \<Rightarrow> _" |
714 |
assumes "\<And>s. P s \<Longrightarrow> finite s" |
|
715 |
assumes "\<And>s. P s \<Longrightarrow> f s \<in> sets M" |
|
716 |
shows "\<Union>{f s|s. P s} \<in> sets M" |
|
717 |
proof - |
|
718 |
have "\<Union>{f s|s. P s} = (\<Union>n::nat. let s = set (from_nat n) in if P s then f s else {})" |
|
719 |
proof safe |
|
720 |
fix x X s assume "x \<in> f s" "P s" |
|
721 |
moreover with assms obtain l where "s = set l" using finite_list by blast |
|
722 |
ultimately show "x \<in> (\<Union>n. let s = set (from_nat n) in if P s then f s else {})" using `P s` |
|
723 |
by (auto intro!: exI[where x="to_nat l"]) |
|
724 |
next |
|
725 |
fix x n assume "x \<in> (let s = set (from_nat n) in if P s then f s else {})" |
|
726 |
thus "x \<in> \<Union>{f s|s. P s}" using assms by (auto simp: Let_def split: split_if_asm) |
|
727 |
qed |
|
728 |
hence "\<Union>{f s|s. P s} = (\<Union>n. let s = set (from_nat n) in if P s then f s else {})" by simp |
|
729 |
also have "\<dots> \<in> sets M" using assms by (auto simp: Let_def) |
|
730 |
finally show ?thesis . |
|
731 |
qed |
|
732 |
||
733 |
lemma space_subset_in_sets: |
|
734 |
fixes J::"'a::countable set set" |
|
735 |
assumes "J \<subseteq> I" |
|
736 |
assumes "\<And>j. j \<in> J \<Longrightarrow> finite j" |
|
737 |
shows "space (PiF J M) \<in> sets (PiF I M)" |
|
738 |
proof - |
|
739 |
have "space (PiF J M) = \<Union>{space (PiF {j} M)|j. j \<in> J}" |
|
740 |
unfolding space_PiF by blast |
|
741 |
also have "\<dots> \<in> sets (PiF I M)" using assms |
|
742 |
by (intro countable_finite_comprehension) (auto simp: singleton_space_subset_in_sets) |
|
743 |
finally show ?thesis . |
|
744 |
qed |
|
745 |
||
746 |
lemma subspace_set_in_sets: |
|
747 |
fixes J::"'a::countable set set" |
|
748 |
assumes A: "A \<in> sets (PiF J M)" |
|
749 |
assumes "J \<subseteq> I" |
|
750 |
assumes "\<And>j. j \<in> J \<Longrightarrow> finite j" |
|
751 |
shows "A \<in> sets (PiF I M)" |
|
752 |
using A[unfolded sets_PiF] |
|
753 |
apply (induct A) |
|
754 |
unfolding sets_PiF[symmetric] unfolding space_PiF[symmetric] |
|
755 |
using assms |
|
756 |
by (auto intro: in_sets_PiFI intro!: space_subset_in_sets) |
|
757 |
||
50124 | 758 |
lemma countable_measurable_PiFI: |
50088 | 759 |
fixes I::"'a::countable set set" |
760 |
assumes MN: "\<And>J. J \<in> I \<Longrightarrow> finite J \<Longrightarrow> A \<in> measurable (PiF {J} M) N" |
|
761 |
shows "A \<in> measurable (PiF I M) N" |
|
762 |
unfolding measurable_def |
|
763 |
proof safe |
|
764 |
fix y assume "y \<in> sets N" |
|
765 |
have "A -` y = (\<Union>{A -` y \<inter> {x. domain x = J}|J. finite J})" by auto |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
766 |
{ fix x::"'a \<Rightarrow>\<^isub>F 'b" |
50088 | 767 |
from finite_list[of "domain x"] obtain xs where "set xs = domain x" by auto |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
768 |
hence "\<exists>n. domain x = set (from_nat n)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
769 |
by (intro exI[where x="to_nat xs"]) auto } |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
770 |
hence "A -` y \<inter> space (PiF I M) = (\<Union>n. A -` y \<inter> space (PiF ({set (from_nat n)}\<inter>I) M))" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
771 |
by (auto simp: space_PiF Pi'_def) |
50088 | 772 |
also have "\<dots> \<in> sets (PiF I M)" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
773 |
apply (intro sets.Int sets.countable_nat_UN subsetI, safe) |
50088 | 774 |
apply (case_tac "set (from_nat i) \<in> I") |
775 |
apply simp_all |
|
776 |
apply (rule singleton_subspace_set_in_sets[OF measurable_sets[OF MN]]) |
|
777 |
using assms `y \<in> sets N` |
|
778 |
apply (auto simp: space_PiF) |
|
779 |
done |
|
780 |
finally show "A -` y \<inter> space (PiF I M) \<in> sets (PiF I M)" . |
|
781 |
next |
|
782 |
fix x assume "x \<in> space (PiF I M)" thus "A x \<in> space N" |
|
783 |
using MN[of "domain x"] by (auto simp: space_PiF measurable_space Pi'_def) |
|
784 |
qed |
|
785 |
||
786 |
lemma measurable_PiF: |
|
787 |
assumes f: "\<And>x. x \<in> space N \<Longrightarrow> domain (f x) \<in> I \<and> (\<forall>i\<in>domain (f x). (f x) i \<in> space (M i))" |
|
788 |
assumes S: "\<And>J S. J \<in> I \<Longrightarrow> (\<And>i. i \<in> J \<Longrightarrow> S i \<in> sets (M i)) \<Longrightarrow> |
|
789 |
f -` (Pi' J S) \<inter> space N \<in> sets N" |
|
790 |
shows "f \<in> measurable N (PiF I M)" |
|
791 |
unfolding PiF_def |
|
792 |
using PiF_gen_subset |
|
793 |
apply (rule measurable_measure_of) |
|
794 |
using f apply force |
|
795 |
apply (insert S, auto) |
|
796 |
done |
|
797 |
||
50124 | 798 |
lemma restrict_sets_measurable: |
50088 | 799 |
assumes A: "A \<in> sets (PiF I M)" and "J \<subseteq> I" |
800 |
shows "A \<inter> {m. domain m \<in> J} \<in> sets (PiF J M)" |
|
801 |
using A[unfolded sets_PiF] |
|
50124 | 802 |
proof (induct A) |
803 |
case (Basic a) |
|
50088 | 804 |
then obtain K S where S: "a = Pi' K S" "K \<in> I" "(\<forall>i\<in>K. S i \<in> sets (M i))" |
805 |
by auto |
|
50124 | 806 |
show ?case |
50088 | 807 |
proof cases |
808 |
assume "K \<in> J" |
|
809 |
hence "a \<inter> {m. domain m \<in> J} \<in> {Pi' K X |X K. K \<in> J \<and> X \<in> (\<Pi> j\<in>K. sets (M j))}" using S |
|
810 |
by (auto intro!: exI[where x=K] exI[where x=S] simp: Pi'_def) |
|
811 |
also have "\<dots> \<subseteq> sets (PiF J M)" unfolding sets_PiF by auto |
|
812 |
finally show ?thesis . |
|
813 |
next |
|
814 |
assume "K \<notin> J" |
|
815 |
hence "a \<inter> {m. domain m \<in> J} = {}" using S by (auto simp: Pi'_def) |
|
816 |
also have "\<dots> \<in> sets (PiF J M)" by simp |
|
817 |
finally show ?thesis . |
|
818 |
qed |
|
819 |
next |
|
50124 | 820 |
case (Union a) |
50088 | 821 |
have "UNION UNIV a \<inter> {m. domain m \<in> J} = (\<Union>i. (a i \<inter> {m. domain m \<in> J}))" |
822 |
by simp |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
823 |
also have "\<dots> \<in> sets (PiF J M)" using Union by (intro sets.countable_nat_UN) auto |
50124 | 824 |
finally show ?case . |
50088 | 825 |
next |
50124 | 826 |
case (Compl a) |
50088 | 827 |
have "(space (PiF I M) - a) \<inter> {m. domain m \<in> J} = (space (PiF J M) - (a \<inter> {m. domain m \<in> J}))" |
828 |
using `J \<subseteq> I` by (auto simp: space_PiF Pi'_def) |
|
50124 | 829 |
also have "\<dots> \<in> sets (PiF J M)" using Compl by auto |
830 |
finally show ?case by (simp add: space_PiF) |
|
831 |
qed simp |
|
50088 | 832 |
|
833 |
lemma measurable_finmap_of: |
|
834 |
assumes f: "\<And>i. (\<exists>x \<in> space N. i \<in> J x) \<Longrightarrow> (\<lambda>x. f x i) \<in> measurable N (M i)" |
|
835 |
assumes J: "\<And>x. x \<in> space N \<Longrightarrow> J x \<in> I" "\<And>x. x \<in> space N \<Longrightarrow> finite (J x)" |
|
836 |
assumes JN: "\<And>S. {x. J x = S} \<inter> space N \<in> sets N" |
|
837 |
shows "(\<lambda>x. finmap_of (J x) (f x)) \<in> measurable N (PiF I M)" |
|
838 |
proof (rule measurable_PiF) |
|
839 |
fix x assume "x \<in> space N" |
|
840 |
with J[of x] measurable_space[OF f] |
|
841 |
show "domain (finmap_of (J x) (f x)) \<in> I \<and> |
|
842 |
(\<forall>i\<in>domain (finmap_of (J x) (f x)). (finmap_of (J x) (f x)) i \<in> space (M i))" |
|
843 |
by auto |
|
844 |
next |
|
845 |
fix K S assume "K \<in> I" and *: "\<And>i. i \<in> K \<Longrightarrow> S i \<in> sets (M i)" |
|
846 |
with J have eq: "(\<lambda>x. finmap_of (J x) (f x)) -` Pi' K S \<inter> space N = |
|
847 |
(if \<exists>x \<in> space N. K = J x \<and> finite K then if K = {} then {x \<in> space N. J x = K} |
|
848 |
else (\<Inter>i\<in>K. (\<lambda>x. f x i) -` S i \<inter> {x \<in> space N. J x = K}) else {})" |
|
849 |
by (auto simp: Pi'_def) |
|
850 |
have r: "{x \<in> space N. J x = K} = space N \<inter> ({x. J x = K} \<inter> space N)" by auto |
|
851 |
show "(\<lambda>x. finmap_of (J x) (f x)) -` Pi' K S \<inter> space N \<in> sets N" |
|
852 |
unfolding eq r |
|
853 |
apply (simp del: INT_simps add: ) |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
854 |
apply (intro conjI impI sets.finite_INT JN sets.Int[OF sets.top]) |
50088 | 855 |
apply simp apply assumption |
856 |
apply (subst Int_assoc[symmetric]) |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
857 |
apply (rule sets.Int) |
50088 | 858 |
apply (intro measurable_sets[OF f] *) apply force apply assumption |
859 |
apply (intro JN) |
|
860 |
done |
|
861 |
qed |
|
862 |
||
863 |
lemma measurable_PiM_finmap_of: |
|
864 |
assumes "finite J" |
|
865 |
shows "finmap_of J \<in> measurable (Pi\<^isub>M J M) (PiF {J} M)" |
|
866 |
apply (rule measurable_finmap_of) |
|
867 |
apply (rule measurable_component_singleton) |
|
868 |
apply simp |
|
869 |
apply rule |
|
870 |
apply (rule `finite J`) |
|
871 |
apply simp |
|
872 |
done |
|
873 |
||
874 |
lemma proj_measurable_singleton: |
|
50124 | 875 |
assumes "A \<in> sets (M i)" |
50088 | 876 |
shows "(\<lambda>x. (x)\<^isub>F i) -` A \<inter> space (PiF {I} M) \<in> sets (PiF {I} M)" |
877 |
proof cases |
|
878 |
assume "i \<in> I" |
|
879 |
hence "(\<lambda>x. (x)\<^isub>F i) -` A \<inter> space (PiF {I} M) = |
|
880 |
Pi' I (\<lambda>x. if x = i then A else space (M x))" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
881 |
using sets.sets_into_space[OF ] `A \<in> sets (M i)` assms |
50088 | 882 |
by (auto simp: space_PiF Pi'_def) |
883 |
thus ?thesis using assms `A \<in> sets (M i)` |
|
884 |
by (intro in_sets_PiFI) auto |
|
885 |
next |
|
886 |
assume "i \<notin> I" |
|
887 |
hence "(\<lambda>x. (x)\<^isub>F i) -` A \<inter> space (PiF {I} M) = |
|
888 |
(if undefined \<in> A then space (PiF {I} M) else {})" by (auto simp: space_PiF Pi'_def) |
|
889 |
thus ?thesis by simp |
|
890 |
qed |
|
891 |
||
892 |
lemma measurable_proj_singleton: |
|
50124 | 893 |
assumes "i \<in> I" |
50088 | 894 |
shows "(\<lambda>x. (x)\<^isub>F i) \<in> measurable (PiF {I} M) (M i)" |
50124 | 895 |
by (unfold measurable_def, intro CollectI conjI ballI proj_measurable_singleton assms) |
896 |
(insert `i \<in> I`, auto simp: space_PiF) |
|
50088 | 897 |
|
898 |
lemma measurable_proj_countable: |
|
899 |
fixes I::"'a::countable set set" |
|
900 |
assumes "y \<in> space (M i)" |
|
901 |
shows "(\<lambda>x. if i \<in> domain x then (x)\<^isub>F i else y) \<in> measurable (PiF I M) (M i)" |
|
902 |
proof (rule countable_measurable_PiFI) |
|
903 |
fix J assume "J \<in> I" "finite J" |
|
904 |
show "(\<lambda>x. if i \<in> domain x then x i else y) \<in> measurable (PiF {J} M) (M i)" |
|
905 |
unfolding measurable_def |
|
906 |
proof safe |
|
907 |
fix z assume "z \<in> sets (M i)" |
|
908 |
have "(\<lambda>x. if i \<in> domain x then x i else y) -` z \<inter> space (PiF {J} M) = |
|
909 |
(\<lambda>x. if i \<in> J then (x)\<^isub>F i else y) -` z \<inter> space (PiF {J} M)" |
|
910 |
by (auto simp: space_PiF Pi'_def) |
|
911 |
also have "\<dots> \<in> sets (PiF {J} M)" using `z \<in> sets (M i)` `finite J` |
|
912 |
by (cases "i \<in> J") (auto intro!: measurable_sets[OF measurable_proj_singleton]) |
|
913 |
finally show "(\<lambda>x. if i \<in> domain x then x i else y) -` z \<inter> space (PiF {J} M) \<in> |
|
914 |
sets (PiF {J} M)" . |
|
915 |
qed (insert `y \<in> space (M i)`, auto simp: space_PiF Pi'_def) |
|
916 |
qed |
|
917 |
||
918 |
lemma measurable_restrict_proj: |
|
919 |
assumes "J \<in> II" "finite J" |
|
920 |
shows "finmap_of J \<in> measurable (PiM J M) (PiF II M)" |
|
921 |
using assms |
|
922 |
by (intro measurable_finmap_of measurable_component_singleton) auto |
|
923 |
||
50124 | 924 |
lemma measurable_proj_PiM: |
50088 | 925 |
fixes J K ::"'a::countable set" and I::"'a set set" |
926 |
assumes "finite J" "J \<in> I" |
|
927 |
assumes "x \<in> space (PiM J M)" |
|
50124 | 928 |
shows "proj \<in> measurable (PiF {J} M) (PiM J M)" |
50088 | 929 |
proof (rule measurable_PiM_single) |
930 |
show "proj \<in> space (PiF {J} M) \<rightarrow> (\<Pi>\<^isub>E i \<in> J. space (M i))" |
|
931 |
using assms by (auto simp add: space_PiM space_PiF extensional_def sets_PiF Pi'_def) |
|
932 |
next |
|
933 |
fix A i assume A: "i \<in> J" "A \<in> sets (M i)" |
|
934 |
show "{\<omega> \<in> space (PiF {J} M). (\<omega>)\<^isub>F i \<in> A} \<in> sets (PiF {J} M)" |
|
935 |
proof |
|
936 |
have "{\<omega> \<in> space (PiF {J} M). (\<omega>)\<^isub>F i \<in> A} = |
|
937 |
(\<lambda>\<omega>. (\<omega>)\<^isub>F i) -` A \<inter> space (PiF {J} M)" by auto |
|
938 |
also have "\<dots> \<in> sets (PiF {J} M)" |
|
939 |
using assms A by (auto intro: measurable_sets[OF measurable_proj_singleton] simp: space_PiM) |
|
940 |
finally show ?thesis . |
|
941 |
qed simp |
|
942 |
qed |
|
943 |
||
944 |
lemma space_PiF_singleton_eq_product: |
|
945 |
assumes "finite I" |
|
946 |
shows "space (PiF {I} M) = (\<Pi>' i\<in>I. space (M i))" |
|
947 |
by (auto simp: product_def space_PiF assms) |
|
948 |
||
949 |
text {* adapted from @{thm sets_PiM_single} *} |
|
950 |
||
951 |
lemma sets_PiF_single: |
|
952 |
assumes "finite I" "I \<noteq> {}" |
|
953 |
shows "sets (PiF {I} M) = |
|
954 |
sigma_sets (\<Pi>' i\<in>I. space (M i)) |
|
955 |
{{f\<in>\<Pi>' i\<in>I. space (M i). f i \<in> A} | i A. i \<in> I \<and> A \<in> sets (M i)}" |
|
956 |
(is "_ = sigma_sets ?\<Omega> ?R") |
|
957 |
unfolding sets_PiF_singleton |
|
958 |
proof (rule sigma_sets_eqI) |
|
959 |
interpret R: sigma_algebra ?\<Omega> "sigma_sets ?\<Omega> ?R" by (rule sigma_algebra_sigma_sets) auto |
|
960 |
fix A assume "A \<in> {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" |
|
961 |
then obtain X where X: "A = Pi' I X" "X \<in> (\<Pi> j\<in>I. sets (M j))" by auto |
|
962 |
show "A \<in> sigma_sets ?\<Omega> ?R" |
|
963 |
proof - |
|
964 |
from `I \<noteq> {}` X have "A = (\<Inter>j\<in>I. {f\<in>space (PiF {I} M). f j \<in> X j})" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
965 |
using sets.sets_into_space |
50088 | 966 |
by (auto simp: space_PiF product_def) blast |
967 |
also have "\<dots> \<in> sigma_sets ?\<Omega> ?R" |
|
968 |
using X `I \<noteq> {}` assms by (intro R.finite_INT) (auto simp: space_PiF) |
|
969 |
finally show "A \<in> sigma_sets ?\<Omega> ?R" . |
|
970 |
qed |
|
971 |
next |
|
972 |
fix A assume "A \<in> ?R" |
|
973 |
then obtain i B where A: "A = {f\<in>\<Pi>' i\<in>I. space (M i). f i \<in> B}" "i \<in> I" "B \<in> sets (M i)" |
|
974 |
by auto |
|
975 |
then have "A = (\<Pi>' j \<in> I. if j = i then B else space (M j))" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
976 |
using sets.sets_into_space[OF A(3)] |
50088 | 977 |
apply (auto simp: Pi'_iff split: split_if_asm) |
978 |
apply blast |
|
979 |
done |
|
980 |
also have "\<dots> \<in> sigma_sets ?\<Omega> {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" |
|
981 |
using A |
|
982 |
by (intro sigma_sets.Basic ) |
|
983 |
(auto intro: exI[where x="\<lambda>j. if j = i then B else space (M j)"]) |
|
984 |
finally show "A \<in> sigma_sets ?\<Omega> {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}" . |
|
985 |
qed |
|
986 |
||
987 |
text {* adapted from @{thm PiE_cong} *} |
|
988 |
||
989 |
lemma Pi'_cong: |
|
990 |
assumes "finite I" |
|
991 |
assumes "\<And>i. i \<in> I \<Longrightarrow> f i = g i" |
|
992 |
shows "Pi' I f = Pi' I g" |
|
993 |
using assms by (auto simp: Pi'_def) |
|
994 |
||
995 |
text {* adapted from @{thm Pi_UN} *} |
|
996 |
||
997 |
lemma Pi'_UN: |
|
998 |
fixes A :: "nat \<Rightarrow> 'i \<Rightarrow> 'a set" |
|
999 |
assumes "finite I" |
|
1000 |
assumes mono: "\<And>i n m. i \<in> I \<Longrightarrow> n \<le> m \<Longrightarrow> A n i \<subseteq> A m i" |
|
1001 |
shows "(\<Union>n. Pi' I (A n)) = Pi' I (\<lambda>i. \<Union>n. A n i)" |
|
1002 |
proof (intro set_eqI iffI) |
|
1003 |
fix f assume "f \<in> Pi' I (\<lambda>i. \<Union>n. A n i)" |
|
1004 |
then have "\<forall>i\<in>I. \<exists>n. f i \<in> A n i" "domain f = I" by (auto simp: `finite I` Pi'_def) |
|
1005 |
from bchoice[OF this(1)] obtain n where n: "\<And>i. i \<in> I \<Longrightarrow> f i \<in> (A (n i) i)" by auto |
|
1006 |
obtain k where k: "\<And>i. i \<in> I \<Longrightarrow> n i \<le> k" |
|
1007 |
using `finite I` finite_nat_set_iff_bounded_le[of "n`I"] by auto |
|
1008 |
have "f \<in> Pi' I (\<lambda>i. A k i)" |
|
1009 |
proof |
|
1010 |
fix i assume "i \<in> I" |
|
1011 |
from mono[OF this, of "n i" k] k[OF this] n[OF this] `domain f = I` `i \<in> I` |
|
1012 |
show "f i \<in> A k i " by (auto simp: `finite I`) |
|
1013 |
qed (simp add: `domain f = I` `finite I`) |
|
1014 |
then show "f \<in> (\<Union>n. Pi' I (A n))" by auto |
|
1015 |
qed (auto simp: Pi'_def `finite I`) |
|
1016 |
||
1017 |
text {* adapted from @{thm sigma_prod_algebra_sigma_eq} *} |
|
1018 |
||
1019 |
lemma sigma_fprod_algebra_sigma_eq: |
|
1020 |
fixes E :: "'i \<Rightarrow> 'a set set" |
|
1021 |
assumes [simp]: "finite I" "I \<noteq> {}" |
|
1022 |
assumes S_mono: "\<And>i. i \<in> I \<Longrightarrow> incseq (S i)" |
|
1023 |
and S_union: "\<And>i. i \<in> I \<Longrightarrow> (\<Union>j. S i j) = space (M i)" |
|
1024 |
and S_in_E: "\<And>i. i \<in> I \<Longrightarrow> range (S i) \<subseteq> E i" |
|
1025 |
assumes E_closed: "\<And>i. i \<in> I \<Longrightarrow> E i \<subseteq> Pow (space (M i))" |
|
1026 |
and E_generates: "\<And>i. i \<in> I \<Longrightarrow> sets (M i) = sigma_sets (space (M i)) (E i)" |
|
1027 |
defines "P == { Pi' I F | F. \<forall>i\<in>I. F i \<in> E i }" |
|
1028 |
shows "sets (PiF {I} M) = sigma_sets (space (PiF {I} M)) P" |
|
1029 |
proof |
|
1030 |
let ?P = "sigma (space (Pi\<^isub>F {I} M)) P" |
|
1031 |
have P_closed: "P \<subseteq> Pow (space (Pi\<^isub>F {I} M))" |
|
1032 |
using E_closed by (auto simp: space_PiF P_def Pi'_iff subset_eq) |
|
1033 |
then have space_P: "space ?P = (\<Pi>' i\<in>I. space (M i))" |
|
1034 |
by (simp add: space_PiF) |
|
1035 |
have "sets (PiF {I} M) = |
|
1036 |
sigma_sets (space ?P) {{f \<in> \<Pi>' i\<in>I. space (M i). f i \<in> A} |i A. i \<in> I \<and> A \<in> sets (M i)}" |
|
1037 |
using sets_PiF_single[of I M] by (simp add: space_P) |
|
1038 |
also have "\<dots> \<subseteq> sets (sigma (space (PiF {I} M)) P)" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1039 |
proof (safe intro!: sets.sigma_sets_subset) |
50088 | 1040 |
fix i A assume "i \<in> I" and A: "A \<in> sets (M i)" |
1041 |
have "(\<lambda>x. (x)\<^isub>F i) \<in> measurable ?P (sigma (space (M i)) (E i))" |
|
1042 |
proof (subst measurable_iff_measure_of) |
|
1043 |
show "E i \<subseteq> Pow (space (M i))" using `i \<in> I` by fact |
|
1044 |
from space_P `i \<in> I` show "(\<lambda>x. (x)\<^isub>F i) \<in> space ?P \<rightarrow> space (M i)" |
|
1045 |
by auto |
|
1046 |
show "\<forall>A\<in>E i. (\<lambda>x. (x)\<^isub>F i) -` A \<inter> space ?P \<in> sets ?P" |
|
1047 |
proof |
|
1048 |
fix A assume A: "A \<in> E i" |
|
1049 |
then have "(\<lambda>x. (x)\<^isub>F i) -` A \<inter> space ?P = (\<Pi>' j\<in>I. if i = j then A else space (M j))" |
|
1050 |
using E_closed `i \<in> I` by (auto simp: space_P Pi_iff subset_eq split: split_if_asm) |
|
1051 |
also have "\<dots> = (\<Pi>' j\<in>I. \<Union>n. if i = j then A else S j n)" |
|
1052 |
by (intro Pi'_cong) (simp_all add: S_union) |
|
1053 |
also have "\<dots> = (\<Union>n. \<Pi>' j\<in>I. if i = j then A else S j n)" |
|
1054 |
using S_mono |
|
1055 |
by (subst Pi'_UN[symmetric, OF `finite I`]) (auto simp: incseq_def) |
|
1056 |
also have "\<dots> \<in> sets ?P" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1057 |
proof (safe intro!: sets.countable_UN) |
50088 | 1058 |
fix n show "(\<Pi>' j\<in>I. if i = j then A else S j n) \<in> sets ?P" |
1059 |
using A S_in_E |
|
1060 |
by (simp add: P_closed) |
|
1061 |
(auto simp: P_def subset_eq intro!: exI[of _ "\<lambda>j. if i = j then A else S j n"]) |
|
1062 |
qed |
|
1063 |
finally show "(\<lambda>x. (x)\<^isub>F i) -` A \<inter> space ?P \<in> sets ?P" |
|
1064 |
using P_closed by simp |
|
1065 |
qed |
|
1066 |
qed |
|
1067 |
from measurable_sets[OF this, of A] A `i \<in> I` E_closed |
|
1068 |
have "(\<lambda>x. (x)\<^isub>F i) -` A \<inter> space ?P \<in> sets ?P" |
|
1069 |
by (simp add: E_generates) |
|
1070 |
also have "(\<lambda>x. (x)\<^isub>F i) -` A \<inter> space ?P = {f \<in> \<Pi>' i\<in>I. space (M i). f i \<in> A}" |
|
1071 |
using P_closed by (auto simp: space_PiF) |
|
1072 |
finally show "\<dots> \<in> sets ?P" . |
|
1073 |
qed |
|
1074 |
finally show "sets (PiF {I} M) \<subseteq> sigma_sets (space (PiF {I} M)) P" |
|
1075 |
by (simp add: P_closed) |
|
1076 |
show "sigma_sets (space (PiF {I} M)) P \<subseteq> sets (PiF {I} M)" |
|
1077 |
using `finite I` `I \<noteq> {}` |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1078 |
by (auto intro!: sets.sigma_sets_subset product_in_sets_PiFI simp: E_generates P_def) |
50088 | 1079 |
qed |
1080 |
||
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1081 |
lemma sets_PiF_eq_sigma_union_closed_basis_single: |
50088 | 1082 |
assumes "I \<noteq> {}" |
1083 |
assumes [simp]: "finite I" |
|
1084 |
shows "sets (PiF {I} (\<lambda>_. borel)) = sigma_sets (space (PiF {I} (\<lambda>_. borel))) |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1085 |
{Pi' I F |F. (\<forall>i\<in>I. F i \<in> union_closed_basis)}" |
50088 | 1086 |
proof - |
1087 |
from open_incseqE[OF open_UNIV] guess S::"nat \<Rightarrow> 'b set" . note S = this |
|
1088 |
show ?thesis |
|
1089 |
proof (rule sigma_fprod_algebra_sigma_eq) |
|
1090 |
show "finite I" by simp |
|
1091 |
show "I \<noteq> {}" by fact |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1092 |
show "incseq S" "(\<Union>j. S j) = space borel" "range S \<subseteq> union_closed_basis" |
50088 | 1093 |
using S by simp_all |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1094 |
show "union_closed_basis \<subseteq> Pow (space borel)" by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1095 |
show "sets borel = sigma_sets (space borel) union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1096 |
by (simp add: borel_eq_union_closed_basis) |
50088 | 1097 |
qed |
1098 |
qed |
|
1099 |
||
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1100 |
text {* adapted from @{thm sets_PiF_eq_sigma_union_closed_basis_single} *} |
50088 | 1101 |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1102 |
lemma sets_PiM_eq_sigma_union_closed_basis: |
50088 | 1103 |
assumes "I \<noteq> {}" |
1104 |
assumes [simp]: "finite I" |
|
1105 |
shows "sets (PiM I (\<lambda>_. borel)) = sigma_sets (space (PiM I (\<lambda>_. borel))) |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1106 |
{Pi\<^isub>E I F |F. \<forall>i\<in>I. F i \<in> union_closed_basis}" |
50088 | 1107 |
proof - |
1108 |
from open_incseqE[OF open_UNIV] guess S::"nat \<Rightarrow> 'b set" . note S = this |
|
1109 |
show ?thesis |
|
1110 |
proof (rule sigma_prod_algebra_sigma_eq) |
|
1111 |
show "finite I" by simp note[[show_types]] |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1112 |
fix i show "(\<Union>j. S j) = space borel" "range S \<subseteq> union_closed_basis" |
50088 | 1113 |
using S by simp_all |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1114 |
show "union_closed_basis \<subseteq> Pow (space borel)" by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1115 |
show "sets borel = sigma_sets (space borel) union_closed_basis" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1116 |
by (simp add: borel_eq_union_closed_basis) |
50088 | 1117 |
qed |
1118 |
qed |
|
1119 |
||
1120 |
lemma product_open_generates_sets_PiF_single: |
|
1121 |
assumes "I \<noteq> {}" |
|
1122 |
assumes [simp]: "finite I" |
|
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50251
diff
changeset
|
1123 |
shows "sets (PiF {I} (\<lambda>_. borel::'b::second_countable_topology measure)) = |
50088 | 1124 |
sigma_sets (space (PiF {I} (\<lambda>_. borel))) {Pi' I F |F. (\<forall>i\<in>I. F i \<in> Collect open)}" |
1125 |
proof - |
|
1126 |
from open_incseqE[OF open_UNIV] guess S::"nat \<Rightarrow> 'b set" . note S = this |
|
1127 |
show ?thesis |
|
1128 |
proof (rule sigma_fprod_algebra_sigma_eq) |
|
1129 |
show "finite I" by simp |
|
1130 |
show "I \<noteq> {}" by fact |
|
1131 |
show "incseq S" "(\<Union>j. S j) = space borel" "range S \<subseteq> Collect open" |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1132 |
using S by (auto simp: open_union_closed_basis) |
50088 | 1133 |
show "Collect open \<subseteq> Pow (space borel)" by simp |
1134 |
show "sets borel = sigma_sets (space borel) (Collect open)" |
|
1135 |
by (simp add: borel_def) |
|
1136 |
qed |
|
1137 |
qed |
|
1138 |
||
1139 |
lemma product_open_generates_sets_PiM: |
|
1140 |
assumes "I \<noteq> {}" |
|
1141 |
assumes [simp]: "finite I" |
|
50881
ae630bab13da
renamed countable_basis_space to second_countable_topology
hoelzl
parents:
50251
diff
changeset
|
1142 |
shows "sets (PiM I (\<lambda>_. borel::'b::second_countable_topology measure)) = |
50088 | 1143 |
sigma_sets (space (PiM I (\<lambda>_. borel))) {Pi\<^isub>E I F |F. \<forall>i\<in>I. F i \<in> Collect open}" |
1144 |
proof - |
|
1145 |
from open_incseqE[OF open_UNIV] guess S::"nat \<Rightarrow> 'b set" . note S = this |
|
1146 |
show ?thesis |
|
1147 |
proof (rule sigma_prod_algebra_sigma_eq) |
|
1148 |
show "finite I" by simp note[[show_types]] |
|
1149 |
fix i show "(\<Union>j. S j) = space borel" "range S \<subseteq> Collect open" |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1150 |
using S by (auto simp: open_union_closed_basis) |
50088 | 1151 |
show "Collect open \<subseteq> Pow (space borel)" by simp |
1152 |
show "sets borel = sigma_sets (space borel) (Collect open)" |
|
1153 |
by (simp add: borel_def) |
|
1154 |
qed |
|
1155 |
qed |
|
1156 |
||
50124 | 1157 |
lemma finmap_UNIV[simp]: "(\<Union>J\<in>Collect finite. PI' j : J. UNIV) = UNIV" by auto |
50088 | 1158 |
|
1159 |
lemma borel_eq_PiF_borel: |
|
1160 |
shows "(borel :: ('i::countable \<Rightarrow>\<^isub>F 'a::polish_space) measure) = |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1161 |
PiF (Collect finite) (\<lambda>_. borel :: 'a measure)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1162 |
unfolding borel_def PiF_def |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1163 |
proof (rule measure_eqI, clarsimp, rule sigma_sets_eqI) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1164 |
fix a::"('i \<Rightarrow>\<^isub>F 'a) set" assume "a \<in> Collect open" hence "open a" by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1165 |
then obtain B' where B': "B'\<subseteq>basis_finmap" "a = \<Union>B'" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1166 |
using finmap_topological_basis by (force simp add: topological_basis_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1167 |
have "a \<in> sigma UNIV {Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1168 |
unfolding `a = \<Union>B'` |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1169 |
proof (rule sets.countable_Union) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1170 |
from B' countable_basis_finmap show "countable B'" by (metis countable_subset) |
50088 | 1171 |
next |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1172 |
show "B' \<subseteq> sets (sigma UNIV |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1173 |
{Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)})" (is "_ \<subseteq> sets ?s") |
50088 | 1174 |
proof |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1175 |
fix x assume "x \<in> B'" with B' have "x \<in> basis_finmap" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1176 |
then obtain J X where "x = Pi' J X" "finite J" "X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1177 |
by (auto simp: basis_finmap_def open_union_closed_basis) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1178 |
thus "x \<in> sets ?s" by auto |
50088 | 1179 |
qed |
1180 |
qed |
|
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1181 |
thus "a \<in> sigma_sets UNIV {Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1182 |
by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1183 |
next |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1184 |
fix b::"('i \<Rightarrow>\<^isub>F 'a) set" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1185 |
assume "b \<in> {Pi' J X |X J. finite J \<and> X \<in> J \<rightarrow> sigma_sets UNIV (Collect open)}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1186 |
hence b': "b \<in> sets (Pi\<^isub>F (Collect finite) (\<lambda>_. borel))" by (auto simp: sets_PiF borel_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1187 |
let ?b = "\<lambda>J. b \<inter> {x. domain x = J}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1188 |
have "b = \<Union>((\<lambda>J. ?b J) ` Collect finite)" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1189 |
also have "\<dots> \<in> sets borel" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1190 |
proof (rule sets.countable_Union, safe) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1191 |
fix J::"'i set" assume "finite J" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1192 |
{ assume ef: "J = {}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1193 |
have "?b J \<in> sets borel" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1194 |
proof cases |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1195 |
assume "?b J \<noteq> {}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1196 |
then obtain f where "f \<in> b" "domain f = {}" using ef by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1197 |
hence "?b J = {f}" using `J = {}` |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1198 |
by (auto simp: finmap_eq_iff) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1199 |
also have "{f} \<in> sets borel" by simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1200 |
finally show ?thesis . |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1201 |
qed simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1202 |
} moreover { |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1203 |
assume "J \<noteq> ({}::'i set)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1204 |
have "(?b J) = b \<inter> {m. domain m \<in> {J}}" by auto |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1205 |
also have "\<dots> \<in> sets (PiF {J} (\<lambda>_. borel))" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1206 |
using b' by (rule restrict_sets_measurable) (auto simp: `finite J`) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1207 |
also have "\<dots> = sigma_sets (space (PiF {J} (\<lambda>_. borel))) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1208 |
{Pi' (J) F |F. (\<forall>j\<in>J. F j \<in> Collect open)}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1209 |
(is "_ = sigma_sets _ ?P") |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1210 |
by (rule product_open_generates_sets_PiF_single[OF `J \<noteq> {}` `finite J`]) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1211 |
also have "\<dots> \<subseteq> sigma_sets UNIV (Collect open)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1212 |
by (intro sigma_sets_mono'') (auto intro!: open_Pi'I simp: space_PiF) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1213 |
finally have "(?b J) \<in> sets borel" by (simp add: borel_def) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1214 |
} ultimately show "(?b J) \<in> sets borel" by blast |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1215 |
qed (simp add: countable_Collect_finite) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
1216 |
finally show "b \<in> sigma_sets UNIV (Collect open)" by (simp add: borel_def) |
50088 | 1217 |
qed (simp add: emeasure_sigma borel_def PiF_def) |
1218 |
||
1219 |
subsection {* Isomorphism between Functions and Finite Maps *} |
|
1220 |
||
50124 | 1221 |
lemma measurable_finmap_compose: |
50088 | 1222 |
shows "(\<lambda>m. compose J m f) \<in> measurable (PiM (f ` J) (\<lambda>_. M)) (PiM J (\<lambda>_. M))" |
50124 | 1223 |
unfolding compose_def by measurable |
50088 | 1224 |
|
50124 | 1225 |
lemma measurable_compose_inv: |
50088 | 1226 |
assumes inj: "\<And>j. j \<in> J \<Longrightarrow> f' (f j) = j" |
1227 |
shows "(\<lambda>m. compose (f ` J) m f') \<in> measurable (PiM J (\<lambda>_. M)) (PiM (f ` J) (\<lambda>_. M))" |
|
50124 | 1228 |
unfolding compose_def by (rule measurable_restrict) (auto simp: inj) |
50088 | 1229 |
|
1230 |
locale function_to_finmap = |
|
1231 |
fixes J::"'a set" and f :: "'a \<Rightarrow> 'b::countable" and f' |
|
1232 |
assumes [simp]: "finite J" |
|
1233 |
assumes inv: "i \<in> J \<Longrightarrow> f' (f i) = i" |
|
1234 |
begin |
|
1235 |
||
1236 |
text {* to measure finmaps *} |
|
1237 |
||
1238 |
definition "fm = (finmap_of (f ` J)) o (\<lambda>g. compose (f ` J) g f')" |
|
1239 |
||
1240 |
lemma domain_fm[simp]: "domain (fm x) = f ` J" |
|
1241 |
unfolding fm_def by simp |
|
1242 |
||
1243 |
lemma fm_restrict[simp]: "fm (restrict y J) = fm y" |
|
1244 |
unfolding fm_def by (auto simp: compose_def inv intro: restrict_ext) |
|
1245 |
||
1246 |
lemma fm_product: |
|
1247 |
assumes "\<And>i. space (M i) = UNIV" |
|
1248 |
shows "fm -` Pi' (f ` J) S \<inter> space (Pi\<^isub>M J M) = (\<Pi>\<^isub>E j \<in> J. S (f j))" |
|
1249 |
using assms |
|
1250 |
by (auto simp: inv fm_def compose_def space_PiM Pi'_def) |
|
1251 |
||
1252 |
lemma fm_measurable: |
|
1253 |
assumes "f ` J \<in> N" |
|
1254 |
shows "fm \<in> measurable (Pi\<^isub>M J (\<lambda>_. M)) (Pi\<^isub>F N (\<lambda>_. M))" |
|
1255 |
unfolding fm_def |
|
1256 |
proof (rule measurable_comp, rule measurable_compose_inv) |
|
1257 |
show "finmap_of (f ` J) \<in> measurable (Pi\<^isub>M (f ` J) (\<lambda>_. M)) (PiF N (\<lambda>_. M)) " |
|
1258 |
using assms by (intro measurable_finmap_of measurable_component_singleton) auto |
|
1259 |
qed (simp_all add: inv) |
|
1260 |
||
1261 |
lemma proj_fm: |
|
1262 |
assumes "x \<in> J" |
|
1263 |
shows "fm m (f x) = m x" |
|
1264 |
using assms by (auto simp: fm_def compose_def o_def inv) |
|
1265 |
||
1266 |
lemma inj_on_compose_f': "inj_on (\<lambda>g. compose (f ` J) g f') (extensional J)" |
|
1267 |
proof (rule inj_on_inverseI) |
|
1268 |
fix x::"'a \<Rightarrow> 'c" assume "x \<in> extensional J" |
|
1269 |
thus "(\<lambda>x. compose J x f) (compose (f ` J) x f') = x" |
|
1270 |
by (auto simp: compose_def inv extensional_def) |
|
1271 |
qed |
|
1272 |
||
1273 |
lemma inj_on_fm: |
|
1274 |
assumes "\<And>i. space (M i) = UNIV" |
|
1275 |
shows "inj_on fm (space (Pi\<^isub>M J M))" |
|
1276 |
using assms |
|
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50100
diff
changeset
|
1277 |
apply (auto simp: fm_def space_PiM PiE_def) |
50088 | 1278 |
apply (rule comp_inj_on) |
1279 |
apply (rule inj_on_compose_f') |
|
1280 |
apply (rule finmap_of_inj_on_extensional_finite) |
|
1281 |
apply simp |
|
1282 |
apply (auto) |
|
1283 |
done |
|
1284 |
||
1285 |
text {* to measure functions *} |
|
1286 |
||
1287 |
definition "mf = (\<lambda>g. compose J g f) o proj" |
|
1288 |
||
1289 |
lemma mf_fm: |
|
1290 |
assumes "x \<in> space (Pi\<^isub>M J (\<lambda>_. M))" |
|
1291 |
shows "mf (fm x) = x" |
|
1292 |
proof - |
|
1293 |
have "mf (fm x) \<in> extensional J" |
|
1294 |
by (auto simp: mf_def extensional_def compose_def) |
|
1295 |
moreover |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1296 |
have "x \<in> extensional J" using assms sets.sets_into_space |
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50100
diff
changeset
|
1297 |
by (force simp: space_PiM PiE_def) |
50088 | 1298 |
moreover |
1299 |
{ fix i assume "i \<in> J" |
|
1300 |
hence "mf (fm x) i = x i" |
|
1301 |
by (auto simp: inv mf_def compose_def fm_def) |
|
1302 |
} |
|
1303 |
ultimately |
|
1304 |
show ?thesis by (rule extensionalityI) |
|
1305 |
qed |
|
1306 |
||
1307 |
lemma mf_measurable: |
|
1308 |
assumes "space M = UNIV" |
|
1309 |
shows "mf \<in> measurable (PiF {f ` J} (\<lambda>_. M)) (PiM J (\<lambda>_. M))" |
|
1310 |
unfolding mf_def |
|
1311 |
proof (rule measurable_comp, rule measurable_proj_PiM) |
|
50124 | 1312 |
show "(\<lambda>g. compose J g f) \<in> measurable (Pi\<^isub>M (f ` J) (\<lambda>x. M)) (Pi\<^isub>M J (\<lambda>_. M))" |
1313 |
by (rule measurable_finmap_compose) |
|
50088 | 1314 |
qed (auto simp add: space_PiM extensional_def assms) |
1315 |
||
1316 |
lemma fm_image_measurable: |
|
1317 |
assumes "space M = UNIV" |
|
1318 |
assumes "X \<in> sets (Pi\<^isub>M J (\<lambda>_. M))" |
|
1319 |
shows "fm ` X \<in> sets (PiF {f ` J} (\<lambda>_. M))" |
|
1320 |
proof - |
|
1321 |
have "fm ` X = (mf) -` X \<inter> space (PiF {f ` J} (\<lambda>_. M))" |
|
1322 |
proof safe |
|
1323 |
fix x assume "x \<in> X" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1324 |
with mf_fm[of x] sets.sets_into_space[OF assms(2)] show "fm x \<in> mf -` X" by auto |
50088 | 1325 |
show "fm x \<in> space (PiF {f ` J} (\<lambda>_. M))" by (simp add: space_PiF assms) |
1326 |
next |
|
1327 |
fix y x |
|
1328 |
assume x: "mf y \<in> X" |
|
1329 |
assume y: "y \<in> space (PiF {f ` J} (\<lambda>_. M))" |
|
1330 |
thus "y \<in> fm ` X" |
|
1331 |
by (intro image_eqI[OF _ x], unfold finmap_eq_iff) |
|
1332 |
(auto simp: space_PiF fm_def mf_def compose_def inv Pi'_def) |
|
1333 |
qed |
|
1334 |
also have "\<dots> \<in> sets (PiF {f ` J} (\<lambda>_. M))" |
|
1335 |
using assms |
|
1336 |
by (intro measurable_sets[OF mf_measurable]) auto |
|
1337 |
finally show ?thesis . |
|
1338 |
qed |
|
1339 |
||
1340 |
lemma fm_image_measurable_finite: |
|
1341 |
assumes "space M = UNIV" |
|
1342 |
assumes "X \<in> sets (Pi\<^isub>M J (\<lambda>_. M::'c measure))" |
|
1343 |
shows "fm ` X \<in> sets (PiF (Collect finite) (\<lambda>_. M::'c measure))" |
|
1344 |
using fm_image_measurable[OF assms] |
|
1345 |
by (rule subspace_set_in_sets) (auto simp: finite_subset) |
|
1346 |
||
1347 |
text {* measure on finmaps *} |
|
1348 |
||
1349 |
definition "mapmeasure M N = distr M (PiF (Collect finite) N) (fm)" |
|
1350 |
||
1351 |
lemma sets_mapmeasure[simp]: "sets (mapmeasure M N) = sets (PiF (Collect finite) N)" |
|
1352 |
unfolding mapmeasure_def by simp |
|
1353 |
||
1354 |
lemma space_mapmeasure[simp]: "space (mapmeasure M N) = space (PiF (Collect finite) N)" |
|
1355 |
unfolding mapmeasure_def by simp |
|
1356 |
||
1357 |
lemma mapmeasure_PiF: |
|
1358 |
assumes s1: "space M = space (Pi\<^isub>M J (\<lambda>_. N))" |
|
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50100
diff
changeset
|
1359 |
assumes s2: "sets M = sets (Pi\<^isub>M J (\<lambda>_. N))" |
50088 | 1360 |
assumes "space N = UNIV" |
1361 |
assumes "X \<in> sets (PiF (Collect finite) (\<lambda>_. N))" |
|
1362 |
shows "emeasure (mapmeasure M (\<lambda>_. N)) X = emeasure M ((fm -` X \<inter> extensional J))" |
|
1363 |
using assms |
|
1364 |
by (auto simp: measurable_eqI[OF s1 refl s2 refl] mapmeasure_def emeasure_distr |
|
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50100
diff
changeset
|
1365 |
fm_measurable space_PiM PiE_def) |
50088 | 1366 |
|
1367 |
lemma mapmeasure_PiM: |
|
1368 |
fixes N::"'c measure" |
|
1369 |
assumes s1: "space M = space (Pi\<^isub>M J (\<lambda>_. N))" |
|
1370 |
assumes s2: "sets M = (Pi\<^isub>M J (\<lambda>_. N))" |
|
1371 |
assumes N: "space N = UNIV" |
|
1372 |
assumes X: "X \<in> sets M" |
|
1373 |
shows "emeasure M X = emeasure (mapmeasure M (\<lambda>_. N)) (fm ` X)" |
|
1374 |
unfolding mapmeasure_def |
|
1375 |
proof (subst emeasure_distr, subst measurable_eqI[OF s1 refl s2 refl], rule fm_measurable) |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50124
diff
changeset
|
1376 |
have "X \<subseteq> space (Pi\<^isub>M J (\<lambda>_. N))" using assms by (simp add: sets.sets_into_space) |
50088 | 1377 |
from assms inj_on_fm[of "\<lambda>_. N"] set_mp[OF this] have "fm -` fm ` X \<inter> space (Pi\<^isub>M J (\<lambda>_. N)) = X" |
1378 |
by (auto simp: vimage_image_eq inj_on_def) |
|
1379 |
thus "emeasure M X = emeasure M (fm -` fm ` X \<inter> space M)" using s1 |
|
1380 |
by simp |
|
1381 |
show "fm ` X \<in> sets (PiF (Collect finite) (\<lambda>_. N))" |
|
1382 |
by (rule fm_image_measurable_finite[OF N X[simplified s2]]) |
|
1383 |
qed simp |
|
1384 |
||
1385 |
end |
|
1386 |
||
1387 |
end |