author | wenzelm |
Thu, 24 Jul 2014 11:54:15 +0200 | |
changeset 57641 | dc59f147b27d |
parent 57512 | cc97b347b301 |
child 58876 | 1888e3cb8048 |
permissions | -rw-r--r-- |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
1 |
(* Title: HOL/Probability/Independent_Family.thy |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
2 |
Author: Johannes Hölzl, TU München |
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
3 |
Author: Sudeep Kanav, TU München |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
4 |
*) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
5 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
6 |
header {* Independent families of events, event sets, and random variables *} |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
7 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
8 |
theory Independent_Family |
47694 | 9 |
imports Probability_Measure Infinite_Product_Measure |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
10 |
begin |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
11 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
12 |
definition (in prob_space) |
42983 | 13 |
"indep_sets F I \<longleftrightarrow> (\<forall>i\<in>I. F i \<subseteq> events) \<and> |
42981 | 14 |
(\<forall>J\<subseteq>I. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> (\<forall>A\<in>Pi J F. prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))))" |
15 |
||
16 |
definition (in prob_space) |
|
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
17 |
"indep_set A B \<longleftrightarrow> indep_sets (case_bool A B) UNIV" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
18 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
19 |
definition (in prob_space) |
49784
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
20 |
indep_events_def_alt: "indep_events A I \<longleftrightarrow> indep_sets (\<lambda>i. {A i}) I" |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
21 |
|
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
22 |
lemma (in prob_space) indep_events_def: |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
23 |
"indep_events A I \<longleftrightarrow> (A`I \<subseteq> events) \<and> |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
24 |
(\<forall>J\<subseteq>I. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j)))" |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
25 |
unfolding indep_events_def_alt indep_sets_def |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
26 |
apply (simp add: Ball_def Pi_iff image_subset_iff_funcset) |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
27 |
apply (intro conj_cong refl arg_cong[where f=All] ext imp_cong) |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
28 |
apply auto |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
29 |
done |
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
30 |
|
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
31 |
definition (in prob_space) |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
32 |
"indep_event A B \<longleftrightarrow> indep_events (case_bool A B) UNIV" |
49784
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
33 |
|
47694 | 34 |
lemma (in prob_space) indep_sets_cong: |
42981 | 35 |
"I = J \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> F i = G i) \<Longrightarrow> indep_sets F I \<longleftrightarrow> indep_sets G J" |
36 |
by (simp add: indep_sets_def, intro conj_cong all_cong imp_cong ball_cong) blast+ |
|
37 |
||
38 |
lemma (in prob_space) indep_events_finite_index_events: |
|
39 |
"indep_events F I \<longleftrightarrow> (\<forall>J\<subseteq>I. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> indep_events F J)" |
|
40 |
by (auto simp: indep_events_def) |
|
41 |
||
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
42 |
lemma (in prob_space) indep_sets_finite_index_sets: |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
43 |
"indep_sets F I \<longleftrightarrow> (\<forall>J\<subseteq>I. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> indep_sets F J)" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
44 |
proof (intro iffI allI impI) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
45 |
assume *: "\<forall>J\<subseteq>I. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> indep_sets F J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
46 |
show "indep_sets F I" unfolding indep_sets_def |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
47 |
proof (intro conjI ballI allI impI) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
48 |
fix i assume "i \<in> I" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
49 |
with *[THEN spec, of "{i}"] show "F i \<subseteq> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
50 |
by (auto simp: indep_sets_def) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
51 |
qed (insert *, auto simp: indep_sets_def) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
52 |
qed (auto simp: indep_sets_def) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
53 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
54 |
lemma (in prob_space) indep_sets_mono_index: |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
55 |
"J \<subseteq> I \<Longrightarrow> indep_sets F I \<Longrightarrow> indep_sets F J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
56 |
unfolding indep_sets_def by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
57 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
58 |
lemma (in prob_space) indep_sets_mono_sets: |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
59 |
assumes indep: "indep_sets F I" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
60 |
assumes mono: "\<And>i. i\<in>I \<Longrightarrow> G i \<subseteq> F i" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
61 |
shows "indep_sets G I" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
62 |
proof - |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
63 |
have "(\<forall>i\<in>I. F i \<subseteq> events) \<Longrightarrow> (\<forall>i\<in>I. G i \<subseteq> events)" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
64 |
using mono by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
65 |
moreover have "\<And>A J. J \<subseteq> I \<Longrightarrow> A \<in> (\<Pi> j\<in>J. G j) \<Longrightarrow> A \<in> (\<Pi> j\<in>J. F j)" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
66 |
using mono by (auto simp: Pi_iff) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
67 |
ultimately show ?thesis |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
68 |
using indep by (auto simp: indep_sets_def) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
69 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
70 |
|
49772 | 71 |
lemma (in prob_space) indep_sets_mono: |
72 |
assumes indep: "indep_sets F I" |
|
73 |
assumes mono: "J \<subseteq> I" "\<And>i. i\<in>J \<Longrightarrow> G i \<subseteq> F i" |
|
74 |
shows "indep_sets G J" |
|
75 |
apply (rule indep_sets_mono_sets) |
|
76 |
apply (rule indep_sets_mono_index) |
|
77 |
apply (fact +) |
|
78 |
done |
|
79 |
||
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
80 |
lemma (in prob_space) indep_setsI: |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
81 |
assumes "\<And>i. i \<in> I \<Longrightarrow> F i \<subseteq> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
82 |
and "\<And>A J. J \<noteq> {} \<Longrightarrow> J \<subseteq> I \<Longrightarrow> finite J \<Longrightarrow> (\<forall>j\<in>J. A j \<in> F j) \<Longrightarrow> prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
83 |
shows "indep_sets F I" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
84 |
using assms unfolding indep_sets_def by (auto simp: Pi_iff) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
85 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
86 |
lemma (in prob_space) indep_setsD: |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
87 |
assumes "indep_sets F I" and "J \<subseteq> I" "J \<noteq> {}" "finite J" "\<forall>j\<in>J. A j \<in> F j" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
88 |
shows "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
89 |
using assms unfolding indep_sets_def by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
90 |
|
42982 | 91 |
lemma (in prob_space) indep_setI: |
92 |
assumes ev: "A \<subseteq> events" "B \<subseteq> events" |
|
93 |
and indep: "\<And>a b. a \<in> A \<Longrightarrow> b \<in> B \<Longrightarrow> prob (a \<inter> b) = prob a * prob b" |
|
94 |
shows "indep_set A B" |
|
95 |
unfolding indep_set_def |
|
96 |
proof (rule indep_setsI) |
|
97 |
fix F J assume "J \<noteq> {}" "J \<subseteq> UNIV" |
|
98 |
and F: "\<forall>j\<in>J. F j \<in> (case j of True \<Rightarrow> A | False \<Rightarrow> B)" |
|
99 |
have "J \<in> Pow UNIV" by auto |
|
100 |
with F `J \<noteq> {}` indep[of "F True" "F False"] |
|
101 |
show "prob (\<Inter>j\<in>J. F j) = (\<Prod>j\<in>J. prob (F j))" |
|
102 |
unfolding UNIV_bool Pow_insert by (auto simp: ac_simps) |
|
103 |
qed (auto split: bool.split simp: ev) |
|
104 |
||
105 |
lemma (in prob_space) indep_setD: |
|
106 |
assumes indep: "indep_set A B" and ev: "a \<in> A" "b \<in> B" |
|
107 |
shows "prob (a \<inter> b) = prob a * prob b" |
|
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
108 |
using indep[unfolded indep_set_def, THEN indep_setsD, of UNIV "case_bool a b"] ev |
42982 | 109 |
by (simp add: ac_simps UNIV_bool) |
110 |
||
111 |
lemma (in prob_space) |
|
112 |
assumes indep: "indep_set A B" |
|
42983 | 113 |
shows indep_setD_ev1: "A \<subseteq> events" |
114 |
and indep_setD_ev2: "B \<subseteq> events" |
|
42982 | 115 |
using indep unfolding indep_set_def indep_sets_def UNIV_bool by auto |
116 |
||
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
117 |
lemma (in prob_space) indep_sets_dynkin: |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
118 |
assumes indep: "indep_sets F I" |
47694 | 119 |
shows "indep_sets (\<lambda>i. dynkin (space M) (F i)) I" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
120 |
(is "indep_sets ?F I") |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
121 |
proof (subst indep_sets_finite_index_sets, intro allI impI ballI) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
122 |
fix J assume "finite J" "J \<subseteq> I" "J \<noteq> {}" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
123 |
with indep have "indep_sets F J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
124 |
by (subst (asm) indep_sets_finite_index_sets) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
125 |
{ fix J K assume "indep_sets F K" |
46731 | 126 |
let ?G = "\<lambda>S i. if i \<in> S then ?F i else F i" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
127 |
assume "finite J" "J \<subseteq> K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
128 |
then have "indep_sets (?G J) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
129 |
proof induct |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
130 |
case (insert j J) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
131 |
moreover def G \<equiv> "?G J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
132 |
ultimately have G: "indep_sets G K" "\<And>i. i \<in> K \<Longrightarrow> G i \<subseteq> events" and "j \<in> K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
133 |
by (auto simp: indep_sets_def) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
134 |
let ?D = "{E\<in>events. indep_sets (G(j := {E})) K }" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
135 |
{ fix X assume X: "X \<in> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
136 |
assume indep: "\<And>J A. J \<noteq> {} \<Longrightarrow> J \<subseteq> K \<Longrightarrow> finite J \<Longrightarrow> j \<notin> J \<Longrightarrow> (\<forall>i\<in>J. A i \<in> G i) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
137 |
\<Longrightarrow> prob ((\<Inter>i\<in>J. A i) \<inter> X) = prob X * (\<Prod>i\<in>J. prob (A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
138 |
have "indep_sets (G(j := {X})) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
139 |
proof (rule indep_setsI) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
140 |
fix i assume "i \<in> K" then show "(G(j:={X})) i \<subseteq> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
141 |
using G X by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
142 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
143 |
fix A J assume J: "J \<noteq> {}" "J \<subseteq> K" "finite J" "\<forall>i\<in>J. A i \<in> (G(j := {X})) i" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
144 |
show "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
145 |
proof cases |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
146 |
assume "j \<in> J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
147 |
with J have "A j = X" by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
148 |
show ?thesis |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
149 |
proof cases |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
150 |
assume "J = {j}" then show ?thesis by simp |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
151 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
152 |
assume "J \<noteq> {j}" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
153 |
have "prob (\<Inter>i\<in>J. A i) = prob ((\<Inter>i\<in>J-{j}. A i) \<inter> X)" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
154 |
using `j \<in> J` `A j = X` by (auto intro!: arg_cong[where f=prob] split: split_if_asm) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
155 |
also have "\<dots> = prob X * (\<Prod>i\<in>J-{j}. prob (A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
156 |
proof (rule indep) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
157 |
show "J - {j} \<noteq> {}" "J - {j} \<subseteq> K" "finite (J - {j})" "j \<notin> J - {j}" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
158 |
using J `J \<noteq> {j}` `j \<in> J` by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
159 |
show "\<forall>i\<in>J - {j}. A i \<in> G i" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
160 |
using J by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
161 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
162 |
also have "\<dots> = prob (A j) * (\<Prod>i\<in>J-{j}. prob (A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
163 |
using `A j = X` by simp |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
164 |
also have "\<dots> = (\<Prod>i\<in>J. prob (A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
165 |
unfolding setprod.insert_remove[OF `finite J`, symmetric, of "\<lambda>i. prob (A i)"] |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
166 |
using `j \<in> J` by (simp add: insert_absorb) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
167 |
finally show ?thesis . |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
168 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
169 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
170 |
assume "j \<notin> J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
171 |
with J have "\<forall>i\<in>J. A i \<in> G i" by (auto split: split_if_asm) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
172 |
with J show ?thesis |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
173 |
by (intro indep_setsD[OF G(1)]) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
174 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
175 |
qed } |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
176 |
note indep_sets_insert = this |
47694 | 177 |
have "dynkin_system (space M) ?D" |
42987 | 178 |
proof (rule dynkin_systemI', simp_all cong del: indep_sets_cong, safe) |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
179 |
show "indep_sets (G(j := {{}})) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
180 |
by (rule indep_sets_insert) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
181 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
182 |
fix X assume X: "X \<in> events" and G': "indep_sets (G(j := {X})) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
183 |
show "indep_sets (G(j := {space M - X})) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
184 |
proof (rule indep_sets_insert) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
185 |
fix J A assume J: "J \<noteq> {}" "J \<subseteq> K" "finite J" "j \<notin> J" and A: "\<forall>i\<in>J. A i \<in> G i" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
186 |
then have A_sets: "\<And>i. i\<in>J \<Longrightarrow> A i \<in> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
187 |
using G by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
188 |
have "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) = |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
189 |
prob ((\<Inter>j\<in>J. A j) - (\<Inter>i\<in>insert j J. (A(j := X)) i))" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
190 |
using A_sets sets.sets_into_space[of _ M] X `J \<noteq> {}` |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
191 |
by (auto intro!: arg_cong[where f=prob] split: split_if_asm) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
192 |
also have "\<dots> = prob (\<Inter>j\<in>J. A j) - prob (\<Inter>i\<in>insert j J. (A(j := X)) i)" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
193 |
using J `J \<noteq> {}` `j \<notin> J` A_sets X sets.sets_into_space |
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
194 |
by (auto intro!: finite_measure_Diff sets.finite_INT split: split_if_asm) |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
195 |
finally have "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) = |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
196 |
prob (\<Inter>j\<in>J. A j) - prob (\<Inter>i\<in>insert j J. (A(j := X)) i)" . |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
197 |
moreover { |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
198 |
have "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
199 |
using J A `finite J` by (intro indep_setsD[OF G(1)]) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
200 |
then have "prob (\<Inter>j\<in>J. A j) = prob (space M) * (\<Prod>i\<in>J. prob (A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
201 |
using prob_space by simp } |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
202 |
moreover { |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
203 |
have "prob (\<Inter>i\<in>insert j J. (A(j := X)) i) = (\<Prod>i\<in>insert j J. prob ((A(j := X)) i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
204 |
using J A `j \<in> K` by (intro indep_setsD[OF G']) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
205 |
then have "prob (\<Inter>i\<in>insert j J. (A(j := X)) i) = prob X * (\<Prod>i\<in>J. prob (A i))" |
57418 | 206 |
using `finite J` `j \<notin> J` by (auto intro!: setprod.cong) } |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
207 |
ultimately have "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) = (prob (space M) - prob X) * (\<Prod>i\<in>J. prob (A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
208 |
by (simp add: field_simps) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
209 |
also have "\<dots> = prob (space M - X) * (\<Prod>i\<in>J. prob (A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
210 |
using X A by (simp add: finite_measure_compl) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
211 |
finally show "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) = prob (space M - X) * (\<Prod>i\<in>J. prob (A i))" . |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
212 |
qed (insert X, auto) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
213 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
214 |
fix F :: "nat \<Rightarrow> 'a set" assume disj: "disjoint_family F" and "range F \<subseteq> ?D" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
215 |
then have F: "\<And>i. F i \<in> events" "\<And>i. indep_sets (G(j:={F i})) K" by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
216 |
show "indep_sets (G(j := {\<Union>k. F k})) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
217 |
proof (rule indep_sets_insert) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
218 |
fix J A assume J: "j \<notin> J" "J \<noteq> {}" "J \<subseteq> K" "finite J" and A: "\<forall>i\<in>J. A i \<in> G i" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
219 |
then have A_sets: "\<And>i. i\<in>J \<Longrightarrow> A i \<in> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
220 |
using G by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
221 |
have "prob ((\<Inter>j\<in>J. A j) \<inter> (\<Union>k. F k)) = prob (\<Union>k. (\<Inter>i\<in>insert j J. (A(j := F k)) i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
222 |
using `J \<noteq> {}` `j \<notin> J` `j \<in> K` by (auto intro!: arg_cong[where f=prob] split: split_if_asm) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
223 |
moreover have "(\<lambda>k. prob (\<Inter>i\<in>insert j J. (A(j := F k)) i)) sums prob (\<Union>k. (\<Inter>i\<in>insert j J. (A(j := F k)) i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
224 |
proof (rule finite_measure_UNION) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
225 |
show "disjoint_family (\<lambda>k. \<Inter>i\<in>insert j J. (A(j := F k)) i)" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
226 |
using disj by (rule disjoint_family_on_bisimulation) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
227 |
show "range (\<lambda>k. \<Inter>i\<in>insert j J. (A(j := F k)) i) \<subseteq> events" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
228 |
using A_sets F `finite J` `J \<noteq> {}` `j \<notin> J` by (auto intro!: sets.Int) |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
229 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
230 |
moreover { fix k |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
231 |
from J A `j \<in> K` have "prob (\<Inter>i\<in>insert j J. (A(j := F k)) i) = prob (F k) * (\<Prod>i\<in>J. prob (A i))" |
57418 | 232 |
by (subst indep_setsD[OF F(2)]) (auto intro!: setprod.cong split: split_if_asm) |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
233 |
also have "\<dots> = prob (F k) * prob (\<Inter>i\<in>J. A i)" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
234 |
using J A `j \<in> K` by (subst indep_setsD[OF G(1)]) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
235 |
finally have "prob (\<Inter>i\<in>insert j J. (A(j := F k)) i) = prob (F k) * prob (\<Inter>i\<in>J. A i)" . } |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
236 |
ultimately have "(\<lambda>k. prob (F k) * prob (\<Inter>i\<in>J. A i)) sums (prob ((\<Inter>j\<in>J. A j) \<inter> (\<Union>k. F k)))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
237 |
by simp |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
238 |
moreover |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
239 |
have "(\<lambda>k. prob (F k) * prob (\<Inter>i\<in>J. A i)) sums (prob (\<Union>k. F k) * prob (\<Inter>i\<in>J. A i))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
240 |
using disj F(1) by (intro finite_measure_UNION sums_mult2) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
241 |
then have "(\<lambda>k. prob (F k) * prob (\<Inter>i\<in>J. A i)) sums (prob (\<Union>k. F k) * (\<Prod>i\<in>J. prob (A i)))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
242 |
using J A `j \<in> K` by (subst indep_setsD[OF G(1), symmetric]) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
243 |
ultimately |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
244 |
show "prob ((\<Inter>j\<in>J. A j) \<inter> (\<Union>k. F k)) = prob (\<Union>k. F k) * (\<Prod>j\<in>J. prob (A j))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
245 |
by (auto dest!: sums_unique) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
246 |
qed (insert F, auto) |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
247 |
qed (insert sets.sets_into_space, auto) |
47694 | 248 |
then have mono: "dynkin (space M) (G j) \<subseteq> {E \<in> events. indep_sets (G(j := {E})) K}" |
249 |
proof (rule dynkin_system.dynkin_subset, safe) |
|
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
250 |
fix X assume "X \<in> G j" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
251 |
then show "X \<in> events" using G `j \<in> K` by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
252 |
from `indep_sets G K` |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
253 |
show "indep_sets (G(j := {X})) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
254 |
by (rule indep_sets_mono_sets) (insert `X \<in> G j`, auto) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
255 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
256 |
have "indep_sets (G(j:=?D)) K" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
257 |
proof (rule indep_setsI) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
258 |
fix i assume "i \<in> K" then show "(G(j := ?D)) i \<subseteq> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
259 |
using G(2) by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
260 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
261 |
fix A J assume J: "J\<noteq>{}" "J \<subseteq> K" "finite J" and A: "\<forall>i\<in>J. A i \<in> (G(j := ?D)) i" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
262 |
show "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
263 |
proof cases |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
264 |
assume "j \<in> J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
265 |
with A have indep: "indep_sets (G(j := {A j})) K" by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
266 |
from J A show ?thesis |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
267 |
by (intro indep_setsD[OF indep]) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
268 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
269 |
assume "j \<notin> J" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
270 |
with J A have "\<forall>i\<in>J. A i \<in> G i" by (auto split: split_if_asm) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
271 |
with J show ?thesis |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
272 |
by (intro indep_setsD[OF G(1)]) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
273 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
274 |
qed |
47694 | 275 |
then have "indep_sets (G(j := dynkin (space M) (G j))) K" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
276 |
by (rule indep_sets_mono_sets) (insert mono, auto) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
277 |
then show ?case |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
278 |
by (rule indep_sets_mono_sets) (insert `j \<in> K` `j \<notin> J`, auto simp: G_def) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
279 |
qed (insert `indep_sets F K`, simp) } |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
280 |
from this[OF `indep_sets F J` `finite J` subset_refl] |
47694 | 281 |
show "indep_sets ?F J" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
282 |
by (rule indep_sets_mono_sets) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
283 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
284 |
|
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
285 |
lemma (in prob_space) indep_sets_sigma: |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
286 |
assumes indep: "indep_sets F I" |
47694 | 287 |
assumes stable: "\<And>i. i \<in> I \<Longrightarrow> Int_stable (F i)" |
288 |
shows "indep_sets (\<lambda>i. sigma_sets (space M) (F i)) I" |
|
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
289 |
proof - |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
290 |
from indep_sets_dynkin[OF indep] |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
291 |
show ?thesis |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
292 |
proof (rule indep_sets_mono_sets, subst sigma_eq_dynkin, simp_all add: stable) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
293 |
fix i assume "i \<in> I" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
294 |
with indep have "F i \<subseteq> events" by (auto simp: indep_sets_def) |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
295 |
with sets.sets_into_space show "F i \<subseteq> Pow (space M)" by auto |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
296 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
297 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
298 |
|
42987 | 299 |
lemma (in prob_space) indep_sets_sigma_sets_iff: |
47694 | 300 |
assumes "\<And>i. i \<in> I \<Longrightarrow> Int_stable (F i)" |
42987 | 301 |
shows "indep_sets (\<lambda>i. sigma_sets (space M) (F i)) I \<longleftrightarrow> indep_sets F I" |
302 |
proof |
|
303 |
assume "indep_sets F I" then show "indep_sets (\<lambda>i. sigma_sets (space M) (F i)) I" |
|
47694 | 304 |
by (rule indep_sets_sigma) fact |
42987 | 305 |
next |
306 |
assume "indep_sets (\<lambda>i. sigma_sets (space M) (F i)) I" then show "indep_sets F I" |
|
307 |
by (rule indep_sets_mono_sets) (intro subsetI sigma_sets.Basic) |
|
308 |
qed |
|
309 |
||
49794 | 310 |
definition (in prob_space) |
311 |
indep_vars_def2: "indep_vars M' X I \<longleftrightarrow> |
|
49781 | 312 |
(\<forall>i\<in>I. random_variable (M' i) (X i)) \<and> |
313 |
indep_sets (\<lambda>i. { X i -` A \<inter> space M | A. A \<in> sets (M' i)}) I" |
|
49794 | 314 |
|
315 |
definition (in prob_space) |
|
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
316 |
"indep_var Ma A Mb B \<longleftrightarrow> indep_vars (case_bool Ma Mb) (case_bool A B) UNIV" |
49794 | 317 |
|
318 |
lemma (in prob_space) indep_vars_def: |
|
319 |
"indep_vars M' X I \<longleftrightarrow> |
|
320 |
(\<forall>i\<in>I. random_variable (M' i) (X i)) \<and> |
|
321 |
indep_sets (\<lambda>i. sigma_sets (space M) { X i -` A \<inter> space M | A. A \<in> sets (M' i)}) I" |
|
322 |
unfolding indep_vars_def2 |
|
49781 | 323 |
apply (rule conj_cong[OF refl]) |
49794 | 324 |
apply (rule indep_sets_sigma_sets_iff[symmetric]) |
49781 | 325 |
apply (auto simp: Int_stable_def) |
326 |
apply (rule_tac x="A \<inter> Aa" in exI) |
|
327 |
apply auto |
|
328 |
done |
|
329 |
||
49794 | 330 |
lemma (in prob_space) indep_var_eq: |
331 |
"indep_var S X T Y \<longleftrightarrow> |
|
332 |
(random_variable S X \<and> random_variable T Y) \<and> |
|
333 |
indep_set |
|
334 |
(sigma_sets (space M) { X -` A \<inter> space M | A. A \<in> sets S}) |
|
335 |
(sigma_sets (space M) { Y -` A \<inter> space M | A. A \<in> sets T})" |
|
336 |
unfolding indep_var_def indep_vars_def indep_set_def UNIV_bool |
|
337 |
by (intro arg_cong2[where f="op \<and>"] arg_cong2[where f=indep_sets] ext) |
|
338 |
(auto split: bool.split) |
|
339 |
||
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
340 |
lemma (in prob_space) indep_sets2_eq: |
42981 | 341 |
"indep_set A B \<longleftrightarrow> A \<subseteq> events \<and> B \<subseteq> events \<and> (\<forall>a\<in>A. \<forall>b\<in>B. prob (a \<inter> b) = prob a * prob b)" |
342 |
unfolding indep_set_def |
|
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
343 |
proof (intro iffI ballI conjI) |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
344 |
assume indep: "indep_sets (case_bool A B) UNIV" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
345 |
{ fix a b assume "a \<in> A" "b \<in> B" |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
346 |
with indep_setsD[OF indep, of UNIV "case_bool a b"] |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
347 |
show "prob (a \<inter> b) = prob a * prob b" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
348 |
unfolding UNIV_bool by (simp add: ac_simps) } |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
349 |
from indep show "A \<subseteq> events" "B \<subseteq> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
350 |
unfolding indep_sets_def UNIV_bool by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
351 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
352 |
assume *: "A \<subseteq> events \<and> B \<subseteq> events \<and> (\<forall>a\<in>A. \<forall>b\<in>B. prob (a \<inter> b) = prob a * prob b)" |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
353 |
show "indep_sets (case_bool A B) UNIV" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
354 |
proof (rule indep_setsI) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
355 |
fix i show "(case i of True \<Rightarrow> A | False \<Rightarrow> B) \<subseteq> events" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
356 |
using * by (auto split: bool.split) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
357 |
next |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
358 |
fix J X assume "J \<noteq> {}" "J \<subseteq> UNIV" and X: "\<forall>j\<in>J. X j \<in> (case j of True \<Rightarrow> A | False \<Rightarrow> B)" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
359 |
then have "J = {True} \<or> J = {False} \<or> J = {True,False}" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
360 |
by (auto simp: UNIV_bool) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
361 |
then show "prob (\<Inter>j\<in>J. X j) = (\<Prod>j\<in>J. prob (X j))" |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
362 |
using X * by auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
363 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
364 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
365 |
|
42981 | 366 |
lemma (in prob_space) indep_set_sigma_sets: |
367 |
assumes "indep_set A B" |
|
47694 | 368 |
assumes A: "Int_stable A" and B: "Int_stable B" |
42981 | 369 |
shows "indep_set (sigma_sets (space M) A) (sigma_sets (space M) B)" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
370 |
proof - |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
371 |
have "indep_sets (\<lambda>i. sigma_sets (space M) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) UNIV" |
47694 | 372 |
proof (rule indep_sets_sigma) |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
373 |
show "indep_sets (case_bool A B) UNIV" |
42981 | 374 |
by (rule `indep_set A B`[unfolded indep_set_def]) |
47694 | 375 |
fix i show "Int_stable (case i of True \<Rightarrow> A | False \<Rightarrow> B)" |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
376 |
using A B by (cases i) auto |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
377 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
378 |
then show ?thesis |
42981 | 379 |
unfolding indep_set_def |
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
380 |
by (rule indep_sets_mono_sets) (auto split: bool.split) |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
381 |
qed |
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
382 |
|
42981 | 383 |
lemma (in prob_space) indep_sets_collect_sigma: |
384 |
fixes I :: "'j \<Rightarrow> 'i set" and J :: "'j set" and E :: "'i \<Rightarrow> 'a set set" |
|
385 |
assumes indep: "indep_sets E (\<Union>j\<in>J. I j)" |
|
47694 | 386 |
assumes Int_stable: "\<And>i j. j \<in> J \<Longrightarrow> i \<in> I j \<Longrightarrow> Int_stable (E i)" |
42981 | 387 |
assumes disjoint: "disjoint_family_on I J" |
388 |
shows "indep_sets (\<lambda>j. sigma_sets (space M) (\<Union>i\<in>I j. E i)) J" |
|
389 |
proof - |
|
46731 | 390 |
let ?E = "\<lambda>j. {\<Inter>k\<in>K. E' k| E' K. finite K \<and> K \<noteq> {} \<and> K \<subseteq> I j \<and> (\<forall>k\<in>K. E' k \<in> E k) }" |
42981 | 391 |
|
42983 | 392 |
from indep have E: "\<And>j i. j \<in> J \<Longrightarrow> i \<in> I j \<Longrightarrow> E i \<subseteq> events" |
42981 | 393 |
unfolding indep_sets_def by auto |
394 |
{ fix j |
|
47694 | 395 |
let ?S = "sigma_sets (space M) (\<Union>i\<in>I j. E i)" |
42981 | 396 |
assume "j \<in> J" |
47694 | 397 |
from E[OF this] interpret S: sigma_algebra "space M" ?S |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
398 |
using sets.sets_into_space[of _ M] by (intro sigma_algebra_sigma_sets) auto |
42981 | 399 |
|
400 |
have "sigma_sets (space M) (\<Union>i\<in>I j. E i) = sigma_sets (space M) (?E j)" |
|
401 |
proof (rule sigma_sets_eqI) |
|
402 |
fix A assume "A \<in> (\<Union>i\<in>I j. E i)" |
|
403 |
then guess i .. |
|
404 |
then show "A \<in> sigma_sets (space M) (?E j)" |
|
47694 | 405 |
by (auto intro!: sigma_sets.intros(2-) exI[of _ "{i}"] exI[of _ "\<lambda>i. A"]) |
42981 | 406 |
next |
407 |
fix A assume "A \<in> ?E j" |
|
408 |
then obtain E' K where "finite K" "K \<noteq> {}" "K \<subseteq> I j" "\<And>k. k \<in> K \<Longrightarrow> E' k \<in> E k" |
|
409 |
and A: "A = (\<Inter>k\<in>K. E' k)" |
|
410 |
by auto |
|
47694 | 411 |
then have "A \<in> ?S" unfolding A |
412 |
by (safe intro!: S.finite_INT) auto |
|
42981 | 413 |
then show "A \<in> sigma_sets (space M) (\<Union>i\<in>I j. E i)" |
47694 | 414 |
by simp |
42981 | 415 |
qed } |
416 |
moreover have "indep_sets (\<lambda>j. sigma_sets (space M) (?E j)) J" |
|
47694 | 417 |
proof (rule indep_sets_sigma) |
42981 | 418 |
show "indep_sets ?E J" |
419 |
proof (intro indep_setsI) |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
420 |
fix j assume "j \<in> J" with E show "?E j \<subseteq> events" by (force intro!: sets.finite_INT) |
42981 | 421 |
next |
422 |
fix K A assume K: "K \<noteq> {}" "K \<subseteq> J" "finite K" |
|
423 |
and "\<forall>j\<in>K. A j \<in> ?E j" |
|
424 |
then have "\<forall>j\<in>K. \<exists>E' L. A j = (\<Inter>l\<in>L. E' l) \<and> finite L \<and> L \<noteq> {} \<and> L \<subseteq> I j \<and> (\<forall>l\<in>L. E' l \<in> E l)" |
|
425 |
by simp |
|
426 |
from bchoice[OF this] guess E' .. |
|
427 |
from bchoice[OF this] obtain L |
|
428 |
where A: "\<And>j. j\<in>K \<Longrightarrow> A j = (\<Inter>l\<in>L j. E' j l)" |
|
429 |
and L: "\<And>j. j\<in>K \<Longrightarrow> finite (L j)" "\<And>j. j\<in>K \<Longrightarrow> L j \<noteq> {}" "\<And>j. j\<in>K \<Longrightarrow> L j \<subseteq> I j" |
|
430 |
and E': "\<And>j l. j\<in>K \<Longrightarrow> l \<in> L j \<Longrightarrow> E' j l \<in> E l" |
|
431 |
by auto |
|
432 |
||
433 |
{ fix k l j assume "k \<in> K" "j \<in> K" "l \<in> L j" "l \<in> L k" |
|
434 |
have "k = j" |
|
435 |
proof (rule ccontr) |
|
436 |
assume "k \<noteq> j" |
|
437 |
with disjoint `K \<subseteq> J` `k \<in> K` `j \<in> K` have "I k \<inter> I j = {}" |
|
438 |
unfolding disjoint_family_on_def by auto |
|
439 |
with L(2,3)[OF `j \<in> K`] L(2,3)[OF `k \<in> K`] |
|
440 |
show False using `l \<in> L k` `l \<in> L j` by auto |
|
441 |
qed } |
|
442 |
note L_inj = this |
|
443 |
||
444 |
def k \<equiv> "\<lambda>l. (SOME k. k \<in> K \<and> l \<in> L k)" |
|
445 |
{ fix x j l assume *: "j \<in> K" "l \<in> L j" |
|
446 |
have "k l = j" unfolding k_def |
|
447 |
proof (rule some_equality) |
|
448 |
fix k assume "k \<in> K \<and> l \<in> L k" |
|
449 |
with * L_inj show "k = j" by auto |
|
450 |
qed (insert *, simp) } |
|
451 |
note k_simp[simp] = this |
|
46731 | 452 |
let ?E' = "\<lambda>l. E' (k l) l" |
42981 | 453 |
have "prob (\<Inter>j\<in>K. A j) = prob (\<Inter>l\<in>(\<Union>k\<in>K. L k). ?E' l)" |
454 |
by (auto simp: A intro!: arg_cong[where f=prob]) |
|
455 |
also have "\<dots> = (\<Prod>l\<in>(\<Union>k\<in>K. L k). prob (?E' l))" |
|
456 |
using L K E' by (intro indep_setsD[OF indep]) (simp_all add: UN_mono) |
|
457 |
also have "\<dots> = (\<Prod>j\<in>K. \<Prod>l\<in>L j. prob (E' j l))" |
|
57418 | 458 |
using K L L_inj by (subst setprod.UNION_disjoint) auto |
42981 | 459 |
also have "\<dots> = (\<Prod>j\<in>K. prob (A j))" |
57418 | 460 |
using K L E' by (auto simp add: A intro!: setprod.cong indep_setsD[OF indep, symmetric]) blast |
42981 | 461 |
finally show "prob (\<Inter>j\<in>K. A j) = (\<Prod>j\<in>K. prob (A j))" . |
462 |
qed |
|
463 |
next |
|
464 |
fix j assume "j \<in> J" |
|
47694 | 465 |
show "Int_stable (?E j)" |
42981 | 466 |
proof (rule Int_stableI) |
467 |
fix a assume "a \<in> ?E j" then obtain Ka Ea |
|
468 |
where a: "a = (\<Inter>k\<in>Ka. Ea k)" "finite Ka" "Ka \<noteq> {}" "Ka \<subseteq> I j" "\<And>k. k\<in>Ka \<Longrightarrow> Ea k \<in> E k" by auto |
|
469 |
fix b assume "b \<in> ?E j" then obtain Kb Eb |
|
470 |
where b: "b = (\<Inter>k\<in>Kb. Eb k)" "finite Kb" "Kb \<noteq> {}" "Kb \<subseteq> I j" "\<And>k. k\<in>Kb \<Longrightarrow> Eb k \<in> E k" by auto |
|
471 |
let ?A = "\<lambda>k. (if k \<in> Ka \<inter> Kb then Ea k \<inter> Eb k else if k \<in> Kb then Eb k else if k \<in> Ka then Ea k else {})" |
|
472 |
have "a \<inter> b = INTER (Ka \<union> Kb) ?A" |
|
473 |
by (simp add: a b set_eq_iff) auto |
|
474 |
with a b `j \<in> J` Int_stableD[OF Int_stable] show "a \<inter> b \<in> ?E j" |
|
475 |
by (intro CollectI exI[of _ "Ka \<union> Kb"] exI[of _ ?A]) auto |
|
476 |
qed |
|
477 |
qed |
|
478 |
ultimately show ?thesis |
|
479 |
by (simp cong: indep_sets_cong) |
|
480 |
qed |
|
481 |
||
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
482 |
lemma (in prob_space) indep_vars_restrict: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
483 |
assumes ind: "indep_vars M' X I" and K: "\<And>j. j \<in> L \<Longrightarrow> K j \<subseteq> I" and J: "disjoint_family_on K L" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
484 |
shows "indep_vars (\<lambda>j. PiM (K j) M') (\<lambda>j \<omega>. restrict (\<lambda>i. X i \<omega>) (K j)) L" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
485 |
unfolding indep_vars_def |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
486 |
proof safe |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
487 |
fix j assume "j \<in> L" then show "random_variable (Pi\<^sub>M (K j) M') (\<lambda>\<omega>. \<lambda>i\<in>K j. X i \<omega>)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
488 |
using K ind by (auto simp: indep_vars_def intro!: measurable_restrict) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
489 |
next |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
490 |
have X: "\<And>i. i \<in> I \<Longrightarrow> X i \<in> measurable M (M' i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
491 |
using ind by (auto simp: indep_vars_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
492 |
let ?proj = "\<lambda>j S. {(\<lambda>\<omega>. \<lambda>i\<in>K j. X i \<omega>) -` A \<inter> space M |A. A \<in> S}" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
493 |
let ?UN = "\<lambda>j. sigma_sets (space M) (\<Union>i\<in>K j. { X i -` A \<inter> space M| A. A \<in> sets (M' i) })" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
494 |
show "indep_sets (\<lambda>i. sigma_sets (space M) (?proj i (sets (Pi\<^sub>M (K i) M')))) L" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
495 |
proof (rule indep_sets_mono_sets) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
496 |
fix j assume j: "j \<in> L" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
497 |
have "sigma_sets (space M) (?proj j (sets (Pi\<^sub>M (K j) M'))) = |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
498 |
sigma_sets (space M) (sigma_sets (space M) (?proj j (prod_algebra (K j) M')))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
499 |
using j K X[THEN measurable_space] unfolding sets_PiM |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
500 |
by (subst sigma_sets_vimage_commute) (auto simp add: Pi_iff) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
501 |
also have "\<dots> = sigma_sets (space M) (?proj j (prod_algebra (K j) M'))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
502 |
by (rule sigma_sets_sigma_sets_eq) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
503 |
also have "\<dots> \<subseteq> ?UN j" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
504 |
proof (rule sigma_sets_mono, safe del: disjE elim!: prod_algebraE) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
505 |
fix J E assume J: "finite J" "J \<noteq> {} \<or> K j = {}" "J \<subseteq> K j" and E: "\<forall>i. i \<in> J \<longrightarrow> E i \<in> sets (M' i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
506 |
show "(\<lambda>\<omega>. \<lambda>i\<in>K j. X i \<omega>) -` prod_emb (K j) M' J (Pi\<^sub>E J E) \<inter> space M \<in> ?UN j" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
507 |
proof cases |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
508 |
assume "K j = {}" with J show ?thesis |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
509 |
by (auto simp add: sigma_sets_empty_eq prod_emb_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
510 |
next |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
511 |
assume "K j \<noteq> {}" with J have "J \<noteq> {}" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
512 |
by auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
513 |
{ interpret sigma_algebra "space M" "?UN j" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
514 |
by (rule sigma_algebra_sigma_sets) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
515 |
have "\<And>A. (\<And>i. i \<in> J \<Longrightarrow> A i \<in> ?UN j) \<Longrightarrow> INTER J A \<in> ?UN j" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
516 |
using `finite J` `J \<noteq> {}` by (rule finite_INT) blast } |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
517 |
note INT = this |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
518 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
519 |
from `J \<noteq> {}` J K E[rule_format, THEN sets.sets_into_space] j |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
520 |
have "(\<lambda>\<omega>. \<lambda>i\<in>K j. X i \<omega>) -` prod_emb (K j) M' J (Pi\<^sub>E J E) \<inter> space M |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
521 |
= (\<Inter>i\<in>J. X i -` E i \<inter> space M)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
522 |
apply (subst prod_emb_PiE[OF _ ]) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
523 |
apply auto [] |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
524 |
apply auto [] |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
525 |
apply (auto simp add: Pi_iff intro!: X[THEN measurable_space]) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
526 |
apply (erule_tac x=i in ballE) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
527 |
apply auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
528 |
done |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
529 |
also have "\<dots> \<in> ?UN j" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
530 |
apply (rule INT) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
531 |
apply (rule sigma_sets.Basic) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
532 |
using `J \<subseteq> K j` E |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
533 |
apply auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
534 |
done |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
535 |
finally show ?thesis . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
536 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
537 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
538 |
finally show "sigma_sets (space M) (?proj j (sets (Pi\<^sub>M (K j) M'))) \<subseteq> ?UN j" . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
539 |
next |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
540 |
show "indep_sets ?UN L" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
541 |
proof (rule indep_sets_collect_sigma) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
542 |
show "indep_sets (\<lambda>i. {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) (\<Union>j\<in>L. K j)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
543 |
proof (rule indep_sets_mono_index) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
544 |
show "indep_sets (\<lambda>i. {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
545 |
using ind unfolding indep_vars_def2 by auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
546 |
show "(\<Union>l\<in>L. K l) \<subseteq> I" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
547 |
using K by auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
548 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
549 |
next |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
550 |
fix l i assume "l \<in> L" "i \<in> K l" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
551 |
show "Int_stable {X i -` A \<inter> space M |A. A \<in> sets (M' i)}" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
552 |
apply (auto simp: Int_stable_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
553 |
apply (rule_tac x="A \<inter> Aa" in exI) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
554 |
apply auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
555 |
done |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
556 |
qed fact |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
557 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
558 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
559 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
560 |
lemma (in prob_space) indep_var_restrict: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
561 |
assumes ind: "indep_vars M' X I" and AB: "A \<inter> B = {}" "A \<subseteq> I" "B \<subseteq> I" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
562 |
shows "indep_var (PiM A M') (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) A) (PiM B M') (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) B)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
563 |
proof - |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
564 |
have *: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
565 |
"case_bool (Pi\<^sub>M A M') (Pi\<^sub>M B M') = (\<lambda>b. PiM (case_bool A B b) M')" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
566 |
"case_bool (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>) = (\<lambda>b \<omega>. \<lambda>i\<in>case_bool A B b. X i \<omega>)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
567 |
by (simp_all add: fun_eq_iff split: bool.split) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
568 |
show ?thesis |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
569 |
unfolding indep_var_def * using AB |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
570 |
by (intro indep_vars_restrict[OF ind]) (auto simp: disjoint_family_on_def split: bool.split) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
571 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
572 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
573 |
lemma (in prob_space) indep_vars_subset: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
574 |
assumes "indep_vars M' X I" "J \<subseteq> I" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
575 |
shows "indep_vars M' X J" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
576 |
using assms unfolding indep_vars_def indep_sets_def |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
577 |
by auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
578 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
579 |
lemma (in prob_space) indep_vars_cong: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
580 |
"I = J \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> X i = Y i) \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> M' i = N' i) \<Longrightarrow> indep_vars M' X I \<longleftrightarrow> indep_vars N' Y J" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
581 |
unfolding indep_vars_def2 by (intro conj_cong indep_sets_cong) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
582 |
|
49772 | 583 |
definition (in prob_space) tail_events where |
584 |
"tail_events A = (\<Inter>n. sigma_sets (space M) (UNION {n..} A))" |
|
42982 | 585 |
|
49772 | 586 |
lemma (in prob_space) tail_events_sets: |
587 |
assumes A: "\<And>i::nat. A i \<subseteq> events" |
|
588 |
shows "tail_events A \<subseteq> events" |
|
589 |
proof |
|
590 |
fix X assume X: "X \<in> tail_events A" |
|
42982 | 591 |
let ?A = "(\<Inter>n. sigma_sets (space M) (UNION {n..} A))" |
49772 | 592 |
from X have "\<And>n::nat. X \<in> sigma_sets (space M) (UNION {n..} A)" by (auto simp: tail_events_def) |
42982 | 593 |
from this[of 0] have "X \<in> sigma_sets (space M) (UNION UNIV A)" by simp |
42983 | 594 |
then show "X \<in> events" |
42982 | 595 |
by induct (insert A, auto) |
596 |
qed |
|
597 |
||
49772 | 598 |
lemma (in prob_space) sigma_algebra_tail_events: |
47694 | 599 |
assumes "\<And>i::nat. sigma_algebra (space M) (A i)" |
49772 | 600 |
shows "sigma_algebra (space M) (tail_events A)" |
601 |
unfolding tail_events_def |
|
42982 | 602 |
proof (simp add: sigma_algebra_iff2, safe) |
603 |
let ?A = "(\<Inter>n. sigma_sets (space M) (UNION {n..} A))" |
|
47694 | 604 |
interpret A: sigma_algebra "space M" "A i" for i by fact |
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
605 |
{ fix X x assume "X \<in> ?A" "x \<in> X" |
42982 | 606 |
then have "\<And>n. X \<in> sigma_sets (space M) (UNION {n..} A)" by auto |
607 |
from this[of 0] have "X \<in> sigma_sets (space M) (UNION UNIV A)" by simp |
|
608 |
then have "X \<subseteq> space M" |
|
609 |
by induct (insert A.sets_into_space, auto) |
|
610 |
with `x \<in> X` show "x \<in> space M" by auto } |
|
611 |
{ fix F :: "nat \<Rightarrow> 'a set" and n assume "range F \<subseteq> ?A" |
|
612 |
then show "(UNION UNIV F) \<in> sigma_sets (space M) (UNION {n..} A)" |
|
613 |
by (intro sigma_sets.Union) auto } |
|
614 |
qed (auto intro!: sigma_sets.Compl sigma_sets.Empty) |
|
615 |
||
616 |
lemma (in prob_space) kolmogorov_0_1_law: |
|
617 |
fixes A :: "nat \<Rightarrow> 'a set set" |
|
47694 | 618 |
assumes "\<And>i::nat. sigma_algebra (space M) (A i)" |
42982 | 619 |
assumes indep: "indep_sets A UNIV" |
49772 | 620 |
and X: "X \<in> tail_events A" |
42982 | 621 |
shows "prob X = 0 \<or> prob X = 1" |
622 |
proof - |
|
49781 | 623 |
have A: "\<And>i. A i \<subseteq> events" |
624 |
using indep unfolding indep_sets_def by simp |
|
625 |
||
47694 | 626 |
let ?D = "{D \<in> events. prob (X \<inter> D) = prob X * prob D}" |
627 |
interpret A: sigma_algebra "space M" "A i" for i by fact |
|
49772 | 628 |
interpret T: sigma_algebra "space M" "tail_events A" |
629 |
by (rule sigma_algebra_tail_events) fact |
|
42982 | 630 |
have "X \<subseteq> space M" using T.space_closed X by auto |
631 |
||
42983 | 632 |
have X_in: "X \<in> events" |
49772 | 633 |
using tail_events_sets A X by auto |
42982 | 634 |
|
47694 | 635 |
interpret D: dynkin_system "space M" ?D |
42982 | 636 |
proof (rule dynkin_systemI) |
47694 | 637 |
fix D assume "D \<in> ?D" then show "D \<subseteq> space M" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
638 |
using sets.sets_into_space by auto |
42982 | 639 |
next |
47694 | 640 |
show "space M \<in> ?D" |
42982 | 641 |
using prob_space `X \<subseteq> space M` by (simp add: Int_absorb2) |
642 |
next |
|
47694 | 643 |
fix A assume A: "A \<in> ?D" |
42982 | 644 |
have "prob (X \<inter> (space M - A)) = prob (X - (X \<inter> A))" |
645 |
using `X \<subseteq> space M` by (auto intro!: arg_cong[where f=prob]) |
|
646 |
also have "\<dots> = prob X - prob (X \<inter> A)" |
|
647 |
using X_in A by (intro finite_measure_Diff) auto |
|
648 |
also have "\<dots> = prob X * prob (space M) - prob X * prob A" |
|
649 |
using A prob_space by auto |
|
650 |
also have "\<dots> = prob X * prob (space M - A)" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
651 |
using X_in A sets.sets_into_space |
42982 | 652 |
by (subst finite_measure_Diff) (auto simp: field_simps) |
47694 | 653 |
finally show "space M - A \<in> ?D" |
42982 | 654 |
using A `X \<subseteq> space M` by auto |
655 |
next |
|
47694 | 656 |
fix F :: "nat \<Rightarrow> 'a set" assume dis: "disjoint_family F" and "range F \<subseteq> ?D" |
42982 | 657 |
then have F: "range F \<subseteq> events" "\<And>i. prob (X \<inter> F i) = prob X * prob (F i)" |
658 |
by auto |
|
659 |
have "(\<lambda>i. prob (X \<inter> F i)) sums prob (\<Union>i. X \<inter> F i)" |
|
660 |
proof (rule finite_measure_UNION) |
|
661 |
show "range (\<lambda>i. X \<inter> F i) \<subseteq> events" |
|
662 |
using F X_in by auto |
|
663 |
show "disjoint_family (\<lambda>i. X \<inter> F i)" |
|
664 |
using dis by (rule disjoint_family_on_bisimulation) auto |
|
665 |
qed |
|
666 |
with F have "(\<lambda>i. prob X * prob (F i)) sums prob (X \<inter> (\<Union>i. F i))" |
|
667 |
by simp |
|
668 |
moreover have "(\<lambda>i. prob X * prob (F i)) sums (prob X * prob (\<Union>i. F i))" |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
43920
diff
changeset
|
669 |
by (intro sums_mult finite_measure_UNION F dis) |
42982 | 670 |
ultimately have "prob (X \<inter> (\<Union>i. F i)) = prob X * prob (\<Union>i. F i)" |
671 |
by (auto dest!: sums_unique) |
|
47694 | 672 |
with F show "(\<Union>i. F i) \<in> ?D" |
42982 | 673 |
by auto |
674 |
qed |
|
675 |
||
676 |
{ fix n |
|
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
677 |
have "indep_sets (\<lambda>b. sigma_sets (space M) (\<Union>m\<in>case_bool {..n} {Suc n..} b. A m)) UNIV" |
42982 | 678 |
proof (rule indep_sets_collect_sigma) |
679 |
have *: "(\<Union>b. case b of True \<Rightarrow> {..n} | False \<Rightarrow> {Suc n..}) = UNIV" (is "?U = _") |
|
680 |
by (simp split: bool.split add: set_eq_iff) (metis not_less_eq_eq) |
|
681 |
with indep show "indep_sets A ?U" by simp |
|
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
682 |
show "disjoint_family (case_bool {..n} {Suc n..})" |
42982 | 683 |
unfolding disjoint_family_on_def by (auto split: bool.split) |
684 |
fix m |
|
47694 | 685 |
show "Int_stable (A m)" |
42982 | 686 |
unfolding Int_stable_def using A.Int by auto |
687 |
qed |
|
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
688 |
also have "(\<lambda>b. sigma_sets (space M) (\<Union>m\<in>case_bool {..n} {Suc n..} b. A m)) = |
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
689 |
case_bool (sigma_sets (space M) (\<Union>m\<in>{..n}. A m)) (sigma_sets (space M) (\<Union>m\<in>{Suc n..}. A m))" |
42982 | 690 |
by (auto intro!: ext split: bool.split) |
691 |
finally have indep: "indep_set (sigma_sets (space M) (\<Union>m\<in>{..n}. A m)) (sigma_sets (space M) (\<Union>m\<in>{Suc n..}. A m))" |
|
692 |
unfolding indep_set_def by simp |
|
693 |
||
47694 | 694 |
have "sigma_sets (space M) (\<Union>m\<in>{..n}. A m) \<subseteq> ?D" |
42982 | 695 |
proof (simp add: subset_eq, rule) |
696 |
fix D assume D: "D \<in> sigma_sets (space M) (\<Union>m\<in>{..n}. A m)" |
|
697 |
have "X \<in> sigma_sets (space M) (\<Union>m\<in>{Suc n..}. A m)" |
|
49772 | 698 |
using X unfolding tail_events_def by simp |
42982 | 699 |
from indep_setD[OF indep D this] indep_setD_ev1[OF indep] D |
700 |
show "D \<in> events \<and> prob (X \<inter> D) = prob X * prob D" |
|
701 |
by (auto simp add: ac_simps) |
|
702 |
qed } |
|
47694 | 703 |
then have "(\<Union>n. sigma_sets (space M) (\<Union>m\<in>{..n}. A m)) \<subseteq> ?D" (is "?A \<subseteq> _") |
42982 | 704 |
by auto |
705 |
||
49772 | 706 |
note `X \<in> tail_events A` |
47694 | 707 |
also { |
708 |
have "\<And>n. sigma_sets (space M) (\<Union>i\<in>{n..}. A i) \<subseteq> sigma_sets (space M) ?A" |
|
709 |
by (intro sigma_sets_subseteq UN_mono) auto |
|
49772 | 710 |
then have "tail_events A \<subseteq> sigma_sets (space M) ?A" |
711 |
unfolding tail_events_def by auto } |
|
47694 | 712 |
also have "sigma_sets (space M) ?A = dynkin (space M) ?A" |
42982 | 713 |
proof (rule sigma_eq_dynkin) |
714 |
{ fix B n assume "B \<in> sigma_sets (space M) (\<Union>m\<in>{..n}. A m)" |
|
715 |
then have "B \<subseteq> space M" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
716 |
by induct (insert A sets.sets_into_space[of _ M], auto) } |
47694 | 717 |
then show "?A \<subseteq> Pow (space M)" by auto |
718 |
show "Int_stable ?A" |
|
42982 | 719 |
proof (rule Int_stableI) |
720 |
fix a assume "a \<in> ?A" then guess n .. note a = this |
|
721 |
fix b assume "b \<in> ?A" then guess m .. note b = this |
|
47694 | 722 |
interpret Amn: sigma_algebra "space M" "sigma_sets (space M) (\<Union>i\<in>{..max m n}. A i)" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
723 |
using A sets.sets_into_space[of _ M] by (intro sigma_algebra_sigma_sets) auto |
42982 | 724 |
have "sigma_sets (space M) (\<Union>i\<in>{..n}. A i) \<subseteq> sigma_sets (space M) (\<Union>i\<in>{..max m n}. A i)" |
725 |
by (intro sigma_sets_subseteq UN_mono) auto |
|
726 |
with a have "a \<in> sigma_sets (space M) (\<Union>i\<in>{..max m n}. A i)" by auto |
|
727 |
moreover |
|
728 |
have "sigma_sets (space M) (\<Union>i\<in>{..m}. A i) \<subseteq> sigma_sets (space M) (\<Union>i\<in>{..max m n}. A i)" |
|
729 |
by (intro sigma_sets_subseteq UN_mono) auto |
|
730 |
with b have "b \<in> sigma_sets (space M) (\<Union>i\<in>{..max m n}. A i)" by auto |
|
731 |
ultimately have "a \<inter> b \<in> sigma_sets (space M) (\<Union>i\<in>{..max m n}. A i)" |
|
47694 | 732 |
using Amn.Int[of a b] by simp |
42982 | 733 |
then show "a \<inter> b \<in> (\<Union>n. sigma_sets (space M) (\<Union>i\<in>{..n}. A i))" by auto |
734 |
qed |
|
735 |
qed |
|
47694 | 736 |
also have "dynkin (space M) ?A \<subseteq> ?D" |
737 |
using `?A \<subseteq> ?D` by (auto intro!: D.dynkin_subset) |
|
738 |
finally show ?thesis by auto |
|
42982 | 739 |
qed |
740 |
||
42985 | 741 |
lemma (in prob_space) borel_0_1_law: |
742 |
fixes F :: "nat \<Rightarrow> 'a set" |
|
49781 | 743 |
assumes F2: "indep_events F UNIV" |
42985 | 744 |
shows "prob (\<Inter>n. \<Union>m\<in>{n..}. F m) = 0 \<or> prob (\<Inter>n. \<Union>m\<in>{n..}. F m) = 1" |
745 |
proof (rule kolmogorov_0_1_law[of "\<lambda>i. sigma_sets (space M) { F i }"]) |
|
49781 | 746 |
have F1: "range F \<subseteq> events" |
747 |
using F2 by (simp add: indep_events_def subset_eq) |
|
47694 | 748 |
{ fix i show "sigma_algebra (space M) (sigma_sets (space M) {F i})" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
749 |
using sigma_algebra_sigma_sets[of "{F i}" "space M"] F1 sets.sets_into_space |
47694 | 750 |
by auto } |
42985 | 751 |
show "indep_sets (\<lambda>i. sigma_sets (space M) {F i}) UNIV" |
47694 | 752 |
proof (rule indep_sets_sigma) |
42985 | 753 |
show "indep_sets (\<lambda>i. {F i}) UNIV" |
49784
5e5b2da42a69
remove incseq assumption from measure_eqI_generator_eq
hoelzl
parents:
49781
diff
changeset
|
754 |
unfolding indep_events_def_alt[symmetric] by fact |
47694 | 755 |
fix i show "Int_stable {F i}" |
42985 | 756 |
unfolding Int_stable_def by simp |
757 |
qed |
|
46731 | 758 |
let ?Q = "\<lambda>n. \<Union>i\<in>{n..}. F i" |
49772 | 759 |
show "(\<Inter>n. \<Union>m\<in>{n..}. F m) \<in> tail_events (\<lambda>i. sigma_sets (space M) {F i})" |
760 |
unfolding tail_events_def |
|
42985 | 761 |
proof |
762 |
fix j |
|
47694 | 763 |
interpret S: sigma_algebra "space M" "sigma_sets (space M) (\<Union>i\<in>{j..}. sigma_sets (space M) {F i})" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
764 |
using order_trans[OF F1 sets.space_closed] |
47694 | 765 |
by (intro sigma_algebra_sigma_sets) (simp add: sigma_sets_singleton subset_eq) |
42985 | 766 |
have "(\<Inter>n. ?Q n) = (\<Inter>n\<in>{j..}. ?Q n)" |
767 |
by (intro decseq_SucI INT_decseq_offset UN_mono) auto |
|
47694 | 768 |
also have "\<dots> \<in> sigma_sets (space M) (\<Union>i\<in>{j..}. sigma_sets (space M) {F i})" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
769 |
using order_trans[OF F1 sets.space_closed] |
42985 | 770 |
by (safe intro!: S.countable_INT S.countable_UN) |
47694 | 771 |
(auto simp: sigma_sets_singleton intro!: sigma_sets.Basic bexI) |
42985 | 772 |
finally show "(\<Inter>n. ?Q n) \<in> sigma_sets (space M) (\<Union>i\<in>{j..}. sigma_sets (space M) {F i})" |
47694 | 773 |
by simp |
42985 | 774 |
qed |
775 |
qed |
|
776 |
||
42987 | 777 |
lemma (in prob_space) indep_sets_finite: |
778 |
assumes I: "I \<noteq> {}" "finite I" |
|
779 |
and F: "\<And>i. i \<in> I \<Longrightarrow> F i \<subseteq> events" "\<And>i. i \<in> I \<Longrightarrow> space M \<in> F i" |
|
780 |
shows "indep_sets F I \<longleftrightarrow> (\<forall>A\<in>Pi I F. prob (\<Inter>j\<in>I. A j) = (\<Prod>j\<in>I. prob (A j)))" |
|
781 |
proof |
|
782 |
assume *: "indep_sets F I" |
|
783 |
from I show "\<forall>A\<in>Pi I F. prob (\<Inter>j\<in>I. A j) = (\<Prod>j\<in>I. prob (A j))" |
|
784 |
by (intro indep_setsD[OF *] ballI) auto |
|
785 |
next |
|
786 |
assume indep: "\<forall>A\<in>Pi I F. prob (\<Inter>j\<in>I. A j) = (\<Prod>j\<in>I. prob (A j))" |
|
787 |
show "indep_sets F I" |
|
788 |
proof (rule indep_setsI[OF F(1)]) |
|
789 |
fix A J assume J: "J \<noteq> {}" "J \<subseteq> I" "finite J" |
|
790 |
assume A: "\<forall>j\<in>J. A j \<in> F j" |
|
46731 | 791 |
let ?A = "\<lambda>j. if j \<in> J then A j else space M" |
42987 | 792 |
have "prob (\<Inter>j\<in>I. ?A j) = prob (\<Inter>j\<in>J. A j)" |
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
793 |
using subset_trans[OF F(1) sets.space_closed] J A |
42987 | 794 |
by (auto intro!: arg_cong[where f=prob] split: split_if_asm) blast |
795 |
also |
|
796 |
from A F have "(\<lambda>j. if j \<in> J then A j else space M) \<in> Pi I F" (is "?A \<in> _") |
|
797 |
by (auto split: split_if_asm) |
|
798 |
with indep have "prob (\<Inter>j\<in>I. ?A j) = (\<Prod>j\<in>I. prob (?A j))" |
|
799 |
by auto |
|
800 |
also have "\<dots> = (\<Prod>j\<in>J. prob (A j))" |
|
801 |
unfolding if_distrib setprod.If_cases[OF `finite I`] |
|
57418 | 802 |
using prob_space `J \<subseteq> I` by (simp add: Int_absorb1 setprod.neutral_const) |
42987 | 803 |
finally show "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" .. |
804 |
qed |
|
805 |
qed |
|
806 |
||
42989 | 807 |
lemma (in prob_space) indep_vars_finite: |
42987 | 808 |
fixes I :: "'i set" |
809 |
assumes I: "I \<noteq> {}" "finite I" |
|
47694 | 810 |
and M': "\<And>i. i \<in> I \<Longrightarrow> sets (M' i) = sigma_sets (space (M' i)) (E i)" |
811 |
and rv: "\<And>i. i \<in> I \<Longrightarrow> random_variable (M' i) (X i)" |
|
812 |
and Int_stable: "\<And>i. i \<in> I \<Longrightarrow> Int_stable (E i)" |
|
813 |
and space: "\<And>i. i \<in> I \<Longrightarrow> space (M' i) \<in> E i" and closed: "\<And>i. i \<in> I \<Longrightarrow> E i \<subseteq> Pow (space (M' i))" |
|
814 |
shows "indep_vars M' X I \<longleftrightarrow> |
|
815 |
(\<forall>A\<in>(\<Pi> i\<in>I. E i). prob (\<Inter>j\<in>I. X j -` A j \<inter> space M) = (\<Prod>j\<in>I. prob (X j -` A j \<inter> space M)))" |
|
42987 | 816 |
proof - |
817 |
from rv have X: "\<And>i. i \<in> I \<Longrightarrow> X i \<in> space M \<rightarrow> space (M' i)" |
|
818 |
unfolding measurable_def by simp |
|
819 |
||
820 |
{ fix i assume "i\<in>I" |
|
47694 | 821 |
from closed[OF `i \<in> I`] |
822 |
have "sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)} |
|
823 |
= sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> E i}" |
|
824 |
unfolding sigma_sets_vimage_commute[OF X, OF `i \<in> I`, symmetric] M'[OF `i \<in> I`] |
|
42987 | 825 |
by (subst sigma_sets_sigma_sets_eq) auto } |
47694 | 826 |
note sigma_sets_X = this |
42987 | 827 |
|
828 |
{ fix i assume "i\<in>I" |
|
47694 | 829 |
have "Int_stable {X i -` A \<inter> space M |A. A \<in> E i}" |
42987 | 830 |
proof (rule Int_stableI) |
47694 | 831 |
fix a assume "a \<in> {X i -` A \<inter> space M |A. A \<in> E i}" |
832 |
then obtain A where "a = X i -` A \<inter> space M" "A \<in> E i" by auto |
|
42987 | 833 |
moreover |
47694 | 834 |
fix b assume "b \<in> {X i -` A \<inter> space M |A. A \<in> E i}" |
835 |
then obtain B where "b = X i -` B \<inter> space M" "B \<in> E i" by auto |
|
42987 | 836 |
moreover |
837 |
have "(X i -` A \<inter> space M) \<inter> (X i -` B \<inter> space M) = X i -` (A \<inter> B) \<inter> space M" by auto |
|
838 |
moreover note Int_stable[OF `i \<in> I`] |
|
839 |
ultimately |
|
47694 | 840 |
show "a \<inter> b \<in> {X i -` A \<inter> space M |A. A \<in> E i}" |
42987 | 841 |
by (auto simp del: vimage_Int intro!: exI[of _ "A \<inter> B"] dest: Int_stableD) |
842 |
qed } |
|
47694 | 843 |
note indep_sets_X = indep_sets_sigma_sets_iff[OF this] |
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
844 |
|
42987 | 845 |
{ fix i assume "i \<in> I" |
47694 | 846 |
{ fix A assume "A \<in> E i" |
847 |
with M'[OF `i \<in> I`] have "A \<in> sets (M' i)" by auto |
|
42987 | 848 |
moreover |
47694 | 849 |
from rv[OF `i\<in>I`] have "X i \<in> measurable M (M' i)" by auto |
42987 | 850 |
ultimately |
851 |
have "X i -` A \<inter> space M \<in> sets M" by (auto intro: measurable_sets) } |
|
852 |
with X[OF `i\<in>I`] space[OF `i\<in>I`] |
|
47694 | 853 |
have "{X i -` A \<inter> space M |A. A \<in> E i} \<subseteq> events" |
854 |
"space M \<in> {X i -` A \<inter> space M |A. A \<in> E i}" |
|
42987 | 855 |
by (auto intro!: exI[of _ "space (M' i)"]) } |
47694 | 856 |
note indep_sets_finite_X = indep_sets_finite[OF I this] |
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
857 |
|
47694 | 858 |
have "(\<forall>A\<in>\<Pi> i\<in>I. {X i -` A \<inter> space M |A. A \<in> E i}. prob (INTER I A) = (\<Prod>j\<in>I. prob (A j))) = |
859 |
(\<forall>A\<in>\<Pi> i\<in>I. E i. prob ((\<Inter>j\<in>I. X j -` A j) \<inter> space M) = (\<Prod>x\<in>I. prob (X x -` A x \<inter> space M)))" |
|
42987 | 860 |
(is "?L = ?R") |
861 |
proof safe |
|
47694 | 862 |
fix A assume ?L and A: "A \<in> (\<Pi> i\<in>I. E i)" |
42987 | 863 |
from `?L`[THEN bspec, of "\<lambda>i. X i -` A i \<inter> space M"] A `I \<noteq> {}` |
864 |
show "prob ((\<Inter>j\<in>I. X j -` A j) \<inter> space M) = (\<Prod>x\<in>I. prob (X x -` A x \<inter> space M))" |
|
865 |
by (auto simp add: Pi_iff) |
|
866 |
next |
|
47694 | 867 |
fix A assume ?R and A: "A \<in> (\<Pi> i\<in>I. {X i -` A \<inter> space M |A. A \<in> E i})" |
868 |
from A have "\<forall>i\<in>I. \<exists>B. A i = X i -` B \<inter> space M \<and> B \<in> E i" by auto |
|
42987 | 869 |
from bchoice[OF this] obtain B where B: "\<forall>i\<in>I. A i = X i -` B i \<inter> space M" |
47694 | 870 |
"B \<in> (\<Pi> i\<in>I. E i)" by auto |
42987 | 871 |
from `?R`[THEN bspec, OF B(2)] B(1) `I \<noteq> {}` |
872 |
show "prob (INTER I A) = (\<Prod>j\<in>I. prob (A j))" |
|
873 |
by simp |
|
874 |
qed |
|
875 |
then show ?thesis using `I \<noteq> {}` |
|
47694 | 876 |
by (simp add: rv indep_vars_def indep_sets_X sigma_sets_X indep_sets_finite_X cong: indep_sets_cong) |
42988 | 877 |
qed |
878 |
||
42989 | 879 |
lemma (in prob_space) indep_vars_compose: |
880 |
assumes "indep_vars M' X I" |
|
47694 | 881 |
assumes rv: "\<And>i. i \<in> I \<Longrightarrow> Y i \<in> measurable (M' i) (N i)" |
42989 | 882 |
shows "indep_vars N (\<lambda>i. Y i \<circ> X i) I" |
883 |
unfolding indep_vars_def |
|
42988 | 884 |
proof |
42989 | 885 |
from rv `indep_vars M' X I` |
42988 | 886 |
show "\<forall>i\<in>I. random_variable (N i) (Y i \<circ> X i)" |
47694 | 887 |
by (auto simp: indep_vars_def) |
42988 | 888 |
|
889 |
have "indep_sets (\<lambda>i. sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I" |
|
42989 | 890 |
using `indep_vars M' X I` by (simp add: indep_vars_def) |
42988 | 891 |
then show "indep_sets (\<lambda>i. sigma_sets (space M) {(Y i \<circ> X i) -` A \<inter> space M |A. A \<in> sets (N i)}) I" |
892 |
proof (rule indep_sets_mono_sets) |
|
893 |
fix i assume "i \<in> I" |
|
42989 | 894 |
with `indep_vars M' X I` have X: "X i \<in> space M \<rightarrow> space (M' i)" |
895 |
unfolding indep_vars_def measurable_def by auto |
|
42988 | 896 |
{ fix A assume "A \<in> sets (N i)" |
897 |
then have "\<exists>B. (Y i \<circ> X i) -` A \<inter> space M = X i -` B \<inter> space M \<and> B \<in> sets (M' i)" |
|
898 |
by (intro exI[of _ "Y i -` A \<inter> space (M' i)"]) |
|
56154
f0a927235162
more complete set of lemmas wrt. image and composition
haftmann
parents:
55414
diff
changeset
|
899 |
(auto simp: vimage_comp intro!: measurable_sets rv `i \<in> I` funcset_mem[OF X]) } |
42988 | 900 |
then show "sigma_sets (space M) {(Y i \<circ> X i) -` A \<inter> space M |A. A \<in> sets (N i)} \<subseteq> |
901 |
sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}" |
|
56154
f0a927235162
more complete set of lemmas wrt. image and composition
haftmann
parents:
55414
diff
changeset
|
902 |
by (intro sigma_sets_subseteq) (auto simp: vimage_comp) |
42988 | 903 |
qed |
904 |
qed |
|
905 |
||
57447
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
906 |
lemma (in prob_space) indep_vars_compose2: |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
907 |
assumes "indep_vars M' X I" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
908 |
assumes rv: "\<And>i. i \<in> I \<Longrightarrow> Y i \<in> measurable (M' i) (N i)" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
909 |
shows "indep_vars N (\<lambda>i x. Y i (X i x)) I" |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
910 |
using indep_vars_compose [OF assms] by (simp add: comp_def) |
87429bdecad5
import more stuff from the CLT proof; base the lborel measure on interval_measure; remove lebesgue measure
hoelzl
parents:
57418
diff
changeset
|
911 |
|
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
912 |
lemma (in prob_space) indep_var_compose: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
913 |
assumes "indep_var M1 X1 M2 X2" "Y1 \<in> measurable M1 N1" "Y2 \<in> measurable M2 N2" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
914 |
shows "indep_var N1 (Y1 \<circ> X1) N2 (Y2 \<circ> X2)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
915 |
proof - |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
916 |
have "indep_vars (case_bool N1 N2) (\<lambda>b. case_bool Y1 Y2 b \<circ> case_bool X1 X2 b) UNIV" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
917 |
using assms |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
918 |
by (intro indep_vars_compose[where M'="case_bool M1 M2"]) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
919 |
(auto simp: indep_var_def split: bool.split) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
920 |
also have "(\<lambda>b. case_bool Y1 Y2 b \<circ> case_bool X1 X2 b) = case_bool (Y1 \<circ> X1) (Y2 \<circ> X2)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
921 |
by (simp add: fun_eq_iff split: bool.split) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
922 |
finally show ?thesis |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
923 |
unfolding indep_var_def . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
924 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
925 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
926 |
lemma (in prob_space) indep_vars_Min: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
927 |
fixes X :: "'i \<Rightarrow> 'a \<Rightarrow> real" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
928 |
assumes I: "finite I" "i \<notin> I" and indep: "indep_vars (\<lambda>_. borel) X (insert i I)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
929 |
shows "indep_var borel (X i) borel (\<lambda>\<omega>. Min ((\<lambda>i. X i \<omega>)`I))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
930 |
proof - |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
931 |
have "indep_var |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
932 |
borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i})) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
933 |
borel ((\<lambda>f. Min (f`I)) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
934 |
using I by (intro indep_var_compose[OF indep_var_restrict[OF indep]] borel_measurable_Min) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
935 |
also have "((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i})) = X i" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
936 |
by auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
937 |
also have "((\<lambda>f. Min (f`I)) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I)) = (\<lambda>\<omega>. Min ((\<lambda>i. X i \<omega>)`I))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
938 |
by (auto cong: rev_conj_cong) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
939 |
finally show ?thesis |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
940 |
unfolding indep_var_def . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
941 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
942 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
943 |
lemma (in prob_space) indep_vars_setsum: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
944 |
fixes X :: "'i \<Rightarrow> 'a \<Rightarrow> real" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
945 |
assumes I: "finite I" "i \<notin> I" and indep: "indep_vars (\<lambda>_. borel) X (insert i I)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
946 |
shows "indep_var borel (X i) borel (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
947 |
proof - |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
948 |
have "indep_var |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
949 |
borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i})) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
950 |
borel ((\<lambda>f. \<Sum>i\<in>I. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
951 |
using I by (intro indep_var_compose[OF indep_var_restrict[OF indep]] ) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
952 |
also have "((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i})) = X i" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
953 |
by auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
954 |
also have "((\<lambda>f. \<Sum>i\<in>I. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I)) = (\<lambda>\<omega>. \<Sum>i\<in>I. X i \<omega>)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
955 |
by (auto cong: rev_conj_cong) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
956 |
finally show ?thesis . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
957 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
958 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
959 |
lemma (in prob_space) indep_vars_setprod: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
960 |
fixes X :: "'i \<Rightarrow> 'a \<Rightarrow> real" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
961 |
assumes I: "finite I" "i \<notin> I" and indep: "indep_vars (\<lambda>_. borel) X (insert i I)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
962 |
shows "indep_var borel (X i) borel (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
963 |
proof - |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
964 |
have "indep_var |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
965 |
borel ((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i})) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
966 |
borel ((\<lambda>f. \<Prod>i\<in>I. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
967 |
using I by (intro indep_var_compose[OF indep_var_restrict[OF indep]] ) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
968 |
also have "((\<lambda>f. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) {i})) = X i" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
969 |
by auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
970 |
also have "((\<lambda>f. \<Prod>i\<in>I. f i) \<circ> (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) I)) = (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
971 |
by (auto cong: rev_conj_cong) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
972 |
finally show ?thesis . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
973 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
974 |
|
47694 | 975 |
lemma (in prob_space) indep_varsD_finite: |
42989 | 976 |
assumes X: "indep_vars M' X I" |
42988 | 977 |
assumes I: "I \<noteq> {}" "finite I" "\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (M' i)" |
978 |
shows "prob (\<Inter>i\<in>I. X i -` A i \<inter> space M) = (\<Prod>i\<in>I. prob (X i -` A i \<inter> space M))" |
|
979 |
proof (rule indep_setsD) |
|
980 |
show "indep_sets (\<lambda>i. sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I" |
|
42989 | 981 |
using X by (auto simp: indep_vars_def) |
42988 | 982 |
show "I \<subseteq> I" "I \<noteq> {}" "finite I" using I by auto |
983 |
show "\<forall>i\<in>I. X i -` A i \<inter> space M \<in> sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}" |
|
47694 | 984 |
using I by auto |
42988 | 985 |
qed |
986 |
||
47694 | 987 |
lemma (in prob_space) indep_varsD: |
988 |
assumes X: "indep_vars M' X I" |
|
989 |
assumes I: "J \<noteq> {}" "finite J" "J \<subseteq> I" "\<And>i. i \<in> J \<Longrightarrow> A i \<in> sets (M' i)" |
|
990 |
shows "prob (\<Inter>i\<in>J. X i -` A i \<inter> space M) = (\<Prod>i\<in>J. prob (X i -` A i \<inter> space M))" |
|
991 |
proof (rule indep_setsD) |
|
992 |
show "indep_sets (\<lambda>i. sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}) I" |
|
993 |
using X by (auto simp: indep_vars_def) |
|
994 |
show "\<forall>i\<in>J. X i -` A i \<inter> space M \<in> sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)}" |
|
995 |
using I by auto |
|
996 |
qed fact+ |
|
997 |
||
998 |
lemma (in prob_space) indep_vars_iff_distr_eq_PiM: |
|
999 |
fixes I :: "'i set" and X :: "'i \<Rightarrow> 'a \<Rightarrow> 'b" |
|
1000 |
assumes "I \<noteq> {}" |
|
42988 | 1001 |
assumes rv: "\<And>i. random_variable (M' i) (X i)" |
42989 | 1002 |
shows "indep_vars M' X I \<longleftrightarrow> |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1003 |
distr M (\<Pi>\<^sub>M i\<in>I. M' i) (\<lambda>x. \<lambda>i\<in>I. X i x) = (\<Pi>\<^sub>M i\<in>I. distr M (M' i) (X i))" |
42988 | 1004 |
proof - |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1005 |
let ?P = "\<Pi>\<^sub>M i\<in>I. M' i" |
47694 | 1006 |
let ?X = "\<lambda>x. \<lambda>i\<in>I. X i x" |
1007 |
let ?D = "distr M ?P ?X" |
|
1008 |
have X: "random_variable ?P ?X" by (intro measurable_restrict rv) |
|
1009 |
interpret D: prob_space ?D by (intro prob_space_distr X) |
|
42988 | 1010 |
|
47694 | 1011 |
let ?D' = "\<lambda>i. distr M (M' i) (X i)" |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1012 |
let ?P' = "\<Pi>\<^sub>M i\<in>I. distr M (M' i) (X i)" |
47694 | 1013 |
interpret D': prob_space "?D' i" for i by (intro prob_space_distr rv) |
1014 |
interpret P: product_prob_space ?D' I .. |
|
1015 |
||
42988 | 1016 |
show ?thesis |
47694 | 1017 |
proof |
42989 | 1018 |
assume "indep_vars M' X I" |
47694 | 1019 |
show "?D = ?P'" |
1020 |
proof (rule measure_eqI_generator_eq) |
|
1021 |
show "Int_stable (prod_algebra I M')" |
|
1022 |
by (rule Int_stable_prod_algebra) |
|
1023 |
show "prod_algebra I M' \<subseteq> Pow (space ?P)" |
|
1024 |
using prod_algebra_sets_into_space by (simp add: space_PiM) |
|
1025 |
show "sets ?D = sigma_sets (space ?P) (prod_algebra I M')" |
|
1026 |
by (simp add: sets_PiM space_PiM) |
|
1027 |
show "sets ?P' = sigma_sets (space ?P) (prod_algebra I M')" |
|
1028 |
by (simp add: sets_PiM space_PiM cong: prod_algebra_cong) |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1029 |
let ?A = "\<lambda>i. \<Pi>\<^sub>E i\<in>I. space (M' i)" |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1030 |
show "range ?A \<subseteq> prod_algebra I M'" "(\<Union>i. ?A i) = space (Pi\<^sub>M I M')" |
47694 | 1031 |
by (auto simp: space_PiM intro!: space_in_prod_algebra cong: prod_algebra_cong) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1032 |
{ fix i show "emeasure ?D (\<Pi>\<^sub>E i\<in>I. space (M' i)) \<noteq> \<infinity>" by auto } |
47694 | 1033 |
next |
1034 |
fix E assume E: "E \<in> prod_algebra I M'" |
|
1035 |
from prod_algebraE[OF E] guess J Y . note J = this |
|
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1036 |
|
47694 | 1037 |
from E have "E \<in> sets ?P" by (auto simp: sets_PiM) |
1038 |
then have "emeasure ?D E = emeasure M (?X -` E \<inter> space M)" |
|
1039 |
by (simp add: emeasure_distr X) |
|
1040 |
also have "?X -` E \<inter> space M = (\<Inter>i\<in>J. X i -` Y i \<inter> space M)" |
|
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50104
diff
changeset
|
1041 |
using J `I \<noteq> {}` measurable_space[OF rv] by (auto simp: prod_emb_def PiE_iff split: split_if_asm) |
47694 | 1042 |
also have "emeasure M (\<Inter>i\<in>J. X i -` Y i \<inter> space M) = (\<Prod> i\<in>J. emeasure M (X i -` Y i \<inter> space M))" |
1043 |
using `indep_vars M' X I` J `I \<noteq> {}` using indep_varsD[of M' X I J] |
|
1044 |
by (auto simp: emeasure_eq_measure setprod_ereal) |
|
1045 |
also have "\<dots> = (\<Prod> i\<in>J. emeasure (?D' i) (Y i))" |
|
1046 |
using rv J by (simp add: emeasure_distr) |
|
1047 |
also have "\<dots> = emeasure ?P' E" |
|
1048 |
using P.emeasure_PiM_emb[of J Y] J by (simp add: prod_emb_def) |
|
1049 |
finally show "emeasure ?D E = emeasure ?P' E" . |
|
42988 | 1050 |
qed |
1051 |
next |
|
47694 | 1052 |
assume "?D = ?P'" |
1053 |
show "indep_vars M' X I" unfolding indep_vars_def |
|
1054 |
proof (intro conjI indep_setsI ballI rv) |
|
1055 |
fix i show "sigma_sets (space M) {X i -` A \<inter> space M |A. A \<in> sets (M' i)} \<subseteq> events" |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
1056 |
by (auto intro!: sets.sigma_sets_subset measurable_sets rv) |
42988 | 1057 |
next |
47694 | 1058 |
fix J Y' assume J: "J \<noteq> {}" "J \<subseteq> I" "finite J" |
1059 |
assume Y': "\<forall>j\<in>J. Y' j \<in> sigma_sets (space M) {X j -` A \<inter> space M |A. A \<in> sets (M' j)}" |
|
1060 |
have "\<forall>j\<in>J. \<exists>Y. Y' j = X j -` Y \<inter> space M \<and> Y \<in> sets (M' j)" |
|
42988 | 1061 |
proof |
47694 | 1062 |
fix j assume "j \<in> J" |
1063 |
from Y'[rule_format, OF this] rv[of j] |
|
1064 |
show "\<exists>Y. Y' j = X j -` Y \<inter> space M \<and> Y \<in> sets (M' j)" |
|
1065 |
by (subst (asm) sigma_sets_vimage_commute[symmetric, of _ _ "space (M' j)"]) |
|
50244
de72bbe42190
qualified interpretation of sigma_algebra, to avoid name clashes
immler
parents:
50123
diff
changeset
|
1066 |
(auto dest: measurable_space simp: sets.sigma_sets_eq) |
42988 | 1067 |
qed |
47694 | 1068 |
from bchoice[OF this] obtain Y where |
1069 |
Y: "\<And>j. j \<in> J \<Longrightarrow> Y' j = X j -` Y j \<inter> space M" "\<And>j. j \<in> J \<Longrightarrow> Y j \<in> sets (M' j)" by auto |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1070 |
let ?E = "prod_emb I M' J (Pi\<^sub>E J Y)" |
47694 | 1071 |
from Y have "(\<Inter>j\<in>J. Y' j) = ?X -` ?E \<inter> space M" |
50123
69b35a75caf3
merge extensional dependent function space from FuncSet with the one in Finite_Product_Measure
hoelzl
parents:
50104
diff
changeset
|
1072 |
using J `I \<noteq> {}` measurable_space[OF rv] by (auto simp: prod_emb_def PiE_iff split: split_if_asm) |
47694 | 1073 |
then have "emeasure M (\<Inter>j\<in>J. Y' j) = emeasure M (?X -` ?E \<inter> space M)" |
1074 |
by simp |
|
1075 |
also have "\<dots> = emeasure ?D ?E" |
|
1076 |
using Y J by (intro emeasure_distr[symmetric] X sets_PiM_I) auto |
|
1077 |
also have "\<dots> = emeasure ?P' ?E" |
|
1078 |
using `?D = ?P'` by simp |
|
1079 |
also have "\<dots> = (\<Prod> i\<in>J. emeasure (?D' i) (Y i))" |
|
1080 |
using P.emeasure_PiM_emb[of J Y] J Y by (simp add: prod_emb_def) |
|
1081 |
also have "\<dots> = (\<Prod> i\<in>J. emeasure M (Y' i))" |
|
1082 |
using rv J Y by (simp add: emeasure_distr) |
|
1083 |
finally have "emeasure M (\<Inter>j\<in>J. Y' j) = (\<Prod> i\<in>J. emeasure M (Y' i))" . |
|
1084 |
then show "prob (\<Inter>j\<in>J. Y' j) = (\<Prod> i\<in>J. prob (Y' i))" |
|
1085 |
by (auto simp: emeasure_eq_measure setprod_ereal) |
|
42988 | 1086 |
qed |
1087 |
qed |
|
42987 | 1088 |
qed |
1089 |
||
42989 | 1090 |
lemma (in prob_space) indep_varD: |
1091 |
assumes indep: "indep_var Ma A Mb B" |
|
1092 |
assumes sets: "Xa \<in> sets Ma" "Xb \<in> sets Mb" |
|
1093 |
shows "prob ((\<lambda>x. (A x, B x)) -` (Xa \<times> Xb) \<inter> space M) = |
|
1094 |
prob (A -` Xa \<inter> space M) * prob (B -` Xb \<inter> space M)" |
|
1095 |
proof - |
|
1096 |
have "prob ((\<lambda>x. (A x, B x)) -` (Xa \<times> Xb) \<inter> space M) = |
|
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
1097 |
prob (\<Inter>i\<in>UNIV. (case_bool A B i -` case_bool Xa Xb i \<inter> space M))" |
42989 | 1098 |
by (auto intro!: arg_cong[where f=prob] simp: UNIV_bool) |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
1099 |
also have "\<dots> = (\<Prod>i\<in>UNIV. prob (case_bool A B i -` case_bool Xa Xb i \<inter> space M))" |
42989 | 1100 |
using indep unfolding indep_var_def |
1101 |
by (rule indep_varsD) (auto split: bool.split intro: sets) |
|
1102 |
also have "\<dots> = prob (A -` Xa \<inter> space M) * prob (B -` Xb \<inter> space M)" |
|
1103 |
unfolding UNIV_bool by simp |
|
1104 |
finally show ?thesis . |
|
1105 |
qed |
|
1106 |
||
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1107 |
lemma (in prob_space) prob_indep_random_variable: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1108 |
assumes ind[simp]: "indep_var N X N Y" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1109 |
assumes [simp]: "A \<in> sets N" "B \<in> sets N" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1110 |
shows "\<P>(x in M. X x \<in> A \<and> Y x \<in> B) = \<P>(x in M. X x \<in> A) * \<P>(x in M. Y x \<in> B)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1111 |
proof- |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1112 |
have " \<P>(x in M. (X x)\<in>A \<and> (Y x)\<in> B ) = prob ((\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1113 |
by (auto intro!: arg_cong[where f= prob]) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1114 |
also have "...= prob (X -` A \<inter> space M) * prob (Y -` B \<inter> space M)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1115 |
by (auto intro!: indep_varD[where Ma=N and Mb=N]) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1116 |
also have "... = \<P>(x in M. X x \<in> A) * \<P>(x in M. Y x \<in> B)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1117 |
by (auto intro!: arg_cong2[where f= "op *"] arg_cong[where f= prob]) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1118 |
finally show ?thesis . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1119 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1120 |
|
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1121 |
lemma (in prob_space) |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1122 |
assumes "indep_var S X T Y" |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1123 |
shows indep_var_rv1: "random_variable S X" |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1124 |
and indep_var_rv2: "random_variable T Y" |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1125 |
proof - |
55414
eab03e9cee8a
renamed '{prod,sum,bool,unit}_case' to 'case_...'
blanchet
parents:
53015
diff
changeset
|
1126 |
have "\<forall>i\<in>UNIV. random_variable (case_bool S T i) (case_bool X Y i)" |
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1127 |
using assms unfolding indep_var_def indep_vars_def by auto |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1128 |
then show "random_variable S X" "random_variable T Y" |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1129 |
unfolding UNIV_bool by auto |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1130 |
qed |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1131 |
|
47694 | 1132 |
lemma (in prob_space) indep_var_distribution_eq: |
1133 |
"indep_var S X T Y \<longleftrightarrow> random_variable S X \<and> random_variable T Y \<and> |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1134 |
distr M S X \<Otimes>\<^sub>M distr M T Y = distr M (S \<Otimes>\<^sub>M T) (\<lambda>x. (X x, Y x))" (is "_ \<longleftrightarrow> _ \<and> _ \<and> ?S \<Otimes>\<^sub>M ?T = ?J") |
47694 | 1135 |
proof safe |
1136 |
assume "indep_var S X T Y" |
|
1137 |
then show rvs: "random_variable S X" "random_variable T Y" |
|
1138 |
by (blast dest: indep_var_rv1 indep_var_rv2)+ |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1139 |
then have XY: "random_variable (S \<Otimes>\<^sub>M T) (\<lambda>x. (X x, Y x))" |
47694 | 1140 |
by (rule measurable_Pair) |
1141 |
||
1142 |
interpret X: prob_space ?S by (rule prob_space_distr) fact |
|
1143 |
interpret Y: prob_space ?T by (rule prob_space_distr) fact |
|
1144 |
interpret XY: pair_prob_space ?S ?T .. |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1145 |
show "?S \<Otimes>\<^sub>M ?T = ?J" |
47694 | 1146 |
proof (rule pair_measure_eqI) |
1147 |
show "sigma_finite_measure ?S" .. |
|
1148 |
show "sigma_finite_measure ?T" .. |
|
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1149 |
|
47694 | 1150 |
fix A B assume A: "A \<in> sets ?S" and B: "B \<in> sets ?T" |
1151 |
have "emeasure ?J (A \<times> B) = emeasure M ((\<lambda>x. (X x, Y x)) -` (A \<times> B) \<inter> space M)" |
|
1152 |
using A B by (intro emeasure_distr[OF XY]) auto |
|
1153 |
also have "\<dots> = emeasure M (X -` A \<inter> space M) * emeasure M (Y -` B \<inter> space M)" |
|
1154 |
using indep_varD[OF `indep_var S X T Y`, of A B] A B by (simp add: emeasure_eq_measure) |
|
1155 |
also have "\<dots> = emeasure ?S A * emeasure ?T B" |
|
1156 |
using rvs A B by (simp add: emeasure_distr) |
|
1157 |
finally show "emeasure ?S A * emeasure ?T B = emeasure ?J (A \<times> B)" by simp |
|
1158 |
qed simp |
|
1159 |
next |
|
1160 |
assume rvs: "random_variable S X" "random_variable T Y" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1161 |
then have XY: "random_variable (S \<Otimes>\<^sub>M T) (\<lambda>x. (X x, Y x))" |
47694 | 1162 |
by (rule measurable_Pair) |
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1163 |
|
47694 | 1164 |
let ?S = "distr M S X" and ?T = "distr M T Y" |
1165 |
interpret X: prob_space ?S by (rule prob_space_distr) fact |
|
1166 |
interpret Y: prob_space ?T by (rule prob_space_distr) fact |
|
1167 |
interpret XY: pair_prob_space ?S ?T .. |
|
1168 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1169 |
assume "?S \<Otimes>\<^sub>M ?T = ?J" |
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1170 |
|
47694 | 1171 |
{ fix S and X |
1172 |
have "Int_stable {X -` A \<inter> space M |A. A \<in> sets S}" |
|
1173 |
proof (safe intro!: Int_stableI) |
|
1174 |
fix A B assume "A \<in> sets S" "B \<in> sets S" |
|
1175 |
then show "\<exists>C. (X -` A \<inter> space M) \<inter> (X -` B \<inter> space M) = (X -` C \<inter> space M) \<and> C \<in> sets S" |
|
1176 |
by (intro exI[of _ "A \<inter> B"]) auto |
|
1177 |
qed } |
|
1178 |
note Int_stable = this |
|
1179 |
||
1180 |
show "indep_var S X T Y" unfolding indep_var_eq |
|
1181 |
proof (intro conjI indep_set_sigma_sets Int_stable rvs) |
|
1182 |
show "indep_set {X -` A \<inter> space M |A. A \<in> sets S} {Y -` A \<inter> space M |A. A \<in> sets T}" |
|
1183 |
proof (safe intro!: indep_setI) |
|
1184 |
{ fix A assume "A \<in> sets S" then show "X -` A \<inter> space M \<in> sets M" |
|
1185 |
using `X \<in> measurable M S` by (auto intro: measurable_sets) } |
|
1186 |
{ fix A assume "A \<in> sets T" then show "Y -` A \<inter> space M \<in> sets M" |
|
1187 |
using `Y \<in> measurable M T` by (auto intro: measurable_sets) } |
|
1188 |
next |
|
1189 |
fix A B assume ab: "A \<in> sets S" "B \<in> sets T" |
|
1190 |
then have "ereal (prob ((X -` A \<inter> space M) \<inter> (Y -` B \<inter> space M))) = emeasure ?J (A \<times> B)" |
|
1191 |
using XY by (auto simp add: emeasure_distr emeasure_eq_measure intro!: arg_cong[where f="prob"]) |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1192 |
also have "\<dots> = emeasure (?S \<Otimes>\<^sub>M ?T) (A \<times> B)" |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1193 |
unfolding `?S \<Otimes>\<^sub>M ?T = ?J` .. |
47694 | 1194 |
also have "\<dots> = emeasure ?S A * emeasure ?T B" |
49776 | 1195 |
using ab by (simp add: Y.emeasure_pair_measure_Times) |
47694 | 1196 |
finally show "prob ((X -` A \<inter> space M) \<inter> (Y -` B \<inter> space M)) = |
1197 |
prob (X -` A \<inter> space M) * prob (Y -` B \<inter> space M)" |
|
1198 |
using rvs ab by (simp add: emeasure_eq_measure emeasure_distr) |
|
1199 |
qed |
|
43340
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1200 |
qed |
60e181c4eae4
lemma: independence is equal to mutual information = 0
hoelzl
parents:
42989
diff
changeset
|
1201 |
qed |
42989 | 1202 |
|
49795 | 1203 |
lemma (in prob_space) distributed_joint_indep: |
1204 |
assumes S: "sigma_finite_measure S" and T: "sigma_finite_measure T" |
|
1205 |
assumes X: "distributed M S X Px" and Y: "distributed M T Y Py" |
|
1206 |
assumes indep: "indep_var S X T Y" |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50244
diff
changeset
|
1207 |
shows "distributed M (S \<Otimes>\<^sub>M T) (\<lambda>x. (X x, Y x)) (\<lambda>(x, y). Px x * Py y)" |
49795 | 1208 |
using indep_var_distribution_eq[of S X T Y] indep |
1209 |
by (intro distributed_joint_indep'[OF S T X Y]) auto |
|
1210 |
||
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1211 |
lemma (in prob_space) indep_vars_nn_integral: |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1212 |
assumes I: "finite I" "indep_vars (\<lambda>_. borel) X I" "\<And>i \<omega>. i \<in> I \<Longrightarrow> 0 \<le> X i \<omega>" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1213 |
shows "(\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. X i \<omega>) \<partial>M) = (\<Prod>i\<in>I. \<integral>\<^sup>+\<omega>. X i \<omega> \<partial>M)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1214 |
proof cases |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1215 |
assume "I \<noteq> {}" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1216 |
def Y \<equiv> "\<lambda>i \<omega>. if i \<in> I then X i \<omega> else 0" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1217 |
{ fix i have "i \<in> I \<Longrightarrow> random_variable borel (X i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1218 |
using I(2) by (cases "i\<in>I") (auto simp: indep_vars_def) } |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1219 |
note rv_X = this |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1220 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1221 |
{ fix i have "random_variable borel (Y i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1222 |
using I(2) by (cases "i\<in>I") (auto simp: Y_def rv_X) } |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1223 |
note rv_Y = this[measurable] |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1224 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1225 |
interpret Y: prob_space "distr M borel (Y i)" for i |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1226 |
using I(2) by (cases "i \<in> I") (auto intro!: prob_space_distr simp: Y_def indep_vars_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1227 |
interpret product_sigma_finite "\<lambda>i. distr M borel (Y i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1228 |
.. |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1229 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1230 |
have indep_Y: "indep_vars (\<lambda>i. borel) Y I" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1231 |
by (rule indep_vars_cong[THEN iffD1, OF _ _ _ I(2)]) (auto simp: Y_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1232 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1233 |
have "(\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. X i \<omega>) \<partial>M) = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. max 0 (Y i \<omega>)) \<partial>M)" |
57418 | 1234 |
using I(3) by (auto intro!: nn_integral_cong setprod.cong simp add: Y_def max_def) |
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1235 |
also have "\<dots> = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. max 0 (\<omega> i)) \<partial>distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1236 |
by (subst nn_integral_distr) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1237 |
also have "\<dots> = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. max 0 (\<omega> i)) \<partial>Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1238 |
unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF `I \<noteq> {}` rv_Y indep_Y] .. |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1239 |
also have "\<dots> = (\<Prod>i\<in>I. (\<integral>\<^sup>+\<omega>. max 0 \<omega> \<partial>distr M borel (Y i)))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1240 |
by (rule product_nn_integral_setprod) (auto intro: `finite I`) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1241 |
also have "\<dots> = (\<Prod>i\<in>I. \<integral>\<^sup>+\<omega>. X i \<omega> \<partial>M)" |
57418 | 1242 |
by (intro setprod.cong nn_integral_cong) |
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1243 |
(auto simp: nn_integral_distr nn_integral_max_0 Y_def rv_X) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1244 |
finally show ?thesis . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1245 |
qed (simp add: emeasure_space_1) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1246 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1247 |
lemma (in prob_space) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1248 |
fixes X :: "'i \<Rightarrow> 'a \<Rightarrow> 'b::{real_normed_field, banach, second_countable_topology}" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1249 |
assumes I: "finite I" "indep_vars (\<lambda>_. borel) X I" "\<And>i. i \<in> I \<Longrightarrow> integrable M (X i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1250 |
shows indep_vars_lebesgue_integral: "(\<integral>\<omega>. (\<Prod>i\<in>I. X i \<omega>) \<partial>M) = (\<Prod>i\<in>I. \<integral>\<omega>. X i \<omega> \<partial>M)" (is ?eq) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1251 |
and indep_vars_integrable: "integrable M (\<lambda>\<omega>. (\<Prod>i\<in>I. X i \<omega>))" (is ?int) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1252 |
proof (induct rule: case_split) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1253 |
assume "I \<noteq> {}" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1254 |
def Y \<equiv> "\<lambda>i \<omega>. if i \<in> I then X i \<omega> else 0" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1255 |
{ fix i have "i \<in> I \<Longrightarrow> random_variable borel (X i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1256 |
using I(2) by (cases "i\<in>I") (auto simp: indep_vars_def) } |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1257 |
note rv_X = this[measurable] |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1258 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1259 |
{ fix i have "random_variable borel (Y i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1260 |
using I(2) by (cases "i\<in>I") (auto simp: Y_def rv_X) } |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1261 |
note rv_Y = this[measurable] |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1262 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1263 |
{ fix i have "integrable M (Y i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1264 |
using I(3) by (cases "i\<in>I") (auto simp: Y_def) } |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1265 |
note int_Y = this |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1266 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1267 |
interpret Y: prob_space "distr M borel (Y i)" for i |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1268 |
using I(2) by (cases "i \<in> I") (auto intro!: prob_space_distr simp: Y_def indep_vars_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1269 |
interpret product_sigma_finite "\<lambda>i. distr M borel (Y i)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1270 |
.. |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1271 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1272 |
have indep_Y: "indep_vars (\<lambda>i. borel) Y I" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1273 |
by (rule indep_vars_cong[THEN iffD1, OF _ _ _ I(2)]) (auto simp: Y_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1274 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1275 |
have "(\<integral>\<omega>. (\<Prod>i\<in>I. X i \<omega>) \<partial>M) = (\<integral>\<omega>. (\<Prod>i\<in>I. Y i \<omega>) \<partial>M)" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1276 |
using I(3) by (simp add: Y_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1277 |
also have "\<dots> = (\<integral>\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1278 |
by (subst integral_distr) auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1279 |
also have "\<dots> = (\<integral>\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1280 |
unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF `I \<noteq> {}` rv_Y indep_Y] .. |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1281 |
also have "\<dots> = (\<Prod>i\<in>I. (\<integral>\<omega>. \<omega> \<partial>distr M borel (Y i)))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1282 |
by (rule product_integral_setprod) (auto intro: `finite I` simp: integrable_distr_eq int_Y) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1283 |
also have "\<dots> = (\<Prod>i\<in>I. \<integral>\<omega>. X i \<omega> \<partial>M)" |
57418 | 1284 |
by (intro setprod.cong integral_cong) |
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1285 |
(auto simp: integral_distr Y_def rv_X) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1286 |
finally show ?eq . |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1287 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1288 |
have "integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. (\<Prod>i\<in>I. \<omega> i))" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1289 |
unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF `I \<noteq> {}` rv_Y indep_Y] |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1290 |
by (intro product_integrable_setprod[OF `finite I`]) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1291 |
(simp add: integrable_distr_eq int_Y) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1292 |
then show ?int |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1293 |
by (simp add: integrable_distr_eq Y_def) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1294 |
qed (simp_all add: prob_space) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1295 |
|
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1296 |
lemma (in prob_space) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1297 |
fixes X1 X2 :: "'a \<Rightarrow> 'b::{real_normed_field, banach, second_countable_topology}" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1298 |
assumes "indep_var borel X1 borel X2" "integrable M X1" "integrable M X2" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1299 |
shows indep_var_lebesgue_integral: "(\<integral>\<omega>. X1 \<omega> * X2 \<omega> \<partial>M) = (\<integral>\<omega>. X1 \<omega> \<partial>M) * (\<integral>\<omega>. X2 \<omega> \<partial>M)" (is ?eq) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1300 |
and indep_var_integrable: "integrable M (\<lambda>\<omega>. X1 \<omega> * X2 \<omega>)" (is ?int) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1301 |
unfolding indep_var_def |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1302 |
proof - |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1303 |
have *: "(\<lambda>\<omega>. X1 \<omega> * X2 \<omega>) = (\<lambda>\<omega>. \<Prod>i\<in>UNIV. (case_bool X1 X2 i \<omega>))" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57447
diff
changeset
|
1304 |
by (simp add: UNIV_bool mult.commute) |
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1305 |
have **: "(\<lambda> _. borel) = case_bool borel borel" |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1306 |
by (rule ext, metis (full_types) bool.simps(3) bool.simps(4)) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1307 |
show ?eq |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1308 |
apply (subst *) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1309 |
apply (subst indep_vars_lebesgue_integral) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1310 |
apply (auto) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1311 |
apply (subst **, subst indep_var_def [symmetric], rule assms) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1312 |
apply (simp split: bool.split add: assms) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57447
diff
changeset
|
1313 |
by (simp add: UNIV_bool mult.commute) |
57235
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1314 |
show ?int |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1315 |
apply (subst *) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1316 |
apply (rule indep_vars_integrable) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1317 |
apply auto |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1318 |
apply (subst **, subst indep_var_def [symmetric], rule assms) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1319 |
by (simp split: bool.split add: assms) |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1320 |
qed |
b0b9a10e4bf4
properties of Erlang and exponentially distributed random variables (by Sudeep Kanav)
hoelzl
parents:
56154
diff
changeset
|
1321 |
|
42861
16375b493b64
Add formalization of probabilistic independence for families of sets
hoelzl
parents:
diff
changeset
|
1322 |
end |