| author | Andreas Lochbihler <mail@andreas-lochbihler.de> | 
| Sun, 31 Jan 2021 12:10:20 +0100 | |
| changeset 73213 | bb35f7f60d6c | 
| parent 70136 | f03a01a18c6e | 
| child 74362 | 0135a0c77b64 | 
| permissions | -rw-r--r-- | 
| 63627 | 1 | (* Title: HOL/Analysis/Binary_Product_Measure.thy | 
| 42067 | 2 | Author: Johannes Hölzl, TU München | 
| 3 | *) | |
| 4 | ||
| 69722 
b5163b2132c5
minor tagging updates in 13 theories
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69683diff
changeset | 5 | section \<open>Binary Product Measure\<close> | 
| 42067 | 6 | |
| 42146 
5b52c6a9c627
split Product_Measure into Binary_Product_Measure and Finite_Product_Measure
 hoelzl parents: 
42067diff
changeset | 7 | theory Binary_Product_Measure | 
| 56993 
e5366291d6aa
introduce Bochner integral: generalizes Lebesgue integral from real-valued function to functions on real-normed vector spaces
 hoelzl parents: 
54863diff
changeset | 8 | imports Nonnegative_Lebesgue_Integration | 
| 35833 | 9 | begin | 
| 10 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 11 | lemma Pair_vimage_times[simp]: "Pair x -` (A \<times> B) = (if x \<in> A then B else {})"
 | 
| 40859 | 12 | by auto | 
| 13 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 14 | lemma rev_Pair_vimage_times[simp]: "(\<lambda>x. (x, y)) -` (A \<times> B) = (if y \<in> B then A else {})"
 | 
| 40859 | 15 | by auto | 
| 16 | ||
| 69683 | 17 | subsection "Binary products" | 
| 40859 | 18 | |
| 70136 | 19 | definition\<^marker>\<open>tag important\<close> pair_measure (infixr "\<Otimes>\<^sub>M" 80) where | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 20 | "A \<Otimes>\<^sub>M B = measure_of (space A \<times> space B) | 
| 47694 | 21 |       {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}
 | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 22 | (\<lambda>X. \<integral>\<^sup>+x. (\<integral>\<^sup>+y. indicator X (x,y) \<partial>B) \<partial>A)" | 
| 40859 | 23 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 24 | lemma pair_measure_closed: "{a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B} \<subseteq> Pow (space A \<times> space B)"
 | 
| 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 25 | using sets.space_closed[of A] sets.space_closed[of B] by auto | 
| 49789 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 26 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 27 | lemma space_pair_measure: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 28 | "space (A \<Otimes>\<^sub>M B) = space A \<times> space B" | 
| 49789 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 29 | unfolding pair_measure_def using pair_measure_closed[of A B] | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 30 | by (rule space_measure_of) | 
| 47694 | 31 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 32 | lemma SIGMA_Collect_eq: "(SIGMA x:space M. {y\<in>space N. P x y}) = {x\<in>space (M \<Otimes>\<^sub>M N). P (fst x) (snd x)}"
 | 
| 59000 | 33 | by (auto simp: space_pair_measure) | 
| 34 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 35 | lemma sets_pair_measure: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 36 |   "sets (A \<Otimes>\<^sub>M B) = sigma_sets (space A \<times> space B) {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}"
 | 
| 49789 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 37 | unfolding pair_measure_def using pair_measure_closed[of A B] | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 38 | by (rule sets_measure_of) | 
| 41095 | 39 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 40 | lemma sets_pair_measure_cong[measurable_cong, cong]: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 41 | "sets M1 = sets M1' \<Longrightarrow> sets M2 = sets M2' \<Longrightarrow> sets (M1 \<Otimes>\<^sub>M M2) = sets (M1' \<Otimes>\<^sub>M M2')" | 
| 49776 | 42 | unfolding sets_pair_measure by (simp cong: sets_eq_imp_space_eq) | 
| 43 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 44 | lemma pair_measureI[intro, simp, measurable]: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 45 | "x \<in> sets A \<Longrightarrow> y \<in> sets B \<Longrightarrow> x \<times> y \<in> sets (A \<Otimes>\<^sub>M B)" | 
| 47694 | 46 | by (auto simp: sets_pair_measure) | 
| 41095 | 47 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 48 | lemma sets_Pair: "{x} \<in> sets M1 \<Longrightarrow> {y} \<in> sets M2 \<Longrightarrow> {(x, y)} \<in> sets (M1 \<Otimes>\<^sub>M M2)"
 | 
| 58606 | 49 |   using pair_measureI[of "{x}" M1 "{y}" M2] by simp
 | 
