author | hoelzl |
Wed, 10 Oct 2012 12:12:24 +0200 | |
changeset 49785 | 0a8adca22974 |
parent 49784 | 5e5b2da42a69 |
child 49789 | e0a4cb91a8a9 |
permissions | -rw-r--r-- |
42146
5b52c6a9c627
split Product_Measure into Binary_Product_Measure and Finite_Product_Measure
hoelzl
parents:
42067
diff
changeset
|
1 |
(* Title: HOL/Probability/Binary_Product_Measure.thy |
42067 | 2 |
Author: Johannes Hölzl, TU München |
3 |
*) |
|
4 |
||
42146
5b52c6a9c627
split Product_Measure into Binary_Product_Measure and Finite_Product_Measure
hoelzl
parents:
42067
diff
changeset
|
5 |
header {*Binary product measures*} |
42067 | 6 |
|
42146
5b52c6a9c627
split Product_Measure into Binary_Product_Measure and Finite_Product_Measure
hoelzl
parents:
42067
diff
changeset
|
7 |
theory Binary_Product_Measure |
38656 | 8 |
imports Lebesgue_Integration |
35833 | 9 |
begin |
10 |
||
42950
6e5c2a3c69da
move lemmas to Extended_Reals and Extended_Real_Limits
hoelzl
parents:
42146
diff
changeset
|
11 |
lemma times_eq_iff: "A \<times> B = C \<times> D \<longleftrightarrow> A = C \<and> B = D \<or> ((A = {} \<or> B = {}) \<and> (C = {} \<or> D = {}))" |
6e5c2a3c69da
move lemmas to Extended_Reals and Extended_Real_Limits
hoelzl
parents:
42146
diff
changeset
|
12 |
by auto |
6e5c2a3c69da
move lemmas to Extended_Reals and Extended_Real_Limits
hoelzl
parents:
42146
diff
changeset
|
13 |
|
40859 | 14 |
lemma times_Int_times: "A \<times> B \<inter> C \<times> D = (A \<inter> C) \<times> (B \<inter> D)" |
15 |
by auto |
|
16 |
||
17 |
lemma Pair_vimage_times[simp]: "\<And>A B x. Pair x -` (A \<times> B) = (if x \<in> A then B else {})" |
|
18 |
by auto |
|
19 |
||
20 |
lemma rev_Pair_vimage_times[simp]: "\<And>A B y. (\<lambda>x. (x, y)) -` (A \<times> B) = (if y \<in> B then A else {})" |
|
21 |
by auto |
|
22 |
||
23 |
lemma case_prod_distrib: "f (case x of (x, y) \<Rightarrow> g x y) = (case x of (x, y) \<Rightarrow> f (g x y))" |
|
24 |
by (cases x) simp |
|
25 |
||
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
26 |
lemma split_beta': "(\<lambda>(x,y). f x y) = (\<lambda>x. f (fst x) (snd x))" |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
27 |
by (auto simp: fun_eq_iff) |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
28 |
|
40859 | 29 |
section "Binary products" |
30 |
||
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
31 |
definition pair_measure (infixr "\<Otimes>\<^isub>M" 80) where |
47694 | 32 |
"A \<Otimes>\<^isub>M B = measure_of (space A \<times> space B) |
33 |
{a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B} |
|
34 |
(\<lambda>X. \<integral>\<^isup>+x. (\<integral>\<^isup>+y. indicator X (x,y) \<partial>B) \<partial>A)" |
|
40859 | 35 |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
36 |
lemma space_pair_measure: |
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
37 |
"space (A \<Otimes>\<^isub>M B) = space A \<times> space B" |
47694 | 38 |
unfolding pair_measure_def using space_closed[of A] space_closed[of B] |
39 |
by (intro space_measure_of) auto |
|
40 |
||
41 |
lemma sets_pair_measure: |
|
42 |
"sets (A \<Otimes>\<^isub>M B) = sigma_sets (space A \<times> space B) {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}" |
|
43 |
unfolding pair_measure_def using space_closed[of A] space_closed[of B] |
|
44 |
by (intro sets_measure_of) auto |
|
41095 | 45 |
|
49776 | 46 |
lemma sets_pair_measure_cong[cong]: |
47 |
"sets M1 = sets M1' \<Longrightarrow> sets M2 = sets M2' \<Longrightarrow> sets (M1 \<Otimes>\<^isub>M M2) = sets (M1' \<Otimes>\<^isub>M M2')" |
|
48 |
unfolding sets_pair_measure by (simp cong: sets_eq_imp_space_eq) |
|
49 |
||
47694 | 50 |
lemma pair_measureI[intro, simp]: |
51 |
"x \<in> sets A \<Longrightarrow> y \<in> sets B \<Longrightarrow> x \<times> y \<in> sets (A \<Otimes>\<^isub>M B)" |
|
52 |
by (auto simp: sets_pair_measure) |
|
41095 | 53 |
|
47694 | 54 |
lemma measurable_pair_measureI: |
55 |
assumes 1: "f \<in> space M \<rightarrow> space M1 \<times> space M2" |
|
56 |
assumes 2: "\<And>A B. A \<in> sets M1 \<Longrightarrow> B \<in> sets M2 \<Longrightarrow> f -` (A \<times> B) \<inter> space M \<in> sets M" |
|
57 |
shows "f \<in> measurable M (M1 \<Otimes>\<^isub>M M2)" |
|
58 |
unfolding pair_measure_def using 1 2 |
|
59 |
by (intro measurable_measure_of) (auto dest: sets_into_space) |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
60 |
|
49776 | 61 |
lemma measurable_Pair: |
62 |
assumes f: "f \<in> measurable M M1" and g: "g \<in> measurable M M2" |
|
63 |
shows "(\<lambda>x. (f x, g x)) \<in> measurable M (M1 \<Otimes>\<^isub>M M2)" |
|
64 |
proof (rule measurable_pair_measureI) |
|
65 |
show "(\<lambda>x. (f x, g x)) \<in> space M \<rightarrow> space M1 \<times> space M2" |
|
66 |
using f g by (auto simp: measurable_def) |
|
67 |
fix A B assume *: "A \<in> sets M1" "B \<in> sets M2" |
|
68 |
have "(\<lambda>x. (f x, g x)) -` (A \<times> B) \<inter> space M = (f -` A \<inter> space M) \<inter> (g -` B \<inter> space M)" |
|
69 |
by auto |
|
70 |
also have "\<dots> \<in> sets M" |
|
71 |
by (rule Int) (auto intro!: measurable_sets * f g) |
|
72 |
finally show "(\<lambda>x. (f x, g x)) -` (A \<times> B) \<inter> space M \<in> sets M" . |
|
73 |
qed |
|
74 |
||
75 |
lemma measurable_pair: |
|
76 |
assumes "(fst \<circ> f) \<in> measurable M M1" "(snd \<circ> f) \<in> measurable M M2" |
|
77 |
shows "f \<in> measurable M (M1 \<Otimes>\<^isub>M M2)" |
|
78 |
using measurable_Pair[OF assms] by simp |
|
79 |
||
47694 | 80 |
lemma measurable_fst[intro!, simp]: "fst \<in> measurable (M1 \<Otimes>\<^isub>M M2) M1" |
49776 | 81 |
by (auto simp: fst_vimage_eq_Times space_pair_measure sets_into_space times_Int_times measurable_def) |
40859 | 82 |
|
47694 | 83 |
lemma measurable_snd[intro!, simp]: "snd \<in> measurable (M1 \<Otimes>\<^isub>M M2) M2" |
49776 | 84 |
by (auto simp: snd_vimage_eq_Times space_pair_measure sets_into_space times_Int_times measurable_def) |
47694 | 85 |
|
86 |
lemma measurable_fst': "f \<in> measurable M (N \<Otimes>\<^isub>M P) \<Longrightarrow> (\<lambda>x. fst (f x)) \<in> measurable M N" |
|
87 |
using measurable_comp[OF _ measurable_fst] by (auto simp: comp_def) |
|
88 |
||
89 |
lemma measurable_snd': "f \<in> measurable M (N \<Otimes>\<^isub>M P) \<Longrightarrow> (\<lambda>x. snd (f x)) \<in> measurable M P" |
|
90 |
using measurable_comp[OF _ measurable_snd] by (auto simp: comp_def) |
|
40859 | 91 |
|
47694 | 92 |
lemma measurable_fst'': "f \<in> measurable M N \<Longrightarrow> (\<lambda>x. f (fst x)) \<in> measurable (M \<Otimes>\<^isub>M P) N" |
93 |
using measurable_comp[OF measurable_fst _] by (auto simp: comp_def) |
|
94 |
||
95 |
lemma measurable_snd'': "f \<in> measurable M N \<Longrightarrow> (\<lambda>x. f (snd x)) \<in> measurable (P \<Otimes>\<^isub>M M) N" |
|
96 |
using measurable_comp[OF measurable_snd _] by (auto simp: comp_def) |
|
97 |
||
98 |
lemma measurable_pair_iff: |
|
99 |
"f \<in> measurable M (M1 \<Otimes>\<^isub>M M2) \<longleftrightarrow> (fst \<circ> f) \<in> measurable M M1 \<and> (snd \<circ> f) \<in> measurable M M2" |
|
49776 | 100 |
using measurable_pair[of f M M1 M2] by auto |
40859 | 101 |
|
49776 | 102 |
lemma measurable_split_conv: |
103 |
"(\<lambda>(x, y). f x y) \<in> measurable A B \<longleftrightarrow> (\<lambda>x. f (fst x) (snd x)) \<in> measurable A B" |
|
104 |
by (intro arg_cong2[where f="op \<in>"]) auto |
|
40859 | 105 |
|
47694 | 106 |
lemma measurable_pair_swap': "(\<lambda>(x,y). (y, x)) \<in> measurable (M1 \<Otimes>\<^isub>M M2) (M2 \<Otimes>\<^isub>M M1)" |
49776 | 107 |
by (auto intro!: measurable_Pair simp: measurable_split_conv) |
47694 | 108 |
|
109 |
lemma measurable_pair_swap: |
|
110 |
assumes f: "f \<in> measurable (M1 \<Otimes>\<^isub>M M2) M" shows "(\<lambda>(x,y). f (y, x)) \<in> measurable (M2 \<Otimes>\<^isub>M M1) M" |
|
49776 | 111 |
using measurable_comp[OF measurable_Pair f] by (auto simp: measurable_split_conv comp_def) |
40859 | 112 |
|
47694 | 113 |
lemma measurable_pair_swap_iff: |
114 |
"f \<in> measurable (M2 \<Otimes>\<^isub>M M1) M \<longleftrightarrow> (\<lambda>(x,y). f (y,x)) \<in> measurable (M1 \<Otimes>\<^isub>M M2) M" |
|
115 |
using measurable_pair_swap[of "\<lambda>(x,y). f (y, x)"] |
|
116 |
by (auto intro!: measurable_pair_swap) |
|
40859 | 117 |
|
49776 | 118 |
lemma measurable_ident[intro, simp]: "(\<lambda>x. x) \<in> measurable M M" |
119 |
unfolding measurable_def by auto |
|
120 |
||
47694 | 121 |
lemma measurable_Pair1': "x \<in> space M1 \<Longrightarrow> Pair x \<in> measurable M2 (M1 \<Otimes>\<^isub>M M2)" |
49776 | 122 |
by (auto intro!: measurable_Pair) |
40859 | 123 |
|
47694 | 124 |
lemma sets_Pair1: assumes A: "A \<in> sets (M1 \<Otimes>\<^isub>M M2)" shows "Pair x -` A \<in> sets M2" |
40859 | 125 |
proof - |
47694 | 126 |
have "Pair x -` A = (if x \<in> space M1 then Pair x -` A \<inter> space M2 else {})" |
127 |
using A[THEN sets_into_space] by (auto simp: space_pair_measure) |
|
128 |
also have "\<dots> \<in> sets M2" |
|
129 |
using A by (auto simp add: measurable_Pair1' intro!: measurable_sets split: split_if_asm) |
|
130 |
finally show ?thesis . |
|
40859 | 131 |
qed |
132 |
||
47694 | 133 |
lemma measurable_Pair2': "y \<in> space M2 \<Longrightarrow> (\<lambda>x. (x, y)) \<in> measurable M1 (M1 \<Otimes>\<^isub>M M2)" |
49776 | 134 |
by (auto intro!: measurable_Pair) |
40859 | 135 |
|
47694 | 136 |
lemma sets_Pair2: assumes A: "A \<in> sets (M1 \<Otimes>\<^isub>M M2)" shows "(\<lambda>x. (x, y)) -` A \<in> sets M1" |
137 |
proof - |
|
138 |
have "(\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})" |
|
139 |
using A[THEN sets_into_space] by (auto simp: space_pair_measure) |
|
140 |
also have "\<dots> \<in> sets M1" |
|
141 |
using A by (auto simp add: measurable_Pair2' intro!: measurable_sets split: split_if_asm) |
|
142 |
finally show ?thesis . |
|
40859 | 143 |
qed |
144 |
||
47694 | 145 |
lemma measurable_Pair2: |
146 |
assumes f: "f \<in> measurable (M1 \<Otimes>\<^isub>M M2) M" and x: "x \<in> space M1" |
|
147 |
shows "(\<lambda>y. f (x, y)) \<in> measurable M2 M" |
|
148 |
using measurable_comp[OF measurable_Pair1' f, OF x] |
|
149 |
by (simp add: comp_def) |
|
150 |
||
151 |
lemma measurable_Pair1: |
|
152 |
assumes f: "f \<in> measurable (M1 \<Otimes>\<^isub>M M2) M" and y: "y \<in> space M2" |
|
40859 | 153 |
shows "(\<lambda>x. f (x, y)) \<in> measurable M1 M" |
47694 | 154 |
using measurable_comp[OF measurable_Pair2' f, OF y] |
155 |
by (simp add: comp_def) |
|
40859 | 156 |
|
47694 | 157 |
lemma Int_stable_pair_measure_generator: "Int_stable {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}" |
40859 | 158 |
unfolding Int_stable_def |
47694 | 159 |
by safe (auto simp add: times_Int_times) |
40859 | 160 |
|
49776 | 161 |
lemma (in finite_measure) finite_measure_cut_measurable: |
162 |
assumes "Q \<in> sets (N \<Otimes>\<^isub>M M)" |
|
163 |
shows "(\<lambda>x. emeasure M (Pair x -` Q)) \<in> borel_measurable N" |
|
40859 | 164 |
(is "?s Q \<in> _") |
165 |
proof - |
|
49776 | 166 |
let ?\<Omega> = "space N \<times> space M" and ?D = "{A\<in>sets (N \<Otimes>\<^isub>M M). ?s A \<in> borel_measurable N}" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
167 |
note space_pair_measure[simp] |
47694 | 168 |
interpret dynkin_system ?\<Omega> ?D |
40859 | 169 |
proof (intro dynkin_systemI) |
47694 | 170 |
fix A assume "A \<in> ?D" then show "A \<subseteq> ?\<Omega>" |
49776 | 171 |
using sets_into_space[of A "N \<Otimes>\<^isub>M M"] by simp |
40859 | 172 |
next |
47694 | 173 |
from top show "?\<Omega> \<in> ?D" |
174 |
by (auto simp add: if_distrib intro!: measurable_If) |
|
40859 | 175 |
next |
47694 | 176 |
fix A assume "A \<in> ?D" |
49776 | 177 |
with sets_into_space have "\<And>x. emeasure M (Pair x -` (?\<Omega> - A)) = |
178 |
(if x \<in> space N then emeasure M (space M) - ?s A x else 0)" |
|
47694 | 179 |
by (auto intro!: emeasure_compl simp: vimage_Diff sets_Pair1) |
180 |
with `A \<in> ?D` top show "?\<Omega> - A \<in> ?D" |
|
181 |
by (auto intro!: measurable_If) |
|
40859 | 182 |
next |
49776 | 183 |
fix F :: "nat \<Rightarrow> ('b\<times>'a) set" assume "disjoint_family F" "range F \<subseteq> ?D" |
184 |
moreover then have "\<And>x. emeasure M (\<Union>i. Pair x -` F i) = (\<Sum>i. ?s (F i) x)" |
|
47694 | 185 |
by (intro suminf_emeasure[symmetric]) (auto simp: disjoint_family_on_def sets_Pair1) |
186 |
ultimately show "(\<Union>i. F i) \<in> ?D" |
|
187 |
by (auto simp: vimage_UN intro!: borel_measurable_psuminf) |
|
40859 | 188 |
qed |
49776 | 189 |
let ?G = "{a \<times> b | a b. a \<in> sets N \<and> b \<in> sets M}" |
47694 | 190 |
have "sigma_sets ?\<Omega> ?G = ?D" |
191 |
proof (rule dynkin_lemma) |
|
192 |
show "?G \<subseteq> ?D" |
|
193 |
by (auto simp: if_distrib Int_def[symmetric] intro!: measurable_If) |
|
194 |
qed (auto simp: sets_pair_measure Int_stable_pair_measure_generator) |
|
49776 | 195 |
with `Q \<in> sets (N \<Otimes>\<^isub>M M)` have "Q \<in> ?D" |
47694 | 196 |
by (simp add: sets_pair_measure[symmetric]) |
49776 | 197 |
then show "?s Q \<in> borel_measurable N" by simp |
198 |
qed |
|
199 |
||
200 |
lemma (in sigma_finite_measure) measurable_emeasure_Pair: |
|
201 |
assumes Q: "Q \<in> sets (N \<Otimes>\<^isub>M M)" shows "(\<lambda>x. emeasure M (Pair x -` Q)) \<in> borel_measurable N" (is "?s Q \<in> _") |
|
202 |
proof - |
|
203 |
from sigma_finite_disjoint guess F . note F = this |
|
204 |
then have F_sets: "\<And>i. F i \<in> sets M" by auto |
|
205 |
let ?C = "\<lambda>x i. F i \<inter> Pair x -` Q" |
|
206 |
{ fix i |
|
207 |
have [simp]: "space N \<times> F i \<inter> space N \<times> space M = space N \<times> F i" |
|
208 |
using F sets_into_space by auto |
|
209 |
let ?R = "density M (indicator (F i))" |
|
210 |
have "finite_measure ?R" |
|
211 |
using F by (intro finite_measureI) (auto simp: emeasure_restricted subset_eq) |
|
212 |
then have "(\<lambda>x. emeasure ?R (Pair x -` (space N \<times> space ?R \<inter> Q))) \<in> borel_measurable N" |
|
213 |
by (rule finite_measure.finite_measure_cut_measurable) (auto intro: Q) |
|
214 |
moreover have "\<And>x. emeasure ?R (Pair x -` (space N \<times> space ?R \<inter> Q)) |
|
215 |
= emeasure M (F i \<inter> Pair x -` (space N \<times> space ?R \<inter> Q))" |
|
216 |
using Q F_sets by (intro emeasure_restricted) (auto intro: sets_Pair1) |
|
217 |
moreover have "\<And>x. F i \<inter> Pair x -` (space N \<times> space ?R \<inter> Q) = ?C x i" |
|
218 |
using sets_into_space[OF Q] by (auto simp: space_pair_measure) |
|
219 |
ultimately have "(\<lambda>x. emeasure M (?C x i)) \<in> borel_measurable N" |
|
220 |
by simp } |
|
221 |
moreover |
|
222 |
{ fix x |
|
223 |
have "(\<Sum>i. emeasure M (?C x i)) = emeasure M (\<Union>i. ?C x i)" |
|
224 |
proof (intro suminf_emeasure) |
|
225 |
show "range (?C x) \<subseteq> sets M" |
|
226 |
using F `Q \<in> sets (N \<Otimes>\<^isub>M M)` by (auto intro!: sets_Pair1) |
|
227 |
have "disjoint_family F" using F by auto |
|
228 |
show "disjoint_family (?C x)" |
|
229 |
by (rule disjoint_family_on_bisimulation[OF `disjoint_family F`]) auto |
|
230 |
qed |
|
231 |
also have "(\<Union>i. ?C x i) = Pair x -` Q" |
|
232 |
using F sets_into_space[OF `Q \<in> sets (N \<Otimes>\<^isub>M M)`] |
|
233 |
by (auto simp: space_pair_measure) |
|
234 |
finally have "emeasure M (Pair x -` Q) = (\<Sum>i. emeasure M (?C x i))" |
|
235 |
by simp } |
|
236 |
ultimately show ?thesis using `Q \<in> sets (N \<Otimes>\<^isub>M M)` F_sets |
|
237 |
by auto |
|
238 |
qed |
|
239 |
||
240 |
lemma (in sigma_finite_measure) emeasure_pair_measure: |
|
241 |
assumes "X \<in> sets (N \<Otimes>\<^isub>M M)" |
|
242 |
shows "emeasure (N \<Otimes>\<^isub>M M) X = (\<integral>\<^isup>+ x. \<integral>\<^isup>+ y. indicator X (x, y) \<partial>M \<partial>N)" (is "_ = ?\<mu> X") |
|
243 |
proof (rule emeasure_measure_of[OF pair_measure_def]) |
|
244 |
show "positive (sets (N \<Otimes>\<^isub>M M)) ?\<mu>" |
|
245 |
by (auto simp: positive_def positive_integral_positive) |
|
246 |
have eq[simp]: "\<And>A x y. indicator A (x, y) = indicator (Pair x -` A) y" |
|
247 |
by (auto simp: indicator_def) |
|
248 |
show "countably_additive (sets (N \<Otimes>\<^isub>M M)) ?\<mu>" |
|
249 |
proof (rule countably_additiveI) |
|
250 |
fix F :: "nat \<Rightarrow> ('b \<times> 'a) set" assume F: "range F \<subseteq> sets (N \<Otimes>\<^isub>M M)" "disjoint_family F" |
|
251 |
from F have *: "\<And>i. F i \<in> sets (N \<Otimes>\<^isub>M M)" "(\<Union>i. F i) \<in> sets (N \<Otimes>\<^isub>M M)" by auto |
|
252 |
moreover from F have "\<And>i. (\<lambda>x. emeasure M (Pair x -` F i)) \<in> borel_measurable N" |
|
253 |
by (intro measurable_emeasure_Pair) auto |
|
254 |
moreover have "\<And>x. disjoint_family (\<lambda>i. Pair x -` F i)" |
|
255 |
by (intro disjoint_family_on_bisimulation[OF F(2)]) auto |
|
256 |
moreover have "\<And>x. range (\<lambda>i. Pair x -` F i) \<subseteq> sets M" |
|
257 |
using F by (auto simp: sets_Pair1) |
|
258 |
ultimately show "(\<Sum>n. ?\<mu> (F n)) = ?\<mu> (\<Union>i. F i)" |
|
259 |
by (auto simp add: vimage_UN positive_integral_suminf[symmetric] suminf_emeasure subset_eq emeasure_nonneg sets_Pair1 |
|
260 |
intro!: positive_integral_cong positive_integral_indicator[symmetric]) |
|
261 |
qed |
|
262 |
show "{a \<times> b |a b. a \<in> sets N \<and> b \<in> sets M} \<subseteq> Pow (space N \<times> space M)" |
|
263 |
using space_closed[of N] space_closed[of M] by auto |
|
264 |
qed fact |
|
265 |
||
266 |
lemma (in sigma_finite_measure) emeasure_pair_measure_alt: |
|
267 |
assumes X: "X \<in> sets (N \<Otimes>\<^isub>M M)" |
|
268 |
shows "emeasure (N \<Otimes>\<^isub>M M) X = (\<integral>\<^isup>+x. emeasure M (Pair x -` X) \<partial>N)" |
|
269 |
proof - |
|
270 |
have [simp]: "\<And>x y. indicator X (x, y) = indicator (Pair x -` X) y" |
|
271 |
by (auto simp: indicator_def) |
|
272 |
show ?thesis |
|
273 |
using X by (auto intro!: positive_integral_cong simp: emeasure_pair_measure sets_Pair1) |
|
274 |
qed |
|
275 |
||
276 |
lemma (in sigma_finite_measure) emeasure_pair_measure_Times: |
|
277 |
assumes A: "A \<in> sets N" and B: "B \<in> sets M" |
|
278 |
shows "emeasure (N \<Otimes>\<^isub>M M) (A \<times> B) = emeasure N A * emeasure M B" |
|
279 |
proof - |
|
280 |
have "emeasure (N \<Otimes>\<^isub>M M) (A \<times> B) = (\<integral>\<^isup>+x. emeasure M B * indicator A x \<partial>N)" |
|
281 |
using A B by (auto intro!: positive_integral_cong simp: emeasure_pair_measure_alt) |
|
282 |
also have "\<dots> = emeasure M B * emeasure N A" |
|
283 |
using A by (simp add: emeasure_nonneg positive_integral_cmult_indicator) |
|
284 |
finally show ?thesis |
|
285 |
by (simp add: ac_simps) |
|
40859 | 286 |
qed |
287 |
||
47694 | 288 |
subsection {* Binary products of $\sigma$-finite emeasure spaces *} |
40859 | 289 |
|
47694 | 290 |
locale pair_sigma_finite = M1: sigma_finite_measure M1 + M2: sigma_finite_measure M2 |
291 |
for M1 :: "'a measure" and M2 :: "'b measure" |
|
40859 | 292 |
|
47694 | 293 |
lemma (in pair_sigma_finite) measurable_emeasure_Pair1: |
49776 | 294 |
"Q \<in> sets (M1 \<Otimes>\<^isub>M M2) \<Longrightarrow> (\<lambda>x. emeasure M2 (Pair x -` Q)) \<in> borel_measurable M1" |
295 |
using M2.measurable_emeasure_Pair . |
|
40859 | 296 |
|
47694 | 297 |
lemma (in pair_sigma_finite) measurable_emeasure_Pair2: |
298 |
assumes Q: "Q \<in> sets (M1 \<Otimes>\<^isub>M M2)" shows "(\<lambda>y. emeasure M1 ((\<lambda>x. (x, y)) -` Q)) \<in> borel_measurable M2" |
|
40859 | 299 |
proof - |
47694 | 300 |
have "(\<lambda>(x, y). (y, x)) -` Q \<inter> space (M2 \<Otimes>\<^isub>M M1) \<in> sets (M2 \<Otimes>\<^isub>M M1)" |
301 |
using Q measurable_pair_swap' by (auto intro: measurable_sets) |
|
49776 | 302 |
note M1.measurable_emeasure_Pair[OF this] |
47694 | 303 |
moreover have "\<And>y. Pair y -` ((\<lambda>(x, y). (y, x)) -` Q \<inter> space (M2 \<Otimes>\<^isub>M M1)) = (\<lambda>x. (x, y)) -` Q" |
304 |
using Q[THEN sets_into_space] by (auto simp: space_pair_measure) |
|
305 |
ultimately show ?thesis by simp |
|
39088
ca17017c10e6
Measurable on product space is equiv. to measurable components
hoelzl
parents:
39082
diff
changeset
|
306 |
qed |
ca17017c10e6
Measurable on product space is equiv. to measurable components
hoelzl
parents:
39082
diff
changeset
|
307 |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
308 |
lemma (in pair_sigma_finite) sigma_finite_up_in_pair_measure_generator: |
47694 | 309 |
defines "E \<equiv> {A \<times> B | A B. A \<in> sets M1 \<and> B \<in> sets M2}" |
310 |
shows "\<exists>F::nat \<Rightarrow> ('a \<times> 'b) set. range F \<subseteq> E \<and> incseq F \<and> (\<Union>i. F i) = space M1 \<times> space M2 \<and> |
|
311 |
(\<forall>i. emeasure (M1 \<Otimes>\<^isub>M M2) (F i) \<noteq> \<infinity>)" |
|
40859 | 312 |
proof - |
47694 | 313 |
from M1.sigma_finite_incseq guess F1 . note F1 = this |
314 |
from M2.sigma_finite_incseq guess F2 . note F2 = this |
|
315 |
from F1 F2 have space: "space M1 = (\<Union>i. F1 i)" "space M2 = (\<Union>i. F2 i)" by auto |
|
40859 | 316 |
let ?F = "\<lambda>i. F1 i \<times> F2 i" |
47694 | 317 |
show ?thesis |
40859 | 318 |
proof (intro exI[of _ ?F] conjI allI) |
47694 | 319 |
show "range ?F \<subseteq> E" using F1 F2 by (auto simp: E_def) (metis range_subsetD) |
40859 | 320 |
next |
321 |
have "space M1 \<times> space M2 \<subseteq> (\<Union>i. ?F i)" |
|
322 |
proof (intro subsetI) |
|
323 |
fix x assume "x \<in> space M1 \<times> space M2" |
|
324 |
then obtain i j where "fst x \<in> F1 i" "snd x \<in> F2 j" |
|
325 |
by (auto simp: space) |
|
326 |
then have "fst x \<in> F1 (max i j)" "snd x \<in> F2 (max j i)" |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
327 |
using `incseq F1` `incseq F2` unfolding incseq_def |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
328 |
by (force split: split_max)+ |
40859 | 329 |
then have "(fst x, snd x) \<in> F1 (max i j) \<times> F2 (max i j)" |
330 |
by (intro SigmaI) (auto simp add: min_max.sup_commute) |
|
331 |
then show "x \<in> (\<Union>i. ?F i)" by auto |
|
332 |
qed |
|
47694 | 333 |
then show "(\<Union>i. ?F i) = space M1 \<times> space M2" |
334 |
using space by (auto simp: space) |
|
40859 | 335 |
next |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
336 |
fix i show "incseq (\<lambda>i. F1 i \<times> F2 i)" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
337 |
using `incseq F1` `incseq F2` unfolding incseq_Suc_iff by auto |
40859 | 338 |
next |
339 |
fix i |
|
340 |
from F1 F2 have "F1 i \<in> sets M1" "F2 i \<in> sets M2" by auto |
|
47694 | 341 |
with F1 F2 emeasure_nonneg[of M1 "F1 i"] emeasure_nonneg[of M2 "F2 i"] |
342 |
show "emeasure (M1 \<Otimes>\<^isub>M M2) (F1 i \<times> F2 i) \<noteq> \<infinity>" |
|
343 |
by (auto simp add: emeasure_pair_measure_Times) |
|
344 |
qed |
|
345 |
qed |
|
346 |
||
347 |
sublocale pair_sigma_finite \<subseteq> sigma_finite_measure "M1 \<Otimes>\<^isub>M M2" |
|
348 |
proof |
|
349 |
from sigma_finite_up_in_pair_measure_generator guess F :: "nat \<Rightarrow> ('a \<times> 'b) set" .. note F = this |
|
350 |
show "\<exists>F::nat \<Rightarrow> ('a \<times> 'b) set. range F \<subseteq> sets (M1 \<Otimes>\<^isub>M M2) \<and> (\<Union>i. F i) = space (M1 \<Otimes>\<^isub>M M2) \<and> (\<forall>i. emeasure (M1 \<Otimes>\<^isub>M M2) (F i) \<noteq> \<infinity>)" |
|
351 |
proof (rule exI[of _ F], intro conjI) |
|
352 |
show "range F \<subseteq> sets (M1 \<Otimes>\<^isub>M M2)" using F by (auto simp: pair_measure_def) |
|
353 |
show "(\<Union>i. F i) = space (M1 \<Otimes>\<^isub>M M2)" |
|
354 |
using F by (auto simp: space_pair_measure) |
|
355 |
show "\<forall>i. emeasure (M1 \<Otimes>\<^isub>M M2) (F i) \<noteq> \<infinity>" using F by auto |
|
40859 | 356 |
qed |
357 |
qed |
|
358 |
||
47694 | 359 |
lemma sigma_finite_pair_measure: |
360 |
assumes A: "sigma_finite_measure A" and B: "sigma_finite_measure B" |
|
361 |
shows "sigma_finite_measure (A \<Otimes>\<^isub>M B)" |
|
362 |
proof - |
|
363 |
interpret A: sigma_finite_measure A by fact |
|
364 |
interpret B: sigma_finite_measure B by fact |
|
365 |
interpret AB: pair_sigma_finite A B .. |
|
366 |
show ?thesis .. |
|
40859 | 367 |
qed |
39088
ca17017c10e6
Measurable on product space is equiv. to measurable components
hoelzl
parents:
39082
diff
changeset
|
368 |
|
47694 | 369 |
lemma sets_pair_swap: |
370 |
assumes "A \<in> sets (M1 \<Otimes>\<^isub>M M2)" |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
371 |
shows "(\<lambda>(x, y). (y, x)) -` A \<inter> space (M2 \<Otimes>\<^isub>M M1) \<in> sets (M2 \<Otimes>\<^isub>M M1)" |
47694 | 372 |
using measurable_pair_swap' assms by (rule measurable_sets) |
41661 | 373 |
|
47694 | 374 |
lemma (in pair_sigma_finite) distr_pair_swap: |
375 |
"M1 \<Otimes>\<^isub>M M2 = distr (M2 \<Otimes>\<^isub>M M1) (M1 \<Otimes>\<^isub>M M2) (\<lambda>(x, y). (y, x))" (is "?P = ?D") |
|
40859 | 376 |
proof - |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
377 |
from sigma_finite_up_in_pair_measure_generator guess F :: "nat \<Rightarrow> ('a \<times> 'b) set" .. note F = this |
47694 | 378 |
let ?E = "{a \<times> b |a b. a \<in> sets M1 \<and> b \<in> sets M2}" |
379 |
show ?thesis |
|
380 |
proof (rule measure_eqI_generator_eq[OF Int_stable_pair_measure_generator[of M1 M2]]) |
|
381 |
show "?E \<subseteq> Pow (space ?P)" |
|
382 |
using space_closed[of M1] space_closed[of M2] by (auto simp: space_pair_measure) |
|
383 |
show "sets ?P = sigma_sets (space ?P) ?E" |
|
384 |
by (simp add: sets_pair_measure space_pair_measure) |
|
385 |
then show "sets ?D = sigma_sets (space ?P) ?E" |
|
386 |
by simp |
|
387 |
next |
|
49784
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49776
diff
changeset
|
388 |
show "range F \<subseteq> ?E" "(\<Union>i. F i) = space ?P" "\<And>i. emeasure ?P (F i) \<noteq> \<infinity>" |
47694 | 389 |
using F by (auto simp: space_pair_measure) |
390 |
next |
|
391 |
fix X assume "X \<in> ?E" |
|
392 |
then obtain A B where X[simp]: "X = A \<times> B" and A: "A \<in> sets M1" and B: "B \<in> sets M2" by auto |
|
393 |
have "(\<lambda>(y, x). (x, y)) -` X \<inter> space (M2 \<Otimes>\<^isub>M M1) = B \<times> A" |
|
394 |
using sets_into_space[OF A] sets_into_space[OF B] by (auto simp: space_pair_measure) |
|
395 |
with A B show "emeasure (M1 \<Otimes>\<^isub>M M2) X = emeasure ?D X" |
|
49776 | 396 |
by (simp add: M2.emeasure_pair_measure_Times M1.emeasure_pair_measure_Times emeasure_distr |
47694 | 397 |
measurable_pair_swap' ac_simps) |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
398 |
qed |
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
399 |
qed |
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
400 |
|
47694 | 401 |
lemma (in pair_sigma_finite) emeasure_pair_measure_alt2: |
402 |
assumes A: "A \<in> sets (M1 \<Otimes>\<^isub>M M2)" |
|
403 |
shows "emeasure (M1 \<Otimes>\<^isub>M M2) A = (\<integral>\<^isup>+y. emeasure M1 ((\<lambda>x. (x, y)) -` A) \<partial>M2)" |
|
404 |
(is "_ = ?\<nu> A") |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
405 |
proof - |
47694 | 406 |
have [simp]: "\<And>y. (Pair y -` ((\<lambda>(x, y). (y, x)) -` A \<inter> space (M2 \<Otimes>\<^isub>M M1))) = (\<lambda>x. (x, y)) -` A" |
407 |
using sets_into_space[OF A] by (auto simp: space_pair_measure) |
|
408 |
show ?thesis using A |
|
409 |
by (subst distr_pair_swap) |
|
410 |
(simp_all del: vimage_Int add: measurable_sets[OF measurable_pair_swap'] |
|
49776 | 411 |
M1.emeasure_pair_measure_alt emeasure_distr[OF measurable_pair_swap' A]) |
412 |
qed |
|
413 |
||
414 |
lemma (in pair_sigma_finite) AE_pair: |
|
415 |
assumes "AE x in (M1 \<Otimes>\<^isub>M M2). Q x" |
|
416 |
shows "AE x in M1. (AE y in M2. Q (x, y))" |
|
417 |
proof - |
|
418 |
obtain N where N: "N \<in> sets (M1 \<Otimes>\<^isub>M M2)" "emeasure (M1 \<Otimes>\<^isub>M M2) N = 0" "{x\<in>space (M1 \<Otimes>\<^isub>M M2). \<not> Q x} \<subseteq> N" |
|
419 |
using assms unfolding eventually_ae_filter by auto |
|
420 |
show ?thesis |
|
421 |
proof (rule AE_I) |
|
422 |
from N measurable_emeasure_Pair1[OF `N \<in> sets (M1 \<Otimes>\<^isub>M M2)`] |
|
423 |
show "emeasure M1 {x\<in>space M1. emeasure M2 (Pair x -` N) \<noteq> 0} = 0" |
|
424 |
by (auto simp: M2.emeasure_pair_measure_alt positive_integral_0_iff emeasure_nonneg) |
|
425 |
show "{x \<in> space M1. emeasure M2 (Pair x -` N) \<noteq> 0} \<in> sets M1" |
|
426 |
by (intro borel_measurable_ereal_neq_const measurable_emeasure_Pair1 N) |
|
427 |
{ fix x assume "x \<in> space M1" "emeasure M2 (Pair x -` N) = 0" |
|
428 |
have "AE y in M2. Q (x, y)" |
|
429 |
proof (rule AE_I) |
|
430 |
show "emeasure M2 (Pair x -` N) = 0" by fact |
|
431 |
show "Pair x -` N \<in> sets M2" using N(1) by (rule sets_Pair1) |
|
432 |
show "{y \<in> space M2. \<not> Q (x, y)} \<subseteq> Pair x -` N" |
|
433 |
using N `x \<in> space M1` unfolding space_pair_measure by auto |
|
434 |
qed } |
|
435 |
then show "{x \<in> space M1. \<not> (AE y in M2. Q (x, y))} \<subseteq> {x \<in> space M1. emeasure M2 (Pair x -` N) \<noteq> 0}" |
|
436 |
by auto |
|
437 |
qed |
|
438 |
qed |
|
439 |
||
440 |
lemma (in pair_sigma_finite) AE_pair_measure: |
|
441 |
assumes "{x\<in>space (M1 \<Otimes>\<^isub>M M2). P x} \<in> sets (M1 \<Otimes>\<^isub>M M2)" |
|
442 |
assumes ae: "AE x in M1. AE y in M2. P (x, y)" |
|
443 |
shows "AE x in M1 \<Otimes>\<^isub>M M2. P x" |
|
444 |
proof (subst AE_iff_measurable[OF _ refl]) |
|
445 |
show "{x\<in>space (M1 \<Otimes>\<^isub>M M2). \<not> P x} \<in> sets (M1 \<Otimes>\<^isub>M M2)" |
|
446 |
by (rule sets_Collect) fact |
|
447 |
then have "emeasure (M1 \<Otimes>\<^isub>M M2) {x \<in> space (M1 \<Otimes>\<^isub>M M2). \<not> P x} = |
|
448 |
(\<integral>\<^isup>+ x. \<integral>\<^isup>+ y. indicator {x \<in> space (M1 \<Otimes>\<^isub>M M2). \<not> P x} (x, y) \<partial>M2 \<partial>M1)" |
|
449 |
by (simp add: M2.emeasure_pair_measure) |
|
450 |
also have "\<dots> = (\<integral>\<^isup>+ x. \<integral>\<^isup>+ y. 0 \<partial>M2 \<partial>M1)" |
|
451 |
using ae |
|
452 |
apply (safe intro!: positive_integral_cong_AE) |
|
453 |
apply (intro AE_I2) |
|
454 |
apply (safe intro!: positive_integral_cong_AE) |
|
455 |
apply auto |
|
456 |
done |
|
457 |
finally show "emeasure (M1 \<Otimes>\<^isub>M M2) {x \<in> space (M1 \<Otimes>\<^isub>M M2). \<not> P x} = 0" by simp |
|
458 |
qed |
|
459 |
||
460 |
lemma (in pair_sigma_finite) AE_pair_iff: |
|
461 |
"{x\<in>space (M1 \<Otimes>\<^isub>M M2). P (fst x) (snd x)} \<in> sets (M1 \<Otimes>\<^isub>M M2) \<Longrightarrow> |
|
462 |
(AE x in M1. AE y in M2. P x y) \<longleftrightarrow> (AE x in (M1 \<Otimes>\<^isub>M M2). P (fst x) (snd x))" |
|
463 |
using AE_pair[of "\<lambda>x. P (fst x) (snd x)"] AE_pair_measure[of "\<lambda>x. P (fst x) (snd x)"] by auto |
|
464 |
||
465 |
lemma (in pair_sigma_finite) AE_commute: |
|
466 |
assumes P: "{x\<in>space (M1 \<Otimes>\<^isub>M M2). P (fst x) (snd x)} \<in> sets (M1 \<Otimes>\<^isub>M M2)" |
|
467 |
shows "(AE x in M1. AE y in M2. P x y) \<longleftrightarrow> (AE y in M2. AE x in M1. P x y)" |
|
468 |
proof - |
|
469 |
interpret Q: pair_sigma_finite M2 M1 .. |
|
470 |
have [simp]: "\<And>x. (fst (case x of (x, y) \<Rightarrow> (y, x))) = snd x" "\<And>x. (snd (case x of (x, y) \<Rightarrow> (y, x))) = fst x" |
|
471 |
by auto |
|
472 |
have "{x \<in> space (M2 \<Otimes>\<^isub>M M1). P (snd x) (fst x)} = |
|
473 |
(\<lambda>(x, y). (y, x)) -` {x \<in> space (M1 \<Otimes>\<^isub>M M2). P (fst x) (snd x)} \<inter> space (M2 \<Otimes>\<^isub>M M1)" |
|
474 |
by (auto simp: space_pair_measure) |
|
475 |
also have "\<dots> \<in> sets (M2 \<Otimes>\<^isub>M M1)" |
|
476 |
by (intro sets_pair_swap P) |
|
477 |
finally show ?thesis |
|
478 |
apply (subst AE_pair_iff[OF P]) |
|
479 |
apply (subst distr_pair_swap) |
|
480 |
apply (subst AE_distr_iff[OF measurable_pair_swap' P]) |
|
481 |
apply (subst Q.AE_pair_iff) |
|
482 |
apply simp_all |
|
483 |
done |
|
40859 | 484 |
qed |
485 |
||
486 |
section "Fubinis theorem" |
|
487 |
||
488 |
lemma (in pair_sigma_finite) simple_function_cut: |
|
47694 | 489 |
assumes f: "simple_function (M1 \<Otimes>\<^isub>M M2) f" "\<And>x. 0 \<le> f x" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
490 |
shows "(\<lambda>x. \<integral>\<^isup>+y. f (x, y) \<partial>M2) \<in> borel_measurable M1" |
47694 | 491 |
and "(\<integral>\<^isup>+ x. (\<integral>\<^isup>+ y. f (x, y) \<partial>M2) \<partial>M1) = integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) f" |
40859 | 492 |
proof - |
47694 | 493 |
have f_borel: "f \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
494 |
using f(1) by (rule borel_measurable_simple_function) |
47694 | 495 |
let ?F = "\<lambda>z. f -` {z} \<inter> space (M1 \<Otimes>\<^isub>M M2)" |
46731 | 496 |
let ?F' = "\<lambda>x z. Pair x -` ?F z" |
40859 | 497 |
{ fix x assume "x \<in> space M1" |
498 |
have [simp]: "\<And>z y. indicator (?F z) (x, y) = indicator (?F' x z) y" |
|
499 |
by (auto simp: indicator_def) |
|
47694 | 500 |
have "\<And>y. y \<in> space M2 \<Longrightarrow> (x, y) \<in> space (M1 \<Otimes>\<^isub>M M2)" using `x \<in> space M1` |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
501 |
by (simp add: space_pair_measure) |
40859 | 502 |
moreover have "\<And>x z. ?F' x z \<in> sets M2" using f_borel |
47694 | 503 |
by (rule sets_Pair1[OF measurable_sets]) auto |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
504 |
ultimately have "simple_function M2 (\<lambda> y. f (x, y))" |
47694 | 505 |
apply (rule_tac simple_function_cong[THEN iffD2, OF _]) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
506 |
apply (rule simple_function_indicator_representation[OF f(1)]) |
47694 | 507 |
using `x \<in> space M1` by auto } |
40859 | 508 |
note M2_sf = this |
509 |
{ fix x assume x: "x \<in> space M1" |
|
47694 | 510 |
then have "(\<integral>\<^isup>+y. f (x, y) \<partial>M2) = (\<Sum>z\<in>f ` space (M1 \<Otimes>\<^isub>M M2). z * emeasure M2 (?F' x z))" |
511 |
unfolding positive_integral_eq_simple_integral[OF M2_sf[OF x] f(2)] |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
512 |
unfolding simple_integral_def |
40859 | 513 |
proof (safe intro!: setsum_mono_zero_cong_left) |
47694 | 514 |
from f(1) show "finite (f ` space (M1 \<Otimes>\<^isub>M M2))" by (rule simple_functionD) |
40859 | 515 |
next |
47694 | 516 |
fix y assume "y \<in> space M2" then show "f (x, y) \<in> f ` space (M1 \<Otimes>\<^isub>M M2)" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
517 |
using `x \<in> space M1` by (auto simp: space_pair_measure) |
40859 | 518 |
next |
47694 | 519 |
fix x' y assume "(x', y) \<in> space (M1 \<Otimes>\<^isub>M M2)" |
40859 | 520 |
"f (x', y) \<notin> (\<lambda>y. f (x, y)) ` space M2" |
521 |
then have *: "?F' x (f (x', y)) = {}" |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
522 |
by (force simp: space_pair_measure) |
47694 | 523 |
show "f (x', y) * emeasure M2 (?F' x (f (x', y))) = 0" |
40859 | 524 |
unfolding * by simp |
525 |
qed (simp add: vimage_compose[symmetric] comp_def |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
526 |
space_pair_measure) } |
40859 | 527 |
note eq = this |
47694 | 528 |
moreover have "\<And>z. ?F z \<in> sets (M1 \<Otimes>\<^isub>M M2)" |
529 |
by (auto intro!: f_borel borel_measurable_vimage) |
|
530 |
moreover then have "\<And>z. (\<lambda>x. emeasure M2 (?F' x z)) \<in> borel_measurable M1" |
|
531 |
by (auto intro!: measurable_emeasure_Pair1 simp del: vimage_Int) |
|
532 |
moreover have *: "\<And>i x. 0 \<le> emeasure M2 (Pair x -` (f -` {i} \<inter> space (M1 \<Otimes>\<^isub>M M2)))" |
|
533 |
using f(1)[THEN simple_functionD(2)] f(2) by (intro emeasure_nonneg) |
|
534 |
moreover { fix i assume "i \<in> f`space (M1 \<Otimes>\<^isub>M M2)" |
|
535 |
with * have "\<And>x. 0 \<le> i * emeasure M2 (Pair x -` (f -` {i} \<inter> space (M1 \<Otimes>\<^isub>M M2)))" |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
536 |
using f(2) by auto } |
40859 | 537 |
ultimately |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
538 |
show "(\<lambda>x. \<integral>\<^isup>+y. f (x, y) \<partial>M2) \<in> borel_measurable M1" |
47694 | 539 |
and "(\<integral>\<^isup>+ x. (\<integral>\<^isup>+ y. f (x, y) \<partial>M2) \<partial>M1) = integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) f" using f(2) |
540 |
by (auto simp del: vimage_Int cong: measurable_cong intro!: setsum_cong |
|
541 |
simp add: positive_integral_setsum simple_integral_def |
|
542 |
positive_integral_cmult |
|
543 |
positive_integral_cong[OF eq] |
|
40859 | 544 |
positive_integral_eq_simple_integral[OF f] |
49776 | 545 |
M2.emeasure_pair_measure_alt[symmetric]) |
40859 | 546 |
qed |
547 |
||
548 |
lemma (in pair_sigma_finite) positive_integral_fst_measurable: |
|
47694 | 549 |
assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
550 |
shows "(\<lambda>x. \<integral>\<^isup>+ y. f (x, y) \<partial>M2) \<in> borel_measurable M1" |
40859 | 551 |
(is "?C f \<in> borel_measurable M1") |
47694 | 552 |
and "(\<integral>\<^isup>+ x. (\<integral>\<^isup>+ y. f (x, y) \<partial>M2) \<partial>M1) = integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) f" |
40859 | 553 |
proof - |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
554 |
from borel_measurable_implies_simple_function_sequence'[OF f] guess F . note F = this |
47694 | 555 |
then have F_borel: "\<And>i. F i \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
40859 | 556 |
by (auto intro: borel_measurable_simple_function) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
557 |
note sf = simple_function_cut[OF F(1,5)] |
41097
a1abfa4e2b44
use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents:
41096
diff
changeset
|
558 |
then have "(\<lambda>x. SUP i. ?C (F i) x) \<in> borel_measurable M1" |
a1abfa4e2b44
use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents:
41096
diff
changeset
|
559 |
using F(1) by auto |
40859 | 560 |
moreover |
561 |
{ fix x assume "x \<in> space M1" |
|
47694 | 562 |
from F measurable_Pair2[OF F_borel `x \<in> space M1`] |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
563 |
have "(\<integral>\<^isup>+y. (SUP i. F i (x, y)) \<partial>M2) = (SUP i. ?C (F i) x)" |
47694 | 564 |
by (intro positive_integral_monotone_convergence_SUP) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
565 |
(auto simp: incseq_Suc_iff le_fun_def) |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
566 |
then have "(SUP i. ?C (F i) x) = ?C f x" |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
567 |
unfolding F(4) positive_integral_max_0 by simp } |
40859 | 568 |
note SUPR_C = this |
569 |
ultimately show "?C f \<in> borel_measurable M1" |
|
41097
a1abfa4e2b44
use SUPR_ and INFI_apply instead of SUPR_, INFI_fun_expand
hoelzl
parents:
41096
diff
changeset
|
570 |
by (simp cong: measurable_cong) |
47694 | 571 |
have "(\<integral>\<^isup>+x. (SUP i. F i x) \<partial>(M1 \<Otimes>\<^isub>M M2)) = (SUP i. integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) (F i))" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
572 |
using F_borel F |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
573 |
by (intro positive_integral_monotone_convergence_SUP) auto |
47694 | 574 |
also have "(SUP i. integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) (F i)) = (SUP i. \<integral>\<^isup>+ x. (\<integral>\<^isup>+ y. F i (x, y) \<partial>M2) \<partial>M1)" |
40859 | 575 |
unfolding sf(2) by simp |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
576 |
also have "\<dots> = \<integral>\<^isup>+ x. (SUP i. \<integral>\<^isup>+ y. F i (x, y) \<partial>M2) \<partial>M1" using F sf(1) |
47694 | 577 |
by (intro positive_integral_monotone_convergence_SUP[symmetric]) |
578 |
(auto intro!: positive_integral_mono positive_integral_positive |
|
579 |
simp: incseq_Suc_iff le_fun_def) |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
580 |
also have "\<dots> = \<integral>\<^isup>+ x. (\<integral>\<^isup>+ y. (SUP i. F i (x, y)) \<partial>M2) \<partial>M1" |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
581 |
using F_borel F(2,5) |
47694 | 582 |
by (auto intro!: positive_integral_cong positive_integral_monotone_convergence_SUP[symmetric] measurable_Pair2 |
583 |
simp: incseq_Suc_iff le_fun_def) |
|
584 |
finally show "(\<integral>\<^isup>+ x. (\<integral>\<^isup>+ y. f (x, y) \<partial>M2) \<partial>M1) = integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) f" |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
585 |
using F by (simp add: positive_integral_max_0) |
40859 | 586 |
qed |
587 |
||
47694 | 588 |
lemma (in pair_sigma_finite) positive_integral_snd_measurable: |
589 |
assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
|
590 |
shows "(\<integral>\<^isup>+ y. (\<integral>\<^isup>+ x. f (x, y) \<partial>M1) \<partial>M2) = integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) f" |
|
41661 | 591 |
proof - |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
592 |
interpret Q: pair_sigma_finite M2 M1 by default |
47694 | 593 |
note measurable_pair_swap[OF f] |
40859 | 594 |
from Q.positive_integral_fst_measurable[OF this] |
47694 | 595 |
have "(\<integral>\<^isup>+ y. (\<integral>\<^isup>+ x. f (x, y) \<partial>M1) \<partial>M2) = (\<integral>\<^isup>+ (x, y). f (y, x) \<partial>(M2 \<Otimes>\<^isub>M M1))" |
40859 | 596 |
by simp |
47694 | 597 |
also have "(\<integral>\<^isup>+ (x, y). f (y, x) \<partial>(M2 \<Otimes>\<^isub>M M1)) = integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) f" |
598 |
by (subst distr_pair_swap) |
|
599 |
(auto simp: positive_integral_distr[OF measurable_pair_swap' f] intro!: positive_integral_cong) |
|
40859 | 600 |
finally show ?thesis . |
601 |
qed |
|
602 |
||
603 |
lemma (in pair_sigma_finite) Fubini: |
|
47694 | 604 |
assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
605 |
shows "(\<integral>\<^isup>+ y. (\<integral>\<^isup>+ x. f (x, y) \<partial>M1) \<partial>M2) = (\<integral>\<^isup>+ x. (\<integral>\<^isup>+ y. f (x, y) \<partial>M2) \<partial>M1)" |
40859 | 606 |
unfolding positive_integral_snd_measurable[OF assms] |
607 |
unfolding positive_integral_fst_measurable[OF assms] .. |
|
608 |
||
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
609 |
lemma (in pair_sigma_finite) integrable_product_swap: |
47694 | 610 |
assumes "integrable (M1 \<Otimes>\<^isub>M M2) f" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
611 |
shows "integrable (M2 \<Otimes>\<^isub>M M1) (\<lambda>(x,y). f (y,x))" |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
612 |
proof - |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
613 |
interpret Q: pair_sigma_finite M2 M1 by default |
41661 | 614 |
have *: "(\<lambda>(x,y). f (y,x)) = (\<lambda>x. f (case x of (x,y)\<Rightarrow>(y,x)))" by (auto simp: fun_eq_iff) |
615 |
show ?thesis unfolding * |
|
47694 | 616 |
by (rule integrable_distr[OF measurable_pair_swap']) |
617 |
(simp add: distr_pair_swap[symmetric] assms) |
|
41661 | 618 |
qed |
619 |
||
620 |
lemma (in pair_sigma_finite) integrable_product_swap_iff: |
|
47694 | 621 |
"integrable (M2 \<Otimes>\<^isub>M M1) (\<lambda>(x,y). f (y,x)) \<longleftrightarrow> integrable (M1 \<Otimes>\<^isub>M M2) f" |
41661 | 622 |
proof - |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
623 |
interpret Q: pair_sigma_finite M2 M1 by default |
41661 | 624 |
from Q.integrable_product_swap[of "\<lambda>(x,y). f (y,x)"] integrable_product_swap[of f] |
625 |
show ?thesis by auto |
|
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
626 |
qed |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
627 |
|
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
628 |
lemma (in pair_sigma_finite) integral_product_swap: |
47694 | 629 |
assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
630 |
shows "(\<integral>(x,y). f (y,x) \<partial>(M2 \<Otimes>\<^isub>M M1)) = integral\<^isup>L (M1 \<Otimes>\<^isub>M M2) f" |
|
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
631 |
proof - |
41661 | 632 |
have *: "(\<lambda>(x,y). f (y,x)) = (\<lambda>x. f (case x of (x,y)\<Rightarrow>(y,x)))" by (auto simp: fun_eq_iff) |
47694 | 633 |
show ?thesis unfolding * |
634 |
by (simp add: integral_distr[symmetric, OF measurable_pair_swap' f] distr_pair_swap[symmetric]) |
|
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
635 |
qed |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
636 |
|
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
637 |
lemma (in pair_sigma_finite) integrable_fst_measurable: |
47694 | 638 |
assumes f: "integrable (M1 \<Otimes>\<^isub>M M2) f" |
639 |
shows "AE x in M1. integrable M2 (\<lambda> y. f (x, y))" (is "?AE") |
|
640 |
and "(\<integral>x. (\<integral>y. f (x, y) \<partial>M2) \<partial>M1) = integral\<^isup>L (M1 \<Otimes>\<^isub>M M2) f" (is "?INT") |
|
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
641 |
proof - |
47694 | 642 |
have f_borel: "f \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
643 |
using f by auto |
|
46731 | 644 |
let ?pf = "\<lambda>x. ereal (f x)" and ?nf = "\<lambda>x. ereal (- f x)" |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
645 |
have |
47694 | 646 |
borel: "?nf \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)""?pf \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" and |
647 |
int: "integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) ?nf \<noteq> \<infinity>" "integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) ?pf \<noteq> \<infinity>" |
|
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
648 |
using assms by auto |
43920 | 649 |
have "(\<integral>\<^isup>+x. (\<integral>\<^isup>+y. ereal (f (x, y)) \<partial>M2) \<partial>M1) \<noteq> \<infinity>" |
650 |
"(\<integral>\<^isup>+x. (\<integral>\<^isup>+y. ereal (- f (x, y)) \<partial>M2) \<partial>M1) \<noteq> \<infinity>" |
|
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
651 |
using borel[THEN positive_integral_fst_measurable(1)] int |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
652 |
unfolding borel[THEN positive_integral_fst_measurable(2)] by simp_all |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
653 |
with borel[THEN positive_integral_fst_measurable(1)] |
43920 | 654 |
have AE_pos: "AE x in M1. (\<integral>\<^isup>+y. ereal (f (x, y)) \<partial>M2) \<noteq> \<infinity>" |
655 |
"AE x in M1. (\<integral>\<^isup>+y. ereal (- f (x, y)) \<partial>M2) \<noteq> \<infinity>" |
|
47694 | 656 |
by (auto intro!: positive_integral_PInf_AE ) |
43920 | 657 |
then have AE: "AE x in M1. \<bar>\<integral>\<^isup>+y. ereal (f (x, y)) \<partial>M2\<bar> \<noteq> \<infinity>" |
658 |
"AE x in M1. \<bar>\<integral>\<^isup>+y. ereal (- f (x, y)) \<partial>M2\<bar> \<noteq> \<infinity>" |
|
47694 | 659 |
by (auto simp: positive_integral_positive) |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
660 |
from AE_pos show ?AE using assms |
47694 | 661 |
by (simp add: measurable_Pair2[OF f_borel] integrable_def) |
43920 | 662 |
{ fix f have "(\<integral>\<^isup>+ x. - \<integral>\<^isup>+ y. ereal (f x y) \<partial>M2 \<partial>M1) = (\<integral>\<^isup>+x. 0 \<partial>M1)" |
47694 | 663 |
using positive_integral_positive |
664 |
by (intro positive_integral_cong_pos) (auto simp: ereal_uminus_le_reorder) |
|
43920 | 665 |
then have "(\<integral>\<^isup>+ x. - \<integral>\<^isup>+ y. ereal (f x y) \<partial>M2 \<partial>M1) = 0" by simp } |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
666 |
note this[simp] |
47694 | 667 |
{ fix f assume borel: "(\<lambda>x. ereal (f x)) \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
668 |
and int: "integral\<^isup>P (M1 \<Otimes>\<^isub>M M2) (\<lambda>x. ereal (f x)) \<noteq> \<infinity>" |
|
669 |
and AE: "AE x in M1. (\<integral>\<^isup>+y. ereal (f (x, y)) \<partial>M2) \<noteq> \<infinity>" |
|
43920 | 670 |
have "integrable M1 (\<lambda>x. real (\<integral>\<^isup>+y. ereal (f (x, y)) \<partial>M2))" (is "integrable M1 ?f") |
41705 | 671 |
proof (intro integrable_def[THEN iffD2] conjI) |
672 |
show "?f \<in> borel_measurable M1" |
|
47694 | 673 |
using borel by (auto intro!: positive_integral_fst_measurable) |
43920 | 674 |
have "(\<integral>\<^isup>+x. ereal (?f x) \<partial>M1) = (\<integral>\<^isup>+x. (\<integral>\<^isup>+y. ereal (f (x, y)) \<partial>M2) \<partial>M1)" |
47694 | 675 |
using AE positive_integral_positive[of M2] |
676 |
by (auto intro!: positive_integral_cong_AE simp: ereal_real) |
|
43920 | 677 |
then show "(\<integral>\<^isup>+x. ereal (?f x) \<partial>M1) \<noteq> \<infinity>" |
41705 | 678 |
using positive_integral_fst_measurable[OF borel] int by simp |
43920 | 679 |
have "(\<integral>\<^isup>+x. ereal (- ?f x) \<partial>M1) = (\<integral>\<^isup>+x. 0 \<partial>M1)" |
47694 | 680 |
by (intro positive_integral_cong_pos) |
681 |
(simp add: positive_integral_positive real_of_ereal_pos) |
|
43920 | 682 |
then show "(\<integral>\<^isup>+x. ereal (- ?f x) \<partial>M1) \<noteq> \<infinity>" by simp |
41705 | 683 |
qed } |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
684 |
with this[OF borel(1) int(1) AE_pos(2)] this[OF borel(2) int(2) AE_pos(1)] |
41705 | 685 |
show ?INT |
47694 | 686 |
unfolding lebesgue_integral_def[of "M1 \<Otimes>\<^isub>M M2"] lebesgue_integral_def[of M2] |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
687 |
borel[THEN positive_integral_fst_measurable(2), symmetric] |
47694 | 688 |
using AE[THEN integral_real] |
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41831
diff
changeset
|
689 |
by simp |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
690 |
qed |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
691 |
|
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
692 |
lemma (in pair_sigma_finite) integrable_snd_measurable: |
47694 | 693 |
assumes f: "integrable (M1 \<Otimes>\<^isub>M M2) f" |
694 |
shows "AE y in M2. integrable M1 (\<lambda>x. f (x, y))" (is "?AE") |
|
695 |
and "(\<integral>y. (\<integral>x. f (x, y) \<partial>M1) \<partial>M2) = integral\<^isup>L (M1 \<Otimes>\<^isub>M M2) f" (is "?INT") |
|
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
696 |
proof - |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
697 |
interpret Q: pair_sigma_finite M2 M1 by default |
47694 | 698 |
have Q_int: "integrable (M2 \<Otimes>\<^isub>M M1) (\<lambda>(x, y). f (y, x))" |
41661 | 699 |
using f unfolding integrable_product_swap_iff . |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
700 |
show ?INT |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
701 |
using Q.integrable_fst_measurable(2)[OF Q_int] |
47694 | 702 |
using integral_product_swap[of f] f by auto |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
703 |
show ?AE |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
704 |
using Q.integrable_fst_measurable(1)[OF Q_int] |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
705 |
by simp |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
706 |
qed |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
707 |
|
47694 | 708 |
lemma (in pair_sigma_finite) positive_integral_fst_measurable': |
709 |
assumes f: "(\<lambda>x. f (fst x) (snd x)) \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
|
710 |
shows "(\<lambda>x. \<integral>\<^isup>+ y. f x y \<partial>M2) \<in> borel_measurable M1" |
|
711 |
using positive_integral_fst_measurable(1)[OF f] by simp |
|
712 |
||
713 |
lemma (in pair_sigma_finite) integral_fst_measurable: |
|
714 |
"(\<lambda>x. f (fst x) (snd x)) \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2) \<Longrightarrow> (\<lambda>x. \<integral> y. f x y \<partial>M2) \<in> borel_measurable M1" |
|
715 |
by (auto simp: lebesgue_integral_def intro!: borel_measurable_diff positive_integral_fst_measurable') |
|
716 |
||
717 |
lemma (in pair_sigma_finite) positive_integral_snd_measurable': |
|
718 |
assumes f: "(\<lambda>x. f (fst x) (snd x)) \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
|
719 |
shows "(\<lambda>y. \<integral>\<^isup>+ x. f x y \<partial>M1) \<in> borel_measurable M2" |
|
720 |
proof - |
|
721 |
interpret Q: pair_sigma_finite M2 M1 .. |
|
722 |
show ?thesis |
|
723 |
using measurable_pair_swap[OF f] |
|
724 |
by (intro Q.positive_integral_fst_measurable') (simp add: split_beta') |
|
725 |
qed |
|
726 |
||
727 |
lemma (in pair_sigma_finite) integral_snd_measurable: |
|
728 |
"(\<lambda>x. f (fst x) (snd x)) \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2) \<Longrightarrow> (\<lambda>y. \<integral> x. f x y \<partial>M1) \<in> borel_measurable M2" |
|
729 |
by (auto simp: lebesgue_integral_def intro!: borel_measurable_diff positive_integral_snd_measurable') |
|
730 |
||
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
731 |
lemma (in pair_sigma_finite) Fubini_integral: |
47694 | 732 |
assumes f: "integrable (M1 \<Otimes>\<^isub>M M2) f" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
733 |
shows "(\<integral>y. (\<integral>x. f (x, y) \<partial>M1) \<partial>M2) = (\<integral>x. (\<integral>y. f (x, y) \<partial>M2) \<partial>M1)" |
41026
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
734 |
unfolding integrable_snd_measurable[OF assms] |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
735 |
unfolding integrable_fst_measurable[OF assms] .. |
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
hoelzl
parents:
41023
diff
changeset
|
736 |
|
47694 | 737 |
section {* Products on counting spaces, densities and distributions *} |
40859 | 738 |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41661
diff
changeset
|
739 |
lemma sigma_sets_pair_measure_generator_finite: |
38656 | 740 |
assumes "finite A" and "finite B" |
47694 | 741 |
shows "sigma_sets (A \<times> B) { a \<times> b | a b. a \<subseteq> A \<and> b \<subseteq> B} = Pow (A \<times> B)" |
40859 | 742 |
(is "sigma_sets ?prod ?sets = _") |
38656 | 743 |
proof safe |
744 |
have fin: "finite (A \<times> B)" using assms by (rule finite_cartesian_product) |
|
745 |
fix x assume subset: "x \<subseteq> A \<times> B" |
|
746 |
hence "finite x" using fin by (rule finite_subset) |
|
40859 | 747 |
from this subset show "x \<in> sigma_sets ?prod ?sets" |
38656 | 748 |
proof (induct x) |
749 |
case empty show ?case by (rule sigma_sets.Empty) |
|
750 |
next |
|
751 |
case (insert a x) |
|
47694 | 752 |
hence "{a} \<in> sigma_sets ?prod ?sets" by auto |
38656 | 753 |
moreover have "x \<in> sigma_sets ?prod ?sets" using insert by auto |
754 |
ultimately show ?case unfolding insert_is_Un[of a x] by (rule sigma_sets_Un) |
|
755 |
qed |
|
756 |
next |
|
757 |
fix x a b |
|
40859 | 758 |
assume "x \<in> sigma_sets ?prod ?sets" and "(a, b) \<in> x" |
38656 | 759 |
from sigma_sets_into_sp[OF _ this(1)] this(2) |
40859 | 760 |
show "a \<in> A" and "b \<in> B" by auto |
35833 | 761 |
qed |
762 |
||
47694 | 763 |
lemma pair_measure_count_space: |
764 |
assumes A: "finite A" and B: "finite B" |
|
765 |
shows "count_space A \<Otimes>\<^isub>M count_space B = count_space (A \<times> B)" (is "?P = ?C") |
|
766 |
proof (rule measure_eqI) |
|
767 |
interpret A: finite_measure "count_space A" by (rule finite_measure_count_space) fact |
|
768 |
interpret B: finite_measure "count_space B" by (rule finite_measure_count_space) fact |
|
769 |
interpret P: pair_sigma_finite "count_space A" "count_space B" by default |
|
770 |
show eq: "sets ?P = sets ?C" |
|
771 |
by (simp add: sets_pair_measure sigma_sets_pair_measure_generator_finite A B) |
|
772 |
fix X assume X: "X \<in> sets ?P" |
|
773 |
with eq have X_subset: "X \<subseteq> A \<times> B" by simp |
|
774 |
with A B have fin_Pair: "\<And>x. finite (Pair x -` X)" |
|
775 |
by (intro finite_subset[OF _ B]) auto |
|
776 |
have fin_X: "finite X" using X_subset by (rule finite_subset) (auto simp: A B) |
|
777 |
show "emeasure ?P X = emeasure ?C X" |
|
49776 | 778 |
apply (subst B.emeasure_pair_measure_alt[OF X]) |
47694 | 779 |
apply (subst emeasure_count_space) |
780 |
using X_subset apply auto [] |
|
781 |
apply (simp add: fin_Pair emeasure_count_space X_subset fin_X) |
|
782 |
apply (subst positive_integral_count_space) |
|
783 |
using A apply simp |
|
784 |
apply (simp del: real_of_nat_setsum add: real_of_nat_setsum[symmetric]) |
|
785 |
apply (subst card_gt_0_iff) |
|
786 |
apply (simp add: fin_Pair) |
|
787 |
apply (subst card_SigmaI[symmetric]) |
|
788 |
using A apply simp |
|
789 |
using fin_Pair apply simp |
|
790 |
using X_subset apply (auto intro!: arg_cong[where f=card]) |
|
791 |
done |
|
45777
c36637603821
remove unnecessary sublocale instantiations in HOL-Probability (for clarity and speedup); remove Infinite_Product_Measure.product_prob_space which was a duplicate of Probability_Measure.product_prob_space
hoelzl
parents:
44890
diff
changeset
|
792 |
qed |
35833 | 793 |
|
47694 | 794 |
lemma pair_measure_density: |
795 |
assumes f: "f \<in> borel_measurable M1" "AE x in M1. 0 \<le> f x" |
|
796 |
assumes g: "g \<in> borel_measurable M2" "AE x in M2. 0 \<le> g x" |
|
797 |
assumes "sigma_finite_measure M1" "sigma_finite_measure M2" |
|
798 |
assumes "sigma_finite_measure (density M1 f)" "sigma_finite_measure (density M2 g)" |
|
799 |
shows "density M1 f \<Otimes>\<^isub>M density M2 g = density (M1 \<Otimes>\<^isub>M M2) (\<lambda>(x,y). f x * g y)" (is "?L = ?R") |
|
800 |
proof (rule measure_eqI) |
|
801 |
interpret M1: sigma_finite_measure M1 by fact |
|
802 |
interpret M2: sigma_finite_measure M2 by fact |
|
803 |
interpret D1: sigma_finite_measure "density M1 f" by fact |
|
804 |
interpret D2: sigma_finite_measure "density M2 g" by fact |
|
805 |
interpret L: pair_sigma_finite "density M1 f" "density M2 g" .. |
|
806 |
interpret R: pair_sigma_finite M1 M2 .. |
|
807 |
||
808 |
fix A assume A: "A \<in> sets ?L" |
|
809 |
then have indicator_eq: "\<And>x y. indicator A (x, y) = indicator (Pair x -` A) y" |
|
810 |
and Pair_A: "\<And>x. Pair x -` A \<in> sets M2" |
|
811 |
by (auto simp: indicator_def sets_Pair1) |
|
812 |
have f_fst: "(\<lambda>p. f (fst p)) \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
|
813 |
using measurable_comp[OF measurable_fst f(1)] by (simp add: comp_def) |
|
814 |
have g_snd: "(\<lambda>p. g (snd p)) \<in> borel_measurable (M1 \<Otimes>\<^isub>M M2)" |
|
815 |
using measurable_comp[OF measurable_snd g(1)] by (simp add: comp_def) |
|
816 |
have "(\<lambda>x. \<integral>\<^isup>+ y. g (snd (x, y)) * indicator A (x, y) \<partial>M2) \<in> borel_measurable M1" |
|
817 |
using g_snd Pair_A A by (intro R.positive_integral_fst_measurable) auto |
|
818 |
then have int_g: "(\<lambda>x. \<integral>\<^isup>+ y. g y * indicator A (x, y) \<partial>M2) \<in> borel_measurable M1" |
|
819 |
by simp |
|
38656 | 820 |
|
47694 | 821 |
show "emeasure ?L A = emeasure ?R A" |
49776 | 822 |
apply (subst D2.emeasure_pair_measure[OF A]) |
47694 | 823 |
apply (subst emeasure_density) |
824 |
using f_fst g_snd apply (simp add: split_beta') |
|
825 |
using A apply simp |
|
826 |
apply (subst positive_integral_density[OF g]) |
|
827 |
apply (simp add: indicator_eq Pair_A) |
|
828 |
apply (subst positive_integral_density[OF f]) |
|
829 |
apply (rule int_g) |
|
830 |
apply (subst R.positive_integral_fst_measurable(2)[symmetric]) |
|
831 |
using f g A Pair_A f_fst g_snd |
|
832 |
apply (auto intro!: positive_integral_cong_AE R.measurable_emeasure_Pair1 |
|
833 |
simp: positive_integral_cmult indicator_eq split_beta') |
|
834 |
apply (intro AE_I2 impI) |
|
835 |
apply (subst mult_assoc) |
|
836 |
apply (subst positive_integral_cmult) |
|
837 |
apply auto |
|
838 |
done |
|
839 |
qed simp |
|
840 |
||
841 |
lemma sigma_finite_measure_distr: |
|
842 |
assumes "sigma_finite_measure (distr M N f)" and f: "f \<in> measurable M N" |
|
843 |
shows "sigma_finite_measure M" |
|
40859 | 844 |
proof - |
47694 | 845 |
interpret sigma_finite_measure "distr M N f" by fact |
846 |
from sigma_finite_disjoint guess A . note A = this |
|
847 |
show ?thesis |
|
848 |
proof (unfold_locales, intro conjI exI allI) |
|
849 |
show "range (\<lambda>i. f -` A i \<inter> space M) \<subseteq> sets M" |
|
850 |
using A f by (auto intro!: measurable_sets) |
|
851 |
show "(\<Union>i. f -` A i \<inter> space M) = space M" |
|
852 |
using A(1) A(2)[symmetric] f by (auto simp: measurable_def Pi_def) |
|
853 |
fix i show "emeasure M (f -` A i \<inter> space M) \<noteq> \<infinity>" |
|
854 |
using f A(1,2) A(3)[of i] by (simp add: emeasure_distr subset_eq) |
|
855 |
qed |
|
38656 | 856 |
qed |
857 |
||
47694 | 858 |
lemma measurable_cong': |
859 |
assumes sets: "sets M = sets M'" "sets N = sets N'" |
|
860 |
shows "measurable M N = measurable M' N'" |
|
861 |
using sets[THEN sets_eq_imp_space_eq] sets by (simp add: measurable_def) |
|
38656 | 862 |
|
47694 | 863 |
lemma pair_measure_distr: |
864 |
assumes f: "f \<in> measurable M S" and g: "g \<in> measurable N T" |
|
865 |
assumes "sigma_finite_measure (distr M S f)" "sigma_finite_measure (distr N T g)" |
|
866 |
shows "distr M S f \<Otimes>\<^isub>M distr N T g = distr (M \<Otimes>\<^isub>M N) (S \<Otimes>\<^isub>M T) (\<lambda>(x, y). (f x, g y))" (is "?P = ?D") |
|
867 |
proof (rule measure_eqI) |
|
868 |
show "sets ?P = sets ?D" |
|
869 |
by simp |
|
870 |
interpret S: sigma_finite_measure "distr M S f" by fact |
|
871 |
interpret T: sigma_finite_measure "distr N T g" by fact |
|
872 |
interpret ST: pair_sigma_finite "distr M S f" "distr N T g" .. |
|
873 |
interpret M: sigma_finite_measure M by (rule sigma_finite_measure_distr) fact+ |
|
874 |
interpret N: sigma_finite_measure N by (rule sigma_finite_measure_distr) fact+ |
|
875 |
interpret MN: pair_sigma_finite M N .. |
|
876 |
interpret SN: pair_sigma_finite "distr M S f" N .. |
|
877 |
have [simp]: |
|
878 |
"\<And>f g. fst \<circ> (\<lambda>(x, y). (f x, g y)) = f \<circ> fst" "\<And>f g. snd \<circ> (\<lambda>(x, y). (f x, g y)) = g \<circ> snd" |
|
879 |
by auto |
|
880 |
then have fg: "(\<lambda>(x, y). (f x, g y)) \<in> measurable (M \<Otimes>\<^isub>M N) (S \<Otimes>\<^isub>M T)" |
|
881 |
using measurable_comp[OF measurable_fst f] measurable_comp[OF measurable_snd g] |
|
882 |
by (auto simp: measurable_pair_iff) |
|
883 |
fix A assume A: "A \<in> sets ?P" |
|
884 |
then have "emeasure ?P A = (\<integral>\<^isup>+x. emeasure (distr N T g) (Pair x -` A) \<partial>distr M S f)" |
|
49776 | 885 |
by (rule T.emeasure_pair_measure_alt) |
47694 | 886 |
also have "\<dots> = (\<integral>\<^isup>+x. emeasure N (g -` (Pair x -` A) \<inter> space N) \<partial>distr M S f)" |
887 |
using g A by (simp add: sets_Pair1 emeasure_distr) |
|
888 |
also have "\<dots> = (\<integral>\<^isup>+x. emeasure N (g -` (Pair (f x) -` A) \<inter> space N) \<partial>M)" |
|
889 |
using f g A ST.measurable_emeasure_Pair1[OF A] |
|
890 |
by (intro positive_integral_distr) (auto simp add: sets_Pair1 emeasure_distr) |
|
891 |
also have "\<dots> = (\<integral>\<^isup>+x. emeasure N (Pair x -` ((\<lambda>(x, y). (f x, g y)) -` A \<inter> space (M \<Otimes>\<^isub>M N))) \<partial>M)" |
|
892 |
by (intro positive_integral_cong arg_cong2[where f=emeasure]) (auto simp: space_pair_measure) |
|
893 |
also have "\<dots> = emeasure (M \<Otimes>\<^isub>M N) ((\<lambda>(x, y). (f x, g y)) -` A \<inter> space (M \<Otimes>\<^isub>M N))" |
|
49776 | 894 |
using fg by (intro N.emeasure_pair_measure_alt[symmetric] measurable_sets[OF _ A]) |
47694 | 895 |
(auto cong: measurable_cong') |
896 |
also have "\<dots> = emeasure ?D A" |
|
897 |
using fg A by (subst emeasure_distr) auto |
|
898 |
finally show "emeasure ?P A = emeasure ?D A" . |
|
45777
c36637603821
remove unnecessary sublocale instantiations in HOL-Probability (for clarity and speedup); remove Infinite_Product_Measure.product_prob_space which was a duplicate of Probability_Measure.product_prob_space
hoelzl
parents:
44890
diff
changeset
|
899 |
qed |
39097 | 900 |
|
40859 | 901 |
end |