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