author | hoelzl |
Wed, 01 Dec 2010 19:20:30 +0100 | |
changeset 40859 | de0b30e6c2d2 |
parent 39302 | d7728f65b353 |
child 41023 | 9118eb4eb8dc |
permissions | -rw-r--r-- |
35582 | 1 |
theory Probability_Space |
40859 | 2 |
imports Lebesgue_Integration Radon_Nikodym Product_Measure |
35582 | 3 |
begin |
4 |
||
40859 | 5 |
lemma real_of_pinfreal_inverse[simp]: |
6 |
fixes X :: pinfreal |
|
7 |
shows "real (inverse X) = 1 / real X" |
|
8 |
by (cases X) (auto simp: inverse_eq_divide) |
|
9 |
||
10 |
lemma real_of_pinfreal_le_0[simp]: "real (X :: pinfreal) \<le> 0 \<longleftrightarrow> (X = 0 \<or> X = \<omega>)" |
|
11 |
by (cases X) auto |
|
12 |
||
13 |
lemma real_of_pinfreal_less_0[simp]: "\<not> (real (X :: pinfreal) < 0)" |
|
14 |
by (cases X) auto |
|
15 |
||
35582 | 16 |
locale prob_space = measure_space + |
38656 | 17 |
assumes measure_space_1: "\<mu> (space M) = 1" |
18 |
||
40859 | 19 |
lemma abs_real_of_pinfreal[simp]: "\<bar>real (X :: pinfreal)\<bar> = real X" |
20 |
by simp |
|
21 |
||
22 |
lemma zero_less_real_of_pinfreal: "0 < real (X :: pinfreal) \<longleftrightarrow> X \<noteq> 0 \<and> X \<noteq> \<omega>" |
|
23 |
by (cases X) auto |
|
24 |
||
38656 | 25 |
sublocale prob_space < finite_measure |
26 |
proof |
|
27 |
from measure_space_1 show "\<mu> (space M) \<noteq> \<omega>" by simp |
|
28 |
qed |
|
29 |
||
40859 | 30 |
abbreviation (in prob_space) "events \<equiv> sets M" |
31 |
abbreviation (in prob_space) "prob \<equiv> \<lambda>A. real (\<mu> A)" |
|
32 |
abbreviation (in prob_space) "prob_preserving \<equiv> measure_preserving" |
|
33 |
abbreviation (in prob_space) "random_variable M' X \<equiv> sigma_algebra M' \<and> X \<in> measurable M M'" |
|
34 |
abbreviation (in prob_space) "expectation \<equiv> integral" |
|
35582 | 35 |
|
40859 | 36 |
definition (in prob_space) |
35582 | 37 |
"indep A B \<longleftrightarrow> A \<in> events \<and> B \<in> events \<and> prob (A \<inter> B) = prob A * prob B" |
38 |
||
40859 | 39 |
definition (in prob_space) |
35582 | 40 |
"indep_families F G \<longleftrightarrow> (\<forall> A \<in> F. \<forall> B \<in> G. indep A B)" |
41 |
||
40859 | 42 |
definition (in prob_space) |
38656 | 43 |
"distribution X = (\<lambda>s. \<mu> ((X -` s) \<inter> (space M)))" |
35582 | 44 |
|
40859 | 45 |
abbreviation (in prob_space) |
36624 | 46 |
"joint_distribution X Y \<equiv> distribution (\<lambda>x. (X x, Y x))" |
35582 | 47 |
|
39097 | 48 |
lemma (in prob_space) distribution_cong: |
49 |
assumes "\<And>x. x \<in> space M \<Longrightarrow> X x = Y x" |
|
50 |
shows "distribution X = distribution Y" |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
51 |
unfolding distribution_def fun_eq_iff |
39097 | 52 |
using assms by (auto intro!: arg_cong[where f="\<mu>"]) |
53 |
||
54 |
lemma (in prob_space) joint_distribution_cong: |
|
55 |
assumes "\<And>x. x \<in> space M \<Longrightarrow> X x = X' x" |
|
56 |
assumes "\<And>x. x \<in> space M \<Longrightarrow> Y x = Y' x" |
|
57 |
shows "joint_distribution X Y = joint_distribution X' Y'" |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39198
diff
changeset
|
58 |
unfolding distribution_def fun_eq_iff |
39097 | 59 |
using assms by (auto intro!: arg_cong[where f="\<mu>"]) |
60 |
||
40859 | 61 |
lemma (in prob_space) distribution_id[simp]: |
62 |
assumes "N \<in> sets M" shows "distribution (\<lambda>x. x) N = \<mu> N" |
|
63 |
using assms by (auto simp: distribution_def intro!: arg_cong[where f=\<mu>]) |
|
64 |
||
65 |
lemma (in prob_space) prob_space: "prob (space M) = 1" |
|
38656 | 66 |
unfolding measure_space_1 by simp |
35582 | 67 |
|
40859 | 68 |
lemma (in prob_space) measure_le_1[simp, intro]: |
38656 | 69 |
assumes "A \<in> events" shows "\<mu> A \<le> 1" |
70 |
proof - |
|
71 |
have "\<mu> A \<le> \<mu> (space M)" |
|
72 |
using assms sets_into_space by(auto intro!: measure_mono) |
|
73 |
also note measure_space_1 |
|
74 |
finally show ?thesis . |
|
75 |
qed |
|
35582 | 76 |
|
40859 | 77 |
lemma (in prob_space) prob_compl: |
38656 | 78 |
assumes "A \<in> events" |
79 |
shows "prob (space M - A) = 1 - prob A" |
|
80 |
using `A \<in> events`[THEN sets_into_space] `A \<in> events` measure_space_1 |
|
81 |
by (subst real_finite_measure_Diff) auto |
|
35582 | 82 |
|
40859 | 83 |
lemma (in prob_space) indep_space: |
35582 | 84 |
assumes "s \<in> events" |
85 |
shows "indep (space M) s" |
|
38656 | 86 |
using assms prob_space by (simp add: indep_def) |
35582 | 87 |
|
40859 | 88 |
lemma (in prob_space) prob_space_increasing: "increasing M prob" |
38656 | 89 |
by (auto intro!: real_measure_mono simp: increasing_def) |
35582 | 90 |
|
40859 | 91 |
lemma (in prob_space) prob_zero_union: |
35582 | 92 |
assumes "s \<in> events" "t \<in> events" "prob t = 0" |
93 |
shows "prob (s \<union> t) = prob s" |
|
38656 | 94 |
using assms |
35582 | 95 |
proof - |
96 |
have "prob (s \<union> t) \<le> prob s" |
|
38656 | 97 |
using real_finite_measure_subadditive[of s t] assms by auto |
35582 | 98 |
moreover have "prob (s \<union> t) \<ge> prob s" |
38656 | 99 |
using assms by (blast intro: real_measure_mono) |
35582 | 100 |
ultimately show ?thesis by simp |
101 |
qed |
|
102 |
||
40859 | 103 |
lemma (in prob_space) prob_eq_compl: |
35582 | 104 |
assumes "s \<in> events" "t \<in> events" |
105 |
assumes "prob (space M - s) = prob (space M - t)" |
|
106 |
shows "prob s = prob t" |
|
38656 | 107 |
using assms prob_compl by auto |
35582 | 108 |
|
40859 | 109 |
lemma (in prob_space) prob_one_inter: |
35582 | 110 |
assumes events:"s \<in> events" "t \<in> events" |
111 |
assumes "prob t = 1" |
|
112 |
shows "prob (s \<inter> t) = prob s" |
|
113 |
proof - |
|
38656 | 114 |
have "prob ((space M - s) \<union> (space M - t)) = prob (space M - s)" |
115 |
using events assms prob_compl[of "t"] by (auto intro!: prob_zero_union) |
|
116 |
also have "(space M - s) \<union> (space M - t) = space M - (s \<inter> t)" |
|
117 |
by blast |
|
118 |
finally show "prob (s \<inter> t) = prob s" |
|
119 |
using events by (auto intro!: prob_eq_compl[of "s \<inter> t" s]) |
|
35582 | 120 |
qed |
121 |
||
40859 | 122 |
lemma (in prob_space) prob_eq_bigunion_image: |
35582 | 123 |
assumes "range f \<subseteq> events" "range g \<subseteq> events" |
124 |
assumes "disjoint_family f" "disjoint_family g" |
|
125 |
assumes "\<And> n :: nat. prob (f n) = prob (g n)" |
|
126 |
shows "(prob (\<Union> i. f i) = prob (\<Union> i. g i))" |
|
127 |
using assms |
|
128 |
proof - |
|
38656 | 129 |
have a: "(\<lambda> i. prob (f i)) sums (prob (\<Union> i. f i))" |
130 |
by (rule real_finite_measure_UNION[OF assms(1,3)]) |
|
131 |
have b: "(\<lambda> i. prob (g i)) sums (prob (\<Union> i. g i))" |
|
132 |
by (rule real_finite_measure_UNION[OF assms(2,4)]) |
|
133 |
show ?thesis using sums_unique[OF b] sums_unique[OF a] assms by simp |
|
35582 | 134 |
qed |
135 |
||
40859 | 136 |
lemma (in prob_space) prob_countably_zero: |
35582 | 137 |
assumes "range c \<subseteq> events" |
138 |
assumes "\<And> i. prob (c i) = 0" |
|
38656 | 139 |
shows "prob (\<Union> i :: nat. c i) = 0" |
140 |
proof (rule antisym) |
|
141 |
show "prob (\<Union> i :: nat. c i) \<le> 0" |
|
40859 | 142 |
using real_finite_measure_countably_subadditive[OF assms(1)] |
38656 | 143 |
by (simp add: assms(2) suminf_zero summable_zero) |
144 |
show "0 \<le> prob (\<Union> i :: nat. c i)" by (rule real_pinfreal_nonneg) |
|
35582 | 145 |
qed |
146 |
||
40859 | 147 |
lemma (in prob_space) indep_sym: |
35582 | 148 |
"indep a b \<Longrightarrow> indep b a" |
149 |
unfolding indep_def using Int_commute[of a b] by auto |
|
150 |
||
40859 | 151 |
lemma (in prob_space) indep_refl: |
35582 | 152 |
assumes "a \<in> events" |
153 |
shows "indep a a = (prob a = 0) \<or> (prob a = 1)" |
|
154 |
using assms unfolding indep_def by auto |
|
155 |
||
40859 | 156 |
lemma (in prob_space) prob_equiprobable_finite_unions: |
38656 | 157 |
assumes "s \<in> events" |
158 |
assumes s_finite: "finite s" "\<And>x. x \<in> s \<Longrightarrow> {x} \<in> events" |
|
35582 | 159 |
assumes "\<And> x y. \<lbrakk>x \<in> s; y \<in> s\<rbrakk> \<Longrightarrow> (prob {x} = prob {y})" |
38656 | 160 |
shows "prob s = real (card s) * prob {SOME x. x \<in> s}" |
35582 | 161 |
proof (cases "s = {}") |
38656 | 162 |
case False hence "\<exists> x. x \<in> s" by blast |
35582 | 163 |
from someI_ex[OF this] assms |
164 |
have prob_some: "\<And> x. x \<in> s \<Longrightarrow> prob {x} = prob {SOME y. y \<in> s}" by blast |
|
165 |
have "prob s = (\<Sum> x \<in> s. prob {x})" |
|
38656 | 166 |
using real_finite_measure_finite_singelton[OF s_finite] by simp |
35582 | 167 |
also have "\<dots> = (\<Sum> x \<in> s. prob {SOME y. y \<in> s})" using prob_some by auto |
38656 | 168 |
also have "\<dots> = real (card s) * prob {(SOME x. x \<in> s)}" |
169 |
using setsum_constant assms by (simp add: real_eq_of_nat) |
|
35582 | 170 |
finally show ?thesis by simp |
38656 | 171 |
qed simp |
35582 | 172 |
|
40859 | 173 |
lemma (in prob_space) prob_real_sum_image_fn: |
35582 | 174 |
assumes "e \<in> events" |
175 |
assumes "\<And> x. x \<in> s \<Longrightarrow> e \<inter> f x \<in> events" |
|
176 |
assumes "finite s" |
|
38656 | 177 |
assumes disjoint: "\<And> x y. \<lbrakk>x \<in> s ; y \<in> s ; x \<noteq> y\<rbrakk> \<Longrightarrow> f x \<inter> f y = {}" |
178 |
assumes upper: "space M \<subseteq> (\<Union> i \<in> s. f i)" |
|
35582 | 179 |
shows "prob e = (\<Sum> x \<in> s. prob (e \<inter> f x))" |
180 |
proof - |
|
38656 | 181 |
have e: "e = (\<Union> i \<in> s. e \<inter> f i)" |
182 |
using `e \<in> events` sets_into_space upper by blast |
|
183 |
hence "prob e = prob (\<Union> i \<in> s. e \<inter> f i)" by simp |
|
184 |
also have "\<dots> = (\<Sum> x \<in> s. prob (e \<inter> f x))" |
|
185 |
proof (rule real_finite_measure_finite_Union) |
|
186 |
show "finite s" by fact |
|
187 |
show "\<And>i. i \<in> s \<Longrightarrow> e \<inter> f i \<in> events" by fact |
|
188 |
show "disjoint_family_on (\<lambda>i. e \<inter> f i) s" |
|
189 |
using disjoint by (auto simp: disjoint_family_on_def) |
|
190 |
qed |
|
191 |
finally show ?thesis . |
|
35582 | 192 |
qed |
193 |
||
40859 | 194 |
lemma (in prob_space) distribution_prob_space: |
195 |
assumes "random_variable S X" |
|
38656 | 196 |
shows "prob_space S (distribution X)" |
35582 | 197 |
proof - |
39089 | 198 |
interpret S: measure_space S "distribution X" |
40859 | 199 |
using measure_space_vimage[of X S] assms unfolding distribution_def by simp |
38656 | 200 |
show ?thesis |
201 |
proof |
|
202 |
have "X -` space S \<inter> space M = space M" |
|
203 |
using `random_variable S X` by (auto simp: measurable_def) |
|
39089 | 204 |
then show "distribution X (space S) = 1" |
205 |
using measure_space_1 by (simp add: distribution_def) |
|
35582 | 206 |
qed |
207 |
qed |
|
208 |
||
40859 | 209 |
lemma (in prob_space) AE_distribution: |
210 |
assumes X: "random_variable MX X" and "measure_space.almost_everywhere MX (distribution X) (\<lambda>x. Q x)" |
|
211 |
shows "AE x. Q (X x)" |
|
212 |
proof - |
|
213 |
interpret X: prob_space MX "distribution X" using X by (rule distribution_prob_space) |
|
214 |
obtain N where N: "N \<in> sets MX" "distribution X N = 0" "{x\<in>space MX. \<not> Q x} \<subseteq> N" |
|
215 |
using assms unfolding X.almost_everywhere_def by auto |
|
216 |
show "AE x. Q (X x)" |
|
217 |
using X[unfolded measurable_def] N unfolding distribution_def |
|
218 |
by (intro AE_I'[where N="X -` N \<inter> space M"]) auto |
|
219 |
qed |
|
220 |
||
221 |
lemma (in prob_space) distribution_lebesgue_thm1: |
|
35582 | 222 |
assumes "random_variable s X" |
223 |
assumes "A \<in> sets s" |
|
38656 | 224 |
shows "real (distribution X A) = expectation (indicator (X -` A \<inter> space M))" |
35582 | 225 |
unfolding distribution_def |
226 |
using assms unfolding measurable_def |
|
38656 | 227 |
using integral_indicator by auto |
35582 | 228 |
|
40859 | 229 |
lemma (in prob_space) distribution_lebesgue_thm2: |
230 |
assumes "random_variable S X" and "A \<in> sets S" |
|
38656 | 231 |
shows "distribution X A = |
232 |
measure_space.positive_integral S (distribution X) (indicator A)" |
|
233 |
(is "_ = measure_space.positive_integral _ ?D _") |
|
35582 | 234 |
proof - |
40859 | 235 |
interpret S: prob_space S "distribution X" using assms(1) by (rule distribution_prob_space) |
35582 | 236 |
|
237 |
show ?thesis |
|
38656 | 238 |
using S.positive_integral_indicator(1) |
35582 | 239 |
using assms unfolding distribution_def by auto |
240 |
qed |
|
241 |
||
40859 | 242 |
lemma (in prob_space) finite_expectation1: |
243 |
assumes f: "finite (X`space M)" and rv: "random_variable borel X" |
|
35582 | 244 |
shows "expectation X = (\<Sum> r \<in> X ` space M. r * prob (X -` {r} \<inter> space M))" |
40859 | 245 |
proof (rule integral_on_finite(2)[OF rv[THEN conjunct2] f]) |
38656 | 246 |
fix x have "X -` {x} \<inter> space M \<in> sets M" |
247 |
using rv unfolding measurable_def by auto |
|
248 |
thus "\<mu> (X -` {x} \<inter> space M) \<noteq> \<omega>" using finite_measure by simp |
|
249 |
qed |
|
35582 | 250 |
|
40859 | 251 |
lemma (in prob_space) finite_expectation: |
252 |
assumes "finite (space M)" "random_variable borel X" |
|
38656 | 253 |
shows "expectation X = (\<Sum> r \<in> X ` (space M). r * real (distribution X {r}))" |
254 |
using assms unfolding distribution_def using finite_expectation1 by auto |
|
255 |
||
40859 | 256 |
lemma (in prob_space) prob_x_eq_1_imp_prob_y_eq_0: |
35582 | 257 |
assumes "{x} \<in> events" |
38656 | 258 |
assumes "prob {x} = 1" |
35582 | 259 |
assumes "{y} \<in> events" |
260 |
assumes "y \<noteq> x" |
|
261 |
shows "prob {y} = 0" |
|
262 |
using prob_one_inter[of "{y}" "{x}"] assms by auto |
|
263 |
||
40859 | 264 |
lemma (in prob_space) distribution_empty[simp]: "distribution X {} = 0" |
38656 | 265 |
unfolding distribution_def by simp |
266 |
||
40859 | 267 |
lemma (in prob_space) distribution_space[simp]: "distribution X (X ` space M) = 1" |
38656 | 268 |
proof - |
269 |
have "X -` X ` space M \<inter> space M = space M" by auto |
|
270 |
thus ?thesis unfolding distribution_def by (simp add: measure_space_1) |
|
271 |
qed |
|
272 |
||
40859 | 273 |
lemma (in prob_space) distribution_one: |
274 |
assumes "random_variable M' X" and "A \<in> sets M'" |
|
38656 | 275 |
shows "distribution X A \<le> 1" |
276 |
proof - |
|
277 |
have "distribution X A \<le> \<mu> (space M)" unfolding distribution_def |
|
278 |
using assms[unfolded measurable_def] by (auto intro!: measure_mono) |
|
279 |
thus ?thesis by (simp add: measure_space_1) |
|
280 |
qed |
|
281 |
||
40859 | 282 |
lemma (in prob_space) distribution_finite: |
283 |
assumes "random_variable M' X" and "A \<in> sets M'" |
|
38656 | 284 |
shows "distribution X A \<noteq> \<omega>" |
285 |
using distribution_one[OF assms] by auto |
|
286 |
||
40859 | 287 |
lemma (in prob_space) distribution_x_eq_1_imp_distribution_y_eq_0: |
35582 | 288 |
assumes X: "random_variable \<lparr>space = X ` (space M), sets = Pow (X ` (space M))\<rparr> X" |
38656 | 289 |
(is "random_variable ?S X") |
290 |
assumes "distribution X {x} = 1" |
|
35582 | 291 |
assumes "y \<noteq> x" |
292 |
shows "distribution X {y} = 0" |
|
293 |
proof - |
|
40859 | 294 |
from distribution_prob_space[OF X] |
38656 | 295 |
interpret S: prob_space ?S "distribution X" by simp |
296 |
have x: "{x} \<in> sets ?S" |
|
297 |
proof (rule ccontr) |
|
298 |
assume "{x} \<notin> sets ?S" |
|
35582 | 299 |
hence "X -` {x} \<inter> space M = {}" by auto |
38656 | 300 |
thus "False" using assms unfolding distribution_def by auto |
301 |
qed |
|
302 |
have [simp]: "{y} \<inter> {x} = {}" "{x} - {y} = {x}" using `y \<noteq> x` by auto |
|
303 |
show ?thesis |
|
304 |
proof cases |
|
305 |
assume "{y} \<in> sets ?S" |
|
306 |
with `{x} \<in> sets ?S` assms show "distribution X {y} = 0" |
|
307 |
using S.measure_inter_full_set[of "{y}" "{x}"] |
|
308 |
by simp |
|
309 |
next |
|
310 |
assume "{y} \<notin> sets ?S" |
|
35582 | 311 |
hence "X -` {y} \<inter> space M = {}" by auto |
38656 | 312 |
thus "distribution X {y} = 0" unfolding distribution_def by auto |
313 |
qed |
|
35582 | 314 |
qed |
315 |
||
40859 | 316 |
lemma (in prob_space) joint_distribution_Times_le_fst: |
317 |
assumes X: "random_variable MX X" and Y: "random_variable MY Y" |
|
318 |
and A: "A \<in> sets MX" and B: "B \<in> sets MY" |
|
319 |
shows "joint_distribution X Y (A \<times> B) \<le> distribution X A" |
|
320 |
unfolding distribution_def |
|
321 |
proof (intro measure_mono) |
|
322 |
show "(\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M \<subseteq> X -` A \<inter> space M" by force |
|
323 |
show "X -` A \<inter> space M \<in> events" |
|
324 |
using X A unfolding measurable_def by simp |
|
325 |
have *: "(\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M = |
|
326 |
(X -` A \<inter> space M) \<inter> (Y -` B \<inter> space M)" by auto |
|
327 |
show "(\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M \<in> events" |
|
328 |
unfolding * apply (rule Int) |
|
329 |
using assms unfolding measurable_def by auto |
|
330 |
qed |
|
331 |
||
332 |
lemma (in prob_space) joint_distribution_commute: |
|
333 |
"joint_distribution X Y x = joint_distribution Y X ((\<lambda>(x,y). (y,x))`x)" |
|
334 |
unfolding distribution_def by (auto intro!: arg_cong[where f=\<mu>]) |
|
335 |
||
336 |
lemma (in prob_space) joint_distribution_Times_le_snd: |
|
337 |
assumes X: "random_variable MX X" and Y: "random_variable MY Y" |
|
338 |
and A: "A \<in> sets MX" and B: "B \<in> sets MY" |
|
339 |
shows "joint_distribution X Y (A \<times> B) \<le> distribution Y B" |
|
340 |
using assms |
|
341 |
by (subst joint_distribution_commute) |
|
342 |
(simp add: swap_product joint_distribution_Times_le_fst) |
|
343 |
||
344 |
lemma (in prob_space) random_variable_pairI: |
|
345 |
assumes "random_variable MX X" |
|
346 |
assumes "random_variable MY Y" |
|
347 |
shows "random_variable (sigma (pair_algebra MX MY)) (\<lambda>x. (X x, Y x))" |
|
348 |
proof |
|
349 |
interpret MX: sigma_algebra MX using assms by simp |
|
350 |
interpret MY: sigma_algebra MY using assms by simp |
|
351 |
interpret P: pair_sigma_algebra MX MY by default |
|
352 |
show "sigma_algebra (sigma (pair_algebra MX MY))" by default |
|
353 |
have sa: "sigma_algebra M" by default |
|
354 |
show "(\<lambda>x. (X x, Y x)) \<in> measurable M (sigma (pair_algebra MX MY))" |
|
355 |
unfolding P.measurable_pair[OF sa] using assms by (simp add: comp_def) |
|
356 |
qed |
|
357 |
||
358 |
lemma (in prob_space) distribution_order: |
|
359 |
assumes "random_variable MX X" "random_variable MY Y" |
|
360 |
assumes "{x} \<in> sets MX" "{y} \<in> sets MY" |
|
361 |
shows "r \<le> joint_distribution X Y {(x, y)} \<Longrightarrow> r \<le> distribution X {x}" |
|
362 |
and "r \<le> joint_distribution X Y {(x, y)} \<Longrightarrow> r \<le> distribution Y {y}" |
|
363 |
and "r < joint_distribution X Y {(x, y)} \<Longrightarrow> r < distribution X {x}" |
|
364 |
and "r < joint_distribution X Y {(x, y)} \<Longrightarrow> r < distribution Y {y}" |
|
365 |
and "distribution X {x} = 0 \<Longrightarrow> joint_distribution X Y {(x, y)} = 0" |
|
366 |
and "distribution Y {y} = 0 \<Longrightarrow> joint_distribution X Y {(x, y)} = 0" |
|
367 |
using joint_distribution_Times_le_snd[OF assms] |
|
368 |
using joint_distribution_Times_le_fst[OF assms] |
|
369 |
by auto |
|
370 |
||
371 |
lemma (in prob_space) joint_distribution_commute_singleton: |
|
372 |
"joint_distribution X Y {(x, y)} = joint_distribution Y X {(y, x)}" |
|
373 |
unfolding distribution_def by (auto intro!: arg_cong[where f=\<mu>]) |
|
374 |
||
375 |
lemma (in prob_space) joint_distribution_assoc_singleton: |
|
376 |
"joint_distribution X (\<lambda>x. (Y x, Z x)) {(x, y, z)} = |
|
377 |
joint_distribution (\<lambda>x. (X x, Y x)) Z {((x, y), z)}" |
|
378 |
unfolding distribution_def by (auto intro!: arg_cong[where f=\<mu>]) |
|
379 |
||
380 |
locale pair_prob_space = M1: prob_space M1 p1 + M2: prob_space M2 p2 for M1 p1 M2 p2 |
|
381 |
||
382 |
sublocale pair_prob_space \<subseteq> pair_sigma_finite M1 p1 M2 p2 by default |
|
383 |
||
384 |
sublocale pair_prob_space \<subseteq> P: prob_space P pair_measure |
|
385 |
proof |
|
386 |
show "pair_measure (space P) = 1" |
|
387 |
by (simp add: pair_algebra_def pair_measure_times M1.measure_space_1 M2.measure_space_1) |
|
388 |
qed |
|
389 |
||
390 |
lemma countably_additiveI[case_names countably]: |
|
391 |
assumes "\<And>A. \<lbrakk> range A \<subseteq> sets M ; disjoint_family A ; (\<Union>i. A i) \<in> sets M\<rbrakk> \<Longrightarrow> |
|
392 |
(\<Sum>\<^isub>\<infinity>n. \<mu> (A n)) = \<mu> (\<Union>i. A i)" |
|
393 |
shows "countably_additive M \<mu>" |
|
394 |
using assms unfolding countably_additive_def by auto |
|
395 |
||
396 |
lemma (in prob_space) joint_distribution_prob_space: |
|
397 |
assumes "random_variable MX X" "random_variable MY Y" |
|
398 |
shows "prob_space (sigma (pair_algebra MX MY)) (joint_distribution X Y)" |
|
399 |
proof - |
|
400 |
interpret X: prob_space MX "distribution X" by (intro distribution_prob_space assms) |
|
401 |
interpret Y: prob_space MY "distribution Y" by (intro distribution_prob_space assms) |
|
402 |
interpret XY: pair_sigma_finite MX "distribution X" MY "distribution Y" by default |
|
403 |
show ?thesis |
|
404 |
proof |
|
405 |
let "?X A" = "(\<lambda>x. (X x, Y x)) -` A \<inter> space M" |
|
406 |
show "joint_distribution X Y {} = 0" by (simp add: distribution_def) |
|
407 |
show "countably_additive XY.P (joint_distribution X Y)" |
|
408 |
proof (rule countably_additiveI) |
|
409 |
fix A :: "nat \<Rightarrow> ('b \<times> 'c) set" |
|
410 |
assume A: "range A \<subseteq> sets XY.P" and df: "disjoint_family A" |
|
411 |
have "(\<Sum>\<^isub>\<infinity>n. \<mu> (?X (A n))) = \<mu> (\<Union>x. ?X (A x))" |
|
412 |
proof (intro measure_countably_additive) |
|
413 |
from assms have *: "(\<lambda>x. (X x, Y x)) \<in> measurable M XY.P" |
|
414 |
by (intro XY.measurable_prod_sigma) (simp_all add: comp_def, default) |
|
415 |
show "range (\<lambda>n. ?X (A n)) \<subseteq> events" |
|
416 |
using measurable_sets[OF *] A by auto |
|
417 |
show "disjoint_family (\<lambda>n. ?X (A n))" |
|
418 |
by (intro disjoint_family_on_bisimulation[OF df]) auto |
|
419 |
qed |
|
420 |
then show "(\<Sum>\<^isub>\<infinity>n. joint_distribution X Y (A n)) = joint_distribution X Y (\<Union>i. A i)" |
|
421 |
by (simp add: distribution_def vimage_UN) |
|
422 |
qed |
|
423 |
have "?X (space MX \<times> space MY) = space M" |
|
424 |
using assms by (auto simp: measurable_def) |
|
425 |
then show "joint_distribution X Y (space XY.P) = 1" |
|
426 |
by (simp add: space_pair_algebra distribution_def measure_space_1) |
|
427 |
qed |
|
428 |
qed |
|
429 |
||
430 |
section "Probability spaces on finite sets" |
|
35582 | 431 |
|
35977 | 432 |
locale finite_prob_space = prob_space + finite_measure_space |
433 |
||
40859 | 434 |
abbreviation (in prob_space) "finite_random_variable M' X \<equiv> finite_sigma_algebra M' \<and> X \<in> measurable M M'" |
435 |
||
436 |
lemma (in prob_space) finite_random_variableD: |
|
437 |
assumes "finite_random_variable M' X" shows "random_variable M' X" |
|
438 |
proof - |
|
439 |
interpret M': finite_sigma_algebra M' using assms by simp |
|
440 |
then show "random_variable M' X" using assms by simp default |
|
441 |
qed |
|
442 |
||
443 |
lemma (in prob_space) distribution_finite_prob_space: |
|
444 |
assumes "finite_random_variable MX X" |
|
445 |
shows "finite_prob_space MX (distribution X)" |
|
446 |
proof - |
|
447 |
interpret X: prob_space MX "distribution X" |
|
448 |
using assms[THEN finite_random_variableD] by (rule distribution_prob_space) |
|
449 |
interpret MX: finite_sigma_algebra MX |
|
450 |
using assms by simp |
|
451 |
show ?thesis |
|
452 |
proof |
|
453 |
fix x assume "x \<in> space MX" |
|
454 |
then have "X -` {x} \<inter> space M \<in> sets M" |
|
455 |
using assms unfolding measurable_def by simp |
|
456 |
then show "distribution X {x} \<noteq> \<omega>" |
|
457 |
unfolding distribution_def by simp |
|
458 |
qed |
|
459 |
qed |
|
460 |
||
461 |
lemma (in prob_space) simple_function_imp_finite_random_variable[simp, intro]: |
|
462 |
assumes "simple_function X" |
|
463 |
shows "finite_random_variable \<lparr> space = X`space M, sets = Pow (X`space M) \<rparr> X" |
|
464 |
proof (intro conjI) |
|
465 |
have [simp]: "finite (X ` space M)" using assms unfolding simple_function_def by simp |
|
466 |
interpret X: sigma_algebra "\<lparr>space = X ` space M, sets = Pow (X ` space M)\<rparr>" |
|
467 |
by (rule sigma_algebra_Pow) |
|
468 |
show "finite_sigma_algebra \<lparr>space = X ` space M, sets = Pow (X ` space M)\<rparr>" |
|
469 |
by default auto |
|
470 |
show "X \<in> measurable M \<lparr>space = X ` space M, sets = Pow (X ` space M)\<rparr>" |
|
471 |
proof (unfold measurable_def, clarsimp) |
|
472 |
fix A assume A: "A \<subseteq> X`space M" |
|
473 |
then have "finite A" by (rule finite_subset) simp |
|
474 |
then have "X -` (\<Union>a\<in>A. {a}) \<inter> space M \<in> events" |
|
475 |
unfolding vimage_UN UN_extend_simps |
|
476 |
apply (rule finite_UN) |
|
477 |
using A assms unfolding simple_function_def by auto |
|
478 |
then show "X -` A \<inter> space M \<in> events" by simp |
|
479 |
qed |
|
480 |
qed |
|
481 |
||
482 |
lemma (in prob_space) simple_function_imp_random_variable[simp, intro]: |
|
483 |
assumes "simple_function X" |
|
484 |
shows "random_variable \<lparr> space = X`space M, sets = Pow (X`space M) \<rparr> X" |
|
485 |
using simple_function_imp_finite_random_variable[OF assms] |
|
486 |
by (auto dest!: finite_random_variableD) |
|
487 |
||
488 |
lemma (in prob_space) sum_over_space_real_distribution: |
|
489 |
"simple_function X \<Longrightarrow> (\<Sum>x\<in>X`space M. real (distribution X {x})) = 1" |
|
490 |
unfolding distribution_def prob_space[symmetric] |
|
491 |
by (subst real_finite_measure_finite_Union[symmetric]) |
|
492 |
(auto simp add: disjoint_family_on_def simple_function_def |
|
493 |
intro!: arg_cong[where f=prob]) |
|
494 |
||
495 |
lemma (in prob_space) finite_random_variable_pairI: |
|
496 |
assumes "finite_random_variable MX X" |
|
497 |
assumes "finite_random_variable MY Y" |
|
498 |
shows "finite_random_variable (sigma (pair_algebra MX MY)) (\<lambda>x. (X x, Y x))" |
|
499 |
proof |
|
500 |
interpret MX: finite_sigma_algebra MX using assms by simp |
|
501 |
interpret MY: finite_sigma_algebra MY using assms by simp |
|
502 |
interpret P: pair_finite_sigma_algebra MX MY by default |
|
503 |
show "finite_sigma_algebra (sigma (pair_algebra MX MY))" by default |
|
504 |
have sa: "sigma_algebra M" by default |
|
505 |
show "(\<lambda>x. (X x, Y x)) \<in> measurable M (sigma (pair_algebra MX MY))" |
|
506 |
unfolding P.measurable_pair[OF sa] using assms by (simp add: comp_def) |
|
507 |
qed |
|
508 |
||
509 |
lemma (in prob_space) finite_random_variable_imp_sets: |
|
510 |
"finite_random_variable MX X \<Longrightarrow> x \<in> space MX \<Longrightarrow> {x} \<in> sets MX" |
|
511 |
unfolding finite_sigma_algebra_def finite_sigma_algebra_axioms_def by simp |
|
512 |
||
513 |
lemma (in prob_space) finite_random_variable_vimage: |
|
514 |
assumes X: "finite_random_variable MX X" shows "X -` A \<inter> space M \<in> events" |
|
515 |
proof - |
|
516 |
interpret X: finite_sigma_algebra MX using X by simp |
|
517 |
from X have vimage: "\<And>A. A \<subseteq> space MX \<Longrightarrow> X -` A \<inter> space M \<in> events" and |
|
518 |
"X \<in> space M \<rightarrow> space MX" |
|
519 |
by (auto simp: measurable_def) |
|
520 |
then have *: "X -` A \<inter> space M = X -` (A \<inter> space MX) \<inter> space M" |
|
521 |
by auto |
|
522 |
show "X -` A \<inter> space M \<in> events" |
|
523 |
unfolding * by (intro vimage) auto |
|
524 |
qed |
|
525 |
||
526 |
lemma (in prob_space) joint_distribution_finite_Times_le_fst: |
|
527 |
assumes X: "finite_random_variable MX X" and Y: "finite_random_variable MY Y" |
|
528 |
shows "joint_distribution X Y (A \<times> B) \<le> distribution X A" |
|
529 |
unfolding distribution_def |
|
530 |
proof (intro measure_mono) |
|
531 |
show "(\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M \<subseteq> X -` A \<inter> space M" by force |
|
532 |
show "X -` A \<inter> space M \<in> events" |
|
533 |
using finite_random_variable_vimage[OF X] . |
|
534 |
have *: "(\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M = |
|
535 |
(X -` A \<inter> space M) \<inter> (Y -` B \<inter> space M)" by auto |
|
536 |
show "(\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M \<in> events" |
|
537 |
unfolding * apply (rule Int) |
|
538 |
using assms[THEN finite_random_variable_vimage] by auto |
|
539 |
qed |
|
540 |
||
541 |
lemma (in prob_space) joint_distribution_finite_Times_le_snd: |
|
542 |
assumes X: "finite_random_variable MX X" and Y: "finite_random_variable MY Y" |
|
543 |
shows "joint_distribution X Y (A \<times> B) \<le> distribution Y B" |
|
544 |
using assms |
|
545 |
by (subst joint_distribution_commute) |
|
546 |
(simp add: swap_product joint_distribution_finite_Times_le_fst) |
|
547 |
||
548 |
lemma (in prob_space) finite_distribution_order: |
|
549 |
assumes "finite_random_variable MX X" "finite_random_variable MY Y" |
|
550 |
shows "r \<le> joint_distribution X Y {(x, y)} \<Longrightarrow> r \<le> distribution X {x}" |
|
551 |
and "r \<le> joint_distribution X Y {(x, y)} \<Longrightarrow> r \<le> distribution Y {y}" |
|
552 |
and "r < joint_distribution X Y {(x, y)} \<Longrightarrow> r < distribution X {x}" |
|
553 |
and "r < joint_distribution X Y {(x, y)} \<Longrightarrow> r < distribution Y {y}" |
|
554 |
and "distribution X {x} = 0 \<Longrightarrow> joint_distribution X Y {(x, y)} = 0" |
|
555 |
and "distribution Y {y} = 0 \<Longrightarrow> joint_distribution X Y {(x, y)} = 0" |
|
556 |
using joint_distribution_finite_Times_le_snd[OF assms, of "{x}" "{y}"] |
|
557 |
using joint_distribution_finite_Times_le_fst[OF assms, of "{x}" "{y}"] |
|
558 |
by auto |
|
559 |
||
560 |
lemma (in prob_space) finite_distribution_finite: |
|
561 |
assumes "finite_random_variable M' X" |
|
562 |
shows "distribution X {x} \<noteq> \<omega>" |
|
563 |
proof - |
|
564 |
have "distribution X {x} \<le> \<mu> (space M)" |
|
565 |
unfolding distribution_def |
|
566 |
using finite_random_variable_vimage[OF assms] |
|
567 |
by (intro measure_mono) auto |
|
568 |
then show ?thesis |
|
569 |
by auto |
|
570 |
qed |
|
571 |
||
572 |
lemma (in prob_space) setsum_joint_distribution: |
|
573 |
assumes X: "finite_random_variable MX X" |
|
574 |
assumes Y: "random_variable MY Y" "B \<in> sets MY" |
|
575 |
shows "(\<Sum>a\<in>space MX. joint_distribution X Y ({a} \<times> B)) = distribution Y B" |
|
576 |
unfolding distribution_def |
|
577 |
proof (subst measure_finitely_additive'') |
|
578 |
interpret MX: finite_sigma_algebra MX using X by auto |
|
579 |
show "finite (space MX)" using MX.finite_space . |
|
580 |
let "?d i" = "(\<lambda>x. (X x, Y x)) -` ({i} \<times> B) \<inter> space M" |
|
581 |
{ fix i assume "i \<in> space MX" |
|
582 |
moreover have "?d i = (X -` {i} \<inter> space M) \<inter> (Y -` B \<inter> space M)" by auto |
|
583 |
ultimately show "?d i \<in> events" |
|
584 |
using measurable_sets[of X M MX] measurable_sets[of Y M MY B] X Y |
|
585 |
using MX.sets_eq_Pow by auto } |
|
586 |
show "disjoint_family_on ?d (space MX)" by (auto simp: disjoint_family_on_def) |
|
587 |
show "\<mu> (\<Union>i\<in>space MX. ?d i) = \<mu> (Y -` B \<inter> space M)" |
|
588 |
using X[unfolded measurable_def] |
|
589 |
by (auto intro!: arg_cong[where f=\<mu>]) |
|
590 |
qed |
|
591 |
||
592 |
lemma (in prob_space) setsum_joint_distribution_singleton: |
|
593 |
assumes X: "finite_random_variable MX X" |
|
594 |
assumes Y: "finite_random_variable MY Y" "b \<in> space MY" |
|
595 |
shows "(\<Sum>a\<in>space MX. joint_distribution X Y {(a, b)}) = distribution Y {b}" |
|
596 |
using setsum_joint_distribution[OF X |
|
597 |
finite_random_variableD[OF Y(1)] |
|
598 |
finite_random_variable_imp_sets[OF Y]] by simp |
|
599 |
||
600 |
lemma (in prob_space) setsum_real_joint_distribution: |
|
601 |
assumes X: "finite_random_variable MX X" |
|
602 |
assumes Y: "random_variable MY Y" "B \<in> sets MY" |
|
603 |
shows "(\<Sum>a\<in>space MX. real (joint_distribution X Y ({a} \<times> B))) = real (distribution Y B)" |
|
604 |
proof - |
|
605 |
interpret MX: finite_sigma_algebra MX using X by auto |
|
606 |
show ?thesis |
|
607 |
unfolding setsum_joint_distribution[OF assms, symmetric] |
|
608 |
using distribution_finite[OF random_variable_pairI[OF finite_random_variableD[OF X] Y(1)]] Y(2) |
|
609 |
by (simp add: space_pair_algebra in_sigma pair_algebraI MX.sets_eq_Pow real_of_pinfreal_setsum) |
|
610 |
qed |
|
611 |
||
612 |
lemma (in prob_space) setsum_real_joint_distribution_singleton: |
|
613 |
assumes X: "finite_random_variable MX X" |
|
614 |
assumes Y: "finite_random_variable MY Y" "b \<in> space MY" |
|
615 |
shows "(\<Sum>a\<in>space MX. real (joint_distribution X Y {(a,b)})) = real (distribution Y {b})" |
|
616 |
using setsum_real_joint_distribution[OF X |
|
617 |
finite_random_variableD[OF Y(1)] |
|
618 |
finite_random_variable_imp_sets[OF Y]] by simp |
|
619 |
||
620 |
locale pair_finite_prob_space = M1: finite_prob_space M1 p1 + M2: finite_prob_space M2 p2 for M1 p1 M2 p2 |
|
621 |
||
622 |
sublocale pair_finite_prob_space \<subseteq> pair_prob_space M1 p1 M2 p2 by default |
|
623 |
sublocale pair_finite_prob_space \<subseteq> pair_finite_space M1 p1 M2 p2 by default |
|
624 |
sublocale pair_finite_prob_space \<subseteq> finite_prob_space P pair_measure by default |
|
625 |
||
626 |
lemma (in prob_space) joint_distribution_finite_prob_space: |
|
627 |
assumes X: "finite_random_variable MX X" |
|
628 |
assumes Y: "finite_random_variable MY Y" |
|
629 |
shows "finite_prob_space (sigma (pair_algebra MX MY)) (joint_distribution X Y)" |
|
630 |
proof - |
|
631 |
interpret X: finite_prob_space MX "distribution X" |
|
632 |
using X by (rule distribution_finite_prob_space) |
|
633 |
interpret Y: finite_prob_space MY "distribution Y" |
|
634 |
using Y by (rule distribution_finite_prob_space) |
|
635 |
interpret P: prob_space "sigma (pair_algebra MX MY)" "joint_distribution X Y" |
|
636 |
using assms[THEN finite_random_variableD] by (rule joint_distribution_prob_space) |
|
637 |
interpret XY: pair_finite_prob_space MX "distribution X" MY "distribution Y" |
|
638 |
by default |
|
639 |
show ?thesis |
|
640 |
proof |
|
641 |
fix x assume "x \<in> space XY.P" |
|
642 |
moreover have "(\<lambda>x. (X x, Y x)) \<in> measurable M XY.P" |
|
643 |
using X Y by (subst XY.measurable_pair) (simp_all add: o_def, default) |
|
644 |
ultimately have "(\<lambda>x. (X x, Y x)) -` {x} \<inter> space M \<in> sets M" |
|
645 |
unfolding measurable_def by simp |
|
646 |
then show "joint_distribution X Y {x} \<noteq> \<omega>" |
|
647 |
unfolding distribution_def by simp |
|
648 |
qed |
|
649 |
qed |
|
650 |
||
36624 | 651 |
lemma finite_prob_space_eq: |
38656 | 652 |
"finite_prob_space M \<mu> \<longleftrightarrow> finite_measure_space M \<mu> \<and> \<mu> (space M) = 1" |
36624 | 653 |
unfolding finite_prob_space_def finite_measure_space_def prob_space_def prob_space_axioms_def |
654 |
by auto |
|
655 |
||
656 |
lemma (in prob_space) not_empty: "space M \<noteq> {}" |
|
657 |
using prob_space empty_measure by auto |
|
658 |
||
38656 | 659 |
lemma (in finite_prob_space) sum_over_space_eq_1: "(\<Sum>x\<in>space M. \<mu> {x}) = 1" |
660 |
using measure_space_1 sum_over_space by simp |
|
36624 | 661 |
|
662 |
lemma (in finite_prob_space) positive_distribution: "0 \<le> distribution X x" |
|
38656 | 663 |
unfolding distribution_def by simp |
36624 | 664 |
|
665 |
lemma (in finite_prob_space) joint_distribution_restriction_fst: |
|
666 |
"joint_distribution X Y A \<le> distribution X (fst ` A)" |
|
667 |
unfolding distribution_def |
|
668 |
proof (safe intro!: measure_mono) |
|
669 |
fix x assume "x \<in> space M" and *: "(X x, Y x) \<in> A" |
|
670 |
show "x \<in> X -` fst ` A" |
|
671 |
by (auto intro!: image_eqI[OF _ *]) |
|
672 |
qed (simp_all add: sets_eq_Pow) |
|
673 |
||
674 |
lemma (in finite_prob_space) joint_distribution_restriction_snd: |
|
675 |
"joint_distribution X Y A \<le> distribution Y (snd ` A)" |
|
676 |
unfolding distribution_def |
|
677 |
proof (safe intro!: measure_mono) |
|
678 |
fix x assume "x \<in> space M" and *: "(X x, Y x) \<in> A" |
|
679 |
show "x \<in> Y -` snd ` A" |
|
680 |
by (auto intro!: image_eqI[OF _ *]) |
|
681 |
qed (simp_all add: sets_eq_Pow) |
|
682 |
||
683 |
lemma (in finite_prob_space) distribution_order: |
|
684 |
shows "0 \<le> distribution X x'" |
|
685 |
and "(distribution X x' \<noteq> 0) \<longleftrightarrow> (0 < distribution X x')" |
|
686 |
and "r \<le> joint_distribution X Y {(x, y)} \<Longrightarrow> r \<le> distribution X {x}" |
|
687 |
and "r \<le> joint_distribution X Y {(x, y)} \<Longrightarrow> r \<le> distribution Y {y}" |
|
688 |
and "r < joint_distribution X Y {(x, y)} \<Longrightarrow> r < distribution X {x}" |
|
689 |
and "r < joint_distribution X Y {(x, y)} \<Longrightarrow> r < distribution Y {y}" |
|
690 |
and "distribution X {x} = 0 \<Longrightarrow> joint_distribution X Y {(x, y)} = 0" |
|
691 |
and "distribution Y {y} = 0 \<Longrightarrow> joint_distribution X Y {(x, y)} = 0" |
|
692 |
using positive_distribution[of X x'] |
|
693 |
positive_distribution[of "\<lambda>x. (X x, Y x)" "{(x, y)}"] |
|
694 |
joint_distribution_restriction_fst[of X Y "{(x, y)}"] |
|
695 |
joint_distribution_restriction_snd[of X Y "{(x, y)}"] |
|
696 |
by auto |
|
697 |
||
39097 | 698 |
lemma (in finite_prob_space) distribution_mono: |
699 |
assumes "\<And>t. \<lbrakk> t \<in> space M ; X t \<in> x \<rbrakk> \<Longrightarrow> Y t \<in> y" |
|
700 |
shows "distribution X x \<le> distribution Y y" |
|
701 |
unfolding distribution_def |
|
702 |
using assms by (auto simp: sets_eq_Pow intro!: measure_mono) |
|
703 |
||
704 |
lemma (in finite_prob_space) distribution_mono_gt_0: |
|
705 |
assumes gt_0: "0 < distribution X x" |
|
706 |
assumes *: "\<And>t. \<lbrakk> t \<in> space M ; X t \<in> x \<rbrakk> \<Longrightarrow> Y t \<in> y" |
|
707 |
shows "0 < distribution Y y" |
|
708 |
by (rule less_le_trans[OF gt_0 distribution_mono]) (rule *) |
|
709 |
||
710 |
lemma (in finite_prob_space) sum_over_space_distrib: |
|
711 |
"(\<Sum>x\<in>X`space M. distribution X {x}) = 1" |
|
712 |
unfolding distribution_def measure_space_1[symmetric] using finite_space |
|
713 |
by (subst measure_finitely_additive'') |
|
714 |
(auto simp add: disjoint_family_on_def sets_eq_Pow intro!: arg_cong[where f=\<mu>]) |
|
715 |
||
716 |
lemma (in finite_prob_space) sum_over_space_real_distribution: |
|
717 |
"(\<Sum>x\<in>X`space M. real (distribution X {x})) = 1" |
|
718 |
unfolding distribution_def prob_space[symmetric] using finite_space |
|
719 |
by (subst real_finite_measure_finite_Union[symmetric]) |
|
720 |
(auto simp add: disjoint_family_on_def sets_eq_Pow intro!: arg_cong[where f=prob]) |
|
721 |
||
722 |
lemma (in finite_prob_space) finite_sum_over_space_eq_1: |
|
723 |
"(\<Sum>x\<in>space M. real (\<mu> {x})) = 1" |
|
724 |
using sum_over_space_eq_1 finite_measure by (simp add: real_of_pinfreal_setsum sets_eq_Pow) |
|
725 |
||
726 |
lemma (in finite_prob_space) distribution_finite: |
|
727 |
"distribution X A \<noteq> \<omega>" |
|
728 |
using finite_measure[of "X -` A \<inter> space M"] |
|
729 |
unfolding distribution_def sets_eq_Pow by auto |
|
730 |
||
731 |
lemma (in finite_prob_space) real_distribution_gt_0[simp]: |
|
732 |
"0 < real (distribution Y y) \<longleftrightarrow> 0 < distribution Y y" |
|
733 |
using assms by (auto intro!: real_pinfreal_pos distribution_finite) |
|
734 |
||
735 |
lemma (in finite_prob_space) real_distribution_mult_pos_pos: |
|
736 |
assumes "0 < distribution Y y" |
|
737 |
and "0 < distribution X x" |
|
738 |
shows "0 < real (distribution Y y * distribution X x)" |
|
739 |
unfolding real_of_pinfreal_mult[symmetric] |
|
740 |
using assms by (auto intro!: mult_pos_pos) |
|
741 |
||
742 |
lemma (in finite_prob_space) real_distribution_divide_pos_pos: |
|
743 |
assumes "0 < distribution Y y" |
|
744 |
and "0 < distribution X x" |
|
745 |
shows "0 < real (distribution Y y / distribution X x)" |
|
746 |
unfolding divide_pinfreal_def real_of_pinfreal_mult[symmetric] |
|
747 |
using assms distribution_finite[of X x] by (cases "distribution X x") (auto intro!: mult_pos_pos) |
|
748 |
||
749 |
lemma (in finite_prob_space) real_distribution_mult_inverse_pos_pos: |
|
750 |
assumes "0 < distribution Y y" |
|
751 |
and "0 < distribution X x" |
|
752 |
shows "0 < real (distribution Y y * inverse (distribution X x))" |
|
753 |
unfolding divide_pinfreal_def real_of_pinfreal_mult[symmetric] |
|
754 |
using assms distribution_finite[of X x] by (cases "distribution X x") (auto intro!: mult_pos_pos) |
|
755 |
||
756 |
lemma (in prob_space) distribution_remove_const: |
|
757 |
shows "joint_distribution X (\<lambda>x. ()) {(x, ())} = distribution X {x}" |
|
758 |
and "joint_distribution (\<lambda>x. ()) X {((), x)} = distribution X {x}" |
|
759 |
and "joint_distribution X (\<lambda>x. (Y x, ())) {(x, y, ())} = joint_distribution X Y {(x, y)}" |
|
760 |
and "joint_distribution X (\<lambda>x. ((), Y x)) {(x, (), y)} = joint_distribution X Y {(x, y)}" |
|
761 |
and "distribution (\<lambda>x. ()) {()} = 1" |
|
762 |
unfolding measure_space_1[symmetric] |
|
763 |
by (auto intro!: arg_cong[where f="\<mu>"] simp: distribution_def) |
|
35977 | 764 |
|
39097 | 765 |
lemma (in finite_prob_space) setsum_distribution_gen: |
766 |
assumes "Z -` {c} \<inter> space M = (\<Union>x \<in> X`space M. Y -` {f x}) \<inter> space M" |
|
767 |
and "inj_on f (X`space M)" |
|
768 |
shows "(\<Sum>x \<in> X`space M. distribution Y {f x}) = distribution Z {c}" |
|
769 |
unfolding distribution_def assms |
|
770 |
using finite_space assms |
|
771 |
by (subst measure_finitely_additive'') |
|
772 |
(auto simp add: disjoint_family_on_def sets_eq_Pow inj_on_def |
|
773 |
intro!: arg_cong[where f=prob]) |
|
774 |
||
775 |
lemma (in finite_prob_space) setsum_distribution: |
|
776 |
"(\<Sum>x \<in> X`space M. joint_distribution X Y {(x, y)}) = distribution Y {y}" |
|
777 |
"(\<Sum>y \<in> Y`space M. joint_distribution X Y {(x, y)}) = distribution X {x}" |
|
778 |
"(\<Sum>x \<in> X`space M. joint_distribution X (\<lambda>x. (Y x, Z x)) {(x, y, z)}) = joint_distribution Y Z {(y, z)}" |
|
779 |
"(\<Sum>y \<in> Y`space M. joint_distribution X (\<lambda>x. (Y x, Z x)) {(x, y, z)}) = joint_distribution X Z {(x, z)}" |
|
780 |
"(\<Sum>z \<in> Z`space M. joint_distribution X (\<lambda>x. (Y x, Z x)) {(x, y, z)}) = joint_distribution X Y {(x, y)}" |
|
781 |
by (auto intro!: inj_onI setsum_distribution_gen) |
|
782 |
||
783 |
lemma (in finite_prob_space) setsum_real_distribution_gen: |
|
784 |
assumes "Z -` {c} \<inter> space M = (\<Union>x \<in> X`space M. Y -` {f x}) \<inter> space M" |
|
785 |
and "inj_on f (X`space M)" |
|
786 |
shows "(\<Sum>x \<in> X`space M. real (distribution Y {f x})) = real (distribution Z {c})" |
|
787 |
unfolding distribution_def assms |
|
788 |
using finite_space assms |
|
789 |
by (subst real_finite_measure_finite_Union[symmetric]) |
|
790 |
(auto simp add: disjoint_family_on_def sets_eq_Pow inj_on_def |
|
791 |
intro!: arg_cong[where f=prob]) |
|
792 |
||
793 |
lemma (in finite_prob_space) setsum_real_distribution: |
|
794 |
"(\<Sum>x \<in> X`space M. real (joint_distribution X Y {(x, y)})) = real (distribution Y {y})" |
|
795 |
"(\<Sum>y \<in> Y`space M. real (joint_distribution X Y {(x, y)})) = real (distribution X {x})" |
|
796 |
"(\<Sum>x \<in> X`space M. real (joint_distribution X (\<lambda>x. (Y x, Z x)) {(x, y, z)})) = real (joint_distribution Y Z {(y, z)})" |
|
797 |
"(\<Sum>y \<in> Y`space M. real (joint_distribution X (\<lambda>x. (Y x, Z x)) {(x, y, z)})) = real (joint_distribution X Z {(x, z)})" |
|
798 |
"(\<Sum>z \<in> Z`space M. real (joint_distribution X (\<lambda>x. (Y x, Z x)) {(x, y, z)})) = real (joint_distribution X Y {(x, y)})" |
|
799 |
by (auto intro!: inj_onI setsum_real_distribution_gen) |
|
800 |
||
801 |
lemma (in finite_prob_space) real_distribution_order: |
|
802 |
shows "r \<le> real (joint_distribution X Y {(x, y)}) \<Longrightarrow> r \<le> real (distribution X {x})" |
|
803 |
and "r \<le> real (joint_distribution X Y {(x, y)}) \<Longrightarrow> r \<le> real (distribution Y {y})" |
|
804 |
and "r < real (joint_distribution X Y {(x, y)}) \<Longrightarrow> r < real (distribution X {x})" |
|
805 |
and "r < real (joint_distribution X Y {(x, y)}) \<Longrightarrow> r < real (distribution Y {y})" |
|
806 |
and "distribution X {x} = 0 \<Longrightarrow> real (joint_distribution X Y {(x, y)}) = 0" |
|
807 |
and "distribution Y {y} = 0 \<Longrightarrow> real (joint_distribution X Y {(x, y)}) = 0" |
|
808 |
using real_of_pinfreal_mono[OF distribution_finite joint_distribution_restriction_fst, of X Y "{(x, y)}"] |
|
809 |
using real_of_pinfreal_mono[OF distribution_finite joint_distribution_restriction_snd, of X Y "{(x, y)}"] |
|
810 |
using real_pinfreal_nonneg[of "joint_distribution X Y {(x, y)}"] |
|
811 |
by auto |
|
812 |
||
813 |
lemma (in prob_space) joint_distribution_remove[simp]: |
|
814 |
"joint_distribution X X {(x, x)} = distribution X {x}" |
|
815 |
unfolding distribution_def by (auto intro!: arg_cong[where f="\<mu>"]) |
|
816 |
||
817 |
lemma (in finite_prob_space) distribution_1: |
|
818 |
"distribution X A \<le> 1" |
|
819 |
unfolding distribution_def measure_space_1[symmetric] |
|
820 |
by (auto intro!: measure_mono simp: sets_eq_Pow) |
|
821 |
||
822 |
lemma (in finite_prob_space) real_distribution_1: |
|
823 |
"real (distribution X A) \<le> 1" |
|
824 |
unfolding real_pinfreal_1[symmetric] |
|
825 |
by (rule real_of_pinfreal_mono[OF _ distribution_1]) simp |
|
826 |
||
827 |
lemma (in finite_prob_space) uniform_prob: |
|
828 |
assumes "x \<in> space M" |
|
829 |
assumes "\<And> x y. \<lbrakk>x \<in> space M ; y \<in> space M\<rbrakk> \<Longrightarrow> prob {x} = prob {y}" |
|
830 |
shows "prob {x} = 1 / real (card (space M))" |
|
831 |
proof - |
|
832 |
have prob_x: "\<And> y. y \<in> space M \<Longrightarrow> prob {y} = prob {x}" |
|
833 |
using assms(2)[OF _ `x \<in> space M`] by blast |
|
834 |
have "1 = prob (space M)" |
|
835 |
using prob_space by auto |
|
836 |
also have "\<dots> = (\<Sum> x \<in> space M. prob {x})" |
|
837 |
using real_finite_measure_finite_Union[of "space M" "\<lambda> x. {x}", simplified] |
|
838 |
sets_eq_Pow inj_singleton[unfolded inj_on_def, rule_format] |
|
839 |
finite_space unfolding disjoint_family_on_def prob_space[symmetric] |
|
840 |
by (auto simp add:setsum_restrict_set) |
|
841 |
also have "\<dots> = (\<Sum> y \<in> space M. prob {x})" |
|
842 |
using prob_x by auto |
|
843 |
also have "\<dots> = real_of_nat (card (space M)) * prob {x}" by simp |
|
844 |
finally have one: "1 = real (card (space M)) * prob {x}" |
|
845 |
using real_eq_of_nat by auto |
|
846 |
hence two: "real (card (space M)) \<noteq> 0" by fastsimp |
|
847 |
from one have three: "prob {x} \<noteq> 0" by fastsimp |
|
848 |
thus ?thesis using one two three divide_cancel_right |
|
849 |
by (auto simp:field_simps) |
|
39092 | 850 |
qed |
35977 | 851 |
|
39092 | 852 |
lemma (in prob_space) prob_space_subalgebra: |
853 |
assumes "N \<subseteq> sets M" "sigma_algebra (M\<lparr> sets := N \<rparr>)" |
|
854 |
shows "prob_space (M\<lparr> sets := N \<rparr>) \<mu>" |
|
855 |
proof - |
|
856 |
interpret N: measure_space "M\<lparr> sets := N \<rparr>" \<mu> |
|
857 |
using measure_space_subalgebra[OF assms] . |
|
858 |
show ?thesis |
|
859 |
proof qed (simp add: measure_space_1) |
|
35977 | 860 |
qed |
861 |
||
39092 | 862 |
lemma (in prob_space) prob_space_of_restricted_space: |
863 |
assumes "\<mu> A \<noteq> 0" "\<mu> A \<noteq> \<omega>" "A \<in> sets M" |
|
864 |
shows "prob_space (restricted_space A) (\<lambda>S. \<mu> S / \<mu> A)" |
|
865 |
unfolding prob_space_def prob_space_axioms_def |
|
866 |
proof |
|
867 |
show "\<mu> (space (restricted_space A)) / \<mu> A = 1" |
|
868 |
using `\<mu> A \<noteq> 0` `\<mu> A \<noteq> \<omega>` by (auto simp: pinfreal_noteq_omega_Ex) |
|
869 |
have *: "\<And>S. \<mu> S / \<mu> A = inverse (\<mu> A) * \<mu> S" by (simp add: mult_commute) |
|
870 |
interpret A: measure_space "restricted_space A" \<mu> |
|
871 |
using `A \<in> sets M` by (rule restricted_measure_space) |
|
872 |
show "measure_space (restricted_space A) (\<lambda>S. \<mu> S / \<mu> A)" |
|
873 |
proof |
|
874 |
show "\<mu> {} / \<mu> A = 0" by auto |
|
875 |
show "countably_additive (restricted_space A) (\<lambda>S. \<mu> S / \<mu> A)" |
|
876 |
unfolding countably_additive_def psuminf_cmult_right * |
|
877 |
using A.measure_countably_additive by auto |
|
878 |
qed |
|
879 |
qed |
|
880 |
||
881 |
lemma finite_prob_spaceI: |
|
882 |
assumes "finite (space M)" "sets M = Pow(space M)" "\<mu> (space M) = 1" "\<mu> {} = 0" |
|
883 |
and "\<And>A B. A\<subseteq>space M \<Longrightarrow> B\<subseteq>space M \<Longrightarrow> A \<inter> B = {} \<Longrightarrow> \<mu> (A \<union> B) = \<mu> A + \<mu> B" |
|
884 |
shows "finite_prob_space M \<mu>" |
|
885 |
unfolding finite_prob_space_eq |
|
886 |
proof |
|
887 |
show "finite_measure_space M \<mu>" using assms |
|
888 |
by (auto intro!: finite_measure_spaceI) |
|
889 |
show "\<mu> (space M) = 1" by fact |
|
890 |
qed |
|
36624 | 891 |
|
892 |
lemma (in finite_prob_space) finite_measure_space: |
|
39097 | 893 |
fixes X :: "'a \<Rightarrow> 'x" |
38656 | 894 |
shows "finite_measure_space \<lparr>space = X ` space M, sets = Pow (X ` space M)\<rparr> (distribution X)" |
895 |
(is "finite_measure_space ?S _") |
|
39092 | 896 |
proof (rule finite_measure_spaceI, simp_all) |
36624 | 897 |
show "finite (X ` space M)" using finite_space by simp |
39097 | 898 |
next |
899 |
fix A B :: "'x set" assume "A \<inter> B = {}" |
|
900 |
then show "distribution X (A \<union> B) = distribution X A + distribution X B" |
|
901 |
unfolding distribution_def |
|
902 |
by (subst measure_additive) |
|
903 |
(auto intro!: arg_cong[where f=\<mu>] simp: sets_eq_Pow) |
|
36624 | 904 |
qed |
905 |
||
39097 | 906 |
lemma (in finite_prob_space) finite_prob_space_of_images: |
907 |
"finite_prob_space \<lparr> space = X ` space M, sets = Pow (X ` space M)\<rparr> (distribution X)" |
|
908 |
by (simp add: finite_prob_space_eq finite_measure_space) |
|
909 |
||
910 |
lemma (in finite_prob_space) real_distribution_order': |
|
911 |
shows "real (distribution X {x}) = 0 \<Longrightarrow> real (joint_distribution X Y {(x, y)}) = 0" |
|
912 |
and "real (distribution Y {y}) = 0 \<Longrightarrow> real (joint_distribution X Y {(x, y)}) = 0" |
|
913 |
using real_of_pinfreal_mono[OF distribution_finite joint_distribution_restriction_fst, of X Y "{(x, y)}"] |
|
914 |
using real_of_pinfreal_mono[OF distribution_finite joint_distribution_restriction_snd, of X Y "{(x, y)}"] |
|
915 |
using real_pinfreal_nonneg[of "joint_distribution X Y {(x, y)}"] |
|
916 |
by auto |
|
917 |
||
39096 | 918 |
lemma (in finite_prob_space) finite_product_measure_space: |
39097 | 919 |
fixes X :: "'a \<Rightarrow> 'x" and Y :: "'a \<Rightarrow> 'y" |
39096 | 920 |
assumes "finite s1" "finite s2" |
921 |
shows "finite_measure_space \<lparr> space = s1 \<times> s2, sets = Pow (s1 \<times> s2)\<rparr> (joint_distribution X Y)" |
|
922 |
(is "finite_measure_space ?M ?D") |
|
39097 | 923 |
proof (rule finite_measure_spaceI, simp_all) |
924 |
show "finite (s1 \<times> s2)" |
|
39096 | 925 |
using assms by auto |
39097 | 926 |
show "joint_distribution X Y (s1\<times>s2) \<noteq> \<omega>" |
927 |
using distribution_finite . |
|
928 |
next |
|
929 |
fix A B :: "('x*'y) set" assume "A \<inter> B = {}" |
|
930 |
then show "joint_distribution X Y (A \<union> B) = joint_distribution X Y A + joint_distribution X Y B" |
|
931 |
unfolding distribution_def |
|
932 |
by (subst measure_additive) |
|
933 |
(auto intro!: arg_cong[where f=\<mu>] simp: sets_eq_Pow) |
|
39096 | 934 |
qed |
935 |
||
39097 | 936 |
lemma (in finite_prob_space) finite_product_measure_space_of_images: |
39096 | 937 |
shows "finite_measure_space \<lparr> space = X ` space M \<times> Y ` space M, |
938 |
sets = Pow (X ` space M \<times> Y ` space M) \<rparr> |
|
939 |
(joint_distribution X Y)" |
|
940 |
using finite_space by (auto intro!: finite_product_measure_space) |
|
941 |
||
40859 | 942 |
lemma (in finite_prob_space) finite_product_prob_space_of_images: |
943 |
"finite_prob_space \<lparr> space = X ` space M \<times> Y ` space M, sets = Pow (X ` space M \<times> Y ` space M)\<rparr> |
|
944 |
(joint_distribution X Y)" |
|
945 |
(is "finite_prob_space ?S _") |
|
946 |
proof (simp add: finite_prob_space_eq finite_product_measure_space_of_images) |
|
947 |
have "X -` X ` space M \<inter> Y -` Y ` space M \<inter> space M = space M" by auto |
|
948 |
thus "joint_distribution X Y (X ` space M \<times> Y ` space M) = 1" |
|
949 |
by (simp add: distribution_def prob_space vimage_Times comp_def measure_space_1) |
|
950 |
qed |
|
951 |
||
39085 | 952 |
section "Conditional Expectation and Probability" |
953 |
||
954 |
lemma (in prob_space) conditional_expectation_exists: |
|
39083 | 955 |
fixes X :: "'a \<Rightarrow> pinfreal" |
956 |
assumes borel: "X \<in> borel_measurable M" |
|
957 |
and N_subalgebra: "N \<subseteq> sets M" "sigma_algebra (M\<lparr> sets := N \<rparr>)" |
|
958 |
shows "\<exists>Y\<in>borel_measurable (M\<lparr> sets := N \<rparr>). \<forall>C\<in>N. |
|
959 |
positive_integral (\<lambda>x. Y x * indicator C x) = positive_integral (\<lambda>x. X x * indicator C x)" |
|
960 |
proof - |
|
961 |
interpret P: prob_space "M\<lparr> sets := N \<rparr>" \<mu> |
|
962 |
using prob_space_subalgebra[OF N_subalgebra] . |
|
963 |
||
964 |
let "?f A" = "\<lambda>x. X x * indicator A x" |
|
965 |
let "?Q A" = "positive_integral (?f A)" |
|
966 |
||
967 |
from measure_space_density[OF borel] |
|
968 |
have Q: "measure_space (M\<lparr> sets := N \<rparr>) ?Q" |
|
969 |
by (rule measure_space.measure_space_subalgebra[OF _ N_subalgebra]) |
|
970 |
then interpret Q: measure_space "M\<lparr> sets := N \<rparr>" ?Q . |
|
971 |
||
972 |
have "P.absolutely_continuous ?Q" |
|
973 |
unfolding P.absolutely_continuous_def |
|
974 |
proof (safe, simp) |
|
975 |
fix A assume "A \<in> N" "\<mu> A = 0" |
|
976 |
moreover then have f_borel: "?f A \<in> borel_measurable M" |
|
977 |
using borel N_subalgebra by (auto intro: borel_measurable_indicator) |
|
978 |
moreover have "{x\<in>space M. ?f A x \<noteq> 0} = (?f A -` {0<..} \<inter> space M) \<inter> A" |
|
979 |
by (auto simp: indicator_def) |
|
980 |
moreover have "\<mu> \<dots> \<le> \<mu> A" |
|
981 |
using `A \<in> N` N_subalgebra f_borel |
|
982 |
by (auto intro!: measure_mono Int[of _ A] measurable_sets) |
|
983 |
ultimately show "?Q A = 0" |
|
984 |
by (simp add: positive_integral_0_iff) |
|
985 |
qed |
|
986 |
from P.Radon_Nikodym[OF Q this] |
|
987 |
obtain Y where Y: "Y \<in> borel_measurable (M\<lparr>sets := N\<rparr>)" |
|
988 |
"\<And>A. A \<in> sets (M\<lparr>sets:=N\<rparr>) \<Longrightarrow> ?Q A = P.positive_integral (\<lambda>x. Y x * indicator A x)" |
|
989 |
by blast |
|
39084 | 990 |
with N_subalgebra show ?thesis |
991 |
by (auto intro!: bexI[OF _ Y(1)]) |
|
39083 | 992 |
qed |
993 |
||
39085 | 994 |
definition (in prob_space) |
995 |
"conditional_expectation N X = (SOME Y. Y\<in>borel_measurable (M\<lparr>sets:=N\<rparr>) |
|
996 |
\<and> (\<forall>C\<in>N. positive_integral (\<lambda>x. Y x * indicator C x) = positive_integral (\<lambda>x. X x * indicator C x)))" |
|
997 |
||
998 |
abbreviation (in prob_space) |
|
39092 | 999 |
"conditional_prob N A \<equiv> conditional_expectation N (indicator A)" |
39085 | 1000 |
|
1001 |
lemma (in prob_space) |
|
1002 |
fixes X :: "'a \<Rightarrow> pinfreal" |
|
1003 |
assumes borel: "X \<in> borel_measurable M" |
|
1004 |
and N_subalgebra: "N \<subseteq> sets M" "sigma_algebra (M\<lparr> sets := N \<rparr>)" |
|
1005 |
shows borel_measurable_conditional_expectation: |
|
1006 |
"conditional_expectation N X \<in> borel_measurable (M\<lparr> sets := N \<rparr>)" |
|
1007 |
and conditional_expectation: "\<And>C. C \<in> N \<Longrightarrow> |
|
1008 |
positive_integral (\<lambda>x. conditional_expectation N X x * indicator C x) = |
|
1009 |
positive_integral (\<lambda>x. X x * indicator C x)" |
|
1010 |
(is "\<And>C. C \<in> N \<Longrightarrow> ?eq C") |
|
1011 |
proof - |
|
1012 |
note CE = conditional_expectation_exists[OF assms, unfolded Bex_def] |
|
1013 |
then show "conditional_expectation N X \<in> borel_measurable (M\<lparr> sets := N \<rparr>)" |
|
1014 |
unfolding conditional_expectation_def by (rule someI2_ex) blast |
|
1015 |
||
1016 |
from CE show "\<And>C. C\<in>N \<Longrightarrow> ?eq C" |
|
1017 |
unfolding conditional_expectation_def by (rule someI2_ex) blast |
|
1018 |
qed |
|
1019 |
||
39091 | 1020 |
lemma (in sigma_algebra) factorize_measurable_function: |
1021 |
fixes Z :: "'a \<Rightarrow> pinfreal" and Y :: "'a \<Rightarrow> 'c" |
|
1022 |
assumes "sigma_algebra M'" and "Y \<in> measurable M M'" "Z \<in> borel_measurable M" |
|
1023 |
shows "Z \<in> borel_measurable (sigma_algebra.vimage_algebra M' (space M) Y) |
|
1024 |
\<longleftrightarrow> (\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. Z x = g (Y x))" |
|
1025 |
proof safe |
|
1026 |
interpret M': sigma_algebra M' by fact |
|
1027 |
have Y: "Y \<in> space M \<rightarrow> space M'" using assms unfolding measurable_def by auto |
|
1028 |
from M'.sigma_algebra_vimage[OF this] |
|
1029 |
interpret va: sigma_algebra "M'.vimage_algebra (space M) Y" . |
|
1030 |
||
1031 |
{ fix g :: "'c \<Rightarrow> pinfreal" assume "g \<in> borel_measurable M'" |
|
1032 |
with M'.measurable_vimage_algebra[OF Y] |
|
1033 |
have "g \<circ> Y \<in> borel_measurable (M'.vimage_algebra (space M) Y)" |
|
1034 |
by (rule measurable_comp) |
|
1035 |
moreover assume "\<forall>x\<in>space M. Z x = g (Y x)" |
|
1036 |
then have "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y) \<longleftrightarrow> |
|
1037 |
g \<circ> Y \<in> borel_measurable (M'.vimage_algebra (space M) Y)" |
|
1038 |
by (auto intro!: measurable_cong) |
|
1039 |
ultimately show "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y)" |
|
1040 |
by simp } |
|
1041 |
||
1042 |
assume "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y)" |
|
1043 |
from va.borel_measurable_implies_simple_function_sequence[OF this] |
|
1044 |
obtain f where f: "\<And>i. va.simple_function (f i)" and "f \<up> Z" by blast |
|
1045 |
||
1046 |
have "\<forall>i. \<exists>g. M'.simple_function g \<and> (\<forall>x\<in>space M. f i x = g (Y x))" |
|
1047 |
proof |
|
1048 |
fix i |
|
1049 |
from f[of i] have "finite (f i`space M)" and B_ex: |
|
1050 |
"\<forall>z\<in>(f i)`space M. \<exists>B. B \<in> sets M' \<and> (f i) -` {z} \<inter> space M = Y -` B \<inter> space M" |
|
1051 |
unfolding va.simple_function_def by auto |
|
1052 |
from B_ex[THEN bchoice] guess B .. note B = this |
|
1053 |
||
1054 |
let ?g = "\<lambda>x. \<Sum>z\<in>f i`space M. z * indicator (B z) x" |
|
1055 |
||
1056 |
show "\<exists>g. M'.simple_function g \<and> (\<forall>x\<in>space M. f i x = g (Y x))" |
|
1057 |
proof (intro exI[of _ ?g] conjI ballI) |
|
1058 |
show "M'.simple_function ?g" using B by auto |
|
1059 |
||
1060 |
fix x assume "x \<in> space M" |
|
1061 |
then have "\<And>z. z \<in> f i`space M \<Longrightarrow> indicator (B z) (Y x) = (indicator (f i -` {z} \<inter> space M) x::pinfreal)" |
|
1062 |
unfolding indicator_def using B by auto |
|
1063 |
then show "f i x = ?g (Y x)" using `x \<in> space M` f[of i] |
|
1064 |
by (subst va.simple_function_indicator_representation) auto |
|
1065 |
qed |
|
1066 |
qed |
|
1067 |
from choice[OF this] guess g .. note g = this |
|
1068 |
||
1069 |
show "\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. Z x = g (Y x)" |
|
1070 |
proof (intro ballI bexI) |
|
1071 |
show "(SUP i. g i) \<in> borel_measurable M'" |
|
1072 |
using g by (auto intro: M'.borel_measurable_simple_function) |
|
1073 |
fix x assume "x \<in> space M" |
|
1074 |
have "Z x = (SUP i. f i) x" using `f \<up> Z` unfolding isoton_def by simp |
|
1075 |
also have "\<dots> = (SUP i. g i) (Y x)" unfolding SUPR_fun_expand |
|
1076 |
using g `x \<in> space M` by simp |
|
1077 |
finally show "Z x = (SUP i. g i) (Y x)" . |
|
1078 |
qed |
|
1079 |
qed |
|
39090
a2d38b8b693e
Introduced sigma algebra generated by function preimages.
hoelzl
parents:
39089
diff
changeset
|
1080 |
|
35582 | 1081 |
end |