| 50 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 51 | lemma measurable_pair_measureI: | 
| 47694 | 52 | assumes 1: "f \<in> space M \<rightarrow> space M1 \<times> space M2" | 
| 53 | 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" | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 54 | shows "f \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" | 
| 47694 | 55 | unfolding pair_measure_def using 1 2 | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 56 | by (intro measurable_measure_of) (auto dest: sets.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: 
41661diff
changeset | 57 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 58 | lemma measurable_split_replace[measurable (raw)]: | 
| 61424 
c3658c18b7bc
prod_case as canonical name for product type eliminator
 haftmann parents: 
61169diff
changeset | 59 | "(\<lambda>x. f x (fst (g x)) (snd (g x))) \<in> measurable M N \<Longrightarrow> (\<lambda>x. case_prod (f x) (g x)) \<in> measurable M N" | 
| 50003 | 60 | unfolding split_beta' . | 
| 61 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 62 | lemma measurable_Pair[measurable (raw)]: | 
| 49776 | 63 | assumes f: "f \<in> measurable M M1" and g: "g \<in> measurable M M2" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 64 | shows "(\<lambda>x. (f x, g x)) \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 65 | proof (rule measurable_pair_measureI) | 
| 49776 | 66 | show "(\<lambda>x. (f x, g x)) \<in> space M \<rightarrow> space M1 \<times> space M2" | 
| 67 | using f g by (auto simp: measurable_def) | |
| 68 | fix A B assume *: "A \<in> sets M1" "B \<in> sets M2" | |
| 69 | have "(\<lambda>x. (f x, g x)) -` (A \<times> B) \<inter> space M = (f -` A \<inter> space M) \<inter> (g -` B \<inter> space M)" | |
| 70 | by auto | |
| 71 | also have "\<dots> \<in> sets M" | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 72 | by (rule sets.Int) (auto intro!: measurable_sets * f g) | 
| 49776 | 73 | finally show "(\<lambda>x. (f x, g x)) -` (A \<times> B) \<inter> space M \<in> sets M" . | 
| 74 | qed | |
| 75 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 76 | lemma measurable_fst[intro!, simp, measurable]: "fst \<in> measurable (M1 \<Otimes>\<^sub>M M2) M1" | 
| 69939 
812ce526da33
new material on topology: products, etc. Some renamings, esp continuous_on_topo -> continuous_map
 paulson <lp15@cam.ac.uk> parents: 
69861diff
changeset | 77 | by (auto simp: fst_vimage_eq_Times space_pair_measure sets.sets_into_space Times_Int_Times | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 78 | measurable_def) | 
| 40859 | 79 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 80 | lemma measurable_snd[intro!, simp, measurable]: "snd \<in> measurable (M1 \<Otimes>\<^sub>M M2) M2" | 
| 69939 
812ce526da33
new material on topology: products, etc. Some renamings, esp continuous_on_topo -> continuous_map
 paulson <lp15@cam.ac.uk> parents: 
69861diff
changeset | 81 | by (auto simp: snd_vimage_eq_Times space_pair_measure sets.sets_into_space Times_Int_Times | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 82 | measurable_def) | 
| 47694 | 83 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 84 | lemma measurable_Pair_compose_split[measurable_dest]: | 
| 61424 
c3658c18b7bc
prod_case as canonical name for product type eliminator
 haftmann parents: 
61169diff
changeset | 85 | assumes f: "case_prod f \<in> measurable (M1 \<Otimes>\<^sub>M M2) N" | 
| 59353 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 86 | assumes g: "g \<in> measurable M M1" and h: "h \<in> measurable M M2" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 87 | shows "(\<lambda>x. f (g x) (h x)) \<in> measurable M N" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 88 | using measurable_compose[OF measurable_Pair f, OF g h] by simp | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 89 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 90 | lemma measurable_Pair1_compose[measurable_dest]: | 
| 59353 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 91 | assumes f: "(\<lambda>x. (f x, g x)) \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 92 | assumes [measurable]: "h \<in> measurable N M" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 93 | shows "(\<lambda>x. f (h x)) \<in> measurable N M1" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 94 | using measurable_compose[OF f measurable_fst] by simp | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 95 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 96 | lemma measurable_Pair2_compose[measurable_dest]: | 
| 59353 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 97 | assumes f: "(\<lambda>x. (f x, g x)) \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 98 | assumes [measurable]: "h \<in> measurable N M" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 99 | shows "(\<lambda>x. g (h x)) \<in> measurable N M2" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 100 | using measurable_compose[OF f measurable_snd] by simp | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 101 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 102 | lemma measurable_pair: | 
| 59353 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 103 | assumes "(fst \<circ> f) \<in> measurable M M1" "(snd \<circ> f) \<in> measurable M M2" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 104 | shows "f \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 105 | using measurable_Pair[OF assms] by simp | 
| 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 106 | |
| 69739 | 107 | lemma | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 108 | assumes f[measurable]: "f \<in> measurable M (N \<Otimes>\<^sub>M P)" | 
| 50003 | 109 | shows measurable_fst': "(\<lambda>x. fst (f x)) \<in> measurable M N" | 
| 110 | and measurable_snd': "(\<lambda>x. snd (f x)) \<in> measurable M P" | |
| 111 | by simp_all | |
| 40859 | 112 | |
| 69739 | 113 | lemma | 
| 50003 | 114 | assumes f[measurable]: "f \<in> measurable M N" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 115 | shows measurable_fst'': "(\<lambda>x. f (fst x)) \<in> measurable (M \<Otimes>\<^sub>M P) N" | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 116 | and measurable_snd'': "(\<lambda>x. f (snd x)) \<in> measurable (P \<Otimes>\<^sub>M M) N" | 
| 50003 | 117 | by simp_all | 
| 47694 | 118 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 119 | lemma sets_pair_in_sets: | 
| 63333 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 120 | assumes "\<And>a b. a \<in> sets A \<Longrightarrow> b \<in> sets B \<Longrightarrow> a \<times> b \<in> sets N" | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 121 | shows "sets (A \<Otimes>\<^sub>M B) \<subseteq> sets N" | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 122 | unfolding sets_pair_measure | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 123 | by (intro sets.sigma_sets_subset') (auto intro!: assms) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 124 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 125 | lemma sets_pair_eq_sets_fst_snd: | 
| 63333 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 126 |   "sets (A \<Otimes>\<^sub>M B) = sets (Sup {vimage_algebra (space A \<times> space B) fst A, vimage_algebra (space A \<times> space B) snd B})"
 | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 127 |     (is "?P = sets (Sup {?fst, ?snd})")
 | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 128 | proof - | 
| 58606 | 129 |   { fix a b assume ab: "a \<in> sets A" "b \<in> sets B"
 | 
| 130 | then have "a \<times> b = (fst -` a \<inter> (space A \<times> space B)) \<inter> (snd -` b \<inter> (space A \<times> space B))" | |
| 131 | by (auto dest: sets.sets_into_space) | |
| 63333 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 132 |     also have "\<dots> \<in> sets (Sup {?fst, ?snd})"
 | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 133 | apply (rule sets.Int) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 134 | apply (rule in_sets_Sup) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 135 | apply auto [] | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 136 | apply (rule insertI1) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 137 | apply (auto intro: ab in_vimage_algebra) [] | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 138 | apply (rule in_sets_Sup) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 139 | apply auto [] | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 140 | apply (rule insertI2) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 141 | apply (auto intro: ab in_vimage_algebra) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 142 | done | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 143 |     finally have "a \<times> b \<in> sets (Sup {?fst, ?snd})" . }
 | 
| 58606 | 144 | moreover have "sets ?fst \<subseteq> sets (A \<Otimes>\<^sub>M B)" | 
| 145 | by (rule sets_image_in_sets) (auto simp: space_pair_measure[symmetric]) | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 146 | moreover have "sets ?snd \<subseteq> sets (A \<Otimes>\<^sub>M B)" | 
| 58606 | 147 | by (rule sets_image_in_sets) (auto simp: space_pair_measure) | 
| 148 | ultimately show ?thesis | |
| 63333 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 149 | apply (intro antisym[of "sets A" for A] sets_Sup_in_sets sets_pair_in_sets) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 150 | apply simp | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 151 | apply simp | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 152 | apply simp | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 153 | apply (elim disjE) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 154 | apply (simp add: space_pair_measure) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 155 | apply (simp add: space_pair_measure) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 156 | apply (auto simp add: space_pair_measure) | 
| 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 157 | done | 
| 58606 | 158 | qed | 
| 159 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 160 | lemma measurable_pair_iff: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 161 | "f \<in> measurable M (M1 \<Otimes>\<^sub>M M2) \<longleftrightarrow> (fst \<circ> f) \<in> measurable M M1 \<and> (snd \<circ> f) \<in> measurable M M2" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 162 | by (auto intro: measurable_pair[of f M M1 M2]) | 
| 40859 | 163 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 164 | lemma measurable_split_conv: | 
| 49776 | 165 | "(\<lambda>(x, y). f x y) \<in> measurable A B \<longleftrightarrow> (\<lambda>x. f (fst x) (snd x)) \<in> measurable A B" | 
| 67399 | 166 | by (intro arg_cong2[where f="(\<in>)"]) auto | 
| 40859 | 167 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 168 | lemma measurable_pair_swap': "(\<lambda>(x,y). (y, x)) \<in> measurable (M1 \<Otimes>\<^sub>M M2) (M2 \<Otimes>\<^sub>M M1)" | 
| 49776 | 169 | by (auto intro!: measurable_Pair simp: measurable_split_conv) | 
| 47694 | 170 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 171 | lemma measurable_pair_swap: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 172 | assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" shows "(\<lambda>(x,y). f (y, x)) \<in> measurable (M2 \<Otimes>\<^sub>M M1) M" | 
| 49776 | 173 | using measurable_comp[OF measurable_Pair f] by (auto simp: measurable_split_conv comp_def) | 
| 40859 | 174 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 175 | lemma measurable_pair_swap_iff: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 176 | "f \<in> measurable (M2 \<Otimes>\<^sub>M M1) M \<longleftrightarrow> (\<lambda>(x,y). f (y,x)) \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" | 
| 50003 | 177 | by (auto dest: measurable_pair_swap) | 
| 49776 | 178 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 179 | lemma measurable_Pair1': "x \<in> space M1 \<Longrightarrow> Pair x \<in> measurable M2 (M1 \<Otimes>\<^sub>M M2)" | 
| 50003 | 180 | by simp | 
| 40859 | 181 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 182 | lemma sets_Pair1[measurable (raw)]: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 183 | assumes A: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "Pair x -` A \<in> sets M2" | 
| 40859 | 184 | proof - | 
| 47694 | 185 |   have "Pair x -` A = (if x \<in> space M1 then Pair x -` A \<inter> space M2 else {})"
 | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 186 | using A[THEN sets.sets_into_space] by (auto simp: space_pair_measure) | 
| 47694 | 187 | also have "\<dots> \<in> sets M2" | 
| 62390 | 188 | using A by (auto simp add: measurable_Pair1' intro!: measurable_sets split: if_split_asm) | 
| 47694 | 189 | finally show ?thesis . | 
| 40859 | 190 | qed | 
| 191 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 192 | lemma measurable_Pair2': "y \<in> space M2 \<Longrightarrow> (\<lambda>x. (x, y)) \<in> measurable M1 (M1 \<Otimes>\<^sub>M M2)" | 
| 49776 | 193 | by (auto intro!: measurable_Pair) | 
| 40859 | 194 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 195 | lemma sets_Pair2: assumes A: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "(\<lambda>x. (x, y)) -` A \<in> sets M1" | 
| 47694 | 196 | proof - | 
| 197 |   have "(\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})"
 | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 198 | using A[THEN sets.sets_into_space] by (auto simp: space_pair_measure) | 
| 47694 | 199 | also have "\<dots> \<in> sets M1" | 
| 62390 | 200 | using A by (auto simp add: measurable_Pair2' intro!: measurable_sets split: if_split_asm) | 
| 47694 | 201 | finally show ?thesis . | 
| 40859 | 202 | qed | 
| 203 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 204 | lemma measurable_Pair2: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 205 | assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" and x: "x \<in> space M1" | 
| 47694 | 206 | shows "(\<lambda>y. f (x, y)) \<in> measurable M2 M" | 
| 207 | using measurable_comp[OF measurable_Pair1' f, OF x] | |
| 208 | by (simp add: comp_def) | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 209 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 210 | lemma measurable_Pair1: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 211 | assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" and y: "y \<in> space M2" | 
| 40859 | 212 | shows "(\<lambda>x. f (x, y)) \<in> measurable M1 M" | 
| 47694 | 213 | using measurable_comp[OF measurable_Pair2' f, OF y] | 
| 214 | by (simp add: comp_def) | |
| 40859 | 215 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 216 | lemma Int_stable_pair_measure_generator: "Int_stable {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}"
 | 
| 40859 | 217 | unfolding Int_stable_def | 
| 69939 
812ce526da33
new material on topology: products, etc. Some renamings, esp continuous_on_topo -> continuous_map
 paulson <lp15@cam.ac.uk> parents: 
69861diff
changeset | 218 | by safe (auto simp add: Times_Int_Times) | 
| 40859 | 219 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 220 | lemma (in finite_measure) finite_measure_cut_measurable: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 221 | assumes [measurable]: "Q \<in> sets (N \<Otimes>\<^sub>M M)" | 
| 49776 | 222 | shows "(\<lambda>x. emeasure M (Pair x -` Q)) \<in> borel_measurable N" | 
| 40859 | 223 | (is "?s Q \<in> _") | 
| 49789 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 224 | using Int_stable_pair_measure_generator pair_measure_closed assms | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 225 | unfolding sets_pair_measure | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 226 | proof (induct rule: sigma_sets_induct_disjoint) | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 227 | case (compl A) | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 228 | with sets.sets_into_space have "\<And>x. emeasure M (Pair x -` ((space N \<times> space M) - A)) = | 
| 49789 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 229 | (if x \<in> space N then emeasure M (space M) - ?s A x else 0)" | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 230 | unfolding sets_pair_measure[symmetric] | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 231 | by (auto intro!: emeasure_compl simp: vimage_Diff sets_Pair1) | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 232 | with compl sets.top show ?case | 
| 49789 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 233 | by (auto intro!: measurable_If simp: space_pair_measure) | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 234 | next | 
| 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 235 | case (union F) | 
| 53374 
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
 wenzelm parents: 
53015diff
changeset | 236 | then have "\<And>x. emeasure M (Pair x -` (\<Union>i. F i)) = (\<Sum>i. ?s (F i) x)" | 
| 60727 | 237 | by (simp add: suminf_emeasure disjoint_family_on_vimageI subset_eq vimage_UN sets_pair_measure[symmetric]) | 
| 53374 
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
 wenzelm parents: 
53015diff
changeset | 238 | with union show ?case | 
| 50003 | 239 | unfolding sets_pair_measure[symmetric] by simp | 
| 49789 
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
 hoelzl parents: 
49784diff
changeset | 240 | qed (auto simp add: if_distrib Int_def[symmetric] intro!: measurable_If) | 
| 49776 | 241 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 242 | lemma (in sigma_finite_measure) measurable_emeasure_Pair: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 243 | assumes Q: "Q \<in> sets (N \<Otimes>\<^sub>M M)" shows "(\<lambda>x. emeasure M (Pair x -` Q)) \<in> borel_measurable N" (is "?s Q \<in> _") | 
| 49776 | 244 | proof - | 
| 245 | from sigma_finite_disjoint guess F . note F = this | |
| 246 | then have F_sets: "\<And>i. F i \<in> sets M" by auto | |
| 247 | let ?C = "\<lambda>x i. F i \<inter> Pair x -` Q" | |
| 248 |   { fix i
 | |
| 249 | have [simp]: "space N \<times> F i \<inter> space N \<times> space M = space N \<times> F i" | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 250 | using F sets.sets_into_space by auto | 
| 49776 | 251 | let ?R = "density M (indicator (F i))" | 
| 252 | have "finite_measure ?R" | |
| 253 | using F by (intro finite_measureI) (auto simp: emeasure_restricted subset_eq) | |
| 254 | then have "(\<lambda>x. emeasure ?R (Pair x -` (space N \<times> space ?R \<inter> Q))) \<in> borel_measurable N" | |
| 255 | by (rule finite_measure.finite_measure_cut_measurable) (auto intro: Q) | |
| 256 | moreover have "\<And>x. emeasure ?R (Pair x -` (space N \<times> space ?R \<inter> Q)) | |
| 257 | = emeasure M (F i \<inter> Pair x -` (space N \<times> space ?R \<inter> Q))" | |
| 258 | using Q F_sets by (intro emeasure_restricted) (auto intro: sets_Pair1) | |
| 259 | moreover have "\<And>x. F i \<inter> Pair x -` (space N \<times> space ?R \<inter> Q) = ?C x i" | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 260 | using sets.sets_into_space[OF Q] by (auto simp: space_pair_measure) | 
| 49776 | 261 | ultimately have "(\<lambda>x. emeasure M (?C x i)) \<in> borel_measurable N" | 
| 262 | by simp } | |
| 263 | moreover | |
| 264 |   { fix x
 | |
| 265 | have "(\<Sum>i. emeasure M (?C x i)) = emeasure M (\<Union>i. ?C x i)" | |
| 266 | proof (intro suminf_emeasure) | |
| 267 | show "range (?C x) \<subseteq> sets M" | |
| 61808 | 268 | using F \<open>Q \<in> sets (N \<Otimes>\<^sub>M M)\<close> by (auto intro!: sets_Pair1) | 
| 49776 | 269 | have "disjoint_family F" using F by auto | 
| 270 | show "disjoint_family (?C x)" | |
| 61808 | 271 | by (rule disjoint_family_on_bisimulation[OF \<open>disjoint_family F\<close>]) auto | 
| 49776 | 272 | qed | 
| 273 | also have "(\<Union>i. ?C x i) = Pair x -` Q" | |
| 61808 | 274 | using F sets.sets_into_space[OF \<open>Q \<in> sets (N \<Otimes>\<^sub>M M)\<close>] | 
| 49776 | 275 | by (auto simp: space_pair_measure) | 
| 276 | finally have "emeasure M (Pair x -` Q) = (\<Sum>i. emeasure M (?C x i))" | |
| 277 | by simp } | |
| 61808 | 278 | ultimately show ?thesis using \<open>Q \<in> sets (N \<Otimes>\<^sub>M M)\<close> F_sets | 
| 49776 | 279 | by auto | 
| 280 | qed | |
| 281 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 282 | lemma (in sigma_finite_measure) measurable_emeasure[measurable (raw)]: | 
| 50003 | 283 | assumes space: "\<And>x. x \<in> space N \<Longrightarrow> A x \<subseteq> space M" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 284 |   assumes A: "{x\<in>space (N \<Otimes>\<^sub>M M). snd x \<in> A (fst x)} \<in> sets (N \<Otimes>\<^sub>M M)"
 | 
| 50003 | 285 | shows "(\<lambda>x. emeasure M (A x)) \<in> borel_measurable N" | 
| 286 | proof - | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 287 |   from space have "\<And>x. x \<in> space N \<Longrightarrow> Pair x -` {x \<in> space (N \<Otimes>\<^sub>M M). snd x \<in> A (fst x)} = A x"
 | 
| 50003 | 288 | by (auto simp: space_pair_measure) | 
| 289 | with measurable_emeasure_Pair[OF A] show ?thesis | |
| 290 | by (auto cong: measurable_cong) | |
| 291 | qed | |
| 292 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 293 | lemma (in sigma_finite_measure) emeasure_pair_measure: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 294 | assumes "X \<in> sets (N \<Otimes>\<^sub>M M)" | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 295 | shows "emeasure (N \<Otimes>\<^sub>M M) X = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator X (x, y) \<partial>M \<partial>N)" (is "_ = ?\<mu> X") | 
| 49776 | 296 | proof (rule emeasure_measure_of[OF pair_measure_def]) | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 297 | show "positive (sets (N \<Otimes>\<^sub>M M)) ?\<mu>" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 298 | by (auto simp: positive_def) | 
| 49776 | 299 | have eq[simp]: "\<And>A x y. indicator A (x, y) = indicator (Pair x -` A) y" | 
| 300 | by (auto simp: indicator_def) | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 301 | show "countably_additive (sets (N \<Otimes>\<^sub>M M)) ?\<mu>" | 
| 49776 | 302 | proof (rule countably_additiveI) | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 303 |     fix F :: "nat \<Rightarrow> ('b \<times> 'a) set" assume F: "range F \<subseteq> sets (N \<Otimes>\<^sub>M M)" "disjoint_family F"
 | 
| 59353 
f0707dc3d9aa
measurability prover: removed app splitting, replaced by more powerful destruction rules
 hoelzl parents: 
59088diff
changeset | 304 | from F have *: "\<And>i. F i \<in> sets (N \<Otimes>\<^sub>M M)" by auto | 
| 49776 | 305 | moreover have "\<And>x. disjoint_family (\<lambda>i. Pair x -` F i)" | 
| 306 | by (intro disjoint_family_on_bisimulation[OF F(2)]) auto | |
| 307 | moreover have "\<And>x. range (\<lambda>i. Pair x -` F i) \<subseteq> sets M" | |
| 308 | using F by (auto simp: sets_Pair1) | |
| 309 | ultimately show "(\<Sum>n. ?\<mu> (F n)) = ?\<mu> (\<Union>i. F i)" | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 310 | by (auto simp add: nn_integral_suminf[symmetric] vimage_UN suminf_emeasure | 
| 56996 | 311 | intro!: nn_integral_cong nn_integral_indicator[symmetric]) | 
| 49776 | 312 | qed | 
| 313 |   show "{a \<times> b |a b. a \<in> sets N \<and> b \<in> sets M} \<subseteq> Pow (space N \<times> space M)"
 | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 314 | using sets.space_closed[of N] sets.space_closed[of M] by auto | 
| 49776 | 315 | qed fact | 
| 316 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 317 | lemma (in sigma_finite_measure) emeasure_pair_measure_alt: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 318 | assumes X: "X \<in> sets (N \<Otimes>\<^sub>M M)" | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 319 | shows "emeasure (N \<Otimes>\<^sub>M M) X = (\<integral>\<^sup>+x. emeasure M (Pair x -` X) \<partial>N)" | 
| 49776 | 320 | proof - | 
| 321 | have [simp]: "\<And>x y. indicator X (x, y) = indicator (Pair x -` X) y" | |
| 322 | by (auto simp: indicator_def) | |
| 323 | show ?thesis | |
| 56996 | 324 | using X by (auto intro!: nn_integral_cong simp: emeasure_pair_measure sets_Pair1) | 
| 49776 | 325 | qed | 
| 326 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 327 | proposition (in sigma_finite_measure) emeasure_pair_measure_Times: | 
| 49776 | 328 | assumes A: "A \<in> sets N" and B: "B \<in> sets M" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 329 | shows "emeasure (N \<Otimes>\<^sub>M M) (A \<times> B) = emeasure N A * emeasure M B" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 330 | proof - | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 331 | have "emeasure (N \<Otimes>\<^sub>M M) (A \<times> B) = (\<integral>\<^sup>+x. emeasure M B * indicator A x \<partial>N)" | 
| 56996 | 332 | using A B by (auto intro!: nn_integral_cong simp: emeasure_pair_measure_alt) | 
| 49776 | 333 | also have "\<dots> = emeasure M B * emeasure N A" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 334 | using A by (simp add: nn_integral_cmult_indicator) | 
| 49776 | 335 | finally show ?thesis | 
| 336 | by (simp add: ac_simps) | |
| 40859 | 337 | qed | 
| 338 | ||
| 69683 | 339 | subsection \<open>Binary products of \<open>\<sigma>\<close>-finite emeasure spaces\<close> | 
| 40859 | 340 | |
| 70136 | 341 | locale\<^marker>\<open>tag unimportant\<close> pair_sigma_finite = M1?: sigma_finite_measure M1 + M2?: sigma_finite_measure M2 | 
| 47694 | 342 | for M1 :: "'a measure" and M2 :: "'b measure" | 
| 40859 | 343 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 344 | lemma (in pair_sigma_finite) measurable_emeasure_Pair1: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 345 | "Q \<in> sets (M1 \<Otimes>\<^sub>M M2) \<Longrightarrow> (\<lambda>x. emeasure M2 (Pair x -` Q)) \<in> borel_measurable M1" | 
| 49776 | 346 | using M2.measurable_emeasure_Pair . | 
| 40859 | 347 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 348 | lemma (in pair_sigma_finite) measurable_emeasure_Pair2: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 349 | assumes Q: "Q \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "(\<lambda>y. emeasure M1 ((\<lambda>x. (x, y)) -` Q)) \<in> borel_measurable M2" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 350 | proof - | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 351 | have "(\<lambda>(x, y). (y, x)) -` Q \<inter> space (M2 \<Otimes>\<^sub>M M1) \<in> sets (M2 \<Otimes>\<^sub>M M1)" | 
| 47694 | 352 | using Q measurable_pair_swap' by (auto intro: measurable_sets) | 
| 49776 | 353 | note M1.measurable_emeasure_Pair[OF this] | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 354 | moreover have "\<And>y. Pair y -` ((\<lambda>(x, y). (y, x)) -` Q \<inter> space (M2 \<Otimes>\<^sub>M M1)) = (\<lambda>x. (x, y)) -` Q" | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 355 | using Q[THEN sets.sets_into_space] by (auto simp: space_pair_measure) | 
| 47694 | 356 | ultimately show ?thesis by simp | 
| 39088 
ca17017c10e6
Measurable on product space is equiv. to measurable components
 hoelzl parents: 
39082diff
changeset | 357 | qed | 
| 
ca17017c10e6
Measurable on product space is equiv. to measurable components
 hoelzl parents: 
39082diff
changeset | 358 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 359 | proposition (in pair_sigma_finite) sigma_finite_up_in_pair_measure_generator: | 
| 47694 | 360 |   defines "E \<equiv> {A \<times> B | A B. A \<in> sets M1 \<and> B \<in> sets M2}"
 | 
| 361 |   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>
 | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 362 | (\<forall>i. emeasure (M1 \<Otimes>\<^sub>M M2) (F i) \<noteq> \<infinity>)" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 363 | proof - | 
| 47694 | 364 | from M1.sigma_finite_incseq guess F1 . note F1 = this | 
| 365 | from M2.sigma_finite_incseq guess F2 . note F2 = this | |
| 366 | from F1 F2 have space: "space M1 = (\<Union>i. F1 i)" "space M2 = (\<Union>i. F2 i)" by auto | |
| 40859 | 367 | let ?F = "\<lambda>i. F1 i \<times> F2 i" | 
| 47694 | 368 | show ?thesis | 
| 40859 | 369 | proof (intro exI[of _ ?F] conjI allI) | 
| 47694 | 370 | show "range ?F \<subseteq> E" using F1 F2 by (auto simp: E_def) (metis range_subsetD) | 
| 40859 | 371 | next | 
| 372 | have "space M1 \<times> space M2 \<subseteq> (\<Union>i. ?F i)" | |
| 373 | proof (intro subsetI) | |
| 374 | fix x assume "x \<in> space M1 \<times> space M2" | |
| 375 | then obtain i j where "fst x \<in> F1 i" "snd x \<in> F2 j" | |
| 376 | by (auto simp: space) | |
| 377 | then have "fst x \<in> F1 (max i j)" "snd x \<in> F2 (max j i)" | |
| 61808 | 378 | using \<open>incseq F1\<close> \<open>incseq F2\<close> unfolding incseq_def | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41831diff
changeset | 379 | by (force split: split_max)+ | 
| 40859 | 380 | then have "(fst x, snd x) \<in> F1 (max i j) \<times> F2 (max i j)" | 
| 54863 
82acc20ded73
prefer more canonical names for lemmas on min/max
 haftmann parents: 
53374diff
changeset | 381 | by (intro SigmaI) (auto simp add: max.commute) | 
| 40859 | 382 | then show "x \<in> (\<Union>i. ?F i)" by auto | 
| 383 | qed | |
| 47694 | 384 | then show "(\<Union>i. ?F i) = space M1 \<times> space M2" | 
| 385 | using space by (auto simp: space) | |
| 40859 | 386 | next | 
| 41981 
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
 hoelzl parents: 
41831diff
changeset | 387 | fix i show "incseq (\<lambda>i. F1 i \<times> F2 i)" | 
| 61808 | 388 | using \<open>incseq F1\<close> \<open>incseq F2\<close> unfolding incseq_Suc_iff by auto | 
| 40859 | 389 | next | 
| 390 | fix i | |
| 391 | from F1 F2 have "F1 i \<in> sets M1" "F2 i \<in> sets M2" by auto | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 392 | with F1 F2 show "emeasure (M1 \<Otimes>\<^sub>M M2) (F1 i \<times> F2 i) \<noteq> \<infinity>" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 393 | by (auto simp add: emeasure_pair_measure_Times ennreal_mult_eq_top_iff) | 
| 47694 | 394 | qed | 
| 395 | qed | |
| 396 | ||
| 70136 | 397 | sublocale\<^marker>\<open>tag unimportant\<close> pair_sigma_finite \<subseteq> P?: sigma_finite_measure "M1 \<Otimes>\<^sub>M M2" | 
| 47694 | 398 | proof | 
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 399 | from M1.sigma_finite_countable guess F1 .. | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 400 | moreover from M2.sigma_finite_countable guess F2 .. | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 401 | ultimately show | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 402 | "\<exists>A. countable A \<and> A \<subseteq> sets (M1 \<Otimes>\<^sub>M M2) \<and> \<Union>A = space (M1 \<Otimes>\<^sub>M M2) \<and> (\<forall>a\<in>A. emeasure (M1 \<Otimes>\<^sub>M M2) a \<noteq> \<infinity>)" | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 403 | by (intro exI[of _ "(\<lambda>(a, b). a \<times> b) ` (F1 \<times> F2)"] conjI) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 404 | (auto simp: M2.emeasure_pair_measure_Times space_pair_measure set_eq_iff subset_eq ennreal_mult_eq_top_iff) | 
| 40859 | 405 | qed | 
| 406 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 407 | lemma sigma_finite_pair_measure: | 
| 47694 | 408 | assumes A: "sigma_finite_measure A" and B: "sigma_finite_measure B" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 409 | shows "sigma_finite_measure (A \<Otimes>\<^sub>M B)" | 
| 47694 | 410 | proof - | 
| 411 | interpret A: sigma_finite_measure A by fact | |
| 412 | interpret B: sigma_finite_measure B by fact | |
| 413 | interpret AB: pair_sigma_finite A B .. | |
| 414 | show ?thesis .. | |
| 40859 | 415 | qed | 
| 39088 
ca17017c10e6
Measurable on product space is equiv. to measurable components
 hoelzl parents: 
39082diff
changeset | 416 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 417 | lemma sets_pair_swap: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 418 | assumes "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 419 | shows "(\<lambda>(x, y). (y, x)) -` A \<inter> space (M2 \<Otimes>\<^sub>M M1) \<in> sets (M2 \<Otimes>\<^sub>M M1)" | 
| 47694 | 420 | using measurable_pair_swap' assms by (rule measurable_sets) | 
| 41661 | 421 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 422 | lemma (in pair_sigma_finite) distr_pair_swap: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 423 | "M1 \<Otimes>\<^sub>M M2 = distr (M2 \<Otimes>\<^sub>M M1) (M1 \<Otimes>\<^sub>M M2) (\<lambda>(x, y). (y, x))" (is "?P = ?D") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 424 | proof - | 
| 41689 
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
 hoelzl parents: 
41661diff
changeset | 425 |   from sigma_finite_up_in_pair_measure_generator guess F :: "nat \<Rightarrow> ('a \<times> 'b) set" .. note F = this
 | 
| 47694 | 426 |   let ?E = "{a \<times> b |a b. a \<in> sets M1 \<and> b \<in> sets M2}"
 | 
| 427 | show ?thesis | |
| 428 | proof (rule measure_eqI_generator_eq[OF Int_stable_pair_measure_generator[of M1 M2]]) | |
| 429 | show "?E \<subseteq> Pow (space ?P)" | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 430 | using sets.space_closed[of M1] sets.space_closed[of M2] by (auto simp: space_pair_measure) | 
| 47694 | 431 | show "sets ?P = sigma_sets (space ?P) ?E" | 
| 432 | by (simp add: sets_pair_measure space_pair_measure) | |
| 433 | then show "sets ?D = sigma_sets (space ?P) ?E" | |
| 434 | by simp | |
| 435 | next | |
| 49784 
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
 hoelzl parents: 
49776diff
changeset | 436 | show "range F \<subseteq> ?E" "(\<Union>i. F i) = space ?P" "\<And>i. emeasure ?P (F i) \<noteq> \<infinity>" | 
| 47694 | 437 | using F by (auto simp: space_pair_measure) | 
| 438 | next | |
| 439 | fix X assume "X \<in> ?E" | |
| 440 | 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 | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 441 | have "(\<lambda>(y, x). (x, y)) -` X \<inter> space (M2 \<Otimes>\<^sub>M M1) = B \<times> A" | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 442 | using sets.sets_into_space[OF A] sets.sets_into_space[OF B] by (auto simp: space_pair_measure) | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 443 | with A B show "emeasure (M1 \<Otimes>\<^sub>M M2) X = emeasure ?D X" | 
| 49776 | 444 | by (simp add: M2.emeasure_pair_measure_Times M1.emeasure_pair_measure_Times emeasure_distr | 
| 47694 | 445 | 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: 
41661diff
changeset | 446 | qed | 
| 
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
 hoelzl parents: 
41661diff
changeset | 447 | qed | 
| 
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
 hoelzl parents: 
41661diff
changeset | 448 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 449 | lemma (in pair_sigma_finite) emeasure_pair_measure_alt2: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 450 | assumes A: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 451 | shows "emeasure (M1 \<Otimes>\<^sub>M M2) A = (\<integral>\<^sup>+y. emeasure M1 ((\<lambda>x. (x, y)) -` A) \<partial>M2)" | 
| 47694 | 452 | (is "_ = ?\<nu> A") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 453 | proof - | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 454 | have [simp]: "\<And>y. (Pair y -` ((\<lambda>(x, y). (y, x)) -` A \<inter> space (M2 \<Otimes>\<^sub>M M1))) = (\<lambda>x. (x, y)) -` A" | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 455 | using sets.sets_into_space[OF A] by (auto simp: space_pair_measure) | 
| 47694 | 456 | show ?thesis using A | 
| 457 | by (subst distr_pair_swap) | |
| 458 | (simp_all del: vimage_Int add: measurable_sets[OF measurable_pair_swap'] | |
| 49776 | 459 | M1.emeasure_pair_measure_alt emeasure_distr[OF measurable_pair_swap' A]) | 
| 460 | qed | |
| 461 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 462 | lemma (in pair_sigma_finite) AE_pair: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 463 | assumes "AE x in (M1 \<Otimes>\<^sub>M M2). Q x" | 
| 49776 | 464 | shows "AE x in M1. (AE y in M2. Q (x, y))" | 
| 465 | proof - | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 466 |   obtain N where N: "N \<in> sets (M1 \<Otimes>\<^sub>M M2)" "emeasure (M1 \<Otimes>\<^sub>M M2) N = 0" "{x\<in>space (M1 \<Otimes>\<^sub>M M2). \<not> Q x} \<subseteq> N"
 | 
| 49776 | 467 | using assms unfolding eventually_ae_filter by auto | 
| 468 | show ?thesis | |
| 469 | proof (rule AE_I) | |
| 61808 | 470 | from N measurable_emeasure_Pair1[OF \<open>N \<in> sets (M1 \<Otimes>\<^sub>M M2)\<close>] | 
| 49776 | 471 |     show "emeasure M1 {x\<in>space M1. emeasure M2 (Pair x -` N) \<noteq> 0} = 0"
 | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 472 | by (auto simp: M2.emeasure_pair_measure_alt nn_integral_0_iff) | 
| 49776 | 473 |     show "{x \<in> space M1. emeasure M2 (Pair x -` N) \<noteq> 0} \<in> sets M1"
 | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 474 | by (intro borel_measurable_eq measurable_emeasure_Pair1 N sets.sets_Collect_neg N) simp | 
| 49776 | 475 |     { fix x assume "x \<in> space M1" "emeasure M2 (Pair x -` N) = 0"
 | 
| 476 | have "AE y in M2. Q (x, y)" | |
| 477 | proof (rule AE_I) | |
| 478 | show "emeasure M2 (Pair x -` N) = 0" by fact | |
| 479 | show "Pair x -` N \<in> sets M2" using N(1) by (rule sets_Pair1) | |
| 480 |         show "{y \<in> space M2. \<not> Q (x, y)} \<subseteq> Pair x -` N"
 | |
| 61808 | 481 | using N \<open>x \<in> space M1\<close> unfolding space_pair_measure by auto | 
| 49776 | 482 | qed } | 
| 483 |     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}"
 | |
| 484 | by auto | |
| 485 | qed | |
| 486 | qed | |
| 487 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 488 | lemma (in pair_sigma_finite) AE_pair_measure: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 489 |   assumes "{x\<in>space (M1 \<Otimes>\<^sub>M M2). P x} \<in> sets (M1 \<Otimes>\<^sub>M M2)"
 | 
| 49776 | 490 | assumes ae: "AE x in M1. AE y in M2. P (x, y)" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 491 | shows "AE x in M1 \<Otimes>\<^sub>M M2. P x" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 492 | proof (subst AE_iff_measurable[OF _ refl]) | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 493 |   show "{x\<in>space (M1 \<Otimes>\<^sub>M M2). \<not> P x} \<in> sets (M1 \<Otimes>\<^sub>M M2)"
 | 
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 494 | by (rule sets.sets_Collect) fact | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 495 |   then have "emeasure (M1 \<Otimes>\<^sub>M M2) {x \<in> space (M1 \<Otimes>\<^sub>M M2). \<not> P x} =
 | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 496 |       (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator {x \<in> space (M1 \<Otimes>\<^sub>M M2). \<not> P x} (x, y) \<partial>M2 \<partial>M1)"
 | 
| 49776 | 497 | by (simp add: M2.emeasure_pair_measure) | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 498 | also have "\<dots> = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. 0 \<partial>M2 \<partial>M1)" | 
| 49776 | 499 | using ae | 
| 56996 | 500 | apply (safe intro!: nn_integral_cong_AE) | 
| 49776 | 501 | apply (intro AE_I2) | 
| 56996 | 502 | apply (safe intro!: nn_integral_cong_AE) | 
| 49776 | 503 | apply auto | 
| 504 | done | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 505 |   finally show "emeasure (M1 \<Otimes>\<^sub>M M2) {x \<in> space (M1 \<Otimes>\<^sub>M M2). \<not> P x} = 0" by simp
 | 
| 49776 | 506 | qed | 
| 507 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 508 | lemma (in pair_sigma_finite) AE_pair_iff: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 509 |   "{x\<in>space (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x)} \<in> sets (M1 \<Otimes>\<^sub>M M2) \<Longrightarrow>
 | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 510 | (AE x in M1. AE y in M2. P x y) \<longleftrightarrow> (AE x in (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x))" | 
| 49776 | 511 | using AE_pair[of "\<lambda>x. P (fst x) (snd x)"] AE_pair_measure[of "\<lambda>x. P (fst x) (snd x)"] by auto | 
| 512 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 513 | lemma (in pair_sigma_finite) AE_commute: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 514 |   assumes P: "{x\<in>space (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x)} \<in> sets (M1 \<Otimes>\<^sub>M M2)"
 | 
| 49776 | 515 | shows "(AE x in M1. AE y in M2. P x y) \<longleftrightarrow> (AE y in M2. AE x in M1. P x y)" | 
| 516 | proof - | |
| 517 | interpret Q: pair_sigma_finite M2 M1 .. | |
| 518 | 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" | |
| 519 | by auto | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 520 |   have "{x \<in> space (M2 \<Otimes>\<^sub>M M1). P (snd x) (fst x)} =
 | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 521 |     (\<lambda>(x, y). (y, x)) -` {x \<in> space (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x)} \<inter> space (M2 \<Otimes>\<^sub>M M1)"
 | 
| 49776 | 522 | by (auto simp: space_pair_measure) | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 523 | also have "\<dots> \<in> sets (M2 \<Otimes>\<^sub>M M1)" | 
| 49776 | 524 | by (intro sets_pair_swap P) | 
| 525 | finally show ?thesis | |
| 526 | apply (subst AE_pair_iff[OF P]) | |
| 527 | apply (subst distr_pair_swap) | |
| 528 | apply (subst AE_distr_iff[OF measurable_pair_swap' P]) | |
| 529 | apply (subst Q.AE_pair_iff) | |
| 530 | apply simp_all | |
| 531 | done | |
| 40859 | 532 | qed | 
| 533 | ||
| 69683 | 534 | subsection "Fubinis theorem" | 
| 40859 | 535 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 536 | lemma measurable_compose_Pair1: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 537 | "x \<in> space M1 \<Longrightarrow> g \<in> measurable (M1 \<Otimes>\<^sub>M M2) L \<Longrightarrow> (\<lambda>y. g (x, y)) \<in> measurable M2 L" | 
| 50003 | 538 | by simp | 
| 49800 | 539 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 540 | lemma (in sigma_finite_measure) borel_measurable_nn_integral_fst: | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 541 | assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M)" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 542 | shows "(\<lambda>x. \<integral>\<^sup>+ y. f (x, y) \<partial>M) \<in> borel_measurable M1" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 543 | using f proof induct | 
| 49800 | 544 | case (cong u v) | 
| 49999 
dfb63b9b8908
for the product measure it is enough if only one measure is sigma-finite
 hoelzl parents: 
49825diff
changeset | 545 | then have "\<And>w x. w \<in> space M1 \<Longrightarrow> x \<in> space M \<Longrightarrow> u (w, x) = v (w, x)" | 
| 49800 | 546 | by (auto simp: space_pair_measure) | 
| 547 | show ?case | |
| 548 | apply (subst measurable_cong) | |
| 56996 | 549 | apply (rule nn_integral_cong) | 
| 49800 | 550 | apply fact+ | 
| 551 | done | |
| 552 | next | |
| 553 | case (set Q) | |
| 554 | have [simp]: "\<And>x y. indicator Q (x, y) = indicator (Pair x -` Q) y" | |
| 555 | by (auto simp: indicator_def) | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 556 | have "\<And>x. x \<in> space M1 \<Longrightarrow> emeasure M (Pair x -` Q) = \<integral>\<^sup>+ y. indicator Q (x, y) \<partial>M" | 
| 49800 | 557 | by (simp add: sets_Pair1[OF set]) | 
| 49999 
dfb63b9b8908
for the product measure it is enough if only one measure is sigma-finite
 hoelzl parents: 
49825diff
changeset | 558 | from this measurable_emeasure_Pair[OF set] show ?case | 
| 49800 | 559 | by (rule measurable_cong[THEN iffD1]) | 
| 56996 | 560 | qed (simp_all add: nn_integral_add nn_integral_cmult measurable_compose_Pair1 | 
| 69861 
62e47f06d22c
avoid context-sensitive simp rules whose context-free form (image_comp) is not simp by default
 haftmann parents: 
69739diff
changeset | 561 | nn_integral_monotone_convergence_SUP incseq_def le_fun_def image_comp | 
| 49800 | 562 | cong: measurable_cong) | 
| 563 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 564 | lemma (in sigma_finite_measure) nn_integral_fst: | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 565 | assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M)" | 
| 56996 | 566 | shows "(\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) \<partial>M \<partial>M1) = integral\<^sup>N (M1 \<Otimes>\<^sub>M M) f" (is "?I f = _") | 
| 68833 
fde093888c16
tagged 21 theories in the Analysis library for the manual
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
67693diff
changeset | 567 | using f proof induct | 
| 49800 | 568 | case (cong u v) | 
| 53374 
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
 wenzelm parents: 
53015diff
changeset | 569 | then have "?I u = ?I v" | 
| 56996 | 570 | by (intro nn_integral_cong) (auto simp: space_pair_measure) | 
| 53374 
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
 wenzelm parents: 
53015diff
changeset | 571 | with cong show ?case | 
| 56996 | 572 | by (simp cong: nn_integral_cong) | 
| 573 | qed (simp_all add: emeasure_pair_measure nn_integral_cmult nn_integral_add | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 574 | nn_integral_monotone_convergence_SUP measurable_compose_Pair1 | 
| 69861 
62e47f06d22c
avoid context-sensitive simp rules whose context-free form (image_comp) is not simp by default
 haftmann parents: 
69739diff
changeset | 575 | borel_measurable_nn_integral_fst nn_integral_mono incseq_def le_fun_def image_comp | 
| 56996 | 576 | cong: nn_integral_cong) | 
| 40859 | 577 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 578 | lemma (in sigma_finite_measure) borel_measurable_nn_integral[measurable (raw)]: | 
| 61424 
c3658c18b7bc
prod_case as canonical name for product type eliminator
 haftmann parents: 
61169diff
changeset | 579 | "case_prod f \<in> borel_measurable (N \<Otimes>\<^sub>M M) \<Longrightarrow> (\<lambda>x. \<integral>\<^sup>+ y. f x y \<partial>M) \<in> borel_measurable N" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 580 | using borel_measurable_nn_integral_fst[of "case_prod f" N] by simp | 
| 50003 | 581 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 582 | proposition (in pair_sigma_finite) nn_integral_snd: | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 583 | assumes f[measurable]: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2)" | 
| 56996 | 584 | shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f (x, y) \<partial>M1) \<partial>M2) = integral\<^sup>N (M1 \<Otimes>\<^sub>M M2) f" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 585 | proof - | 
| 47694 | 586 | note measurable_pair_swap[OF f] | 
| 56996 | 587 | from M1.nn_integral_fst[OF this] | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 588 | have "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f (x, y) \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ (x, y). f (y, x) \<partial>(M2 \<Otimes>\<^sub>M M1))" | 
| 40859 | 589 | by simp | 
| 56996 | 590 | also have "(\<integral>\<^sup>+ (x, y). f (y, x) \<partial>(M2 \<Otimes>\<^sub>M M1)) = integral\<^sup>N (M1 \<Otimes>\<^sub>M M2) f" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 591 | by (subst distr_pair_swap) (auto simp add: nn_integral_distr intro!: nn_integral_cong) | 
| 40859 | 592 | finally show ?thesis . | 
| 593 | qed | |
| 594 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 595 | theorem (in pair_sigma_finite) Fubini: | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 596 | assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2)" | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 597 | shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f (x, y) \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ x. (\<integral>\<^sup>+ y. f (x, y) \<partial>M2) \<partial>M1)" | 
| 56996 | 598 | unfolding nn_integral_snd[OF assms] M2.nn_integral_fst[OF assms] .. | 
| 41026 
bea75746dc9d
folding on arbitrary Lebesgue integrable functions
 hoelzl parents: 
41023diff
changeset | 599 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 600 | theorem (in pair_sigma_finite) Fubini': | 
| 61424 
c3658c18b7bc
prod_case as canonical name for product type eliminator
 haftmann parents: 
61169diff
changeset | 601 | assumes f: "case_prod f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2)" | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 602 | shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f x y \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ x. (\<integral>\<^sup>+ y. f x y \<partial>M2) \<partial>M1)" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 603 | using Fubini[OF f] by simp | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 604 | |
| 69683 | 605 | subsection \<open>Products on counting spaces, densities and distributions\<close> | 
| 40859 | 606 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 607 | proposition sigma_prod: | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 608 | assumes X_cover: "\<exists>E\<subseteq>A. countable E \<and> X = \<Union>E" and A: "A \<subseteq> Pow X" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 609 | assumes Y_cover: "\<exists>E\<subseteq>B. countable E \<and> Y = \<Union>E" and B: "B \<subseteq> Pow Y" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 610 |   shows "sigma X A \<Otimes>\<^sub>M sigma Y B = sigma (X \<times> Y) {a \<times> b | a b. a \<in> A \<and> b \<in> B}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 611 | (is "?P = ?S") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 612 | proof (rule measure_eqI) | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 613 | have [simp]: "snd \<in> X \<times> Y \<rightarrow> Y" "fst \<in> X \<times> Y \<rightarrow> X" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 614 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 615 |   let ?XY = "{{fst -` a \<inter> X \<times> Y | a. a \<in> A}, {snd -` b \<inter> X \<times> Y | b. b \<in> B}}"
 | 
| 69260 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 haftmann parents: 
68833diff
changeset | 616 | have "sets ?P = sets (SUP xy\<in>?XY. sigma (X \<times> Y) xy)" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 617 | by (simp add: vimage_algebra_sigma sets_pair_eq_sets_fst_snd A B) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 618 | also have "\<dots> = sets (sigma (X \<times> Y) (\<Union>?XY))" | 
| 63333 
158ab2239496
Probability: show that measures form a complete lattice
 hoelzl parents: 
63040diff
changeset | 619 | by (intro Sup_sigma arg_cong[where f=sets]) auto | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 620 | also have "\<dots> = sets ?S" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 621 | proof (intro arg_cong[where f=sets] sigma_eqI sigma_sets_eqI) | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 622 |     show "\<Union>?XY \<subseteq> Pow (X \<times> Y)" "{a \<times> b |a b. a \<in> A \<and> b \<in> B} \<subseteq> Pow (X \<times> Y)"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 623 | using A B by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 624 | next | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 625 |     interpret XY: sigma_algebra "X \<times> Y" "sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 626 | using A B by (intro sigma_algebra_sigma_sets) auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 627 | fix Z assume "Z \<in> \<Union>?XY" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 628 |     then show "Z \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 629 | proof safe | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 630 | fix a assume "a \<in> A" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 631 | from Y_cover obtain E where E: "E \<subseteq> B" "countable E" and "Y = \<Union>E" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 632 | by auto | 
| 61808 | 633 | with \<open>a \<in> A\<close> A have eq: "fst -` a \<inter> X \<times> Y = (\<Union>e\<in>E. a \<times> e)" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 634 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 635 |       show "fst -` a \<inter> X \<times> Y \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
 | 
| 61808 | 636 | using \<open>a \<in> A\<close> E unfolding eq by (auto intro!: XY.countable_UN') | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 637 | next | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 638 | fix b assume "b \<in> B" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 639 | from X_cover obtain E where E: "E \<subseteq> A" "countable E" and "X = \<Union>E" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 640 | by auto | 
| 61808 | 641 | with \<open>b \<in> B\<close> B have eq: "snd -` b \<inter> X \<times> Y = (\<Union>e\<in>E. e \<times> b)" | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 642 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 643 |       show "snd -` b \<inter> X \<times> Y \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
 | 
| 61808 | 644 | using \<open>b \<in> B\<close> E unfolding eq by (auto intro!: XY.countable_UN') | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 645 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 646 | next | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 647 |     fix Z assume "Z \<in> {a \<times> b |a b. a \<in> A \<and> b \<in> B}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 648 | then obtain a b where "Z = a \<times> b" and ab: "a \<in> A" "b \<in> B" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 649 | by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 650 | then have Z: "Z = (fst -` a \<inter> X \<times> Y) \<inter> (snd -` b \<inter> X \<times> Y)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 651 | using A B by auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 652 | interpret XY: sigma_algebra "X \<times> Y" "sigma_sets (X \<times> Y) (\<Union>?XY)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 653 | by (intro sigma_algebra_sigma_sets) auto | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 654 | show "Z \<in> sigma_sets (X \<times> Y) (\<Union>?XY)" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 655 | unfolding Z by (rule XY.Int) (blast intro: ab)+ | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 656 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 657 | finally show "sets ?P = sets ?S" . | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 658 | next | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 659 | interpret finite_measure "sigma X A" for X A | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 660 | proof qed (simp add: emeasure_sigma) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 661 | fix A assume "A \<in> sets ?P" then show "emeasure ?P A = emeasure ?S A" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 662 | by (simp add: emeasure_pair_measure_alt emeasure_sigma) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 663 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 664 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 665 | lemma sigma_sets_pair_measure_generator_finite: | 
| 38656 | 666 | assumes "finite A" and "finite B" | 
| 47694 | 667 |   shows "sigma_sets (A \<times> B) { a \<times> b | a b. a \<subseteq> A \<and> b \<subseteq> B} = Pow (A \<times> B)"
 | 
| 40859 | 668 | (is "sigma_sets ?prod ?sets = _") | 
| 38656 | 669 | proof safe | 
| 670 | have fin: "finite (A \<times> B)" using assms by (rule finite_cartesian_product) | |
| 671 | fix x assume subset: "x \<subseteq> A \<times> B" | |
| 672 | hence "finite x" using fin by (rule finite_subset) | |
| 40859 | 673 | from this subset show "x \<in> sigma_sets ?prod ?sets" | 
| 38656 | 674 | proof (induct x) | 
| 675 | case empty show ?case by (rule sigma_sets.Empty) | |
| 676 | next | |
| 677 | case (insert a x) | |
| 47694 | 678 |     hence "{a} \<in> sigma_sets ?prod ?sets" by auto
 | 
| 38656 | 679 | moreover have "x \<in> sigma_sets ?prod ?sets" using insert by auto | 
| 680 | ultimately show ?case unfolding insert_is_Un[of a x] by (rule sigma_sets_Un) | |
| 681 | qed | |
| 682 | next | |
| 683 | fix x a b | |
| 40859 | 684 | assume "x \<in> sigma_sets ?prod ?sets" and "(a, b) \<in> x" | 
| 38656 | 685 | from sigma_sets_into_sp[OF _ this(1)] this(2) | 
| 40859 | 686 | show "a \<in> A" and "b \<in> B" by auto | 
| 35833 | 687 | qed | 
| 688 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 689 | proposition sets_pair_eq: | 
| 64008 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 690 | assumes Ea: "Ea \<subseteq> Pow (space A)" "sets A = sigma_sets (space A) Ea" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 691 | and Ca: "countable Ca" "Ca \<subseteq> Ea" "\<Union>Ca = space A" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 692 | and Eb: "Eb \<subseteq> Pow (space B)" "sets B = sigma_sets (space B) Eb" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 693 | and Cb: "countable Cb" "Cb \<subseteq> Eb" "\<Union>Cb = space B" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 694 |   shows "sets (A \<Otimes>\<^sub>M B) = sets (sigma (space A \<times> space B) { a \<times> b | a b. a \<in> Ea \<and> b \<in> Eb })"
 | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 695 | (is "_ = sets (sigma ?\<Omega> ?E)") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 696 | proof | 
| 64008 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 697 | show "sets (sigma ?\<Omega> ?E) \<subseteq> sets (A \<Otimes>\<^sub>M B)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 698 | using Ea(1) Eb(1) by (subst sigma_le_sets) (auto simp: Ea(2) Eb(2)) | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 699 | have "?E \<subseteq> Pow ?\<Omega>" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 700 | using Ea(1) Eb(1) by auto | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 701 | then have E: "a \<in> Ea \<Longrightarrow> b \<in> Eb \<Longrightarrow> a \<times> b \<in> sets (sigma ?\<Omega> ?E)" for a b | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 702 | by auto | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 703 |   have "sets (A \<Otimes>\<^sub>M B) \<subseteq> sets (Sup {vimage_algebra ?\<Omega> fst A, vimage_algebra ?\<Omega> snd B})"
 | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 704 | unfolding sets_pair_eq_sets_fst_snd .. | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 705 | also have "vimage_algebra ?\<Omega> fst A = vimage_algebra ?\<Omega> fst (sigma (space A) Ea)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 706 | by (intro vimage_algebra_cong[OF refl refl]) (simp add: Ea) | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 707 |   also have "\<dots> = sigma ?\<Omega> {fst -` A \<inter> ?\<Omega> |A. A \<in> Ea}"
 | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 708 | by (intro Ea vimage_algebra_sigma) auto | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 709 | also have "vimage_algebra ?\<Omega> snd B = vimage_algebra ?\<Omega> snd (sigma (space B) Eb)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 710 | by (intro vimage_algebra_cong[OF refl refl]) (simp add: Eb) | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 711 |   also have "\<dots> = sigma ?\<Omega> {snd -` A \<inter> ?\<Omega> |A. A \<in> Eb}"
 | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 712 | by (intro Eb vimage_algebra_sigma) auto | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 713 |   also have "{sigma ?\<Omega> {fst -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Ea}, sigma ?\<Omega> {snd -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Eb}} =
 | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 714 |     sigma ?\<Omega> ` {{fst -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Ea}, {snd -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Eb}}"
 | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 715 | by auto | 
| 69260 
0a9688695a1b
removed relics of ASCII syntax for indexed big operators
 haftmann parents: 
68833diff
changeset | 716 |   also have "sets (SUP S\<in>{{fst -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Ea}, {snd -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Eb}}. sigma ?\<Omega> S) =
 | 
| 64008 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 717 |     sets (sigma ?\<Omega> (\<Union>{{fst -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Ea}, {snd -` Aa \<inter> ?\<Omega> |Aa. Aa \<in> Eb}}))"
 | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 718 | using Ea(1) Eb(1) by (intro sets_Sup_sigma) auto | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 719 | also have "\<dots> \<subseteq> sets (sigma ?\<Omega> ?E)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 720 | proof (subst sigma_le_sets, safe intro!: space_in_measure_of) | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 721 | fix a assume "a \<in> Ea" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 722 | then have "fst -` a \<inter> ?\<Omega> = (\<Union>b\<in>Cb. a \<times> b)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 723 | using Cb(3)[symmetric] Ea(1) by auto | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 724 | then show "fst -` a \<inter> ?\<Omega> \<in> sets (sigma ?\<Omega> ?E)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 725 | using Cb \<open>a \<in> Ea\<close> by (auto intro!: sets.countable_UN' E) | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 726 | next | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 727 | fix b assume "b \<in> Eb" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 728 | then have "snd -` b \<inter> ?\<Omega> = (\<Union>a\<in>Ca. a \<times> b)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 729 | using Ca(3)[symmetric] Eb(1) by auto | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 730 | then show "snd -` b \<inter> ?\<Omega> \<in> sets (sigma ?\<Omega> ?E)" | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 731 | using Ca \<open>b \<in> Eb\<close> by (auto intro!: sets.countable_UN' E) | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 732 | qed | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 733 | finally show "sets (A \<Otimes>\<^sub>M B) \<subseteq> sets (sigma ?\<Omega> ?E)" . | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 734 | qed | 
| 
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
 hoelzl parents: 
63627diff
changeset | 735 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 736 | proposition borel_prod: | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 737 |   "(borel \<Otimes>\<^sub>M borel) = (borel :: ('a::second_countable_topology \<times> 'b::second_countable_topology) measure)"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 738 | (is "?P = ?B") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 739 | proof - | 
| 59088 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 740 |   have "?B = sigma UNIV {A \<times> B | A B. open A \<and> open B}"
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 741 | by (rule second_countable_borel_measurable[OF open_prod_generated]) | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 742 | also have "\<dots> = ?P" | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 743 | unfolding borel_def | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 744 |     by (subst sigma_prod) (auto intro!: exI[of _ "{UNIV}"])
 | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 745 | finally show ?thesis .. | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 746 | qed | 
| 
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
 hoelzl parents: 
59048diff
changeset | 747 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 748 | proposition pair_measure_count_space: | 
| 47694 | 749 | assumes A: "finite A" and B: "finite B" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 750 | shows "count_space A \<Otimes>\<^sub>M count_space B = count_space (A \<times> B)" (is "?P = ?C") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 751 | proof (rule measure_eqI) | 
| 47694 | 752 | interpret A: finite_measure "count_space A" by (rule finite_measure_count_space) fact | 
| 753 | interpret B: finite_measure "count_space B" by (rule finite_measure_count_space) fact | |
| 61169 | 754 | interpret P: pair_sigma_finite "count_space A" "count_space B" .. | 
| 47694 | 755 | show eq: "sets ?P = sets ?C" | 
| 756 | by (simp add: sets_pair_measure sigma_sets_pair_measure_generator_finite A B) | |
| 757 | fix X assume X: "X \<in> sets ?P" | |
| 758 | with eq have X_subset: "X \<subseteq> A \<times> B" by simp | |
| 759 | with A B have fin_Pair: "\<And>x. finite (Pair x -` X)" | |
| 760 | by (intro finite_subset[OF _ B]) auto | |
| 761 | have fin_X: "finite X" using X_subset by (rule finite_subset) (auto simp: A B) | |
| 67693 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 762 | have card: "0 < card (Pair a -` X)" if "(a, b) \<in> X" for a b | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 763 | using card_gt_0_iff fin_Pair that by auto | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 764 | then have "emeasure ?P X = \<integral>\<^sup>+ x. emeasure (count_space B) (Pair x -` X) | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 765 | \<partial>count_space A" | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 766 | by (simp add: B.emeasure_pair_measure_alt X) | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 767 | also have "... = emeasure ?C X" | 
| 47694 | 768 | apply (subst emeasure_count_space) | 
| 67693 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 769 | using card X_subset A fin_Pair fin_X | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 770 | apply (auto simp add: nn_integral_count_space | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 771 | of_nat_sum[symmetric] card_SigmaI[symmetric] | 
| 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 772 | simp del: card_SigmaI | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 773 | intro!: arg_cong[where f=card]) | 
| 47694 | 774 | done | 
| 67693 
4fa9d5ef95bc
fixed the proof of pair_measure_count_space
 paulson <lp15@cam.ac.uk> parents: 
67399diff
changeset | 775 | finally show "emeasure ?P X = emeasure ?C X" . | 
| 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: 
44890diff
changeset | 776 | qed | 
| 35833 | 777 | |
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 778 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 779 | lemma emeasure_prod_count_space: | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 780 | assumes A: "A \<in> sets (count_space UNIV \<Otimes>\<^sub>M M)" (is "A \<in> sets (?A \<Otimes>\<^sub>M ?B)") | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 781 | shows "emeasure (?A \<Otimes>\<^sub>M ?B) A = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x, y) \<partial>?B \<partial>?A)" | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 782 | by (rule emeasure_measure_of[OF pair_measure_def]) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 783 | (auto simp: countably_additive_def positive_def suminf_indicator A | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 784 | nn_integral_suminf[symmetric] dest: sets.sets_into_space) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 785 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 786 | lemma emeasure_prod_count_space_single[simp]: "emeasure (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) {x} = 1"
 | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 787 | proof - | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 788 |   have [simp]: "\<And>a b x y. indicator {(a, b)} (x, y) = (indicator {a} x * indicator {b} y::ennreal)"
 | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 789 | by (auto split: split_indicator) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 790 | show ?thesis | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 791 | by (cases x) (auto simp: emeasure_prod_count_space nn_integral_cmult sets_Pair) | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 792 | qed | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 793 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 794 | lemma emeasure_count_space_prod_eq: | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 795 |   fixes A :: "('a \<times> 'b) set"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 796 | assumes A: "A \<in> sets (count_space UNIV \<Otimes>\<^sub>M count_space UNIV)" (is "A \<in> sets (?A \<Otimes>\<^sub>M ?B)") | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 797 | shows "emeasure (?A \<Otimes>\<^sub>M ?B) A = emeasure (count_space UNIV) A" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 798 | proof - | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 799 |   { fix A :: "('a \<times> 'b) set" assume "countable A"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 800 |     then have "emeasure (?A \<Otimes>\<^sub>M ?B) (\<Union>a\<in>A. {a}) = (\<integral>\<^sup>+a. emeasure (?A \<Otimes>\<^sub>M ?B) {a} \<partial>count_space A)"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 801 | by (intro emeasure_UN_countable) (auto simp: sets_Pair disjoint_family_on_def) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 802 | also have "\<dots> = (\<integral>\<^sup>+a. indicator A a \<partial>count_space UNIV)" | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 803 | by (subst nn_integral_count_space_indicator) auto | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 804 | finally have "emeasure (?A \<Otimes>\<^sub>M ?B) A = emeasure (count_space UNIV) A" | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 805 | by simp } | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 806 | note * = this | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 807 | |
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 808 | show ?thesis | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 809 | proof cases | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 810 | assume "finite A" then show ?thesis | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 811 | by (intro * countable_finite) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 812 | next | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 813 | assume "infinite A" | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 814 | then obtain C where "countable C" and "infinite C" and "C \<subseteq> A" | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 815 | by (auto dest: infinite_countable_subset') | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 816 | with A have "emeasure (?A \<Otimes>\<^sub>M ?B) C \<le> emeasure (?A \<Otimes>\<^sub>M ?B) A" | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 817 | by (intro emeasure_mono) auto | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 818 | also have "emeasure (?A \<Otimes>\<^sub>M ?B) C = emeasure (count_space UNIV) C" | 
| 61808 | 819 | using \<open>countable C\<close> by (rule *) | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 820 | finally show ?thesis | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 821 | using \<open>infinite C\<close> \<open>infinite A\<close> by (simp add: top_unique) | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 822 | qed | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 823 | qed | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 824 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 825 | lemma nn_integral_count_space_prod_eq: | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 826 | "nn_integral (count_space UNIV \<Otimes>\<^sub>M count_space UNIV) f = nn_integral (count_space UNIV) f" | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 827 | (is "nn_integral ?P f = _") | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 828 | proof cases | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 829 |   assume cntbl: "countable {x. f x \<noteq> 0}"
 | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 830 |   have [simp]: "\<And>x. card ({x} \<inter> {x. f x \<noteq> 0}) = (indicator {x. f x \<noteq> 0} x::ennreal)"
 | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 831 | by (auto split: split_indicator) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 832 |   have [measurable]: "\<And>y. (\<lambda>x. indicator {y} x) \<in> borel_measurable ?P"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 833 |     by (rule measurable_discrete_difference[of "\<lambda>x. 0" _ borel "{y}" "\<lambda>x. indicator {y} x" for y])
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 834 | (auto intro: sets_Pair) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 835 | |
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 836 |   have "(\<integral>\<^sup>+x. f x \<partial>?P) = (\<integral>\<^sup>+x. \<integral>\<^sup>+x'. f x * indicator {x} x' \<partial>count_space {x. f x \<noteq> 0} \<partial>?P)"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 837 | by (auto simp add: nn_integral_cmult nn_integral_indicator' intro!: nn_integral_cong split: split_indicator) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 838 |   also have "\<dots> = (\<integral>\<^sup>+x. \<integral>\<^sup>+x'. f x' * indicator {x'} x \<partial>count_space {x. f x \<noteq> 0} \<partial>?P)"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 839 | by (auto intro!: nn_integral_cong split: split_indicator) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 840 |   also have "\<dots> = (\<integral>\<^sup>+x'. \<integral>\<^sup>+x. f x' * indicator {x'} x \<partial>?P \<partial>count_space {x. f x \<noteq> 0})"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 841 | by (intro nn_integral_count_space_nn_integral cntbl) auto | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 842 |   also have "\<dots> = (\<integral>\<^sup>+x'. f x' \<partial>count_space {x. f x \<noteq> 0})"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 843 | by (intro nn_integral_cong) (auto simp: nn_integral_cmult sets_Pair) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 844 | finally show ?thesis | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 845 | by (auto simp add: nn_integral_count_space_indicator intro!: nn_integral_cong split: split_indicator) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 846 | next | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 847 |   { fix x assume "f x \<noteq> 0"
 | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 848 | then have "(\<exists>r\<ge>0. 0 < r \<and> f x = ennreal r) \<or> f x = \<infinity>" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 849 | by (cases "f x" rule: ennreal_cases) (auto simp: less_le) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 850 | then have "\<exists>n. ennreal (1 / real (Suc n)) \<le> f x" | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 851 | by (auto elim!: nat_approx_posE intro!: less_imp_le) } | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 852 | note * = this | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 853 | |
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 854 |   assume cntbl: "uncountable {x. f x \<noteq> 0}"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 855 |   also have "{x. f x \<noteq> 0} = (\<Union>n. {x. 1/Suc n \<le> f x})"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 856 | using * by auto | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 857 |   finally obtain n where "infinite {x. 1/Suc n \<le> f x}"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 858 | by (meson countableI_type countable_UN uncountable_infinite) | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 859 |   then obtain C where C: "C \<subseteq> {x. 1/Suc n \<le> f x}" and "countable C" "infinite C"
 | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 860 | by (metis infinite_countable_subset') | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 861 | |
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 862 | have [measurable]: "C \<in> sets ?P" | 
| 61808 | 863 | using sets.countable[OF _ \<open>countable C\<close>, of ?P] by (auto simp: sets_Pair) | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 864 | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 865 | have "(\<integral>\<^sup>+x. ennreal (1/Suc n) * indicator C x \<partial>?P) \<le> nn_integral ?P f" | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 866 | using C by (intro nn_integral_mono) (auto split: split_indicator simp: zero_ereal_def[symmetric]) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 867 | moreover have "(\<integral>\<^sup>+x. ennreal (1/Suc n) * indicator C x \<partial>?P) = \<infinity>" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 868 | using \<open>infinite C\<close> by (simp add: nn_integral_cmult emeasure_count_space_prod_eq ennreal_mult_top) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 869 | moreover have "(\<integral>\<^sup>+x. ennreal (1/Suc n) * indicator C x \<partial>count_space UNIV) \<le> nn_integral (count_space UNIV) f" | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 870 | using C by (intro nn_integral_mono) (auto split: split_indicator simp: zero_ereal_def[symmetric]) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 871 | moreover have "(\<integral>\<^sup>+x. ennreal (1/Suc n) * indicator C x \<partial>count_space UNIV) = \<infinity>" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 872 | using \<open>infinite C\<close> by (simp add: nn_integral_cmult ennreal_mult_top) | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 873 | ultimately show ?thesis | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 874 | by (simp add: top_unique) | 
| 59426 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 875 | qed | 
| 
6fca83e88417
integral of the product of count spaces equals the integral of the count space of the product type
 hoelzl parents: 
59353diff
changeset | 876 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 877 | theorem pair_measure_density: | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 878 | assumes f: "f \<in> borel_measurable M1" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 879 | assumes g: "g \<in> borel_measurable M2" | 
| 50003 | 880 | assumes "sigma_finite_measure M2" "sigma_finite_measure (density M2 g)" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 881 | shows "density M1 f \<Otimes>\<^sub>M density M2 g = density (M1 \<Otimes>\<^sub>M M2) (\<lambda>(x,y). f x * g y)" (is "?L = ?R") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 882 | proof (rule measure_eqI) | 
| 47694 | 883 | interpret M2: sigma_finite_measure M2 by fact | 
| 884 | interpret D2: sigma_finite_measure "density M2 g" by fact | |
| 885 | ||
| 886 | fix A assume A: "A \<in> sets ?L" | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 887 | with f g have "(\<integral>\<^sup>+ x. f x * \<integral>\<^sup>+ y. g y * indicator A (x, y) \<partial>M2 \<partial>M1) = | 
| 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 888 | (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f x * g y * indicator A (x, y) \<partial>M2 \<partial>M1)" | 
| 56996 | 889 | by (intro nn_integral_cong_AE) | 
| 890 | (auto simp add: nn_integral_cmult[symmetric] ac_simps) | |
| 50003 | 891 | with A f g show "emeasure ?L A = emeasure ?R A" | 
| 56996 | 892 | by (simp add: D2.emeasure_pair_measure emeasure_density nn_integral_density | 
| 893 | M2.nn_integral_fst[symmetric] | |
| 894 | cong: nn_integral_cong) | |
| 47694 | 895 | qed simp | 
| 896 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 897 | lemma sigma_finite_measure_distr: | 
| 47694 | 898 | assumes "sigma_finite_measure (distr M N f)" and f: "f \<in> measurable M N" | 
| 899 | shows "sigma_finite_measure M" | |
| 40859 | 900 | proof - | 
| 47694 | 901 | interpret sigma_finite_measure "distr M N f" by fact | 
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 902 | from sigma_finite_countable guess A .. note A = this | 
| 47694 | 903 | show ?thesis | 
| 57447 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 904 | proof | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 905 | show "\<exists>A. countable A \<and> A \<subseteq> sets M \<and> \<Union>A = space M \<and> (\<forall>a\<in>A. emeasure M a \<noteq> \<infinity>)" | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 906 | using A f | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 907 | by (intro exI[of _ "(\<lambda>a. f -` a \<inter> space M) ` A"]) | 
| 
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
 hoelzl parents: 
57235diff
changeset | 908 | (auto simp: emeasure_distr set_eq_iff subset_eq intro: measurable_space) | 
| 47694 | 909 | qed | 
| 38656 | 910 | qed | 
| 911 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 912 | lemma pair_measure_distr: | 
| 47694 | 913 | assumes f: "f \<in> measurable M S" and g: "g \<in> measurable N T" | 
| 50003 | 914 | assumes "sigma_finite_measure (distr N T g)" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 915 | shows "distr M S f \<Otimes>\<^sub>M distr N T g = distr (M \<Otimes>\<^sub>M N) (S \<Otimes>\<^sub>M T) (\<lambda>(x, y). (f x, g y))" (is "?P = ?D") | 
| 47694 | 916 | proof (rule measure_eqI) | 
| 917 | interpret T: sigma_finite_measure "distr N T g" by fact | |
| 918 | interpret N: sigma_finite_measure N by (rule sigma_finite_measure_distr) fact+ | |
| 50003 | 919 | |
| 47694 | 920 | fix A assume A: "A \<in> sets ?P" | 
| 50003 | 921 | with f g show "emeasure ?P A = emeasure ?D A" | 
| 922 | by (auto simp add: N.emeasure_pair_measure_alt space_pair_measure emeasure_distr | |
| 56996 | 923 | T.emeasure_pair_measure_alt nn_integral_distr | 
| 924 | intro!: nn_integral_cong arg_cong[where f="emeasure N"]) | |
| 50003 | 925 | qed simp | 
| 39097 | 926 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 927 | lemma pair_measure_eqI: | 
| 50104 | 928 | assumes "sigma_finite_measure M1" "sigma_finite_measure M2" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 929 | assumes sets: "sets (M1 \<Otimes>\<^sub>M M2) = sets M" | 
| 50104 | 930 | assumes emeasure: "\<And>A B. A \<in> sets M1 \<Longrightarrow> B \<in> sets M2 \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure M (A \<times> B)" | 
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 931 | shows "M1 \<Otimes>\<^sub>M M2 = M" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 932 | proof - | 
| 50104 | 933 | interpret M1: sigma_finite_measure M1 by fact | 
| 934 | interpret M2: sigma_finite_measure M2 by fact | |
| 61169 | 935 | interpret pair_sigma_finite M1 M2 .. | 
| 50104 | 936 |   from sigma_finite_up_in_pair_measure_generator guess F :: "nat \<Rightarrow> ('a \<times> 'b) set" .. note F = this
 | 
| 937 |   let ?E = "{a \<times> b |a b. a \<in> sets M1 \<and> b \<in> sets M2}"
 | |
| 53015 
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
 wenzelm parents: 
50244diff
changeset | 938 | let ?P = "M1 \<Otimes>\<^sub>M M2" | 
| 50104 | 939 | show ?thesis | 
| 940 | proof (rule measure_eqI_generator_eq[OF Int_stable_pair_measure_generator[of M1 M2]]) | |
| 941 | show "?E \<subseteq> Pow (space ?P)" | |
| 50244 
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
 immler parents: 
50104diff
changeset | 942 | using sets.space_closed[of M1] sets.space_closed[of M2] by (auto simp: space_pair_measure) | 
| 50104 | 943 | show "sets ?P = sigma_sets (space ?P) ?E" | 
| 944 | by (simp add: sets_pair_measure space_pair_measure) | |
| 945 | then show "sets M = sigma_sets (space ?P) ?E" | |
| 946 | using sets[symmetric] by simp | |
| 947 | next | |
| 948 | show "range F \<subseteq> ?E" "(\<Union>i. F i) = space ?P" "\<And>i. emeasure ?P (F i) \<noteq> \<infinity>" | |
| 949 | using F by (auto simp: space_pair_measure) | |
| 950 | next | |
| 951 | fix X assume "X \<in> ?E" | |
| 952 | 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 | |
| 953 | then have "emeasure ?P X = emeasure M1 A * emeasure M2 B" | |
| 954 | by (simp add: M2.emeasure_pair_measure_Times) | |
| 955 | also have "\<dots> = emeasure M (A \<times> B)" | |
| 956 | using A B emeasure by auto | |
| 957 | finally show "emeasure ?P X = emeasure M X" | |
| 958 | by simp | |
| 959 | qed | |
| 960 | qed | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 961 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 962 | lemma sets_pair_countable: | 
| 57025 | 963 | assumes "countable S1" "countable S2" | 
| 964 | assumes M: "sets M = Pow S1" and N: "sets N = Pow S2" | |
| 965 | shows "sets (M \<Otimes>\<^sub>M N) = Pow (S1 \<times> S2)" | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 966 | proof auto | 
| 57025 | 967 | fix x a b assume x: "x \<in> sets (M \<Otimes>\<^sub>M N)" "(a, b) \<in> x" | 
| 968 | from sets.sets_into_space[OF x(1)] x(2) | |
| 969 | sets_eq_imp_space_eq[of N "count_space S2"] sets_eq_imp_space_eq[of M "count_space S1"] M N | |
| 970 | show "a \<in> S1" "b \<in> S2" | |
| 971 | by (auto simp: space_pair_measure) | |
| 972 | next | |
| 973 | fix X assume X: "X \<subseteq> S1 \<times> S2" | |
| 974 | then have "countable X" | |
| 61808 | 975 | by (metis countable_subset \<open>countable S1\<close> \<open>countable S2\<close> countable_SIGMA) | 
| 57025 | 976 |   have "X = (\<Union>(a, b)\<in>X. {a} \<times> {b})" by auto
 | 
| 977 | also have "\<dots> \<in> sets (M \<Otimes>\<^sub>M N)" | |
| 978 | using X | |
| 61808 | 979 | by (safe intro!: sets.countable_UN' \<open>countable X\<close> subsetI pair_measureI) (auto simp: M N) | 
| 57025 | 980 | finally show "X \<in> sets (M \<Otimes>\<^sub>M N)" . | 
| 981 | qed | |
| 982 | ||
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 983 | lemma pair_measure_countable: | 
| 57025 | 984 | assumes "countable S1" "countable S2" | 
| 985 | shows "count_space S1 \<Otimes>\<^sub>M count_space S2 = count_space (S1 \<times> S2)" | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 986 | proof (rule pair_measure_eqI) | 
| 57025 | 987 | show "sigma_finite_measure (count_space S1)" "sigma_finite_measure (count_space S2)" | 
| 988 | using assms by (auto intro!: sigma_finite_measure_count_space_countable) | |
| 989 | show "sets (count_space S1 \<Otimes>\<^sub>M count_space S2) = sets (count_space (S1 \<times> S2))" | |
| 990 | by (subst sets_pair_countable[OF assms]) auto | |
| 991 | next | |
| 992 | fix A B assume "A \<in> sets (count_space S1)" "B \<in> sets (count_space S2)" | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 993 | then show "emeasure (count_space S1) A * emeasure (count_space S2) B = | 
| 57025 | 994 | emeasure (count_space (S1 \<times> S2)) (A \<times> B)" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 995 | by (subst (1 2 3) emeasure_count_space) (auto simp: finite_cartesian_product_iff ennreal_mult_top ennreal_top_mult) | 
| 57025 | 996 | qed | 
| 50104 | 997 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 998 | proposition nn_integral_fst_count_space: | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 999 | "(\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) \<partial>count_space UNIV \<partial>count_space UNIV) = integral\<^sup>N (count_space UNIV) f" | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1000 | (is "?lhs = ?rhs") | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 1001 | proof(cases) | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1002 |   assume *: "countable {xy. f xy \<noteq> 0}"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1003 |   let ?A = "fst ` {xy. f xy \<noteq> 0}"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1004 |   let ?B = "snd ` {xy. f xy \<noteq> 0}"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1005 | from * have [simp]: "countable ?A" "countable ?B" by(rule countable_image)+ | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1006 | have "?lhs = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) \<partial>count_space UNIV \<partial>count_space ?A)" | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1007 | by(rule nn_integral_count_space_eq) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1008 | (auto simp add: nn_integral_0_iff_AE AE_count_space not_le intro: rev_image_eqI) | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1009 | also have "\<dots> = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) \<partial>count_space ?B \<partial>count_space ?A)" | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1010 | by(intro nn_integral_count_space_eq nn_integral_cong)(auto intro: rev_image_eqI) | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1011 | also have "\<dots> = (\<integral>\<^sup>+ xy. f xy \<partial>count_space (?A \<times> ?B))" | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1012 | by(subst sigma_finite_measure.nn_integral_fst) | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1013 | (simp_all add: sigma_finite_measure_count_space_countable pair_measure_countable) | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1014 | also have "\<dots> = ?rhs" | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1015 | by(rule nn_integral_count_space_eq)(auto intro: rev_image_eqI) | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1016 | finally show ?thesis . | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1017 | next | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1018 |   { fix xy assume "f xy \<noteq> 0"
 | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1019 | then have "(\<exists>r\<ge>0. 0 < r \<and> f xy = ennreal r) \<or> f xy = \<infinity>" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1020 | by (cases "f xy" rule: ennreal_cases) (auto simp: less_le) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1021 | then have "\<exists>n. ennreal (1 / real (Suc n)) \<le> f xy" | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1022 | by (auto elim!: nat_approx_posE intro!: less_imp_le) } | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1023 | note * = this | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1024 | |
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1025 |   assume cntbl: "uncountable {xy. f xy \<noteq> 0}"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1026 |   also have "{xy. f xy \<noteq> 0} = (\<Union>n. {xy. 1/Suc n \<le> f xy})"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1027 | using * by auto | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1028 |   finally obtain n where "infinite {xy. 1/Suc n \<le> f xy}"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1029 | by (meson countableI_type countable_UN uncountable_infinite) | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1030 |   then obtain C where C: "C \<subseteq> {xy. 1/Suc n \<le> f xy}" and "countable C" "infinite C"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1031 | by (metis infinite_countable_subset') | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1032 | |
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1033 | have "\<infinity> = (\<integral>\<^sup>+ xy. ennreal (1 / Suc n) * indicator C xy \<partial>count_space UNIV)" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1034 | using \<open>infinite C\<close> by(simp add: nn_integral_cmult ennreal_mult_top) | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1035 | also have "\<dots> \<le> ?rhs" using C | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1036 | by(intro nn_integral_mono)(auto split: split_indicator) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1037 | finally have "?rhs = \<infinity>" by (simp add: top_unique) | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1038 | moreover have "?lhs = \<infinity>" | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1039 | proof(cases "finite (fst ` C)") | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1040 | case True | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1041 | then obtain x C' where x: "x \<in> fst ` C" | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1042 |       and C': "C' = fst -` {x} \<inter> C"
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1043 | and "infinite C'" | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1044 | using \<open>infinite C\<close> by(auto elim!: inf_img_fin_domE') | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1045 |     from x C C' have **: "C' \<subseteq> {xy. 1 / Suc n \<le> f xy}" by auto
 | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1046 | |
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1047 | from C' \<open>infinite C'\<close> have "infinite (snd ` C')" | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1048 | by(auto dest!: finite_imageD simp add: inj_on_def) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1049 | then have "\<infinity> = (\<integral>\<^sup>+ y. ennreal (1 / Suc n) * indicator (snd ` C') y \<partial>count_space UNIV)" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1050 | by(simp add: nn_integral_cmult ennreal_mult_top) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1051 | also have "\<dots> = (\<integral>\<^sup>+ y. ennreal (1 / Suc n) * indicator C' (x, y) \<partial>count_space UNIV)" | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1052 | by(rule nn_integral_cong)(force split: split_indicator intro: rev_image_eqI simp add: C') | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1053 |     also have "\<dots> = (\<integral>\<^sup>+ x'. (\<integral>\<^sup>+ y. ennreal (1 / Suc n) * indicator C' (x, y) \<partial>count_space UNIV) * indicator {x} x' \<partial>count_space UNIV)"
 | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1054 | by(simp add: one_ereal_def[symmetric]) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1055 | also have "\<dots> \<le> (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. ennreal (1 / Suc n) * indicator C' (x, y) \<partial>count_space UNIV \<partial>count_space UNIV)" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1056 | by(rule nn_integral_mono)(simp split: split_indicator) | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1057 | also have "\<dots> \<le> ?lhs" using ** | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1058 | by(intro nn_integral_mono)(auto split: split_indicator) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1059 | finally show ?thesis by (simp add: top_unique) | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1060 | next | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1061 | case False | 
| 63040 | 1062 | define C' where "C' = fst ` C" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1063 | have "\<infinity> = \<integral>\<^sup>+ x. ennreal (1 / Suc n) * indicator C' x \<partial>count_space UNIV" | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1064 | using C'_def False by(simp add: nn_integral_cmult ennreal_mult_top) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1065 |     also have "\<dots> = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. ennreal (1 / Suc n) * indicator C' x * indicator {SOME y. (x, y) \<in> C} y \<partial>count_space UNIV \<partial>count_space UNIV"
 | 
| 62083 | 1066 | by(auto simp add: one_ereal_def[symmetric] max_def intro: nn_integral_cong) | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1067 | also have "\<dots> \<le> \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. ennreal (1 / Suc n) * indicator C (x, y) \<partial>count_space UNIV \<partial>count_space UNIV" | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1068 | by(intro nn_integral_mono)(auto simp add: C'_def split: split_indicator intro: someI) | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1069 | also have "\<dots> \<le> ?lhs" using C | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1070 | by(intro nn_integral_mono)(auto split: split_indicator) | 
| 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1071 | finally show ?thesis by (simp add: top_unique) | 
| 59489 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1072 | qed | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1073 | ultimately show ?thesis by simp | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1074 | qed | 
| 
fd5d23cc0e97
nn_integral can be split over arbitrary product count_spaces
 Andreas Lochbihler parents: 
59426diff
changeset | 1075 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 1076 | proposition nn_integral_snd_count_space: | 
| 59491 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1077 | "(\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. f (x, y) \<partial>count_space UNIV \<partial>count_space UNIV) = integral\<^sup>N (count_space UNIV) f" | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1078 | (is "?lhs = ?rhs") | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1079 | proof - | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1080 | have "?lhs = (\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. (\<lambda>(y, x). f (x, y)) (y, x) \<partial>count_space UNIV \<partial>count_space UNIV)" | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1081 | by(simp) | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1082 | also have "\<dots> = \<integral>\<^sup>+ yx. (\<lambda>(y, x). f (x, y)) yx \<partial>count_space UNIV" | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1083 | by(rule nn_integral_fst_count_space) | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1084 | also have "\<dots> = \<integral>\<^sup>+ xy. f xy \<partial>count_space ((\<lambda>(x, y). (y, x)) ` UNIV)" | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1085 | by(subst nn_integral_bij_count_space[OF inj_on_imp_bij_betw, symmetric]) | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1086 | (simp_all add: inj_on_def split_def) | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1087 | also have "\<dots> = ?rhs" by(rule nn_integral_count_space_eq) auto | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1088 | finally show ?thesis . | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1089 | qed | 
| 
40f570f9a284
add another lemma to split nn_integral over product count_space
 Andreas Lochbihler parents: 
59489diff
changeset | 1090 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 1091 | lemma measurable_pair_measure_countable1: | 
| 60066 | 1092 | assumes "countable A" | 
| 1093 | and [measurable]: "\<And>x. x \<in> A \<Longrightarrow> (\<lambda>y. f (x, y)) \<in> measurable N K" | |
| 1094 | shows "f \<in> measurable (count_space A \<Otimes>\<^sub>M N) K" | |
| 1095 | using _ _ assms(1) | |
| 1096 | by(rule measurable_compose_countable'[where f="\<lambda>a b. f (a, snd b)" and g=fst and I=A, simplified])simp_all | |
| 1097 | ||
| 69683 | 1098 | subsection \<open>Product of Borel spaces\<close> | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1099 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 1100 | theorem borel_Times: | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1101 | fixes A :: "'a::topological_space set" and B :: "'b::topological_space set" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1102 | assumes A: "A \<in> sets borel" and B: "B \<in> sets borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1103 | shows "A \<times> B \<in> sets borel" | 
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 1104 | proof - | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1105 | have "A \<times> B = (A\<times>UNIV) \<inter> (UNIV \<times> B)" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1106 | by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1107 | moreover | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1108 |   { have "A \<in> sigma_sets UNIV {S. open S}" using A by (simp add: sets_borel)
 | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1109 | then have "A\<times>UNIV \<in> sets borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1110 | proof (induct A) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1111 | case (Basic S) then show ?case | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1112 | by (auto intro!: borel_open open_Times) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1113 | next | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1114 | case (Compl A) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1115 | moreover have *: "(UNIV - A) \<times> UNIV = UNIV - (A \<times> UNIV)" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1116 | by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1117 | ultimately show ?case | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1118 | unfolding * by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1119 | next | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1120 | case (Union A) | 
| 69313 | 1121 | moreover have *: "(\<Union>(A ` UNIV)) \<times> UNIV = \<Union>((\<lambda>i. A i \<times> UNIV) ` UNIV)" | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1122 | by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1123 | ultimately show ?case | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1124 | unfolding * by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1125 | qed simp } | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1126 | moreover | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1127 |   { have "B \<in> sigma_sets UNIV {S. open S}" using B by (simp add: sets_borel)
 | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1128 | then have "UNIV\<times>B \<in> sets borel" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1129 | proof (induct B) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1130 | case (Basic S) then show ?case | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1131 | by (auto intro!: borel_open open_Times) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1132 | next | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1133 | case (Compl B) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1134 | moreover have *: "UNIV \<times> (UNIV - B) = UNIV - (UNIV \<times> B)" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1135 | by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1136 | ultimately show ?case | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1137 | unfolding * by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1138 | next | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1139 | case (Union B) | 
| 69313 | 1140 | moreover have *: "UNIV \<times> (\<Union>(B ` UNIV)) = \<Union>((\<lambda>i. UNIV \<times> B i) ` UNIV)" | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1141 | by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1142 | ultimately show ?case | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1143 | unfolding * by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1144 | qed simp } | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1145 | ultimately show ?thesis | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1146 | by auto | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1147 | qed | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1148 | |
| 69652 
3417a8f154eb
updated tagging first 5
 Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> parents: 
69566diff
changeset | 1149 | lemma finite_measure_pair_measure: | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1150 | assumes "finite_measure M" "finite_measure N" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1151 | shows "finite_measure (N \<Otimes>\<^sub>M M)" | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1152 | proof (rule finite_measureI) | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1153 | interpret M: finite_measure M by fact | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1154 | interpret N: finite_measure N by fact | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1155 | show "emeasure (N \<Otimes>\<^sub>M M) (space (N \<Otimes>\<^sub>M M)) \<noteq> \<infinity>" | 
| 62975 
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
 hoelzl parents: 
62390diff
changeset | 1156 | by (auto simp: space_pair_measure M.emeasure_pair_measure_Times ennreal_mult_eq_top_iff) | 
| 57235 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1157 | qed | 
| 
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
 hoelzl parents: 
57025diff
changeset | 1158 | |
| 62083 | 1159 | end |