author | immler |
Wed, 02 May 2018 13:49:38 +0200 | |
changeset 68072 | 493b818e8e10 |
parent 67982 | 7643b005b29a |
child 68073 | fad29d2a17a5 |
permissions | -rw-r--r-- |
63627 | 1 |
(* Title: HOL/Analysis/Sigma_Algebra.thy |
42067 | 2 |
Author: Stefan Richter, Markus Wenzel, TU München |
3 |
Author: Johannes Hölzl, TU München |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41959
diff
changeset
|
4 |
Plus material from the Hurd/Coble measure theory development, |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41959
diff
changeset
|
5 |
translated by Lawrence Paulson. |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
6 |
*) |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
7 |
|
67962 | 8 |
section \<open>Sigma Algebra\<close> |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
9 |
|
41413
64cd30d6b0b8
explicit file specifications -- avoid secondary load path;
wenzelm
parents:
41095
diff
changeset
|
10 |
theory Sigma_Algebra |
64cd30d6b0b8
explicit file specifications -- avoid secondary load path;
wenzelm
parents:
41095
diff
changeset
|
11 |
imports |
42145 | 12 |
Complex_Main |
66453
cc19f7ca2ed6
session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents:
64008
diff
changeset
|
13 |
"HOL-Library.Countable_Set" |
cc19f7ca2ed6
session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents:
64008
diff
changeset
|
14 |
"HOL-Library.Indicator_Function" |
cc19f7ca2ed6
session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents:
64008
diff
changeset
|
15 |
"HOL-Library.Extended_Nonnegative_Real" |
cc19f7ca2ed6
session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents:
64008
diff
changeset
|
16 |
"HOL-Library.Disjoint_Sets" |
41413
64cd30d6b0b8
explicit file specifications -- avoid secondary load path;
wenzelm
parents:
41095
diff
changeset
|
17 |
begin |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
18 |
|
61808 | 19 |
text \<open>Sigma algebras are an elementary concept in measure |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
20 |
theory. To measure --- that is to integrate --- functions, we first have |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
21 |
to measure sets. Unfortunately, when dealing with a large universe, |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
22 |
it is often not possible to consistently assign a measure to every |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
23 |
subset. Therefore it is necessary to define the set of measurable |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
24 |
subsets of the universe. A sigma algebra is such a set that has |
61808 | 25 |
three very natural and desirable properties.\<close> |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
26 |
|
61808 | 27 |
subsection \<open>Families of sets\<close> |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
28 |
|
67962 | 29 |
locale%important subset_class = |
47694 | 30 |
fixes \<Omega> :: "'a set" and M :: "'a set set" |
31 |
assumes space_closed: "M \<subseteq> Pow \<Omega>" |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
32 |
|
47694 | 33 |
lemma (in subset_class) sets_into_space: "x \<in> M \<Longrightarrow> x \<subseteq> \<Omega>" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
34 |
by (metis PowD contra_subsetD space_closed) |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
35 |
|
61808 | 36 |
subsubsection \<open>Semiring of sets\<close> |
47762 | 37 |
|
67962 | 38 |
locale%important semiring_of_sets = subset_class + |
47762 | 39 |
assumes empty_sets[iff]: "{} \<in> M" |
40 |
assumes Int[intro]: "\<And>a b. a \<in> M \<Longrightarrow> b \<in> M \<Longrightarrow> a \<inter> b \<in> M" |
|
41 |
assumes Diff_cover: |
|
42 |
"\<And>a b. a \<in> M \<Longrightarrow> b \<in> M \<Longrightarrow> \<exists>C\<subseteq>M. finite C \<and> disjoint C \<and> a - b = \<Union>C" |
|
43 |
||
44 |
lemma (in semiring_of_sets) finite_INT[intro]: |
|
45 |
assumes "finite I" "I \<noteq> {}" "\<And>i. i \<in> I \<Longrightarrow> A i \<in> M" |
|
46 |
shows "(\<Inter>i\<in>I. A i) \<in> M" |
|
47 |
using assms by (induct rule: finite_ne_induct) auto |
|
48 |
||
49 |
lemma (in semiring_of_sets) Int_space_eq1 [simp]: "x \<in> M \<Longrightarrow> \<Omega> \<inter> x = x" |
|
50 |
by (metis Int_absorb1 sets_into_space) |
|
51 |
||
52 |
lemma (in semiring_of_sets) Int_space_eq2 [simp]: "x \<in> M \<Longrightarrow> x \<inter> \<Omega> = x" |
|
53 |
by (metis Int_absorb2 sets_into_space) |
|
54 |
||
55 |
lemma (in semiring_of_sets) sets_Collect_conj: |
|
56 |
assumes "{x\<in>\<Omega>. P x} \<in> M" "{x\<in>\<Omega>. Q x} \<in> M" |
|
57 |
shows "{x\<in>\<Omega>. Q x \<and> P x} \<in> M" |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
58 |
proof - |
47762 | 59 |
have "{x\<in>\<Omega>. Q x \<and> P x} = {x\<in>\<Omega>. Q x} \<inter> {x\<in>\<Omega>. P x}" |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
60 |
by auto |
47762 | 61 |
with assms show ?thesis by auto |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
62 |
qed |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
63 |
|
50002
ce0d316b5b44
add measurability prover; add support for Borel sets
hoelzl
parents:
49834
diff
changeset
|
64 |
lemma (in semiring_of_sets) sets_Collect_finite_All': |
47762 | 65 |
assumes "\<And>i. i \<in> S \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M" "finite S" "S \<noteq> {}" |
66 |
shows "{x\<in>\<Omega>. \<forall>i\<in>S. P i x} \<in> M" |
|
67 |
proof - |
|
68 |
have "{x\<in>\<Omega>. \<forall>i\<in>S. P i x} = (\<Inter>i\<in>S. {x\<in>\<Omega>. P i x})" |
|
61808 | 69 |
using \<open>S \<noteq> {}\<close> by auto |
47762 | 70 |
with assms show ?thesis by auto |
71 |
qed |
|
72 |
||
67962 | 73 |
subsubsection \<open>Ring of sets\<close> |
74 |
||
75 |
locale%important ring_of_sets = semiring_of_sets + |
|
47762 | 76 |
assumes Un [intro]: "\<And>a b. a \<in> M \<Longrightarrow> b \<in> M \<Longrightarrow> a \<union> b \<in> M" |
77 |
||
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
78 |
lemma (in ring_of_sets) finite_Union [intro]: |
61952 | 79 |
"finite X \<Longrightarrow> X \<subseteq> M \<Longrightarrow> \<Union>X \<in> M" |
38656 | 80 |
by (induct set: finite) (auto simp add: Un) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
81 |
|
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
82 |
lemma (in ring_of_sets) finite_UN[intro]: |
47694 | 83 |
assumes "finite I" and "\<And>i. i \<in> I \<Longrightarrow> A i \<in> M" |
84 |
shows "(\<Union>i\<in>I. A i) \<in> M" |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41959
diff
changeset
|
85 |
using assms by induct auto |
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41959
diff
changeset
|
86 |
|
47762 | 87 |
lemma (in ring_of_sets) Diff [intro]: |
88 |
assumes "a \<in> M" "b \<in> M" shows "a - b \<in> M" |
|
89 |
using Diff_cover[OF assms] by auto |
|
90 |
||
91 |
lemma ring_of_setsI: |
|
92 |
assumes space_closed: "M \<subseteq> Pow \<Omega>" |
|
93 |
assumes empty_sets[iff]: "{} \<in> M" |
|
94 |
assumes Un[intro]: "\<And>a b. a \<in> M \<Longrightarrow> b \<in> M \<Longrightarrow> a \<union> b \<in> M" |
|
95 |
assumes Diff[intro]: "\<And>a b. a \<in> M \<Longrightarrow> b \<in> M \<Longrightarrow> a - b \<in> M" |
|
96 |
shows "ring_of_sets \<Omega> M" |
|
97 |
proof |
|
98 |
fix a b assume ab: "a \<in> M" "b \<in> M" |
|
99 |
from ab show "\<exists>C\<subseteq>M. finite C \<and> disjoint C \<and> a - b = \<Union>C" |
|
100 |
by (intro exI[of _ "{a - b}"]) (auto simp: disjoint_def) |
|
101 |
have "a \<inter> b = a - (a - b)" by auto |
|
102 |
also have "\<dots> \<in> M" using ab by auto |
|
103 |
finally show "a \<inter> b \<in> M" . |
|
104 |
qed fact+ |
|
105 |
||
106 |
lemma ring_of_sets_iff: "ring_of_sets \<Omega> M \<longleftrightarrow> M \<subseteq> Pow \<Omega> \<and> {} \<in> M \<and> (\<forall>a\<in>M. \<forall>b\<in>M. a \<union> b \<in> M) \<and> (\<forall>a\<in>M. \<forall>b\<in>M. a - b \<in> M)" |
|
107 |
proof |
|
108 |
assume "ring_of_sets \<Omega> M" |
|
109 |
then interpret ring_of_sets \<Omega> M . |
|
110 |
show "M \<subseteq> Pow \<Omega> \<and> {} \<in> M \<and> (\<forall>a\<in>M. \<forall>b\<in>M. a \<union> b \<in> M) \<and> (\<forall>a\<in>M. \<forall>b\<in>M. a - b \<in> M)" |
|
111 |
using space_closed by auto |
|
112 |
qed (auto intro!: ring_of_setsI) |
|
41981
cdf7693bbe08
reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents:
41959
diff
changeset
|
113 |
|
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
114 |
lemma (in ring_of_sets) insert_in_sets: |
47694 | 115 |
assumes "{x} \<in> M" "A \<in> M" shows "insert x A \<in> M" |
38656 | 116 |
proof - |
47694 | 117 |
have "{x} \<union> A \<in> M" using assms by (rule Un) |
38656 | 118 |
thus ?thesis by auto |
119 |
qed |
|
120 |
||
42867 | 121 |
lemma (in ring_of_sets) sets_Collect_disj: |
47694 | 122 |
assumes "{x\<in>\<Omega>. P x} \<in> M" "{x\<in>\<Omega>. Q x} \<in> M" |
123 |
shows "{x\<in>\<Omega>. Q x \<or> P x} \<in> M" |
|
42867 | 124 |
proof - |
47694 | 125 |
have "{x\<in>\<Omega>. Q x \<or> P x} = {x\<in>\<Omega>. Q x} \<union> {x\<in>\<Omega>. P x}" |
42867 | 126 |
by auto |
127 |
with assms show ?thesis by auto |
|
128 |
qed |
|
129 |
||
130 |
lemma (in ring_of_sets) sets_Collect_finite_Ex: |
|
47694 | 131 |
assumes "\<And>i. i \<in> S \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M" "finite S" |
132 |
shows "{x\<in>\<Omega>. \<exists>i\<in>S. P i x} \<in> M" |
|
42867 | 133 |
proof - |
47694 | 134 |
have "{x\<in>\<Omega>. \<exists>i\<in>S. P i x} = (\<Union>i\<in>S. {x\<in>\<Omega>. P i x})" |
42867 | 135 |
by auto |
136 |
with assms show ?thesis by auto |
|
137 |
qed |
|
138 |
||
67962 | 139 |
subsubsection \<open>Algebra of sets\<close> |
140 |
||
141 |
locale%important algebra = ring_of_sets + |
|
47694 | 142 |
assumes top [iff]: "\<Omega> \<in> M" |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
143 |
|
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
144 |
lemma (in algebra) compl_sets [intro]: |
47694 | 145 |
"a \<in> M \<Longrightarrow> \<Omega> - a \<in> M" |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
146 |
by auto |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
147 |
|
67962 | 148 |
lemma%important algebra_iff_Un: |
47694 | 149 |
"algebra \<Omega> M \<longleftrightarrow> |
150 |
M \<subseteq> Pow \<Omega> \<and> |
|
151 |
{} \<in> M \<and> |
|
152 |
(\<forall>a \<in> M. \<Omega> - a \<in> M) \<and> |
|
153 |
(\<forall>a \<in> M. \<forall> b \<in> M. a \<union> b \<in> M)" (is "_ \<longleftrightarrow> ?Un") |
|
67962 | 154 |
proof%unimportant |
47694 | 155 |
assume "algebra \<Omega> M" |
156 |
then interpret algebra \<Omega> M . |
|
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
157 |
show ?Un using sets_into_space by auto |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
158 |
next |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
159 |
assume ?Un |
47762 | 160 |
then have "\<Omega> \<in> M" by auto |
161 |
interpret ring_of_sets \<Omega> M |
|
162 |
proof (rule ring_of_setsI) |
|
163 |
show \<Omega>: "M \<subseteq> Pow \<Omega>" "{} \<in> M" |
|
61808 | 164 |
using \<open>?Un\<close> by auto |
47694 | 165 |
fix a b assume a: "a \<in> M" and b: "b \<in> M" |
61808 | 166 |
then show "a \<union> b \<in> M" using \<open>?Un\<close> by auto |
47694 | 167 |
have "a - b = \<Omega> - ((\<Omega> - a) \<union> b)" |
168 |
using \<Omega> a b by auto |
|
169 |
then show "a - b \<in> M" |
|
61808 | 170 |
using a b \<open>?Un\<close> by auto |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
171 |
qed |
47762 | 172 |
show "algebra \<Omega> M" proof qed fact |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
173 |
qed |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
174 |
|
67962 | 175 |
lemma%important algebra_iff_Int: |
47694 | 176 |
"algebra \<Omega> M \<longleftrightarrow> |
177 |
M \<subseteq> Pow \<Omega> & {} \<in> M & |
|
178 |
(\<forall>a \<in> M. \<Omega> - a \<in> M) & |
|
179 |
(\<forall>a \<in> M. \<forall> b \<in> M. a \<inter> b \<in> M)" (is "_ \<longleftrightarrow> ?Int") |
|
67962 | 180 |
proof%unimportant |
47694 | 181 |
assume "algebra \<Omega> M" |
182 |
then interpret algebra \<Omega> M . |
|
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
183 |
show ?Int using sets_into_space by auto |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
184 |
next |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
185 |
assume ?Int |
47694 | 186 |
show "algebra \<Omega> M" |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
187 |
proof (unfold algebra_iff_Un, intro conjI ballI) |
47694 | 188 |
show \<Omega>: "M \<subseteq> Pow \<Omega>" "{} \<in> M" |
61808 | 189 |
using \<open>?Int\<close> by auto |
190 |
from \<open>?Int\<close> show "\<And>a. a \<in> M \<Longrightarrow> \<Omega> - a \<in> M" by auto |
|
47694 | 191 |
fix a b assume M: "a \<in> M" "b \<in> M" |
192 |
hence "a \<union> b = \<Omega> - ((\<Omega> - a) \<inter> (\<Omega> - b))" |
|
193 |
using \<Omega> by blast |
|
194 |
also have "... \<in> M" |
|
61808 | 195 |
using M \<open>?Int\<close> by auto |
47694 | 196 |
finally show "a \<union> b \<in> M" . |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
197 |
qed |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
198 |
qed |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
199 |
|
42867 | 200 |
lemma (in algebra) sets_Collect_neg: |
47694 | 201 |
assumes "{x\<in>\<Omega>. P x} \<in> M" |
202 |
shows "{x\<in>\<Omega>. \<not> P x} \<in> M" |
|
42867 | 203 |
proof - |
47694 | 204 |
have "{x\<in>\<Omega>. \<not> P x} = \<Omega> - {x\<in>\<Omega>. P x}" by auto |
42867 | 205 |
with assms show ?thesis by auto |
206 |
qed |
|
207 |
||
208 |
lemma (in algebra) sets_Collect_imp: |
|
47694 | 209 |
"{x\<in>\<Omega>. P x} \<in> M \<Longrightarrow> {x\<in>\<Omega>. Q x} \<in> M \<Longrightarrow> {x\<in>\<Omega>. Q x \<longrightarrow> P x} \<in> M" |
42867 | 210 |
unfolding imp_conv_disj by (intro sets_Collect_disj sets_Collect_neg) |
211 |
||
212 |
lemma (in algebra) sets_Collect_const: |
|
47694 | 213 |
"{x\<in>\<Omega>. P} \<in> M" |
42867 | 214 |
by (cases P) auto |
215 |
||
42984 | 216 |
lemma algebra_single_set: |
47762 | 217 |
"X \<subseteq> S \<Longrightarrow> algebra S { {}, X, S - X, S }" |
218 |
by (auto simp: algebra_iff_Int) |
|
42984 | 219 |
|
67962 | 220 |
subsubsection%unimportant \<open>Restricted algebras\<close> |
39092 | 221 |
|
222 |
abbreviation (in algebra) |
|
67399 | 223 |
"restricted_space A \<equiv> ((\<inter>) A) ` M" |
39092 | 224 |
|
38656 | 225 |
lemma (in algebra) restricted_algebra: |
47694 | 226 |
assumes "A \<in> M" shows "algebra A (restricted_space A)" |
47762 | 227 |
using assms by (auto simp: algebra_iff_Int) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
228 |
|
61808 | 229 |
subsubsection \<open>Sigma Algebras\<close> |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
230 |
|
67962 | 231 |
locale%important sigma_algebra = algebra + |
47694 | 232 |
assumes countable_nat_UN [intro]: "\<And>A. range A \<subseteq> M \<Longrightarrow> (\<Union>i::nat. A i) \<in> M" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
233 |
|
42984 | 234 |
lemma (in algebra) is_sigma_algebra: |
47694 | 235 |
assumes "finite M" |
236 |
shows "sigma_algebra \<Omega> M" |
|
42984 | 237 |
proof |
47694 | 238 |
fix A :: "nat \<Rightarrow> 'a set" assume "range A \<subseteq> M" |
239 |
then have "(\<Union>i. A i) = (\<Union>s\<in>M \<inter> range A. s)" |
|
42984 | 240 |
by auto |
47694 | 241 |
also have "(\<Union>s\<in>M \<inter> range A. s) \<in> M" |
61808 | 242 |
using \<open>finite M\<close> by auto |
47694 | 243 |
finally show "(\<Union>i. A i) \<in> M" . |
42984 | 244 |
qed |
245 |
||
38656 | 246 |
lemma countable_UN_eq: |
247 |
fixes A :: "'i::countable \<Rightarrow> 'a set" |
|
47694 | 248 |
shows "(range A \<subseteq> M \<longrightarrow> (\<Union>i. A i) \<in> M) \<longleftrightarrow> |
249 |
(range (A \<circ> from_nat) \<subseteq> M \<longrightarrow> (\<Union>i. (A \<circ> from_nat) i) \<in> M)" |
|
38656 | 250 |
proof - |
251 |
let ?A' = "A \<circ> from_nat" |
|
252 |
have *: "(\<Union>i. ?A' i) = (\<Union>i. A i)" (is "?l = ?r") |
|
253 |
proof safe |
|
254 |
fix x i assume "x \<in> A i" thus "x \<in> ?l" |
|
255 |
by (auto intro!: exI[of _ "to_nat i"]) |
|
256 |
next |
|
257 |
fix x i assume "x \<in> ?A' i" thus "x \<in> ?r" |
|
258 |
by (auto intro!: exI[of _ "from_nat i"]) |
|
259 |
qed |
|
260 |
have **: "range ?A' = range A" |
|
40702 | 261 |
using surj_from_nat |
56154
f0a927235162
more complete set of lemmas wrt. image and composition
haftmann
parents:
54420
diff
changeset
|
262 |
by (auto simp: image_comp [symmetric] intro!: imageI) |
38656 | 263 |
show ?thesis unfolding * ** .. |
264 |
qed |
|
265 |
||
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
266 |
lemma (in sigma_algebra) countable_Union [intro]: |
61952 | 267 |
assumes "countable X" "X \<subseteq> M" shows "\<Union>X \<in> M" |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
268 |
proof cases |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
269 |
assume "X \<noteq> {}" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
270 |
hence "\<Union>X = (\<Union>n. from_nat_into X n)" |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
271 |
using assms by (auto intro: from_nat_into) (metis from_nat_into_surj) |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
272 |
also have "\<dots> \<in> M" using assms |
61808 | 273 |
by (auto intro!: countable_nat_UN) (metis \<open>X \<noteq> {}\<close> from_nat_into set_mp) |
50245
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
274 |
finally show ?thesis . |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
275 |
qed simp |
dea9363887a6
based countable topological basis on Countable_Set
immler
parents:
50244
diff
changeset
|
276 |
|
38656 | 277 |
lemma (in sigma_algebra) countable_UN[intro]: |
278 |
fixes A :: "'i::countable \<Rightarrow> 'a set" |
|
47694 | 279 |
assumes "A`X \<subseteq> M" |
280 |
shows "(\<Union>x\<in>X. A x) \<in> M" |
|
38656 | 281 |
proof - |
46731 | 282 |
let ?A = "\<lambda>i. if i \<in> X then A i else {}" |
47694 | 283 |
from assms have "range ?A \<subseteq> M" by auto |
38656 | 284 |
with countable_nat_UN[of "?A \<circ> from_nat"] countable_UN_eq[of ?A M] |
47694 | 285 |
have "(\<Union>x. ?A x) \<in> M" by auto |
62390 | 286 |
moreover have "(\<Union>x. ?A x) = (\<Union>x\<in>X. A x)" by (auto split: if_split_asm) |
38656 | 287 |
ultimately show ?thesis by simp |
288 |
qed |
|
289 |
||
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
290 |
lemma (in sigma_algebra) countable_UN': |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
291 |
fixes A :: "'i \<Rightarrow> 'a set" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
292 |
assumes X: "countable X" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
293 |
assumes A: "A`X \<subseteq> M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
294 |
shows "(\<Union>x\<in>X. A x) \<in> M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
295 |
proof - |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
296 |
have "(\<Union>x\<in>X. A x) = (\<Union>i\<in>to_nat_on X ` X. A (from_nat_into X i))" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
297 |
using X by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
298 |
also have "\<dots> \<in> M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
299 |
using A X |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
300 |
by (intro countable_UN) auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
301 |
finally show ?thesis . |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
302 |
qed |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
303 |
|
61633 | 304 |
lemma (in sigma_algebra) countable_UN'': |
305 |
"\<lbrakk> countable X; \<And>x y. x \<in> X \<Longrightarrow> A x \<in> M \<rbrakk> \<Longrightarrow> (\<Union>x\<in>X. A x) \<in> M" |
|
306 |
by(erule countable_UN')(auto) |
|
307 |
||
33533
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
paulson
parents:
33271
diff
changeset
|
308 |
lemma (in sigma_algebra) countable_INT [intro]: |
38656 | 309 |
fixes A :: "'i::countable \<Rightarrow> 'a set" |
47694 | 310 |
assumes A: "A`X \<subseteq> M" "X \<noteq> {}" |
311 |
shows "(\<Inter>i\<in>X. A i) \<in> M" |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
312 |
proof - |
47694 | 313 |
from A have "\<forall>i\<in>X. A i \<in> M" by fast |
314 |
hence "\<Omega> - (\<Union>i\<in>X. \<Omega> - A i) \<in> M" by blast |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
315 |
moreover |
47694 | 316 |
have "(\<Inter>i\<in>X. A i) = \<Omega> - (\<Union>i\<in>X. \<Omega> - A i)" using space_closed A |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
317 |
by blast |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
318 |
ultimately show ?thesis by metis |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
319 |
qed |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
320 |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
321 |
lemma (in sigma_algebra) countable_INT': |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
322 |
fixes A :: "'i \<Rightarrow> 'a set" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
323 |
assumes X: "countable X" "X \<noteq> {}" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
324 |
assumes A: "A`X \<subseteq> M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
325 |
shows "(\<Inter>x\<in>X. A x) \<in> M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
326 |
proof - |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
327 |
have "(\<Inter>x\<in>X. A x) = (\<Inter>i\<in>to_nat_on X ` X. A (from_nat_into X i))" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
328 |
using X by auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
329 |
also have "\<dots> \<in> M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
330 |
using A X |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
331 |
by (intro countable_INT) auto |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
332 |
finally show ?thesis . |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
333 |
qed |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
334 |
|
59088
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
335 |
lemma (in sigma_algebra) countable_INT'': |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
336 |
"UNIV \<in> M \<Longrightarrow> countable I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> F i \<in> M) \<Longrightarrow> (\<Inter>i\<in>I. F i) \<in> M" |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
337 |
by (cases "I = {}") (auto intro: countable_INT') |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
338 |
|
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
339 |
lemma (in sigma_algebra) countable: |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
340 |
assumes "\<And>a. a \<in> A \<Longrightarrow> {a} \<in> M" "countable A" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
341 |
shows "A \<in> M" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
342 |
proof - |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
343 |
have "(\<Union>a\<in>A. {a}) \<in> M" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
344 |
using assms by (intro countable_UN') auto |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
345 |
also have "(\<Union>a\<in>A. {a}) = A" by auto |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
346 |
finally show ?thesis by auto |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
347 |
qed |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57138
diff
changeset
|
348 |
|
47694 | 349 |
lemma ring_of_sets_Pow: "ring_of_sets sp (Pow sp)" |
47762 | 350 |
by (auto simp: ring_of_sets_iff) |
42145 | 351 |
|
47694 | 352 |
lemma algebra_Pow: "algebra sp (Pow sp)" |
47762 | 353 |
by (auto simp: algebra_iff_Un) |
38656 | 354 |
|
355 |
lemma sigma_algebra_iff: |
|
47694 | 356 |
"sigma_algebra \<Omega> M \<longleftrightarrow> |
357 |
algebra \<Omega> M \<and> (\<forall>A. range A \<subseteq> M \<longrightarrow> (\<Union>i::nat. A i) \<in> M)" |
|
38656 | 358 |
by (simp add: sigma_algebra_def sigma_algebra_axioms_def) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
359 |
|
47762 | 360 |
lemma sigma_algebra_Pow: "sigma_algebra sp (Pow sp)" |
361 |
by (auto simp: sigma_algebra_iff algebra_iff_Int) |
|
362 |
||
42867 | 363 |
lemma (in sigma_algebra) sets_Collect_countable_All: |
47694 | 364 |
assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M" |
365 |
shows "{x\<in>\<Omega>. \<forall>i::'i::countable. P i x} \<in> M" |
|
42867 | 366 |
proof - |
47694 | 367 |
have "{x\<in>\<Omega>. \<forall>i::'i::countable. P i x} = (\<Inter>i. {x\<in>\<Omega>. P i x})" by auto |
42867 | 368 |
with assms show ?thesis by auto |
369 |
qed |
|
370 |
||
371 |
lemma (in sigma_algebra) sets_Collect_countable_Ex: |
|
47694 | 372 |
assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M" |
373 |
shows "{x\<in>\<Omega>. \<exists>i::'i::countable. P i x} \<in> M" |
|
42867 | 374 |
proof - |
47694 | 375 |
have "{x\<in>\<Omega>. \<exists>i::'i::countable. P i x} = (\<Union>i. {x\<in>\<Omega>. P i x})" by auto |
42867 | 376 |
with assms show ?thesis by auto |
377 |
qed |
|
378 |
||
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
379 |
lemma (in sigma_algebra) sets_Collect_countable_Ex': |
54418 | 380 |
assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
381 |
assumes "countable I" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
382 |
shows "{x\<in>\<Omega>. \<exists>i\<in>I. P i x} \<in> M" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
383 |
proof - |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
384 |
have "{x\<in>\<Omega>. \<exists>i\<in>I. P i x} = (\<Union>i\<in>I. {x\<in>\<Omega>. P i x})" by auto |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
385 |
with assms show ?thesis |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
386 |
by (auto intro!: countable_UN') |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
387 |
qed |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50387
diff
changeset
|
388 |
|
54418 | 389 |
lemma (in sigma_algebra) sets_Collect_countable_All': |
390 |
assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M" |
|
391 |
assumes "countable I" |
|
392 |
shows "{x\<in>\<Omega>. \<forall>i\<in>I. P i x} \<in> M" |
|
393 |
proof - |
|
394 |
have "{x\<in>\<Omega>. \<forall>i\<in>I. P i x} = (\<Inter>i\<in>I. {x\<in>\<Omega>. P i x}) \<inter> \<Omega>" by auto |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
395 |
with assms show ?thesis |
54418 | 396 |
by (cases "I = {}") (auto intro!: countable_INT') |
397 |
qed |
|
398 |
||
399 |
lemma (in sigma_algebra) sets_Collect_countable_Ex1': |
|
400 |
assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M" |
|
401 |
assumes "countable I" |
|
402 |
shows "{x\<in>\<Omega>. \<exists>!i\<in>I. P i x} \<in> M" |
|
403 |
proof - |
|
404 |
have "{x\<in>\<Omega>. \<exists>!i\<in>I. P i x} = {x\<in>\<Omega>. \<exists>i\<in>I. P i x \<and> (\<forall>j\<in>I. P j x \<longrightarrow> i = j)}" |
|
405 |
by auto |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
406 |
with assms show ?thesis |
54418 | 407 |
by (auto intro!: sets_Collect_countable_All' sets_Collect_countable_Ex' sets_Collect_conj sets_Collect_imp sets_Collect_const) |
408 |
qed |
|
409 |
||
42867 | 410 |
lemmas (in sigma_algebra) sets_Collect = |
411 |
sets_Collect_imp sets_Collect_disj sets_Collect_conj sets_Collect_neg sets_Collect_const |
|
412 |
sets_Collect_countable_All sets_Collect_countable_Ex sets_Collect_countable_All |
|
413 |
||
47694 | 414 |
lemma (in sigma_algebra) sets_Collect_countable_Ball: |
415 |
assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M" |
|
416 |
shows "{x\<in>\<Omega>. \<forall>i::'i::countable\<in>X. P i x} \<in> M" |
|
417 |
unfolding Ball_def by (intro sets_Collect assms) |
|
418 |
||
419 |
lemma (in sigma_algebra) sets_Collect_countable_Bex: |
|
420 |
assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M" |
|
421 |
shows "{x\<in>\<Omega>. \<exists>i::'i::countable\<in>X. P i x} \<in> M" |
|
422 |
unfolding Bex_def by (intro sets_Collect assms) |
|
423 |
||
42984 | 424 |
lemma sigma_algebra_single_set: |
425 |
assumes "X \<subseteq> S" |
|
47694 | 426 |
shows "sigma_algebra S { {}, X, S - X, S }" |
61808 | 427 |
using algebra.is_sigma_algebra[OF algebra_single_set[OF \<open>X \<subseteq> S\<close>]] by simp |
42984 | 428 |
|
67962 | 429 |
subsubsection%unimportant \<open>Binary Unions\<close> |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
430 |
|
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
431 |
definition binary :: "'a \<Rightarrow> 'a \<Rightarrow> nat \<Rightarrow> 'a" |
50252 | 432 |
where "binary a b = (\<lambda>x. b)(0 := a)" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
433 |
|
38656 | 434 |
lemma range_binary_eq: "range(binary a b) = {a,b}" |
435 |
by (auto simp add: binary_def) |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
436 |
|
38656 | 437 |
lemma Un_range_binary: "a \<union> b = (\<Union>i::nat. binary a b i)" |
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
438 |
by (simp add: range_binary_eq cong del: strong_SUP_cong) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
439 |
|
38656 | 440 |
lemma Int_range_binary: "a \<inter> b = (\<Inter>i::nat. binary a b i)" |
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
441 |
by (simp add: range_binary_eq cong del: strong_INF_cong) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
442 |
|
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
443 |
lemma sigma_algebra_iff2: |
47694 | 444 |
"sigma_algebra \<Omega> M \<longleftrightarrow> |
445 |
M \<subseteq> Pow \<Omega> \<and> |
|
446 |
{} \<in> M \<and> (\<forall>s \<in> M. \<Omega> - s \<in> M) \<and> |
|
447 |
(\<forall>A. range A \<subseteq> M \<longrightarrow> (\<Union>i::nat. A i) \<in> M)" |
|
38656 | 448 |
by (auto simp add: range_binary_eq sigma_algebra_def sigma_algebra_axioms_def |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
449 |
algebra_iff_Un Un_range_binary) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
450 |
|
61808 | 451 |
subsubsection \<open>Initial Sigma Algebra\<close> |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
452 |
|
67962 | 453 |
text%important \<open>Sigma algebras can naturally be created as the closure of any set of |
61808 | 454 |
M with regard to the properties just postulated.\<close> |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
455 |
|
67962 | 456 |
inductive_set%important sigma_sets :: "'a set \<Rightarrow> 'a set set \<Rightarrow> 'a set set" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
457 |
for sp :: "'a set" and A :: "'a set set" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
458 |
where |
47694 | 459 |
Basic[intro, simp]: "a \<in> A \<Longrightarrow> a \<in> sigma_sets sp A" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
460 |
| Empty: "{} \<in> sigma_sets sp A" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
461 |
| Compl: "a \<in> sigma_sets sp A \<Longrightarrow> sp - a \<in> sigma_sets sp A" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
462 |
| Union: "(\<And>i::nat. a i \<in> sigma_sets sp A) \<Longrightarrow> (\<Union>i. a i) \<in> sigma_sets sp A" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
463 |
|
41543 | 464 |
lemma (in sigma_algebra) sigma_sets_subset: |
47694 | 465 |
assumes a: "a \<subseteq> M" |
466 |
shows "sigma_sets \<Omega> a \<subseteq> M" |
|
41543 | 467 |
proof |
468 |
fix x |
|
47694 | 469 |
assume "x \<in> sigma_sets \<Omega> a" |
470 |
from this show "x \<in> M" |
|
41543 | 471 |
by (induct rule: sigma_sets.induct, auto) (metis a subsetD) |
472 |
qed |
|
473 |
||
474 |
lemma sigma_sets_into_sp: "A \<subseteq> Pow sp \<Longrightarrow> x \<in> sigma_sets sp A \<Longrightarrow> x \<subseteq> sp" |
|
475 |
by (erule sigma_sets.induct, auto) |
|
476 |
||
477 |
lemma sigma_algebra_sigma_sets: |
|
47694 | 478 |
"a \<subseteq> Pow \<Omega> \<Longrightarrow> sigma_algebra \<Omega> (sigma_sets \<Omega> a)" |
41543 | 479 |
by (auto simp add: sigma_algebra_iff2 dest: sigma_sets_into_sp |
480 |
intro!: sigma_sets.Union sigma_sets.Empty sigma_sets.Compl) |
|
481 |
||
482 |
lemma sigma_sets_least_sigma_algebra: |
|
483 |
assumes "A \<subseteq> Pow S" |
|
47694 | 484 |
shows "sigma_sets S A = \<Inter>{B. A \<subseteq> B \<and> sigma_algebra S B}" |
41543 | 485 |
proof safe |
47694 | 486 |
fix B X assume "A \<subseteq> B" and sa: "sigma_algebra S B" |
41543 | 487 |
and X: "X \<in> sigma_sets S A" |
61808 | 488 |
from sigma_algebra.sigma_sets_subset[OF sa, simplified, OF \<open>A \<subseteq> B\<close>] X |
41543 | 489 |
show "X \<in> B" by auto |
490 |
next |
|
47694 | 491 |
fix X assume "X \<in> \<Inter>{B. A \<subseteq> B \<and> sigma_algebra S B}" |
492 |
then have [intro!]: "\<And>B. A \<subseteq> B \<Longrightarrow> sigma_algebra S B \<Longrightarrow> X \<in> B" |
|
41543 | 493 |
by simp |
47694 | 494 |
have "A \<subseteq> sigma_sets S A" using assms by auto |
495 |
moreover have "sigma_algebra S (sigma_sets S A)" |
|
41543 | 496 |
using assms by (intro sigma_algebra_sigma_sets[of A]) auto |
497 |
ultimately show "X \<in> sigma_sets S A" by auto |
|
498 |
qed |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
499 |
|
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
500 |
lemma sigma_sets_top: "sp \<in> sigma_sets sp A" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
501 |
by (metis Diff_empty sigma_sets.Compl sigma_sets.Empty) |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
502 |
|
38656 | 503 |
lemma sigma_sets_Un: |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
504 |
"a \<in> sigma_sets sp A \<Longrightarrow> b \<in> sigma_sets sp A \<Longrightarrow> a \<union> b \<in> sigma_sets sp A" |
38656 | 505 |
apply (simp add: Un_range_binary range_binary_eq) |
40859 | 506 |
apply (rule Union, simp add: binary_def) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
507 |
done |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
508 |
|
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
509 |
lemma sigma_sets_Inter: |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
510 |
assumes Asb: "A \<subseteq> Pow sp" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
511 |
shows "(\<And>i::nat. a i \<in> sigma_sets sp A) \<Longrightarrow> (\<Inter>i. a i) \<in> sigma_sets sp A" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
512 |
proof - |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
513 |
assume ai: "\<And>i::nat. a i \<in> sigma_sets sp A" |
38656 | 514 |
hence "\<And>i::nat. sp-(a i) \<in> sigma_sets sp A" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
515 |
by (rule sigma_sets.Compl) |
38656 | 516 |
hence "(\<Union>i. sp-(a i)) \<in> sigma_sets sp A" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
517 |
by (rule sigma_sets.Union) |
38656 | 518 |
hence "sp-(\<Union>i. sp-(a i)) \<in> sigma_sets sp A" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
519 |
by (rule sigma_sets.Compl) |
38656 | 520 |
also have "sp-(\<Union>i. sp-(a i)) = sp Int (\<Inter>i. a i)" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
521 |
by auto |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
522 |
also have "... = (\<Inter>i. a i)" using ai |
38656 | 523 |
by (blast dest: sigma_sets_into_sp [OF Asb]) |
524 |
finally show ?thesis . |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
525 |
qed |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
526 |
|
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
527 |
lemma sigma_sets_INTER: |
38656 | 528 |
assumes Asb: "A \<subseteq> Pow sp" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
529 |
and ai: "\<And>i::nat. i \<in> S \<Longrightarrow> a i \<in> sigma_sets sp A" and non: "S \<noteq> {}" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
530 |
shows "(\<Inter>i\<in>S. a i) \<in> sigma_sets sp A" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
531 |
proof - |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
532 |
from ai have "\<And>i. (if i\<in>S then a i else sp) \<in> sigma_sets sp A" |
47694 | 533 |
by (simp add: sigma_sets.intros(2-) sigma_sets_top) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
534 |
hence "(\<Inter>i. (if i\<in>S then a i else sp)) \<in> sigma_sets sp A" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
535 |
by (rule sigma_sets_Inter [OF Asb]) |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
536 |
also have "(\<Inter>i. (if i\<in>S then a i else sp)) = (\<Inter>i\<in>S. a i)" |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
537 |
by auto (metis ai non sigma_sets_into_sp subset_empty subset_iff Asb)+ |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
538 |
finally show ?thesis . |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
539 |
qed |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
540 |
|
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
541 |
lemma sigma_sets_UNION: |
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
542 |
"countable B \<Longrightarrow> (\<And>b. b \<in> B \<Longrightarrow> b \<in> sigma_sets X A) \<Longrightarrow> (\<Union>B) \<in> sigma_sets X A" |
51683
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
hoelzl
parents:
50526
diff
changeset
|
543 |
apply (cases "B = {}") |
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
hoelzl
parents:
50526
diff
changeset
|
544 |
apply (simp add: sigma_sets.Empty) |
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
545 |
using from_nat_into [of B] range_from_nat_into [of B] sigma_sets.Union [of "from_nat_into B" X A] |
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
546 |
apply simp |
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
547 |
apply auto |
63167 | 548 |
apply (metis Sup_bot_conv(1) Union_empty \<open>\<lbrakk>B \<noteq> {}; countable B\<rbrakk> \<Longrightarrow> range (from_nat_into B) = B\<close>) |
51683
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
hoelzl
parents:
50526
diff
changeset
|
549 |
done |
baefa3b461c2
generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
hoelzl
parents:
50526
diff
changeset
|
550 |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
551 |
lemma (in sigma_algebra) sigma_sets_eq: |
47694 | 552 |
"sigma_sets \<Omega> M = M" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
553 |
proof |
47694 | 554 |
show "M \<subseteq> sigma_sets \<Omega> M" |
37032 | 555 |
by (metis Set.subsetI sigma_sets.Basic) |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
556 |
next |
47694 | 557 |
show "sigma_sets \<Omega> M \<subseteq> M" |
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
558 |
by (metis sigma_sets_subset subset_refl) |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
559 |
qed |
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
560 |
|
42981 | 561 |
lemma sigma_sets_eqI: |
562 |
assumes A: "\<And>a. a \<in> A \<Longrightarrow> a \<in> sigma_sets M B" |
|
563 |
assumes B: "\<And>b. b \<in> B \<Longrightarrow> b \<in> sigma_sets M A" |
|
564 |
shows "sigma_sets M A = sigma_sets M B" |
|
565 |
proof (intro set_eqI iffI) |
|
566 |
fix a assume "a \<in> sigma_sets M A" |
|
567 |
from this A show "a \<in> sigma_sets M B" |
|
47694 | 568 |
by induct (auto intro!: sigma_sets.intros(2-) del: sigma_sets.Basic) |
42981 | 569 |
next |
570 |
fix b assume "b \<in> sigma_sets M B" |
|
571 |
from this B show "b \<in> sigma_sets M A" |
|
47694 | 572 |
by induct (auto intro!: sigma_sets.intros(2-) del: sigma_sets.Basic) |
42981 | 573 |
qed |
574 |
||
42984 | 575 |
lemma sigma_sets_subseteq: assumes "A \<subseteq> B" shows "sigma_sets X A \<subseteq> sigma_sets X B" |
576 |
proof |
|
577 |
fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B" |
|
61808 | 578 |
by induct (insert \<open>A \<subseteq> B\<close>, auto intro: sigma_sets.intros(2-)) |
42984 | 579 |
qed |
580 |
||
47762 | 581 |
lemma sigma_sets_mono: assumes "A \<subseteq> sigma_sets X B" shows "sigma_sets X A \<subseteq> sigma_sets X B" |
582 |
proof |
|
583 |
fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B" |
|
61808 | 584 |
by induct (insert \<open>A \<subseteq> sigma_sets X B\<close>, auto intro: sigma_sets.intros(2-)) |
47762 | 585 |
qed |
586 |
||
587 |
lemma sigma_sets_mono': assumes "A \<subseteq> B" shows "sigma_sets X A \<subseteq> sigma_sets X B" |
|
588 |
proof |
|
589 |
fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B" |
|
61808 | 590 |
by induct (insert \<open>A \<subseteq> B\<close>, auto intro: sigma_sets.intros(2-)) |
47762 | 591 |
qed |
592 |
||
593 |
lemma sigma_sets_superset_generator: "A \<subseteq> sigma_sets X A" |
|
594 |
by (auto intro: sigma_sets.Basic) |
|
595 |
||
38656 | 596 |
lemma (in sigma_algebra) restriction_in_sets: |
597 |
fixes A :: "nat \<Rightarrow> 'a set" |
|
47694 | 598 |
assumes "S \<in> M" |
599 |
and *: "range A \<subseteq> (\<lambda>A. S \<inter> A) ` M" (is "_ \<subseteq> ?r") |
|
600 |
shows "range A \<subseteq> M" "(\<Union>i. A i) \<in> (\<lambda>A. S \<inter> A) ` M" |
|
38656 | 601 |
proof - |
602 |
{ fix i have "A i \<in> ?r" using * by auto |
|
47694 | 603 |
hence "\<exists>B. A i = B \<inter> S \<and> B \<in> M" by auto |
61808 | 604 |
hence "A i \<subseteq> S" "A i \<in> M" using \<open>S \<in> M\<close> by auto } |
47694 | 605 |
thus "range A \<subseteq> M" "(\<Union>i. A i) \<in> (\<lambda>A. S \<inter> A) ` M" |
38656 | 606 |
by (auto intro!: image_eqI[of _ _ "(\<Union>i. A i)"]) |
607 |
qed |
|
608 |
||
609 |
lemma (in sigma_algebra) restricted_sigma_algebra: |
|
47694 | 610 |
assumes "S \<in> M" |
611 |
shows "sigma_algebra S (restricted_space S)" |
|
38656 | 612 |
unfolding sigma_algebra_def sigma_algebra_axioms_def |
613 |
proof safe |
|
47694 | 614 |
show "algebra S (restricted_space S)" using restricted_algebra[OF assms] . |
38656 | 615 |
next |
47694 | 616 |
fix A :: "nat \<Rightarrow> 'a set" assume "range A \<subseteq> restricted_space S" |
38656 | 617 |
from restriction_in_sets[OF assms this[simplified]] |
47694 | 618 |
show "(\<Union>i. A i) \<in> restricted_space S" by simp |
38656 | 619 |
qed |
620 |
||
40859 | 621 |
lemma sigma_sets_Int: |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41543
diff
changeset
|
622 |
assumes "A \<in> sigma_sets sp st" "A \<subseteq> sp" |
67399 | 623 |
shows "(\<inter>) A ` sigma_sets sp st = sigma_sets A ((\<inter>) A ` st)" |
40859 | 624 |
proof (intro equalityI subsetI) |
67399 | 625 |
fix x assume "x \<in> (\<inter>) A ` sigma_sets sp st" |
40859 | 626 |
then obtain y where "y \<in> sigma_sets sp st" "x = y \<inter> A" by auto |
67399 | 627 |
then have "x \<in> sigma_sets (A \<inter> sp) ((\<inter>) A ` st)" |
40859 | 628 |
proof (induct arbitrary: x) |
629 |
case (Compl a) |
|
630 |
then show ?case |
|
631 |
by (force intro!: sigma_sets.Compl simp: Diff_Int_distrib ac_simps) |
|
632 |
next |
|
633 |
case (Union a) |
|
634 |
then show ?case |
|
635 |
by (auto intro!: sigma_sets.Union |
|
636 |
simp add: UN_extend_simps simp del: UN_simps) |
|
47694 | 637 |
qed (auto intro!: sigma_sets.intros(2-)) |
67399 | 638 |
then show "x \<in> sigma_sets A ((\<inter>) A ` st)" |
61808 | 639 |
using \<open>A \<subseteq> sp\<close> by (simp add: Int_absorb2) |
40859 | 640 |
next |
67399 | 641 |
fix x assume "x \<in> sigma_sets A ((\<inter>) A ` st)" |
642 |
then show "x \<in> (\<inter>) A ` sigma_sets sp st" |
|
40859 | 643 |
proof induct |
644 |
case (Compl a) |
|
645 |
then obtain x where "a = A \<inter> x" "x \<in> sigma_sets sp st" by auto |
|
61808 | 646 |
then show ?case using \<open>A \<subseteq> sp\<close> |
40859 | 647 |
by (force simp add: image_iff intro!: bexI[of _ "sp - x"] sigma_sets.Compl) |
648 |
next |
|
649 |
case (Union a) |
|
650 |
then have "\<forall>i. \<exists>x. x \<in> sigma_sets sp st \<and> a i = A \<inter> x" |
|
651 |
by (auto simp: image_iff Bex_def) |
|
652 |
from choice[OF this] guess f .. |
|
653 |
then show ?case |
|
654 |
by (auto intro!: bexI[of _ "(\<Union>x. f x)"] sigma_sets.Union |
|
655 |
simp add: image_iff) |
|
47694 | 656 |
qed (auto intro!: sigma_sets.intros(2-)) |
40859 | 657 |
qed |
658 |
||
47694 | 659 |
lemma sigma_sets_empty_eq: "sigma_sets A {} = {{}, A}" |
40859 | 660 |
proof (intro set_eqI iffI) |
47694 | 661 |
fix a assume "a \<in> sigma_sets A {}" then show "a \<in> {{}, A}" |
662 |
by induct blast+ |
|
663 |
qed (auto intro: sigma_sets.Empty sigma_sets_top) |
|
664 |
||
665 |
lemma sigma_sets_single[simp]: "sigma_sets A {A} = {{}, A}" |
|
666 |
proof (intro set_eqI iffI) |
|
667 |
fix x assume "x \<in> sigma_sets A {A}" |
|
668 |
then show "x \<in> {{}, A}" |
|
669 |
by induct blast+ |
|
40859 | 670 |
next |
47694 | 671 |
fix x assume "x \<in> {{}, A}" |
672 |
then show "x \<in> sigma_sets A {A}" |
|
40859 | 673 |
by (auto intro: sigma_sets.Empty sigma_sets_top) |
674 |
qed |
|
675 |
||
42987 | 676 |
lemma sigma_sets_sigma_sets_eq: |
677 |
"M \<subseteq> Pow S \<Longrightarrow> sigma_sets S (sigma_sets S M) = sigma_sets S M" |
|
47694 | 678 |
by (rule sigma_algebra.sigma_sets_eq[OF sigma_algebra_sigma_sets, of M S]) auto |
42987 | 679 |
|
42984 | 680 |
lemma sigma_sets_singleton: |
681 |
assumes "X \<subseteq> S" |
|
682 |
shows "sigma_sets S { X } = { {}, X, S - X, S }" |
|
683 |
proof - |
|
47694 | 684 |
interpret sigma_algebra S "{ {}, X, S - X, S }" |
42984 | 685 |
by (rule sigma_algebra_single_set) fact |
686 |
have "sigma_sets S { X } \<subseteq> sigma_sets S { {}, X, S - X, S }" |
|
687 |
by (rule sigma_sets_subseteq) simp |
|
688 |
moreover have "\<dots> = { {}, X, S - X, S }" |
|
47694 | 689 |
using sigma_sets_eq by simp |
42984 | 690 |
moreover |
691 |
{ fix A assume "A \<in> { {}, X, S - X, S }" |
|
692 |
then have "A \<in> sigma_sets S { X }" |
|
47694 | 693 |
by (auto intro: sigma_sets.intros(2-) sigma_sets_top) } |
42984 | 694 |
ultimately have "sigma_sets S { X } = sigma_sets S { {}, X, S - X, S }" |
695 |
by (intro antisym) auto |
|
47694 | 696 |
with sigma_sets_eq show ?thesis by simp |
42984 | 697 |
qed |
698 |
||
42863 | 699 |
lemma restricted_sigma: |
47694 | 700 |
assumes S: "S \<in> sigma_sets \<Omega> M" and M: "M \<subseteq> Pow \<Omega>" |
701 |
shows "algebra.restricted_space (sigma_sets \<Omega> M) S = |
|
702 |
sigma_sets S (algebra.restricted_space M S)" |
|
42863 | 703 |
proof - |
704 |
from S sigma_sets_into_sp[OF M] |
|
47694 | 705 |
have "S \<in> sigma_sets \<Omega> M" "S \<subseteq> \<Omega>" by auto |
42863 | 706 |
from sigma_sets_Int[OF this] |
47694 | 707 |
show ?thesis by simp |
42863 | 708 |
qed |
709 |
||
42987 | 710 |
lemma sigma_sets_vimage_commute: |
47694 | 711 |
assumes X: "X \<in> \<Omega> \<rightarrow> \<Omega>'" |
712 |
shows "{X -` A \<inter> \<Omega> |A. A \<in> sigma_sets \<Omega>' M'} |
|
713 |
= sigma_sets \<Omega> {X -` A \<inter> \<Omega> |A. A \<in> M'}" (is "?L = ?R") |
|
42987 | 714 |
proof |
715 |
show "?L \<subseteq> ?R" |
|
716 |
proof clarify |
|
47694 | 717 |
fix A assume "A \<in> sigma_sets \<Omega>' M'" |
718 |
then show "X -` A \<inter> \<Omega> \<in> ?R" |
|
42987 | 719 |
proof induct |
720 |
case Empty then show ?case |
|
721 |
by (auto intro!: sigma_sets.Empty) |
|
722 |
next |
|
723 |
case (Compl B) |
|
47694 | 724 |
have [simp]: "X -` (\<Omega>' - B) \<inter> \<Omega> = \<Omega> - (X -` B \<inter> \<Omega>)" |
42987 | 725 |
by (auto simp add: funcset_mem [OF X]) |
726 |
with Compl show ?case |
|
727 |
by (auto intro!: sigma_sets.Compl) |
|
728 |
next |
|
729 |
case (Union F) |
|
730 |
then show ?case |
|
731 |
by (auto simp add: vimage_UN UN_extend_simps(4) simp del: UN_simps |
|
732 |
intro!: sigma_sets.Union) |
|
47694 | 733 |
qed auto |
42987 | 734 |
qed |
735 |
show "?R \<subseteq> ?L" |
|
736 |
proof clarify |
|
737 |
fix A assume "A \<in> ?R" |
|
47694 | 738 |
then show "\<exists>B. A = X -` B \<inter> \<Omega> \<and> B \<in> sigma_sets \<Omega>' M'" |
42987 | 739 |
proof induct |
740 |
case (Basic B) then show ?case by auto |
|
741 |
next |
|
742 |
case Empty then show ?case |
|
47694 | 743 |
by (auto intro!: sigma_sets.Empty exI[of _ "{}"]) |
42987 | 744 |
next |
745 |
case (Compl B) |
|
47694 | 746 |
then obtain A where A: "B = X -` A \<inter> \<Omega>" "A \<in> sigma_sets \<Omega>' M'" by auto |
747 |
then have [simp]: "\<Omega> - B = X -` (\<Omega>' - A) \<inter> \<Omega>" |
|
42987 | 748 |
by (auto simp add: funcset_mem [OF X]) |
749 |
with A(2) show ?case |
|
47694 | 750 |
by (auto intro: sigma_sets.Compl) |
42987 | 751 |
next |
752 |
case (Union F) |
|
47694 | 753 |
then have "\<forall>i. \<exists>B. F i = X -` B \<inter> \<Omega> \<and> B \<in> sigma_sets \<Omega>' M'" by auto |
42987 | 754 |
from choice[OF this] guess A .. note A = this |
755 |
with A show ?case |
|
47694 | 756 |
by (auto simp: vimage_UN[symmetric] intro: sigma_sets.Union) |
42987 | 757 |
qed |
758 |
qed |
|
759 |
qed |
|
760 |
||
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
761 |
lemma (in ring_of_sets) UNION_in_sets: |
38656 | 762 |
fixes A:: "nat \<Rightarrow> 'a set" |
47694 | 763 |
assumes A: "range A \<subseteq> M" |
764 |
shows "(\<Union>i\<in>{0..<n}. A i) \<in> M" |
|
38656 | 765 |
proof (induct n) |
766 |
case 0 show ?case by simp |
|
767 |
next |
|
768 |
case (Suc n) |
|
769 |
thus ?case |
|
770 |
by (simp add: atLeastLessThanSuc) (metis A Un UNIV_I image_subset_iff) |
|
771 |
qed |
|
772 |
||
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
773 |
lemma (in ring_of_sets) range_disjointed_sets: |
47694 | 774 |
assumes A: "range A \<subseteq> M" |
775 |
shows "range (disjointed A) \<subseteq> M" |
|
38656 | 776 |
proof (auto simp add: disjointed_def) |
777 |
fix n |
|
47694 | 778 |
show "A n - (\<Union>i\<in>{0..<n}. A i) \<in> M" using UNION_in_sets |
38656 | 779 |
by (metis A Diff UNIV_I image_subset_iff) |
780 |
qed |
|
781 |
||
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
782 |
lemma (in algebra) range_disjointed_sets': |
47694 | 783 |
"range A \<subseteq> M \<Longrightarrow> range (disjointed A) \<subseteq> M" |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
784 |
using range_disjointed_sets . |
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
785 |
|
38656 | 786 |
lemma sigma_algebra_disjoint_iff: |
47694 | 787 |
"sigma_algebra \<Omega> M \<longleftrightarrow> algebra \<Omega> M \<and> |
788 |
(\<forall>A. range A \<subseteq> M \<longrightarrow> disjoint_family A \<longrightarrow> (\<Union>i::nat. A i) \<in> M)" |
|
38656 | 789 |
proof (auto simp add: sigma_algebra_iff) |
790 |
fix A :: "nat \<Rightarrow> 'a set" |
|
47694 | 791 |
assume M: "algebra \<Omega> M" |
792 |
and A: "range A \<subseteq> M" |
|
793 |
and UnA: "\<forall>A. range A \<subseteq> M \<longrightarrow> disjoint_family A \<longrightarrow> (\<Union>i::nat. A i) \<in> M" |
|
794 |
hence "range (disjointed A) \<subseteq> M \<longrightarrow> |
|
38656 | 795 |
disjoint_family (disjointed A) \<longrightarrow> |
47694 | 796 |
(\<Union>i. disjointed A i) \<in> M" by blast |
797 |
hence "(\<Union>i. disjointed A i) \<in> M" |
|
798 |
by (simp add: algebra.range_disjointed_sets'[of \<Omega>] M A disjoint_family_disjointed) |
|
799 |
thus "(\<Union>i::nat. A i) \<in> M" by (simp add: UN_disjointed_eq) |
|
800 |
qed |
|
801 |
||
67962 | 802 |
subsubsection%unimportant \<open>Ring generated by a semiring\<close> |
47762 | 803 |
|
804 |
definition (in semiring_of_sets) |
|
805 |
"generated_ring = { \<Union>C | C. C \<subseteq> M \<and> finite C \<and> disjoint C }" |
|
806 |
||
807 |
lemma (in semiring_of_sets) generated_ringE[elim?]: |
|
808 |
assumes "a \<in> generated_ring" |
|
809 |
obtains C where "finite C" "disjoint C" "C \<subseteq> M" "a = \<Union>C" |
|
810 |
using assms unfolding generated_ring_def by auto |
|
811 |
||
812 |
lemma (in semiring_of_sets) generated_ringI[intro?]: |
|
813 |
assumes "finite C" "disjoint C" "C \<subseteq> M" "a = \<Union>C" |
|
814 |
shows "a \<in> generated_ring" |
|
815 |
using assms unfolding generated_ring_def by auto |
|
816 |
||
817 |
lemma (in semiring_of_sets) generated_ringI_Basic: |
|
818 |
"A \<in> M \<Longrightarrow> A \<in> generated_ring" |
|
819 |
by (rule generated_ringI[of "{A}"]) (auto simp: disjoint_def) |
|
820 |
||
821 |
lemma (in semiring_of_sets) generated_ring_disjoint_Un[intro]: |
|
822 |
assumes a: "a \<in> generated_ring" and b: "b \<in> generated_ring" |
|
823 |
and "a \<inter> b = {}" |
|
824 |
shows "a \<union> b \<in> generated_ring" |
|
825 |
proof - |
|
826 |
from a guess Ca .. note Ca = this |
|
827 |
from b guess Cb .. note Cb = this |
|
828 |
show ?thesis |
|
829 |
proof |
|
830 |
show "disjoint (Ca \<union> Cb)" |
|
61808 | 831 |
using \<open>a \<inter> b = {}\<close> Ca Cb by (auto intro!: disjoint_union) |
47762 | 832 |
qed (insert Ca Cb, auto) |
833 |
qed |
|
834 |
||
835 |
lemma (in semiring_of_sets) generated_ring_empty: "{} \<in> generated_ring" |
|
836 |
by (auto simp: generated_ring_def disjoint_def) |
|
837 |
||
838 |
lemma (in semiring_of_sets) generated_ring_disjoint_Union: |
|
839 |
assumes "finite A" shows "A \<subseteq> generated_ring \<Longrightarrow> disjoint A \<Longrightarrow> \<Union>A \<in> generated_ring" |
|
840 |
using assms by (induct A) (auto simp: disjoint_def intro!: generated_ring_disjoint_Un generated_ring_empty) |
|
841 |
||
842 |
lemma (in semiring_of_sets) generated_ring_disjoint_UNION: |
|
843 |
"finite I \<Longrightarrow> disjoint (A ` I) \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> A i \<in> generated_ring) \<Longrightarrow> UNION I A \<in> generated_ring" |
|
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
844 |
by (intro generated_ring_disjoint_Union) auto |
47762 | 845 |
|
846 |
lemma (in semiring_of_sets) generated_ring_Int: |
|
847 |
assumes a: "a \<in> generated_ring" and b: "b \<in> generated_ring" |
|
848 |
shows "a \<inter> b \<in> generated_ring" |
|
849 |
proof - |
|
850 |
from a guess Ca .. note Ca = this |
|
851 |
from b guess Cb .. note Cb = this |
|
63040 | 852 |
define C where "C = (\<lambda>(a,b). a \<inter> b)` (Ca\<times>Cb)" |
47762 | 853 |
show ?thesis |
854 |
proof |
|
855 |
show "disjoint C" |
|
856 |
proof (simp add: disjoint_def C_def, intro ballI impI) |
|
857 |
fix a1 b1 a2 b2 assume sets: "a1 \<in> Ca" "b1 \<in> Cb" "a2 \<in> Ca" "b2 \<in> Cb" |
|
858 |
assume "a1 \<inter> b1 \<noteq> a2 \<inter> b2" |
|
859 |
then have "a1 \<noteq> a2 \<or> b1 \<noteq> b2" by auto |
|
860 |
then show "(a1 \<inter> b1) \<inter> (a2 \<inter> b2) = {}" |
|
861 |
proof |
|
862 |
assume "a1 \<noteq> a2" |
|
863 |
with sets Ca have "a1 \<inter> a2 = {}" |
|
864 |
by (auto simp: disjoint_def) |
|
865 |
then show ?thesis by auto |
|
866 |
next |
|
867 |
assume "b1 \<noteq> b2" |
|
868 |
with sets Cb have "b1 \<inter> b2 = {}" |
|
869 |
by (auto simp: disjoint_def) |
|
870 |
then show ?thesis by auto |
|
871 |
qed |
|
872 |
qed |
|
873 |
qed (insert Ca Cb, auto simp: C_def) |
|
874 |
qed |
|
875 |
||
876 |
lemma (in semiring_of_sets) generated_ring_Inter: |
|
877 |
assumes "finite A" "A \<noteq> {}" shows "A \<subseteq> generated_ring \<Longrightarrow> \<Inter>A \<in> generated_ring" |
|
878 |
using assms by (induct A rule: finite_ne_induct) (auto intro: generated_ring_Int) |
|
879 |
||
880 |
lemma (in semiring_of_sets) generated_ring_INTER: |
|
881 |
"finite I \<Longrightarrow> I \<noteq> {} \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> A i \<in> generated_ring) \<Longrightarrow> INTER I A \<in> generated_ring" |
|
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
882 |
by (intro generated_ring_Inter) auto |
47762 | 883 |
|
884 |
lemma (in semiring_of_sets) generating_ring: |
|
885 |
"ring_of_sets \<Omega> generated_ring" |
|
886 |
proof (rule ring_of_setsI) |
|
887 |
let ?R = generated_ring |
|
888 |
show "?R \<subseteq> Pow \<Omega>" |
|
889 |
using sets_into_space by (auto simp: generated_ring_def generated_ring_empty) |
|
890 |
show "{} \<in> ?R" by (rule generated_ring_empty) |
|
891 |
||
892 |
{ fix a assume a: "a \<in> ?R" then guess Ca .. note Ca = this |
|
893 |
fix b assume b: "b \<in> ?R" then guess Cb .. note Cb = this |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
894 |
|
47762 | 895 |
show "a - b \<in> ?R" |
896 |
proof cases |
|
61808 | 897 |
assume "Cb = {}" with Cb \<open>a \<in> ?R\<close> show ?thesis |
47762 | 898 |
by simp |
899 |
next |
|
900 |
assume "Cb \<noteq> {}" |
|
901 |
with Ca Cb have "a - b = (\<Union>a'\<in>Ca. \<Inter>b'\<in>Cb. a' - b')" by auto |
|
902 |
also have "\<dots> \<in> ?R" |
|
903 |
proof (intro generated_ring_INTER generated_ring_disjoint_UNION) |
|
904 |
fix a b assume "a \<in> Ca" "b \<in> Cb" |
|
905 |
with Ca Cb Diff_cover[of a b] show "a - b \<in> ?R" |
|
906 |
by (auto simp add: generated_ring_def) |
|
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
907 |
(metis DiffI Diff_eq_empty_iff empty_iff) |
47762 | 908 |
next |
909 |
show "disjoint ((\<lambda>a'. \<Inter>b'\<in>Cb. a' - b')`Ca)" |
|
61808 | 910 |
using Ca by (auto simp add: disjoint_def \<open>Cb \<noteq> {}\<close>) |
47762 | 911 |
next |
912 |
show "finite Ca" "finite Cb" "Cb \<noteq> {}" by fact+ |
|
913 |
qed |
|
914 |
finally show "a - b \<in> ?R" . |
|
915 |
qed } |
|
916 |
note Diff = this |
|
917 |
||
918 |
fix a b assume sets: "a \<in> ?R" "b \<in> ?R" |
|
919 |
have "a \<union> b = (a - b) \<union> (a \<inter> b) \<union> (b - a)" by auto |
|
920 |
also have "\<dots> \<in> ?R" |
|
921 |
by (intro sets generated_ring_disjoint_Un generated_ring_Int Diff) auto |
|
922 |
finally show "a \<union> b \<in> ?R" . |
|
923 |
qed |
|
924 |
||
925 |
lemma (in semiring_of_sets) sigma_sets_generated_ring_eq: "sigma_sets \<Omega> generated_ring = sigma_sets \<Omega> M" |
|
926 |
proof |
|
927 |
interpret M: sigma_algebra \<Omega> "sigma_sets \<Omega> M" |
|
928 |
using space_closed by (rule sigma_algebra_sigma_sets) |
|
929 |
show "sigma_sets \<Omega> generated_ring \<subseteq> sigma_sets \<Omega> M" |
|
930 |
by (blast intro!: sigma_sets_mono elim: generated_ringE) |
|
931 |
qed (auto intro!: generated_ringI_Basic sigma_sets_mono) |
|
932 |
||
67962 | 933 |
subsubsection%unimportant \<open>A Two-Element Series\<close> |
38656 | 934 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
935 |
definition binaryset :: "'a set \<Rightarrow> 'a set \<Rightarrow> nat \<Rightarrow> 'a set" |
50252 | 936 |
where "binaryset A B = (\<lambda>x. {})(0 := A, Suc 0 := B)" |
38656 | 937 |
|
938 |
lemma range_binaryset_eq: "range(binaryset A B) = {A,B,{}}" |
|
939 |
apply (simp add: binaryset_def) |
|
39302
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents:
39092
diff
changeset
|
940 |
apply (rule set_eqI) |
38656 | 941 |
apply (auto simp add: image_iff) |
942 |
done |
|
943 |
||
944 |
lemma UN_binaryset_eq: "(\<Union>i. binaryset A B i) = A \<union> B" |
|
62343
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents:
62083
diff
changeset
|
945 |
by (simp add: range_binaryset_eq cong del: strong_SUP_cong) |
38656 | 946 |
|
61808 | 947 |
subsubsection \<open>Closed CDI\<close> |
38656 | 948 |
|
67962 | 949 |
definition%important closed_cdi where |
47694 | 950 |
"closed_cdi \<Omega> M \<longleftrightarrow> |
951 |
M \<subseteq> Pow \<Omega> & |
|
952 |
(\<forall>s \<in> M. \<Omega> - s \<in> M) & |
|
953 |
(\<forall>A. (range A \<subseteq> M) & (A 0 = {}) & (\<forall>n. A n \<subseteq> A (Suc n)) \<longrightarrow> |
|
954 |
(\<Union>i. A i) \<in> M) & |
|
955 |
(\<forall>A. (range A \<subseteq> M) & disjoint_family A \<longrightarrow> (\<Union>i::nat. A i) \<in> M)" |
|
38656 | 956 |
|
957 |
inductive_set |
|
47694 | 958 |
smallest_ccdi_sets :: "'a set \<Rightarrow> 'a set set \<Rightarrow> 'a set set" |
959 |
for \<Omega> M |
|
38656 | 960 |
where |
961 |
Basic [intro]: |
|
47694 | 962 |
"a \<in> M \<Longrightarrow> a \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 963 |
| Compl [intro]: |
47694 | 964 |
"a \<in> smallest_ccdi_sets \<Omega> M \<Longrightarrow> \<Omega> - a \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 965 |
| Inc: |
47694 | 966 |
"range A \<in> Pow(smallest_ccdi_sets \<Omega> M) \<Longrightarrow> A 0 = {} \<Longrightarrow> (\<And>n. A n \<subseteq> A (Suc n)) |
967 |
\<Longrightarrow> (\<Union>i. A i) \<in> smallest_ccdi_sets \<Omega> M" |
|
38656 | 968 |
| Disj: |
47694 | 969 |
"range A \<in> Pow(smallest_ccdi_sets \<Omega> M) \<Longrightarrow> disjoint_family A |
970 |
\<Longrightarrow> (\<Union>i::nat. A i) \<in> smallest_ccdi_sets \<Omega> M" |
|
38656 | 971 |
|
47694 | 972 |
lemma (in subset_class) smallest_closed_cdi1: "M \<subseteq> smallest_ccdi_sets \<Omega> M" |
973 |
by auto |
|
38656 | 974 |
|
47694 | 975 |
lemma (in subset_class) smallest_ccdi_sets: "smallest_ccdi_sets \<Omega> M \<subseteq> Pow \<Omega>" |
38656 | 976 |
apply (rule subsetI) |
977 |
apply (erule smallest_ccdi_sets.induct) |
|
978 |
apply (auto intro: range_subsetD dest: sets_into_space) |
|
979 |
done |
|
980 |
||
47694 | 981 |
lemma (in subset_class) smallest_closed_cdi2: "closed_cdi \<Omega> (smallest_ccdi_sets \<Omega> M)" |
982 |
apply (auto simp add: closed_cdi_def smallest_ccdi_sets) |
|
38656 | 983 |
apply (blast intro: smallest_ccdi_sets.Inc smallest_ccdi_sets.Disj) + |
984 |
done |
|
985 |
||
47694 | 986 |
lemma closed_cdi_subset: "closed_cdi \<Omega> M \<Longrightarrow> M \<subseteq> Pow \<Omega>" |
38656 | 987 |
by (simp add: closed_cdi_def) |
988 |
||
47694 | 989 |
lemma closed_cdi_Compl: "closed_cdi \<Omega> M \<Longrightarrow> s \<in> M \<Longrightarrow> \<Omega> - s \<in> M" |
38656 | 990 |
by (simp add: closed_cdi_def) |
991 |
||
992 |
lemma closed_cdi_Inc: |
|
47694 | 993 |
"closed_cdi \<Omega> M \<Longrightarrow> range A \<subseteq> M \<Longrightarrow> A 0 = {} \<Longrightarrow> (!!n. A n \<subseteq> A (Suc n)) \<Longrightarrow> (\<Union>i. A i) \<in> M" |
38656 | 994 |
by (simp add: closed_cdi_def) |
995 |
||
996 |
lemma closed_cdi_Disj: |
|
47694 | 997 |
"closed_cdi \<Omega> M \<Longrightarrow> range A \<subseteq> M \<Longrightarrow> disjoint_family A \<Longrightarrow> (\<Union>i::nat. A i) \<in> M" |
38656 | 998 |
by (simp add: closed_cdi_def) |
999 |
||
1000 |
lemma closed_cdi_Un: |
|
47694 | 1001 |
assumes cdi: "closed_cdi \<Omega> M" and empty: "{} \<in> M" |
1002 |
and A: "A \<in> M" and B: "B \<in> M" |
|
38656 | 1003 |
and disj: "A \<inter> B = {}" |
47694 | 1004 |
shows "A \<union> B \<in> M" |
38656 | 1005 |
proof - |
47694 | 1006 |
have ra: "range (binaryset A B) \<subseteq> M" |
38656 | 1007 |
by (simp add: range_binaryset_eq empty A B) |
1008 |
have di: "disjoint_family (binaryset A B)" using disj |
|
1009 |
by (simp add: disjoint_family_on_def binaryset_def Int_commute) |
|
1010 |
from closed_cdi_Disj [OF cdi ra di] |
|
1011 |
show ?thesis |
|
1012 |
by (simp add: UN_binaryset_eq) |
|
1013 |
qed |
|
1014 |
||
1015 |
lemma (in algebra) smallest_ccdi_sets_Un: |
|
47694 | 1016 |
assumes A: "A \<in> smallest_ccdi_sets \<Omega> M" and B: "B \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1017 |
and disj: "A \<inter> B = {}" |
47694 | 1018 |
shows "A \<union> B \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1019 |
proof - |
47694 | 1020 |
have ra: "range (binaryset A B) \<in> Pow (smallest_ccdi_sets \<Omega> M)" |
38656 | 1021 |
by (simp add: range_binaryset_eq A B smallest_ccdi_sets.Basic) |
1022 |
have di: "disjoint_family (binaryset A B)" using disj |
|
1023 |
by (simp add: disjoint_family_on_def binaryset_def Int_commute) |
|
1024 |
from Disj [OF ra di] |
|
1025 |
show ?thesis |
|
1026 |
by (simp add: UN_binaryset_eq) |
|
1027 |
qed |
|
1028 |
||
1029 |
lemma (in algebra) smallest_ccdi_sets_Int1: |
|
47694 | 1030 |
assumes a: "a \<in> M" |
1031 |
shows "b \<in> smallest_ccdi_sets \<Omega> M \<Longrightarrow> a \<inter> b \<in> smallest_ccdi_sets \<Omega> M" |
|
38656 | 1032 |
proof (induct rule: smallest_ccdi_sets.induct) |
1033 |
case (Basic x) |
|
1034 |
thus ?case |
|
1035 |
by (metis a Int smallest_ccdi_sets.Basic) |
|
1036 |
next |
|
1037 |
case (Compl x) |
|
47694 | 1038 |
have "a \<inter> (\<Omega> - x) = \<Omega> - ((\<Omega> - a) \<union> (a \<inter> x))" |
38656 | 1039 |
by blast |
47694 | 1040 |
also have "... \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1041 |
by (metis smallest_ccdi_sets.Compl a Compl(2) Diff_Int2 Diff_Int_distrib2 |
47694 | 1042 |
Diff_disjoint Int_Diff Int_empty_right smallest_ccdi_sets_Un |
1043 |
smallest_ccdi_sets.Basic smallest_ccdi_sets.Compl) |
|
38656 | 1044 |
finally show ?case . |
1045 |
next |
|
1046 |
case (Inc A) |
|
1047 |
have 1: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) = a \<inter> (\<Union>i. A i)" |
|
1048 |
by blast |
|
47694 | 1049 |
have "range (\<lambda>i. a \<inter> A i) \<in> Pow(smallest_ccdi_sets \<Omega> M)" using Inc |
38656 | 1050 |
by blast |
1051 |
moreover have "(\<lambda>i. a \<inter> A i) 0 = {}" |
|
1052 |
by (simp add: Inc) |
|
1053 |
moreover have "!!n. (\<lambda>i. a \<inter> A i) n \<subseteq> (\<lambda>i. a \<inter> A i) (Suc n)" using Inc |
|
1054 |
by blast |
|
47694 | 1055 |
ultimately have 2: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1056 |
by (rule smallest_ccdi_sets.Inc) |
1057 |
show ?case |
|
1058 |
by (metis 1 2) |
|
1059 |
next |
|
1060 |
case (Disj A) |
|
1061 |
have 1: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) = a \<inter> (\<Union>i. A i)" |
|
1062 |
by blast |
|
47694 | 1063 |
have "range (\<lambda>i. a \<inter> A i) \<in> Pow(smallest_ccdi_sets \<Omega> M)" using Disj |
38656 | 1064 |
by blast |
1065 |
moreover have "disjoint_family (\<lambda>i. a \<inter> A i)" using Disj |
|
1066 |
by (auto simp add: disjoint_family_on_def) |
|
47694 | 1067 |
ultimately have 2: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1068 |
by (rule smallest_ccdi_sets.Disj) |
1069 |
show ?case |
|
1070 |
by (metis 1 2) |
|
1071 |
qed |
|
1072 |
||
1073 |
||
1074 |
lemma (in algebra) smallest_ccdi_sets_Int: |
|
47694 | 1075 |
assumes b: "b \<in> smallest_ccdi_sets \<Omega> M" |
1076 |
shows "a \<in> smallest_ccdi_sets \<Omega> M \<Longrightarrow> a \<inter> b \<in> smallest_ccdi_sets \<Omega> M" |
|
38656 | 1077 |
proof (induct rule: smallest_ccdi_sets.induct) |
1078 |
case (Basic x) |
|
1079 |
thus ?case |
|
1080 |
by (metis b smallest_ccdi_sets_Int1) |
|
1081 |
next |
|
1082 |
case (Compl x) |
|
47694 | 1083 |
have "(\<Omega> - x) \<inter> b = \<Omega> - (x \<inter> b \<union> (\<Omega> - b))" |
38656 | 1084 |
by blast |
47694 | 1085 |
also have "... \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1086 |
by (metis Compl(2) Diff_disjoint Int_Diff Int_commute Int_empty_right b |
1087 |
smallest_ccdi_sets.Compl smallest_ccdi_sets_Un) |
|
1088 |
finally show ?case . |
|
1089 |
next |
|
1090 |
case (Inc A) |
|
1091 |
have 1: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) = (\<Union>i. A i) \<inter> b" |
|
1092 |
by blast |
|
47694 | 1093 |
have "range (\<lambda>i. A i \<inter> b) \<in> Pow(smallest_ccdi_sets \<Omega> M)" using Inc |
38656 | 1094 |
by blast |
1095 |
moreover have "(\<lambda>i. A i \<inter> b) 0 = {}" |
|
1096 |
by (simp add: Inc) |
|
1097 |
moreover have "!!n. (\<lambda>i. A i \<inter> b) n \<subseteq> (\<lambda>i. A i \<inter> b) (Suc n)" using Inc |
|
1098 |
by blast |
|
47694 | 1099 |
ultimately have 2: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1100 |
by (rule smallest_ccdi_sets.Inc) |
1101 |
show ?case |
|
1102 |
by (metis 1 2) |
|
1103 |
next |
|
1104 |
case (Disj A) |
|
1105 |
have 1: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) = (\<Union>i. A i) \<inter> b" |
|
1106 |
by blast |
|
47694 | 1107 |
have "range (\<lambda>i. A i \<inter> b) \<in> Pow(smallest_ccdi_sets \<Omega> M)" using Disj |
38656 | 1108 |
by blast |
1109 |
moreover have "disjoint_family (\<lambda>i. A i \<inter> b)" using Disj |
|
1110 |
by (auto simp add: disjoint_family_on_def) |
|
47694 | 1111 |
ultimately have 2: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1112 |
by (rule smallest_ccdi_sets.Disj) |
1113 |
show ?case |
|
1114 |
by (metis 1 2) |
|
1115 |
qed |
|
1116 |
||
1117 |
lemma (in algebra) sigma_property_disjoint_lemma: |
|
47694 | 1118 |
assumes sbC: "M \<subseteq> C" |
1119 |
and ccdi: "closed_cdi \<Omega> C" |
|
1120 |
shows "sigma_sets \<Omega> M \<subseteq> C" |
|
38656 | 1121 |
proof - |
47694 | 1122 |
have "smallest_ccdi_sets \<Omega> M \<in> {B . M \<subseteq> B \<and> sigma_algebra \<Omega> B}" |
38656 | 1123 |
apply (auto simp add: sigma_algebra_disjoint_iff algebra_iff_Int |
1124 |
smallest_ccdi_sets_Int) |
|
1125 |
apply (metis Union_Pow_eq Union_upper subsetD smallest_ccdi_sets) |
|
1126 |
apply (blast intro: smallest_ccdi_sets.Disj) |
|
1127 |
done |
|
47694 | 1128 |
hence "sigma_sets (\<Omega>) (M) \<subseteq> smallest_ccdi_sets \<Omega> M" |
38656 | 1129 |
by clarsimp |
47694 | 1130 |
(drule sigma_algebra.sigma_sets_subset [where a="M"], auto) |
38656 | 1131 |
also have "... \<subseteq> C" |
1132 |
proof |
|
1133 |
fix x |
|
47694 | 1134 |
assume x: "x \<in> smallest_ccdi_sets \<Omega> M" |
38656 | 1135 |
thus "x \<in> C" |
1136 |
proof (induct rule: smallest_ccdi_sets.induct) |
|
1137 |
case (Basic x) |
|
1138 |
thus ?case |
|
1139 |
by (metis Basic subsetD sbC) |
|
1140 |
next |
|
1141 |
case (Compl x) |
|
1142 |
thus ?case |
|
1143 |
by (blast intro: closed_cdi_Compl [OF ccdi, simplified]) |
|
1144 |
next |
|
1145 |
case (Inc A) |
|
1146 |
thus ?case |
|
1147 |
by (auto intro: closed_cdi_Inc [OF ccdi, simplified]) |
|
1148 |
next |
|
1149 |
case (Disj A) |
|
1150 |
thus ?case |
|
1151 |
by (auto intro: closed_cdi_Disj [OF ccdi, simplified]) |
|
1152 |
qed |
|
1153 |
qed |
|
1154 |
finally show ?thesis . |
|
1155 |
qed |
|
1156 |
||
1157 |
lemma (in algebra) sigma_property_disjoint: |
|
47694 | 1158 |
assumes sbC: "M \<subseteq> C" |
1159 |
and compl: "!!s. s \<in> C \<inter> sigma_sets (\<Omega>) (M) \<Longrightarrow> \<Omega> - s \<in> C" |
|
1160 |
and inc: "!!A. range A \<subseteq> C \<inter> sigma_sets (\<Omega>) (M) |
|
38656 | 1161 |
\<Longrightarrow> A 0 = {} \<Longrightarrow> (!!n. A n \<subseteq> A (Suc n)) |
1162 |
\<Longrightarrow> (\<Union>i. A i) \<in> C" |
|
47694 | 1163 |
and disj: "!!A. range A \<subseteq> C \<inter> sigma_sets (\<Omega>) (M) |
38656 | 1164 |
\<Longrightarrow> disjoint_family A \<Longrightarrow> (\<Union>i::nat. A i) \<in> C" |
47694 | 1165 |
shows "sigma_sets (\<Omega>) (M) \<subseteq> C" |
38656 | 1166 |
proof - |
47694 | 1167 |
have "sigma_sets (\<Omega>) (M) \<subseteq> C \<inter> sigma_sets (\<Omega>) (M)" |
38656 | 1168 |
proof (rule sigma_property_disjoint_lemma) |
47694 | 1169 |
show "M \<subseteq> C \<inter> sigma_sets (\<Omega>) (M)" |
38656 | 1170 |
by (metis Int_greatest Set.subsetI sbC sigma_sets.Basic) |
1171 |
next |
|
47694 | 1172 |
show "closed_cdi \<Omega> (C \<inter> sigma_sets (\<Omega>) (M))" |
38656 | 1173 |
by (simp add: closed_cdi_def compl inc disj) |
1174 |
(metis PowI Set.subsetI le_infI2 sigma_sets_into_sp space_closed |
|
1175 |
IntE sigma_sets.Compl range_subsetD sigma_sets.Union) |
|
1176 |
qed |
|
1177 |
thus ?thesis |
|
1178 |
by blast |
|
1179 |
qed |
|
1180 |
||
61808 | 1181 |
subsubsection \<open>Dynkin systems\<close> |
40859 | 1182 |
|
67962 | 1183 |
locale%important dynkin_system = subset_class + |
47694 | 1184 |
assumes space: "\<Omega> \<in> M" |
1185 |
and compl[intro!]: "\<And>A. A \<in> M \<Longrightarrow> \<Omega> - A \<in> M" |
|
1186 |
and UN[intro!]: "\<And>A. disjoint_family A \<Longrightarrow> range A \<subseteq> M |
|
1187 |
\<Longrightarrow> (\<Union>i::nat. A i) \<in> M" |
|
40859 | 1188 |
|
47694 | 1189 |
lemma (in dynkin_system) empty[intro, simp]: "{} \<in> M" |
1190 |
using space compl[of "\<Omega>"] by simp |
|
40859 | 1191 |
|
1192 |
lemma (in dynkin_system) diff: |
|
47694 | 1193 |
assumes sets: "D \<in> M" "E \<in> M" and "D \<subseteq> E" |
1194 |
shows "E - D \<in> M" |
|
40859 | 1195 |
proof - |
47694 | 1196 |
let ?f = "\<lambda>x. if x = 0 then D else if x = Suc 0 then \<Omega> - E else {}" |
1197 |
have "range ?f = {D, \<Omega> - E, {}}" |
|
40859 | 1198 |
by (auto simp: image_iff) |
47694 | 1199 |
moreover have "D \<union> (\<Omega> - E) = (\<Union>i. ?f i)" |
62390 | 1200 |
by (auto simp: image_iff split: if_split_asm) |
40859 | 1201 |
moreover |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
51683
diff
changeset
|
1202 |
have "disjoint_family ?f" unfolding disjoint_family_on_def |
61808 | 1203 |
using \<open>D \<in> M\<close>[THEN sets_into_space] \<open>D \<subseteq> E\<close> by auto |
47694 | 1204 |
ultimately have "\<Omega> - (D \<union> (\<Omega> - E)) \<in> M" |
40859 | 1205 |
using sets by auto |
47694 | 1206 |
also have "\<Omega> - (D \<union> (\<Omega> - E)) = E - D" |
40859 | 1207 |
using assms sets_into_space by auto |
1208 |
finally show ?thesis . |
|
1209 |
qed |
|
1210 |
||
1211 |
lemma dynkin_systemI: |
|
47694 | 1212 |
assumes "\<And> A. A \<in> M \<Longrightarrow> A \<subseteq> \<Omega>" "\<Omega> \<in> M" |
1213 |
assumes "\<And> A. A \<in> M \<Longrightarrow> \<Omega> - A \<in> M" |
|
1214 |
assumes "\<And> A. disjoint_family A \<Longrightarrow> range A \<subseteq> M |
|
1215 |
\<Longrightarrow> (\<Union>i::nat. A i) \<in> M" |
|
1216 |
shows "dynkin_system \<Omega> M" |
|
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
1217 |
using assms by (auto simp: dynkin_system_def dynkin_system_axioms_def subset_class_def) |
40859 | 1218 |
|
42988 | 1219 |
lemma dynkin_systemI': |
47694 | 1220 |
assumes 1: "\<And> A. A \<in> M \<Longrightarrow> A \<subseteq> \<Omega>" |
1221 |
assumes empty: "{} \<in> M" |
|
1222 |
assumes Diff: "\<And> A. A \<in> M \<Longrightarrow> \<Omega> - A \<in> M" |
|
1223 |
assumes 2: "\<And> A. disjoint_family A \<Longrightarrow> range A \<subseteq> M |
|
1224 |
\<Longrightarrow> (\<Union>i::nat. A i) \<in> M" |
|
1225 |
shows "dynkin_system \<Omega> M" |
|
42988 | 1226 |
proof - |
47694 | 1227 |
from Diff[OF empty] have "\<Omega> \<in> M" by auto |
42988 | 1228 |
from 1 this Diff 2 show ?thesis |
1229 |
by (intro dynkin_systemI) auto |
|
1230 |
qed |
|
1231 |
||
40859 | 1232 |
lemma dynkin_system_trivial: |
47694 | 1233 |
shows "dynkin_system A (Pow A)" |
40859 | 1234 |
by (rule dynkin_systemI) auto |
1235 |
||
1236 |
lemma sigma_algebra_imp_dynkin_system: |
|
47694 | 1237 |
assumes "sigma_algebra \<Omega> M" shows "dynkin_system \<Omega> M" |
40859 | 1238 |
proof - |
47694 | 1239 |
interpret sigma_algebra \<Omega> M by fact |
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44537
diff
changeset
|
1240 |
show ?thesis using sets_into_space by (fastforce intro!: dynkin_systemI) |
40859 | 1241 |
qed |
1242 |
||
56994 | 1243 |
subsubsection "Intersection sets systems" |
40859 | 1244 |
|
67962 | 1245 |
definition%important "Int_stable M \<longleftrightarrow> (\<forall> a \<in> M. \<forall> b \<in> M. a \<inter> b \<in> M)" |
40859 | 1246 |
|
1247 |
lemma (in algebra) Int_stable: "Int_stable M" |
|
1248 |
unfolding Int_stable_def by auto |
|
1249 |
||
64008
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
1250 |
lemma Int_stableI_image: |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
1251 |
"(\<And>i j. i \<in> I \<Longrightarrow> j \<in> I \<Longrightarrow> \<exists>k\<in>I. A i \<inter> A j = A k) \<Longrightarrow> Int_stable (A ` I)" |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
1252 |
by (auto simp: Int_stable_def image_def) |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
1253 |
|
42981 | 1254 |
lemma Int_stableI: |
47694 | 1255 |
"(\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> a \<inter> b \<in> A) \<Longrightarrow> Int_stable A" |
42981 | 1256 |
unfolding Int_stable_def by auto |
1257 |
||
1258 |
lemma Int_stableD: |
|
47694 | 1259 |
"Int_stable M \<Longrightarrow> a \<in> M \<Longrightarrow> b \<in> M \<Longrightarrow> a \<inter> b \<in> M" |
42981 | 1260 |
unfolding Int_stable_def by auto |
1261 |
||
40859 | 1262 |
lemma (in dynkin_system) sigma_algebra_eq_Int_stable: |
47694 | 1263 |
"sigma_algebra \<Omega> M \<longleftrightarrow> Int_stable M" |
40859 | 1264 |
proof |
47694 | 1265 |
assume "sigma_algebra \<Omega> M" then show "Int_stable M" |
40859 | 1266 |
unfolding sigma_algebra_def using algebra.Int_stable by auto |
1267 |
next |
|
1268 |
assume "Int_stable M" |
|
47694 | 1269 |
show "sigma_algebra \<Omega> M" |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
1270 |
unfolding sigma_algebra_disjoint_iff algebra_iff_Un |
40859 | 1271 |
proof (intro conjI ballI allI impI) |
47694 | 1272 |
show "M \<subseteq> Pow (\<Omega>)" using sets_into_space by auto |
40859 | 1273 |
next |
47694 | 1274 |
fix A B assume "A \<in> M" "B \<in> M" |
1275 |
then have "A \<union> B = \<Omega> - ((\<Omega> - A) \<inter> (\<Omega> - B))" |
|
1276 |
"\<Omega> - A \<in> M" "\<Omega> - B \<in> M" |
|
40859 | 1277 |
using sets_into_space by auto |
47694 | 1278 |
then show "A \<union> B \<in> M" |
61808 | 1279 |
using \<open>Int_stable M\<close> unfolding Int_stable_def by auto |
40859 | 1280 |
qed auto |
1281 |
qed |
|
1282 |
||
56994 | 1283 |
subsubsection "Smallest Dynkin systems" |
40859 | 1284 |
|
67962 | 1285 |
definition%important dynkin where |
47694 | 1286 |
"dynkin \<Omega> M = (\<Inter>{D. dynkin_system \<Omega> D \<and> M \<subseteq> D})" |
40859 | 1287 |
|
1288 |
lemma dynkin_system_dynkin: |
|
47694 | 1289 |
assumes "M \<subseteq> Pow (\<Omega>)" |
1290 |
shows "dynkin_system \<Omega> (dynkin \<Omega> M)" |
|
40859 | 1291 |
proof (rule dynkin_systemI) |
47694 | 1292 |
fix A assume "A \<in> dynkin \<Omega> M" |
40859 | 1293 |
moreover |
47694 | 1294 |
{ fix D assume "A \<in> D" and d: "dynkin_system \<Omega> D" |
1295 |
then have "A \<subseteq> \<Omega>" by (auto simp: dynkin_system_def subset_class_def) } |
|
1296 |
moreover have "{D. dynkin_system \<Omega> D \<and> M \<subseteq> D} \<noteq> {}" |
|
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44537
diff
changeset
|
1297 |
using assms dynkin_system_trivial by fastforce |
47694 | 1298 |
ultimately show "A \<subseteq> \<Omega>" |
40859 | 1299 |
unfolding dynkin_def using assms |
47694 | 1300 |
by auto |
40859 | 1301 |
next |
47694 | 1302 |
show "\<Omega> \<in> dynkin \<Omega> M" |
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44537
diff
changeset
|
1303 |
unfolding dynkin_def using dynkin_system.space by fastforce |
40859 | 1304 |
next |
47694 | 1305 |
fix A assume "A \<in> dynkin \<Omega> M" |
1306 |
then show "\<Omega> - A \<in> dynkin \<Omega> M" |
|
40859 | 1307 |
unfolding dynkin_def using dynkin_system.compl by force |
1308 |
next |
|
1309 |
fix A :: "nat \<Rightarrow> 'a set" |
|
47694 | 1310 |
assume A: "disjoint_family A" "range A \<subseteq> dynkin \<Omega> M" |
1311 |
show "(\<Union>i. A i) \<in> dynkin \<Omega> M" unfolding dynkin_def |
|
40859 | 1312 |
proof (simp, safe) |
47694 | 1313 |
fix D assume "dynkin_system \<Omega> D" "M \<subseteq> D" |
1314 |
with A have "(\<Union>i. A i) \<in> D" |
|
40859 | 1315 |
by (intro dynkin_system.UN) (auto simp: dynkin_def) |
1316 |
then show "(\<Union>i. A i) \<in> D" by auto |
|
1317 |
qed |
|
1318 |
qed |
|
1319 |
||
47694 | 1320 |
lemma dynkin_Basic[intro]: "A \<in> M \<Longrightarrow> A \<in> dynkin \<Omega> M" |
40859 | 1321 |
unfolding dynkin_def by auto |
1322 |
||
1323 |
lemma (in dynkin_system) restricted_dynkin_system: |
|
47694 | 1324 |
assumes "D \<in> M" |
1325 |
shows "dynkin_system \<Omega> {Q. Q \<subseteq> \<Omega> \<and> Q \<inter> D \<in> M}" |
|
40859 | 1326 |
proof (rule dynkin_systemI, simp_all) |
47694 | 1327 |
have "\<Omega> \<inter> D = D" |
61808 | 1328 |
using \<open>D \<in> M\<close> sets_into_space by auto |
47694 | 1329 |
then show "\<Omega> \<inter> D \<in> M" |
61808 | 1330 |
using \<open>D \<in> M\<close> by auto |
40859 | 1331 |
next |
47694 | 1332 |
fix A assume "A \<subseteq> \<Omega> \<and> A \<inter> D \<in> M" |
1333 |
moreover have "(\<Omega> - A) \<inter> D = (\<Omega> - (A \<inter> D)) - (\<Omega> - D)" |
|
40859 | 1334 |
by auto |
47694 | 1335 |
ultimately show "\<Omega> - A \<subseteq> \<Omega> \<and> (\<Omega> - A) \<inter> D \<in> M" |
61808 | 1336 |
using \<open>D \<in> M\<close> by (auto intro: diff) |
40859 | 1337 |
next |
1338 |
fix A :: "nat \<Rightarrow> 'a set" |
|
47694 | 1339 |
assume "disjoint_family A" "range A \<subseteq> {Q. Q \<subseteq> \<Omega> \<and> Q \<inter> D \<in> M}" |
1340 |
then have "\<And>i. A i \<subseteq> \<Omega>" "disjoint_family (\<lambda>i. A i \<inter> D)" |
|
1341 |
"range (\<lambda>i. A i \<inter> D) \<subseteq> M" "(\<Union>x. A x) \<inter> D = (\<Union>x. A x \<inter> D)" |
|
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
44537
diff
changeset
|
1342 |
by ((fastforce simp: disjoint_family_on_def)+) |
47694 | 1343 |
then show "(\<Union>x. A x) \<subseteq> \<Omega> \<and> (\<Union>x. A x) \<inter> D \<in> M" |
40859 | 1344 |
by (auto simp del: UN_simps) |
1345 |
qed |
|
1346 |
||
1347 |
lemma (in dynkin_system) dynkin_subset: |
|
47694 | 1348 |
assumes "N \<subseteq> M" |
1349 |
shows "dynkin \<Omega> N \<subseteq> M" |
|
40859 | 1350 |
proof - |
61169 | 1351 |
have "dynkin_system \<Omega> M" .. |
47694 | 1352 |
then have "dynkin_system \<Omega> M" |
42065
2b98b4c2e2f1
add ring_of_sets and subset_class as basis for algebra
hoelzl
parents:
41983
diff
changeset
|
1353 |
using assms unfolding dynkin_system_def dynkin_system_axioms_def subset_class_def by simp |
61808 | 1354 |
with \<open>N \<subseteq> M\<close> show ?thesis by (auto simp add: dynkin_def) |
40859 | 1355 |
qed |
1356 |
||
1357 |
lemma sigma_eq_dynkin: |
|
47694 | 1358 |
assumes sets: "M \<subseteq> Pow \<Omega>" |
40859 | 1359 |
assumes "Int_stable M" |
47694 | 1360 |
shows "sigma_sets \<Omega> M = dynkin \<Omega> M" |
40859 | 1361 |
proof - |
47694 | 1362 |
have "dynkin \<Omega> M \<subseteq> sigma_sets (\<Omega>) (M)" |
40859 | 1363 |
using sigma_algebra_imp_dynkin_system |
47694 | 1364 |
unfolding dynkin_def sigma_sets_least_sigma_algebra[OF sets] by auto |
40859 | 1365 |
moreover |
47694 | 1366 |
interpret dynkin_system \<Omega> "dynkin \<Omega> M" |
40859 | 1367 |
using dynkin_system_dynkin[OF sets] . |
47694 | 1368 |
have "sigma_algebra \<Omega> (dynkin \<Omega> M)" |
40859 | 1369 |
unfolding sigma_algebra_eq_Int_stable Int_stable_def |
1370 |
proof (intro ballI) |
|
47694 | 1371 |
fix A B assume "A \<in> dynkin \<Omega> M" "B \<in> dynkin \<Omega> M" |
1372 |
let ?D = "\<lambda>E. {Q. Q \<subseteq> \<Omega> \<and> Q \<inter> E \<in> dynkin \<Omega> M}" |
|
1373 |
have "M \<subseteq> ?D B" |
|
40859 | 1374 |
proof |
47694 | 1375 |
fix E assume "E \<in> M" |
1376 |
then have "M \<subseteq> ?D E" "E \<in> dynkin \<Omega> M" |
|
61808 | 1377 |
using sets_into_space \<open>Int_stable M\<close> by (auto simp: Int_stable_def) |
47694 | 1378 |
then have "dynkin \<Omega> M \<subseteq> ?D E" |
61808 | 1379 |
using restricted_dynkin_system \<open>E \<in> dynkin \<Omega> M\<close> |
40859 | 1380 |
by (intro dynkin_system.dynkin_subset) simp_all |
47694 | 1381 |
then have "B \<in> ?D E" |
61808 | 1382 |
using \<open>B \<in> dynkin \<Omega> M\<close> by auto |
47694 | 1383 |
then have "E \<inter> B \<in> dynkin \<Omega> M" |
40859 | 1384 |
by (subst Int_commute) simp |
47694 | 1385 |
then show "E \<in> ?D B" |
61808 | 1386 |
using sets \<open>E \<in> M\<close> by auto |
40859 | 1387 |
qed |
47694 | 1388 |
then have "dynkin \<Omega> M \<subseteq> ?D B" |
61808 | 1389 |
using restricted_dynkin_system \<open>B \<in> dynkin \<Omega> M\<close> |
40859 | 1390 |
by (intro dynkin_system.dynkin_subset) simp_all |
47694 | 1391 |
then show "A \<inter> B \<in> dynkin \<Omega> M" |
61808 | 1392 |
using \<open>A \<in> dynkin \<Omega> M\<close> sets_into_space by auto |
40859 | 1393 |
qed |
47694 | 1394 |
from sigma_algebra.sigma_sets_subset[OF this, of "M"] |
1395 |
have "sigma_sets (\<Omega>) (M) \<subseteq> dynkin \<Omega> M" by auto |
|
1396 |
ultimately have "sigma_sets (\<Omega>) (M) = dynkin \<Omega> M" by auto |
|
40859 | 1397 |
then show ?thesis |
47694 | 1398 |
by (auto simp: dynkin_def) |
40859 | 1399 |
qed |
1400 |
||
1401 |
lemma (in dynkin_system) dynkin_idem: |
|
47694 | 1402 |
"dynkin \<Omega> M = M" |
40859 | 1403 |
proof - |
47694 | 1404 |
have "dynkin \<Omega> M = M" |
40859 | 1405 |
proof |
47694 | 1406 |
show "M \<subseteq> dynkin \<Omega> M" |
40859 | 1407 |
using dynkin_Basic by auto |
47694 | 1408 |
show "dynkin \<Omega> M \<subseteq> M" |
40859 | 1409 |
by (intro dynkin_subset) auto |
1410 |
qed |
|
1411 |
then show ?thesis |
|
47694 | 1412 |
by (auto simp: dynkin_def) |
40859 | 1413 |
qed |
1414 |
||
1415 |
lemma (in dynkin_system) dynkin_lemma: |
|
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41543
diff
changeset
|
1416 |
assumes "Int_stable E" |
47694 | 1417 |
and E: "E \<subseteq> M" "M \<subseteq> sigma_sets \<Omega> E" |
1418 |
shows "sigma_sets \<Omega> E = M" |
|
40859 | 1419 |
proof - |
47694 | 1420 |
have "E \<subseteq> Pow \<Omega>" |
41689
3e39b0e730d6
the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents:
41543
diff
changeset
|
1421 |
using E sets_into_space by force |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
51683
diff
changeset
|
1422 |
then have *: "sigma_sets \<Omega> E = dynkin \<Omega> E" |
61808 | 1423 |
using \<open>Int_stable E\<close> by (rule sigma_eq_dynkin) |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
51683
diff
changeset
|
1424 |
then have "dynkin \<Omega> E = M" |
47694 | 1425 |
using assms dynkin_subset[OF E(1)] by simp |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
51683
diff
changeset
|
1426 |
with * show ?thesis |
47694 | 1427 |
using assms by (auto simp: dynkin_def) |
42864 | 1428 |
qed |
1429 |
||
61808 | 1430 |
subsubsection \<open>Induction rule for intersection-stable generators\<close> |
56994 | 1431 |
|
67962 | 1432 |
text%important \<open>The reason to introduce Dynkin-systems is the following induction rules for $\sigma$-algebras |
61808 | 1433 |
generated by a generator closed under intersection.\<close> |
56994 | 1434 |
|
67962 | 1435 |
lemma%important sigma_sets_induct_disjoint[consumes 3, case_names basic empty compl union]: |
49789
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1436 |
assumes "Int_stable G" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1437 |
and closed: "G \<subseteq> Pow \<Omega>" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1438 |
and A: "A \<in> sigma_sets \<Omega> G" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1439 |
assumes basic: "\<And>A. A \<in> G \<Longrightarrow> P A" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1440 |
and empty: "P {}" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1441 |
and compl: "\<And>A. A \<in> sigma_sets \<Omega> G \<Longrightarrow> P A \<Longrightarrow> P (\<Omega> - A)" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1442 |
and union: "\<And>A. disjoint_family A \<Longrightarrow> range A \<subseteq> sigma_sets \<Omega> G \<Longrightarrow> (\<And>i. P (A i)) \<Longrightarrow> P (\<Union>i::nat. A i)" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1443 |
shows "P A" |
67962 | 1444 |
proof%unimportant - |
49789
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1445 |
let ?D = "{ A \<in> sigma_sets \<Omega> G. P A }" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1446 |
interpret sigma_algebra \<Omega> "sigma_sets \<Omega> G" |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1447 |
using closed by (rule sigma_algebra_sigma_sets) |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1448 |
from compl[OF _ empty] closed have space: "P \<Omega>" by simp |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1449 |
interpret dynkin_system \<Omega> ?D |
61169 | 1450 |
by standard (auto dest: sets_into_space intro!: space compl union) |
49789
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1451 |
have "sigma_sets \<Omega> G = ?D" |
61808 | 1452 |
by (rule dynkin_lemma) (auto simp: basic \<open>Int_stable G\<close>) |
49789
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1453 |
with A show ?thesis by auto |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1454 |
qed |
e0a4cb91a8a9
add induction rule for intersection-stable sigma-sets
hoelzl
parents:
49782
diff
changeset
|
1455 |
|
61808 | 1456 |
subsection \<open>Measure type\<close> |
56994 | 1457 |
|
67962 | 1458 |
definition%important positive :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> bool" where |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1459 |
"positive M \<mu> \<longleftrightarrow> \<mu> {} = 0" |
56994 | 1460 |
|
67962 | 1461 |
definition%important countably_additive :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> bool" where |
56994 | 1462 |
"countably_additive M f \<longleftrightarrow> (\<forall>A. range A \<subseteq> M \<longrightarrow> disjoint_family A \<longrightarrow> (\<Union>i. A i) \<in> M \<longrightarrow> |
1463 |
(\<Sum>i. f (A i)) = f (\<Union>i. A i))" |
|
1464 |
||
67962 | 1465 |
definition%important measure_space :: "'a set \<Rightarrow> 'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> bool" where |
56994 | 1466 |
"measure_space \<Omega> A \<mu> \<longleftrightarrow> sigma_algebra \<Omega> A \<and> positive A \<mu> \<and> countably_additive A \<mu>" |
1467 |
||
67962 | 1468 |
typedef%important 'a measure = "{(\<Omega>::'a set, A, \<mu>). (\<forall>a\<in>-A. \<mu> a = 0) \<and> measure_space \<Omega> A \<mu> }" |
1469 |
proof%unimportant |
|
56994 | 1470 |
have "sigma_algebra UNIV {{}, UNIV}" |
1471 |
by (auto simp: sigma_algebra_iff2) |
|
1472 |
then show "(UNIV, {{}, UNIV}, \<lambda>A. 0) \<in> {(\<Omega>, A, \<mu>). (\<forall>a\<in>-A. \<mu> a = 0) \<and> measure_space \<Omega> A \<mu>} " |
|
1473 |
by (auto simp: measure_space_def positive_def countably_additive_def) |
|
1474 |
qed |
|
1475 |
||
67962 | 1476 |
definition%important space :: "'a measure \<Rightarrow> 'a set" where |
56994 | 1477 |
"space M = fst (Rep_measure M)" |
1478 |
||
67962 | 1479 |
definition%important sets :: "'a measure \<Rightarrow> 'a set set" where |
56994 | 1480 |
"sets M = fst (snd (Rep_measure M))" |
1481 |
||
67962 | 1482 |
definition%important emeasure :: "'a measure \<Rightarrow> 'a set \<Rightarrow> ennreal" where |
56994 | 1483 |
"emeasure M = snd (snd (Rep_measure M))" |
1484 |
||
67962 | 1485 |
definition%important measure :: "'a measure \<Rightarrow> 'a set \<Rightarrow> real" where |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1486 |
"measure M A = enn2real (emeasure M A)" |
56994 | 1487 |
|
1488 |
declare [[coercion sets]] |
|
1489 |
||
1490 |
declare [[coercion measure]] |
|
1491 |
||
1492 |
declare [[coercion emeasure]] |
|
1493 |
||
1494 |
lemma measure_space: "measure_space (space M) (sets M) (emeasure M)" |
|
1495 |
by (cases M) (auto simp: space_def sets_def emeasure_def Abs_measure_inverse) |
|
1496 |
||
61605 | 1497 |
interpretation sets: sigma_algebra "space M" "sets M" for M :: "'a measure" |
56994 | 1498 |
using measure_space[of M] by (auto simp: measure_space_def) |
1499 |
||
67962 | 1500 |
definition%important measure_of :: "'a set \<Rightarrow> 'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> 'a measure" where |
56994 | 1501 |
"measure_of \<Omega> A \<mu> = Abs_measure (\<Omega>, if A \<subseteq> Pow \<Omega> then sigma_sets \<Omega> A else {{}, \<Omega>}, |
1502 |
\<lambda>a. if a \<in> sigma_sets \<Omega> A \<and> measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> then \<mu> a else 0)" |
|
1503 |
||
1504 |
abbreviation "sigma \<Omega> A \<equiv> measure_of \<Omega> A (\<lambda>x. 0)" |
|
1505 |
||
1506 |
lemma measure_space_0: "A \<subseteq> Pow \<Omega> \<Longrightarrow> measure_space \<Omega> (sigma_sets \<Omega> A) (\<lambda>x. 0)" |
|
1507 |
unfolding measure_space_def |
|
1508 |
by (auto intro!: sigma_algebra_sigma_sets simp: positive_def countably_additive_def) |
|
1509 |
||
1510 |
lemma sigma_algebra_trivial: "sigma_algebra \<Omega> {{}, \<Omega>}" |
|
1511 |
by unfold_locales(fastforce intro: exI[where x="{{}}"] exI[where x="{\<Omega>}"])+ |
|
1512 |
||
1513 |
lemma measure_space_0': "measure_space \<Omega> {{}, \<Omega>} (\<lambda>x. 0)" |
|
1514 |
by(simp add: measure_space_def positive_def countably_additive_def sigma_algebra_trivial) |
|
1515 |
||
1516 |
lemma measure_space_closed: |
|
1517 |
assumes "measure_space \<Omega> M \<mu>" |
|
1518 |
shows "M \<subseteq> Pow \<Omega>" |
|
1519 |
proof - |
|
1520 |
interpret sigma_algebra \<Omega> M using assms by(simp add: measure_space_def) |
|
1521 |
show ?thesis by(rule space_closed) |
|
1522 |
qed |
|
1523 |
||
1524 |
lemma (in ring_of_sets) positive_cong_eq: |
|
1525 |
"(\<And>a. a \<in> M \<Longrightarrow> \<mu>' a = \<mu> a) \<Longrightarrow> positive M \<mu>' = positive M \<mu>" |
|
1526 |
by (auto simp add: positive_def) |
|
1527 |
||
1528 |
lemma (in sigma_algebra) countably_additive_eq: |
|
1529 |
"(\<And>a. a \<in> M \<Longrightarrow> \<mu>' a = \<mu> a) \<Longrightarrow> countably_additive M \<mu>' = countably_additive M \<mu>" |
|
1530 |
unfolding countably_additive_def |
|
1531 |
by (intro arg_cong[where f=All] ext) (auto simp add: countably_additive_def subset_eq) |
|
1532 |
||
1533 |
lemma measure_space_eq: |
|
1534 |
assumes closed: "A \<subseteq> Pow \<Omega>" and eq: "\<And>a. a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> a = \<mu>' a" |
|
1535 |
shows "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'" |
|
1536 |
proof - |
|
1537 |
interpret sigma_algebra \<Omega> "sigma_sets \<Omega> A" using closed by (rule sigma_algebra_sigma_sets) |
|
1538 |
from positive_cong_eq[OF eq, of "\<lambda>i. i"] countably_additive_eq[OF eq, of "\<lambda>i. i"] show ?thesis |
|
1539 |
by (auto simp: measure_space_def) |
|
1540 |
qed |
|
1541 |
||
1542 |
lemma measure_of_eq: |
|
1543 |
assumes closed: "A \<subseteq> Pow \<Omega>" and eq: "(\<And>a. a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> a = \<mu>' a)" |
|
1544 |
shows "measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'" |
|
1545 |
proof - |
|
1546 |
have "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'" |
|
1547 |
using assms by (rule measure_space_eq) |
|
1548 |
with eq show ?thesis |
|
1549 |
by (auto simp add: measure_of_def intro!: arg_cong[where f=Abs_measure]) |
|
1550 |
qed |
|
1551 |
||
1552 |
lemma |
|
1553 |
shows space_measure_of_conv: "space (measure_of \<Omega> A \<mu>) = \<Omega>" (is ?space) |
|
1554 |
and sets_measure_of_conv: |
|
1555 |
"sets (measure_of \<Omega> A \<mu>) = (if A \<subseteq> Pow \<Omega> then sigma_sets \<Omega> A else {{}, \<Omega>})" (is ?sets) |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1556 |
and emeasure_measure_of_conv: |
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1557 |
"emeasure (measure_of \<Omega> A \<mu>) = |
56994 | 1558 |
(\<lambda>B. if B \<in> sigma_sets \<Omega> A \<and> measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> then \<mu> B else 0)" (is ?emeasure) |
1559 |
proof - |
|
1560 |
have "?space \<and> ?sets \<and> ?emeasure" |
|
1561 |
proof(cases "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>") |
|
1562 |
case True |
|
1563 |
from measure_space_closed[OF this] sigma_sets_superset_generator[of A \<Omega>] |
|
1564 |
have "A \<subseteq> Pow \<Omega>" by simp |
|
1565 |
hence "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) |
|
1566 |
(\<lambda>a. if a \<in> sigma_sets \<Omega> A then \<mu> a else 0)" |
|
1567 |
by(rule measure_space_eq) auto |
|
61808 | 1568 |
with True \<open>A \<subseteq> Pow \<Omega>\<close> show ?thesis |
56994 | 1569 |
by(simp add: measure_of_def space_def sets_def emeasure_def Abs_measure_inverse) |
1570 |
next |
|
1571 |
case False thus ?thesis |
|
1572 |
by(cases "A \<subseteq> Pow \<Omega>")(simp_all add: Abs_measure_inverse measure_of_def sets_def space_def emeasure_def measure_space_0 measure_space_0') |
|
1573 |
qed |
|
1574 |
thus ?space ?sets ?emeasure by simp_all |
|
1575 |
qed |
|
1576 |
||
1577 |
lemma [simp]: |
|
1578 |
assumes A: "A \<subseteq> Pow \<Omega>" |
|
1579 |
shows sets_measure_of: "sets (measure_of \<Omega> A \<mu>) = sigma_sets \<Omega> A" |
|
1580 |
and space_measure_of: "space (measure_of \<Omega> A \<mu>) = \<Omega>" |
|
1581 |
using assms |
|
1582 |
by(simp_all add: sets_measure_of_conv space_measure_of_conv) |
|
1583 |
||
64008
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
1584 |
lemma space_in_measure_of[simp]: "\<Omega> \<in> sets (measure_of \<Omega> M \<mu>)" |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
1585 |
by (subst sets_measure_of_conv) (auto simp: sigma_sets_top) |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
1586 |
|
56994 | 1587 |
lemma (in sigma_algebra) sets_measure_of_eq[simp]: "sets (measure_of \<Omega> M \<mu>) = M" |
1588 |
using space_closed by (auto intro!: sigma_sets_eq) |
|
1589 |
||
1590 |
lemma (in sigma_algebra) space_measure_of_eq[simp]: "space (measure_of \<Omega> M \<mu>) = \<Omega>" |
|
1591 |
by (rule space_measure_of_conv) |
|
1592 |
||
1593 |
lemma measure_of_subset: "M \<subseteq> Pow \<Omega> \<Longrightarrow> M' \<subseteq> M \<Longrightarrow> sets (measure_of \<Omega> M' \<mu>) \<subseteq> sets (measure_of \<Omega> M \<mu>')" |
|
1594 |
by (auto intro!: sigma_sets_subseteq) |
|
1595 |
||
59000 | 1596 |
lemma emeasure_sigma: "emeasure (sigma \<Omega> A) = (\<lambda>x. 0)" |
1597 |
unfolding measure_of_def emeasure_def |
|
1598 |
by (subst Abs_measure_inverse) |
|
1599 |
(auto simp: measure_space_def positive_def countably_additive_def |
|
1600 |
intro!: sigma_algebra_sigma_sets sigma_algebra_trivial) |
|
1601 |
||
56994 | 1602 |
lemma sigma_sets_mono'': |
1603 |
assumes "A \<in> sigma_sets C D" |
|
1604 |
assumes "B \<subseteq> D" |
|
1605 |
assumes "D \<subseteq> Pow C" |
|
1606 |
shows "sigma_sets A B \<subseteq> sigma_sets C D" |
|
1607 |
proof |
|
1608 |
fix x assume "x \<in> sigma_sets A B" |
|
1609 |
thus "x \<in> sigma_sets C D" |
|
1610 |
proof induct |
|
1611 |
case (Basic a) with assms have "a \<in> D" by auto |
|
1612 |
thus ?case .. |
|
1613 |
next |
|
1614 |
case Empty show ?case by (rule sigma_sets.Empty) |
|
1615 |
next |
|
61808 | 1616 |
from assms have "A \<in> sets (sigma C D)" by (subst sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>]) |
1617 |
moreover case (Compl a) hence "a \<in> sets (sigma C D)" by (subst sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>]) |
|
56994 | 1618 |
ultimately have "A - a \<in> sets (sigma C D)" .. |
61808 | 1619 |
thus ?case by (subst (asm) sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>]) |
56994 | 1620 |
next |
1621 |
case (Union a) |
|
1622 |
thus ?case by (intro sigma_sets.Union) |
|
1623 |
qed |
|
1624 |
qed |
|
1625 |
||
1626 |
lemma in_measure_of[intro, simp]: "M \<subseteq> Pow \<Omega> \<Longrightarrow> A \<in> M \<Longrightarrow> A \<in> sets (measure_of \<Omega> M \<mu>)" |
|
1627 |
by auto |
|
1628 |
||
58606 | 1629 |
lemma space_empty_iff: "space N = {} \<longleftrightarrow> sets N = {{}}" |
1630 |
by (metis Pow_empty Sup_bot_conv(1) cSup_singleton empty_iff |
|
1631 |
sets.sigma_sets_eq sets.space_closed sigma_sets_top subset_singletonD) |
|
1632 |
||
61808 | 1633 |
subsubsection \<open>Constructing simple @{typ "'a measure"}\<close> |
56994 | 1634 |
|
67962 | 1635 |
lemma%important emeasure_measure_of: |
56994 | 1636 |
assumes M: "M = measure_of \<Omega> A \<mu>" |
1637 |
assumes ms: "A \<subseteq> Pow \<Omega>" "positive (sets M) \<mu>" "countably_additive (sets M) \<mu>" |
|
1638 |
assumes X: "X \<in> sets M" |
|
1639 |
shows "emeasure M X = \<mu> X" |
|
67962 | 1640 |
proof%unimportant - |
56994 | 1641 |
interpret sigma_algebra \<Omega> "sigma_sets \<Omega> A" by (rule sigma_algebra_sigma_sets) fact |
1642 |
have "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>" |
|
1643 |
using ms M by (simp add: measure_space_def sigma_algebra_sigma_sets) |
|
1644 |
thus ?thesis using X ms |
|
1645 |
by(simp add: M emeasure_measure_of_conv sets_measure_of_conv) |
|
1646 |
qed |
|
1647 |
||
1648 |
lemma emeasure_measure_of_sigma: |
|
1649 |
assumes ms: "sigma_algebra \<Omega> M" "positive M \<mu>" "countably_additive M \<mu>" |
|
1650 |
assumes A: "A \<in> M" |
|
1651 |
shows "emeasure (measure_of \<Omega> M \<mu>) A = \<mu> A" |
|
1652 |
proof - |
|
1653 |
interpret sigma_algebra \<Omega> M by fact |
|
1654 |
have "measure_space \<Omega> (sigma_sets \<Omega> M) \<mu>" |
|
1655 |
using ms sigma_sets_eq by (simp add: measure_space_def) |
|
1656 |
thus ?thesis by(simp add: emeasure_measure_of_conv A) |
|
1657 |
qed |
|
1658 |
||
1659 |
lemma measure_cases[cases type: measure]: |
|
1660 |
obtains (measure) \<Omega> A \<mu> where "x = Abs_measure (\<Omega>, A, \<mu>)" "\<forall>a\<in>-A. \<mu> a = 0" "measure_space \<Omega> A \<mu>" |
|
1661 |
by atomize_elim (cases x, auto) |
|
1662 |
||
60772 | 1663 |
lemma sets_le_imp_space_le: "sets A \<subseteq> sets B \<Longrightarrow> space A \<subseteq> space B" |
1664 |
by (auto dest: sets.sets_into_space) |
|
1665 |
||
1666 |
lemma sets_eq_imp_space_eq: "sets M = sets M' \<Longrightarrow> space M = space M'" |
|
1667 |
by (auto intro!: antisym sets_le_imp_space_le) |
|
56994 | 1668 |
|
1669 |
lemma emeasure_notin_sets: "A \<notin> sets M \<Longrightarrow> emeasure M A = 0" |
|
1670 |
by (cases M) (auto simp: sets_def emeasure_def Abs_measure_inverse measure_space_def) |
|
1671 |
||
1672 |
lemma emeasure_neq_0_sets: "emeasure M A \<noteq> 0 \<Longrightarrow> A \<in> sets M" |
|
1673 |
using emeasure_notin_sets[of A M] by blast |
|
1674 |
||
1675 |
lemma measure_notin_sets: "A \<notin> sets M \<Longrightarrow> measure M A = 0" |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1676 |
by (simp add: measure_def emeasure_notin_sets zero_ennreal.rep_eq) |
56994 | 1677 |
|
1678 |
lemma measure_eqI: |
|
1679 |
fixes M N :: "'a measure" |
|
1680 |
assumes "sets M = sets N" and eq: "\<And>A. A \<in> sets M \<Longrightarrow> emeasure M A = emeasure N A" |
|
1681 |
shows "M = N" |
|
1682 |
proof (cases M N rule: measure_cases[case_product measure_cases]) |
|
1683 |
case (measure_measure \<Omega> A \<mu> \<Omega>' A' \<mu>') |
|
1684 |
interpret M: sigma_algebra \<Omega> A using measure_measure by (auto simp: measure_space_def) |
|
1685 |
interpret N: sigma_algebra \<Omega>' A' using measure_measure by (auto simp: measure_space_def) |
|
1686 |
have "A = sets M" "A' = sets N" |
|
1687 |
using measure_measure by (simp_all add: sets_def Abs_measure_inverse) |
|
61808 | 1688 |
with \<open>sets M = sets N\<close> have AA': "A = A'" by simp |
56994 | 1689 |
moreover from M.top N.top M.space_closed N.space_closed AA' have "\<Omega> = \<Omega>'" by auto |
1690 |
moreover { fix B have "\<mu> B = \<mu>' B" |
|
1691 |
proof cases |
|
1692 |
assume "B \<in> A" |
|
61808 | 1693 |
with eq \<open>A = sets M\<close> have "emeasure M B = emeasure N B" by simp |
56994 | 1694 |
with measure_measure show "\<mu> B = \<mu>' B" |
1695 |
by (simp add: emeasure_def Abs_measure_inverse) |
|
1696 |
next |
|
1697 |
assume "B \<notin> A" |
|
61808 | 1698 |
with \<open>A = sets M\<close> \<open>A' = sets N\<close> \<open>A = A'\<close> have "B \<notin> sets M" "B \<notin> sets N" |
56994 | 1699 |
by auto |
1700 |
then have "emeasure M B = 0" "emeasure N B = 0" |
|
1701 |
by (simp_all add: emeasure_notin_sets) |
|
1702 |
with measure_measure show "\<mu> B = \<mu>' B" |
|
1703 |
by (simp add: emeasure_def Abs_measure_inverse) |
|
1704 |
qed } |
|
1705 |
then have "\<mu> = \<mu>'" by auto |
|
1706 |
ultimately show "M = N" |
|
1707 |
by (simp add: measure_measure) |
|
1708 |
qed |
|
1709 |
||
1710 |
lemma sigma_eqI: |
|
1711 |
assumes [simp]: "M \<subseteq> Pow \<Omega>" "N \<subseteq> Pow \<Omega>" "sigma_sets \<Omega> M = sigma_sets \<Omega> N" |
|
1712 |
shows "sigma \<Omega> M = sigma \<Omega> N" |
|
1713 |
by (rule measure_eqI) (simp_all add: emeasure_sigma) |
|
1714 |
||
61808 | 1715 |
subsubsection \<open>Measurable functions\<close> |
56994 | 1716 |
|
67962 | 1717 |
definition%important measurable :: "'a measure \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) set" (infixr "\<rightarrow>\<^sub>M" 60) where |
61384 | 1718 |
"measurable A B = {f \<in> space A \<rightarrow> space B. \<forall>y \<in> sets B. f -` y \<inter> space A \<in> sets A}" |
56994 | 1719 |
|
59415 | 1720 |
lemma measurableI: |
1721 |
"(\<And>x. x \<in> space M \<Longrightarrow> f x \<in> space N) \<Longrightarrow> (\<And>A. A \<in> sets N \<Longrightarrow> f -` A \<inter> space M \<in> sets M) \<Longrightarrow> |
|
1722 |
f \<in> measurable M N" |
|
1723 |
by (auto simp: measurable_def) |
|
1724 |
||
56994 | 1725 |
lemma measurable_space: |
1726 |
"f \<in> measurable M A \<Longrightarrow> x \<in> space M \<Longrightarrow> f x \<in> space A" |
|
1727 |
unfolding measurable_def by auto |
|
1728 |
||
1729 |
lemma measurable_sets: |
|
1730 |
"f \<in> measurable M A \<Longrightarrow> S \<in> sets A \<Longrightarrow> f -` S \<inter> space M \<in> sets M" |
|
1731 |
unfolding measurable_def by auto |
|
1732 |
||
1733 |
lemma measurable_sets_Collect: |
|
1734 |
assumes f: "f \<in> measurable M N" and P: "{x\<in>space N. P x} \<in> sets N" shows "{x\<in>space M. P (f x)} \<in> sets M" |
|
1735 |
proof - |
|
1736 |
have "f -` {x \<in> space N. P x} \<inter> space M = {x\<in>space M. P (f x)}" |
|
1737 |
using measurable_space[OF f] by auto |
|
1738 |
with measurable_sets[OF f P] show ?thesis |
|
1739 |
by simp |
|
1740 |
qed |
|
1741 |
||
1742 |
lemma measurable_sigma_sets: |
|
1743 |
assumes B: "sets N = sigma_sets \<Omega> A" "A \<subseteq> Pow \<Omega>" |
|
1744 |
and f: "f \<in> space M \<rightarrow> \<Omega>" |
|
1745 |
and ba: "\<And>y. y \<in> A \<Longrightarrow> (f -` y) \<inter> space M \<in> sets M" |
|
1746 |
shows "f \<in> measurable M N" |
|
1747 |
proof - |
|
1748 |
interpret A: sigma_algebra \<Omega> "sigma_sets \<Omega> A" using B(2) by (rule sigma_algebra_sigma_sets) |
|
1749 |
from B sets.top[of N] A.top sets.space_closed[of N] A.space_closed have \<Omega>: "\<Omega> = space N" by force |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1750 |
|
56994 | 1751 |
{ fix X assume "X \<in> sigma_sets \<Omega> A" |
1752 |
then have "f -` X \<inter> space M \<in> sets M \<and> X \<subseteq> \<Omega>" |
|
1753 |
proof induct |
|
1754 |
case (Basic a) then show ?case |
|
1755 |
by (auto simp add: ba) (metis B(2) subsetD PowD) |
|
1756 |
next |
|
1757 |
case (Compl a) |
|
1758 |
have [simp]: "f -` \<Omega> \<inter> space M = space M" |
|
1759 |
by (auto simp add: funcset_mem [OF f]) |
|
1760 |
then show ?case |
|
1761 |
by (auto simp add: vimage_Diff Diff_Int_distrib2 sets.compl_sets Compl) |
|
1762 |
next |
|
1763 |
case (Union a) |
|
1764 |
then show ?case |
|
1765 |
by (simp add: vimage_UN, simp only: UN_extend_simps(4)) blast |
|
1766 |
qed auto } |
|
1767 |
with f show ?thesis |
|
1768 |
by (auto simp add: measurable_def B \<Omega>) |
|
1769 |
qed |
|
1770 |
||
1771 |
lemma measurable_measure_of: |
|
1772 |
assumes B: "N \<subseteq> Pow \<Omega>" |
|
1773 |
and f: "f \<in> space M \<rightarrow> \<Omega>" |
|
1774 |
and ba: "\<And>y. y \<in> N \<Longrightarrow> (f -` y) \<inter> space M \<in> sets M" |
|
1775 |
shows "f \<in> measurable M (measure_of \<Omega> N \<mu>)" |
|
1776 |
proof - |
|
1777 |
have "sets (measure_of \<Omega> N \<mu>) = sigma_sets \<Omega> N" |
|
1778 |
using B by (rule sets_measure_of) |
|
1779 |
from this assms show ?thesis by (rule measurable_sigma_sets) |
|
1780 |
qed |
|
1781 |
||
1782 |
lemma measurable_iff_measure_of: |
|
1783 |
assumes "N \<subseteq> Pow \<Omega>" "f \<in> space M \<rightarrow> \<Omega>" |
|
1784 |
shows "f \<in> measurable M (measure_of \<Omega> N \<mu>) \<longleftrightarrow> (\<forall>A\<in>N. f -` A \<inter> space M \<in> sets M)" |
|
1785 |
by (metis assms in_measure_of measurable_measure_of assms measurable_sets) |
|
1786 |
||
1787 |
lemma measurable_cong_sets: |
|
1788 |
assumes sets: "sets M = sets M'" "sets N = sets N'" |
|
1789 |
shows "measurable M N = measurable M' N'" |
|
1790 |
using sets[THEN sets_eq_imp_space_eq] sets by (simp add: measurable_def) |
|
1791 |
||
1792 |
lemma measurable_cong: |
|
59415 | 1793 |
assumes "\<And>w. w \<in> space M \<Longrightarrow> f w = g w" |
56994 | 1794 |
shows "f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable M M'" |
1795 |
unfolding measurable_def using assms |
|
1796 |
by (simp cong: vimage_inter_cong Pi_cong) |
|
1797 |
||
59415 | 1798 |
lemma measurable_cong': |
1799 |
assumes "\<And>w. w \<in> space M =simp=> f w = g w" |
|
1800 |
shows "f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable M M'" |
|
1801 |
unfolding measurable_def using assms |
|
1802 |
by (simp cong: vimage_inter_cong Pi_cong add: simp_implies_def) |
|
1803 |
||
56994 | 1804 |
lemma measurable_cong_strong: |
1805 |
"M = N \<Longrightarrow> M' = N' \<Longrightarrow> (\<And>w. w \<in> space M \<Longrightarrow> f w = g w) \<Longrightarrow> |
|
1806 |
f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable N N'" |
|
1807 |
by (metis measurable_cong) |
|
1808 |
||
1809 |
lemma measurable_compose: |
|
1810 |
assumes f: "f \<in> measurable M N" and g: "g \<in> measurable N L" |
|
1811 |
shows "(\<lambda>x. g (f x)) \<in> measurable M L" |
|
1812 |
proof - |
|
1813 |
have "\<And>A. (\<lambda>x. g (f x)) -` A \<inter> space M = f -` (g -` A \<inter> space N) \<inter> space M" |
|
1814 |
using measurable_space[OF f] by auto |
|
1815 |
with measurable_space[OF f] measurable_space[OF g] show ?thesis |
|
1816 |
by (auto intro: measurable_sets[OF f] measurable_sets[OF g] |
|
1817 |
simp del: vimage_Int simp add: measurable_def) |
|
1818 |
qed |
|
1819 |
||
1820 |
lemma measurable_comp: |
|
1821 |
"f \<in> measurable M N \<Longrightarrow> g \<in> measurable N L \<Longrightarrow> g \<circ> f \<in> measurable M L" |
|
1822 |
using measurable_compose[of f M N g L] by (simp add: comp_def) |
|
1823 |
||
1824 |
lemma measurable_const: |
|
1825 |
"c \<in> space M' \<Longrightarrow> (\<lambda>x. c) \<in> measurable M M'" |
|
1826 |
by (auto simp add: measurable_def) |
|
1827 |
||
1828 |
lemma measurable_ident: "id \<in> measurable M M" |
|
1829 |
by (auto simp add: measurable_def) |
|
1830 |
||
59048 | 1831 |
lemma measurable_id: "(\<lambda>x. x) \<in> measurable M M" |
1832 |
by (simp add: measurable_def) |
|
1833 |
||
56994 | 1834 |
lemma measurable_ident_sets: |
1835 |
assumes eq: "sets M = sets M'" shows "(\<lambda>x. x) \<in> measurable M M'" |
|
1836 |
using measurable_ident[of M] |
|
1837 |
unfolding id_def measurable_def eq sets_eq_imp_space_eq[OF eq] . |
|
1838 |
||
1839 |
lemma sets_Least: |
|
1840 |
assumes meas: "\<And>i::nat. {x\<in>space M. P i x} \<in> M" |
|
1841 |
shows "(\<lambda>x. LEAST j. P j x) -` A \<inter> space M \<in> sets M" |
|
1842 |
proof - |
|
1843 |
{ fix i have "(\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M \<in> sets M" |
|
1844 |
proof cases |
|
1845 |
assume i: "(LEAST j. False) = i" |
|
1846 |
have "(\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M = |
|
1847 |
{x\<in>space M. P i x} \<inter> (space M - (\<Union>j<i. {x\<in>space M. P j x})) \<union> (space M - (\<Union>i. {x\<in>space M. P i x}))" |
|
1848 |
by (simp add: set_eq_iff, safe) |
|
1849 |
(insert i, auto dest: Least_le intro: LeastI intro!: Least_equality) |
|
1850 |
with meas show ?thesis |
|
1851 |
by (auto intro!: sets.Int) |
|
1852 |
next |
|
1853 |
assume i: "(LEAST j. False) \<noteq> i" |
|
1854 |
then have "(\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M = |
|
1855 |
{x\<in>space M. P i x} \<inter> (space M - (\<Union>j<i. {x\<in>space M. P j x}))" |
|
1856 |
proof (simp add: set_eq_iff, safe) |
|
1857 |
fix x assume neq: "(LEAST j. False) \<noteq> (LEAST j. P j x)" |
|
1858 |
have "\<exists>j. P j x" |
|
1859 |
by (rule ccontr) (insert neq, auto) |
|
1860 |
then show "P (LEAST j. P j x) x" by (rule LeastI_ex) |
|
1861 |
qed (auto dest: Least_le intro!: Least_equality) |
|
1862 |
with meas show ?thesis |
|
1863 |
by auto |
|
1864 |
qed } |
|
1865 |
then have "(\<Union>i\<in>A. (\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M) \<in> sets M" |
|
1866 |
by (intro sets.countable_UN) auto |
|
1867 |
moreover have "(\<Union>i\<in>A. (\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M) = |
|
1868 |
(\<lambda>x. LEAST j. P j x) -` A \<inter> space M" by auto |
|
1869 |
ultimately show ?thesis by auto |
|
1870 |
qed |
|
1871 |
||
1872 |
lemma measurable_mono1: |
|
1873 |
"M' \<subseteq> Pow \<Omega> \<Longrightarrow> M \<subseteq> M' \<Longrightarrow> |
|
1874 |
measurable (measure_of \<Omega> M \<mu>) N \<subseteq> measurable (measure_of \<Omega> M' \<mu>') N" |
|
1875 |
using measure_of_subset[of M' \<Omega> M] by (auto simp add: measurable_def) |
|
1876 |
||
61808 | 1877 |
subsubsection \<open>Counting space\<close> |
56994 | 1878 |
|
67962 | 1879 |
definition%important count_space :: "'a set \<Rightarrow> 'a measure" where |
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1880 |
"count_space \<Omega> = measure_of \<Omega> (Pow \<Omega>) (\<lambda>A. if finite A then of_nat (card A) else \<infinity>)" |
56994 | 1881 |
|
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1882 |
lemma |
56994 | 1883 |
shows space_count_space[simp]: "space (count_space \<Omega>) = \<Omega>" |
1884 |
and sets_count_space[simp]: "sets (count_space \<Omega>) = Pow \<Omega>" |
|
1885 |
using sigma_sets_into_sp[of "Pow \<Omega>" \<Omega>] |
|
1886 |
by (auto simp: count_space_def) |
|
1887 |
||
1888 |
lemma measurable_count_space_eq1[simp]: |
|
1889 |
"f \<in> measurable (count_space A) M \<longleftrightarrow> f \<in> A \<rightarrow> space M" |
|
1890 |
unfolding measurable_def by simp |
|
1891 |
||
59000 | 1892 |
lemma measurable_compose_countable': |
1893 |
assumes f: "\<And>i. i \<in> I \<Longrightarrow> (\<lambda>x. f i x) \<in> measurable M N" |
|
1894 |
and g: "g \<in> measurable M (count_space I)" and I: "countable I" |
|
56994 | 1895 |
shows "(\<lambda>x. f (g x) x) \<in> measurable M N" |
1896 |
unfolding measurable_def |
|
1897 |
proof safe |
|
1898 |
fix x assume "x \<in> space M" then show "f (g x) x \<in> space N" |
|
59000 | 1899 |
using measurable_space[OF f] g[THEN measurable_space] by auto |
56994 | 1900 |
next |
1901 |
fix A assume A: "A \<in> sets N" |
|
59000 | 1902 |
have "(\<lambda>x. f (g x) x) -` A \<inter> space M = (\<Union>i\<in>I. (g -` {i} \<inter> space M) \<inter> (f i -` A \<inter> space M))" |
1903 |
using measurable_space[OF g] by auto |
|
59415 | 1904 |
also have "\<dots> \<in> sets M" |
1905 |
using f[THEN measurable_sets, OF _ A] g[THEN measurable_sets] |
|
1906 |
by (auto intro!: sets.countable_UN' I intro: sets.Int[OF measurable_sets measurable_sets]) |
|
56994 | 1907 |
finally show "(\<lambda>x. f (g x) x) -` A \<inter> space M \<in> sets M" . |
1908 |
qed |
|
1909 |
||
1910 |
lemma measurable_count_space_eq_countable: |
|
1911 |
assumes "countable A" |
|
1912 |
shows "f \<in> measurable M (count_space A) \<longleftrightarrow> (f \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M))" |
|
1913 |
proof - |
|
1914 |
{ fix X assume "X \<subseteq> A" "f \<in> space M \<rightarrow> A" |
|
61808 | 1915 |
with \<open>countable A\<close> have "f -` X \<inter> space M = (\<Union>a\<in>X. f -` {a} \<inter> space M)" "countable X" |
56994 | 1916 |
by (auto dest: countable_subset) |
1917 |
moreover assume "\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M" |
|
1918 |
ultimately have "f -` X \<inter> space M \<in> sets M" |
|
61808 | 1919 |
using \<open>X \<subseteq> A\<close> by (auto intro!: sets.countable_UN' simp del: UN_simps) } |
56994 | 1920 |
then show ?thesis |
1921 |
unfolding measurable_def by auto |
|
1922 |
qed |
|
1923 |
||
59415 | 1924 |
lemma measurable_count_space_eq2: |
1925 |
"finite A \<Longrightarrow> f \<in> measurable M (count_space A) \<longleftrightarrow> (f \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M))" |
|
1926 |
by (intro measurable_count_space_eq_countable countable_finite) |
|
1927 |
||
1928 |
lemma measurable_count_space_eq2_countable: |
|
1929 |
fixes f :: "'a => 'c::countable" |
|
1930 |
shows "f \<in> measurable M (count_space A) \<longleftrightarrow> (f \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M))" |
|
1931 |
by (intro measurable_count_space_eq_countable countableI_type) |
|
1932 |
||
1933 |
lemma measurable_compose_countable: |
|
1934 |
assumes f: "\<And>i::'i::countable. (\<lambda>x. f i x) \<in> measurable M N" and g: "g \<in> measurable M (count_space UNIV)" |
|
1935 |
shows "(\<lambda>x. f (g x) x) \<in> measurable M N" |
|
1936 |
by (rule measurable_compose_countable'[OF assms]) auto |
|
1937 |
||
1938 |
lemma measurable_count_space_const: |
|
1939 |
"(\<lambda>x. c) \<in> measurable M (count_space UNIV)" |
|
1940 |
by (simp add: measurable_const) |
|
1941 |
||
1942 |
lemma measurable_count_space: |
|
1943 |
"f \<in> measurable (count_space A) (count_space UNIV)" |
|
1944 |
by simp |
|
1945 |
||
1946 |
lemma measurable_compose_rev: |
|
1947 |
assumes f: "f \<in> measurable L N" and g: "g \<in> measurable M L" |
|
1948 |
shows "(\<lambda>x. f (g x)) \<in> measurable M N" |
|
1949 |
using measurable_compose[OF g f] . |
|
1950 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
1951 |
lemma measurable_empty_iff: |
58606 | 1952 |
"space N = {} \<Longrightarrow> f \<in> measurable M N \<longleftrightarrow> space M = {}" |
1953 |
by (auto simp add: measurable_def Pi_iff) |
|
1954 |
||
67962 | 1955 |
subsubsection%unimportant \<open>Extend measure\<close> |
56994 | 1956 |
|
1957 |
definition "extend_measure \<Omega> I G \<mu> = |
|
1958 |
(if (\<exists>\<mu>'. (\<forall>i\<in>I. \<mu>' (G i) = \<mu> i) \<and> measure_space \<Omega> (sigma_sets \<Omega> (G`I)) \<mu>') \<and> \<not> (\<forall>i\<in>I. \<mu> i = 0) |
|
1959 |
then measure_of \<Omega> (G`I) (SOME \<mu>'. (\<forall>i\<in>I. \<mu>' (G i) = \<mu> i) \<and> measure_space \<Omega> (sigma_sets \<Omega> (G`I)) \<mu>') |
|
1960 |
else measure_of \<Omega> (G`I) (\<lambda>_. 0))" |
|
1961 |
||
1962 |
lemma space_extend_measure: "G ` I \<subseteq> Pow \<Omega> \<Longrightarrow> space (extend_measure \<Omega> I G \<mu>) = \<Omega>" |
|
1963 |
unfolding extend_measure_def by simp |
|
1964 |
||
1965 |
lemma sets_extend_measure: "G ` I \<subseteq> Pow \<Omega> \<Longrightarrow> sets (extend_measure \<Omega> I G \<mu>) = sigma_sets \<Omega> (G`I)" |
|
1966 |
unfolding extend_measure_def by simp |
|
1967 |
||
1968 |
lemma emeasure_extend_measure: |
|
1969 |
assumes M: "M = extend_measure \<Omega> I G \<mu>" |
|
1970 |
and eq: "\<And>i. i \<in> I \<Longrightarrow> \<mu>' (G i) = \<mu> i" |
|
1971 |
and ms: "G ` I \<subseteq> Pow \<Omega>" "positive (sets M) \<mu>'" "countably_additive (sets M) \<mu>'" |
|
1972 |
and "i \<in> I" |
|
1973 |
shows "emeasure M (G i) = \<mu> i" |
|
1974 |
proof cases |
|
1975 |
assume *: "(\<forall>i\<in>I. \<mu> i = 0)" |
|
1976 |
with M have M_eq: "M = measure_of \<Omega> (G`I) (\<lambda>_. 0)" |
|
1977 |
by (simp add: extend_measure_def) |
|
61808 | 1978 |
from measure_space_0[OF ms(1)] ms \<open>i\<in>I\<close> |
56994 | 1979 |
have "emeasure M (G i) = 0" |
1980 |
by (intro emeasure_measure_of[OF M_eq]) (auto simp add: M measure_space_def sets_extend_measure) |
|
61808 | 1981 |
with \<open>i\<in>I\<close> * show ?thesis |
56994 | 1982 |
by simp |
1983 |
next |
|
63040 | 1984 |
define P where "P \<mu>' \<longleftrightarrow> (\<forall>i\<in>I. \<mu>' (G i) = \<mu> i) \<and> measure_space \<Omega> (sigma_sets \<Omega> (G`I)) \<mu>'" for \<mu>' |
56994 | 1985 |
assume "\<not> (\<forall>i\<in>I. \<mu> i = 0)" |
1986 |
moreover |
|
1987 |
have "measure_space (space M) (sets M) \<mu>'" |
|
61169 | 1988 |
using ms unfolding measure_space_def by auto standard |
56994 | 1989 |
with ms eq have "\<exists>\<mu>'. P \<mu>'" |
1990 |
unfolding P_def |
|
1991 |
by (intro exI[of _ \<mu>']) (auto simp add: M space_extend_measure sets_extend_measure) |
|
1992 |
ultimately have M_eq: "M = measure_of \<Omega> (G`I) (Eps P)" |
|
1993 |
by (simp add: M extend_measure_def P_def[symmetric]) |
|
1994 |
||
61808 | 1995 |
from \<open>\<exists>\<mu>'. P \<mu>'\<close> have P: "P (Eps P)" by (rule someI_ex) |
56994 | 1996 |
show "emeasure M (G i) = \<mu> i" |
1997 |
proof (subst emeasure_measure_of[OF M_eq]) |
|
1998 |
have sets_M: "sets M = sigma_sets \<Omega> (G`I)" |
|
1999 |
using M_eq ms by (auto simp: sets_extend_measure) |
|
61808 | 2000 |
then show "G i \<in> sets M" using \<open>i \<in> I\<close> by auto |
56994 | 2001 |
show "positive (sets M) (Eps P)" "countably_additive (sets M) (Eps P)" "Eps P (G i) = \<mu> i" |
61808 | 2002 |
using P \<open>i\<in>I\<close> by (auto simp add: sets_M measure_space_def P_def) |
56994 | 2003 |
qed fact |
2004 |
qed |
|
2005 |
||
2006 |
lemma emeasure_extend_measure_Pair: |
|
2007 |
assumes M: "M = extend_measure \<Omega> {(i, j). I i j} (\<lambda>(i, j). G i j) (\<lambda>(i, j). \<mu> i j)" |
|
2008 |
and eq: "\<And>i j. I i j \<Longrightarrow> \<mu>' (G i j) = \<mu> i j" |
|
2009 |
and ms: "\<And>i j. I i j \<Longrightarrow> G i j \<in> Pow \<Omega>" "positive (sets M) \<mu>'" "countably_additive (sets M) \<mu>'" |
|
2010 |
and "I i j" |
|
2011 |
shows "emeasure M (G i j) = \<mu> i j" |
|
61808 | 2012 |
using emeasure_extend_measure[OF M _ _ ms(2,3), of "(i,j)"] eq ms(1) \<open>I i j\<close> |
56994 | 2013 |
by (auto simp: subset_eq) |
2014 |
||
61808 | 2015 |
subsection \<open>The smallest $\sigma$-algebra regarding a function\<close> |
56994 | 2016 |
|
67962 | 2017 |
definition%important |
58588 | 2018 |
"vimage_algebra X f M = sigma X {f -` A \<inter> X | A. A \<in> sets M}" |
2019 |
||
2020 |
lemma space_vimage_algebra[simp]: "space (vimage_algebra X f M) = X" |
|
2021 |
unfolding vimage_algebra_def by (rule space_measure_of) auto |
|
56994 | 2022 |
|
58588 | 2023 |
lemma sets_vimage_algebra: "sets (vimage_algebra X f M) = sigma_sets X {f -` A \<inter> X | A. A \<in> sets M}" |
2024 |
unfolding vimage_algebra_def by (rule sets_measure_of) auto |
|
2025 |
||
2026 |
lemma sets_vimage_algebra2: |
|
2027 |
"f \<in> X \<rightarrow> space M \<Longrightarrow> sets (vimage_algebra X f M) = {f -` A \<inter> X | A. A \<in> sets M}" |
|
2028 |
using sigma_sets_vimage_commute[of f X "space M" "sets M"] |
|
2029 |
unfolding sets_vimage_algebra sets.sigma_sets_eq by simp |
|
56994 | 2030 |
|
59092
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2031 |
lemma sets_vimage_algebra_cong: "sets M = sets N \<Longrightarrow> sets (vimage_algebra X f M) = sets (vimage_algebra X f N)" |
59000 | 2032 |
by (simp add: sets_vimage_algebra) |
2033 |
||
59092
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2034 |
lemma vimage_algebra_cong: |
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2035 |
assumes "X = Y" |
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2036 |
assumes "\<And>x. x \<in> Y \<Longrightarrow> f x = g x" |
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2037 |
assumes "sets M = sets N" |
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2038 |
shows "vimage_algebra X f M = vimage_algebra Y g N" |
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2039 |
by (auto simp: vimage_algebra_def assms intro!: arg_cong2[where f=sigma]) |
d469103c0737
add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents:
59088
diff
changeset
|
2040 |
|
58588 | 2041 |
lemma in_vimage_algebra: "A \<in> sets M \<Longrightarrow> f -` A \<inter> X \<in> sets (vimage_algebra X f M)" |
2042 |
by (auto simp: vimage_algebra_def) |
|
2043 |
||
2044 |
lemma sets_image_in_sets: |
|
2045 |
assumes N: "space N = X" |
|
2046 |
assumes f: "f \<in> measurable N M" |
|
2047 |
shows "sets (vimage_algebra X f M) \<subseteq> sets N" |
|
2048 |
unfolding sets_vimage_algebra N[symmetric] |
|
2049 |
by (rule sets.sigma_sets_subset) (auto intro!: measurable_sets f) |
|
2050 |
||
2051 |
lemma measurable_vimage_algebra1: "f \<in> X \<rightarrow> space M \<Longrightarrow> f \<in> measurable (vimage_algebra X f M) M" |
|
2052 |
unfolding measurable_def by (auto intro: in_vimage_algebra) |
|
2053 |
||
2054 |
lemma measurable_vimage_algebra2: |
|
2055 |
assumes g: "g \<in> space N \<rightarrow> X" and f: "(\<lambda>x. f (g x)) \<in> measurable N M" |
|
2056 |
shows "g \<in> measurable N (vimage_algebra X f M)" |
|
2057 |
unfolding vimage_algebra_def |
|
2058 |
proof (rule measurable_measure_of) |
|
2059 |
fix A assume "A \<in> {f -` A \<inter> X | A. A \<in> sets M}" |
|
2060 |
then obtain Y where Y: "Y \<in> sets M" and A: "A = f -` Y \<inter> X" |
|
2061 |
by auto |
|
2062 |
then have "g -` A \<inter> space N = (\<lambda>x. f (g x)) -` Y \<inter> space N" |
|
2063 |
using g by auto |
|
2064 |
also have "\<dots> \<in> sets N" |
|
2065 |
using f Y by (rule measurable_sets) |
|
2066 |
finally show "g -` A \<inter> space N \<in> sets N" . |
|
2067 |
qed (insert g, auto) |
|
56994 | 2068 |
|
59088
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2069 |
lemma vimage_algebra_sigma: |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2070 |
assumes X: "X \<subseteq> Pow \<Omega>'" and f: "f \<in> \<Omega> \<rightarrow> \<Omega>'" |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2071 |
shows "vimage_algebra \<Omega> f (sigma \<Omega>' X) = sigma \<Omega> {f -` A \<inter> \<Omega> | A. A \<in> X }" (is "?V = ?S") |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2072 |
proof (rule measure_eqI) |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2073 |
have \<Omega>: "{f -` A \<inter> \<Omega> |A. A \<in> X} \<subseteq> Pow \<Omega>" by auto |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2074 |
show "sets ?V = sets ?S" |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2075 |
using sigma_sets_vimage_commute[OF f, of X] |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2076 |
by (simp add: space_measure_of_conv f sets_vimage_algebra2 \<Omega> X) |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2077 |
qed (simp add: vimage_algebra_def emeasure_sigma) |
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2078 |
|
59000 | 2079 |
lemma vimage_algebra_vimage_algebra_eq: |
2080 |
assumes *: "f \<in> X \<rightarrow> Y" "g \<in> Y \<rightarrow> space M" |
|
2081 |
shows "vimage_algebra X f (vimage_algebra Y g M) = vimage_algebra X (\<lambda>x. g (f x)) M" |
|
59088
ff2bd4a14ddb
generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents:
59048
diff
changeset
|
2082 |
(is "?VV = ?V") |
59000 | 2083 |
proof (rule measure_eqI) |
2084 |
have "(\<lambda>x. g (f x)) \<in> X \<rightarrow> space M" "\<And>A. A \<inter> f -` Y \<inter> X = A \<inter> X" |
|
2085 |
using * by auto |
|
2086 |
with * show "sets ?VV = sets ?V" |
|
2087 |
by (simp add: sets_vimage_algebra2 ex_simps[symmetric] vimage_comp comp_def del: ex_simps) |
|
2088 |
qed (simp add: vimage_algebra_def emeasure_sigma) |
|
2089 |
||
61808 | 2090 |
subsubsection \<open>Restricted Space Sigma Algebra\<close> |
56994 | 2091 |
|
57025 | 2092 |
definition restrict_space where |
67399 | 2093 |
"restrict_space M \<Omega> = measure_of (\<Omega> \<inter> space M) (((\<inter>) \<Omega>) ` sets M) (emeasure M)" |
56994 | 2094 |
|
57025 | 2095 |
lemma space_restrict_space: "space (restrict_space M \<Omega>) = \<Omega> \<inter> space M" |
2096 |
using sets.sets_into_space unfolding restrict_space_def by (subst space_measure_of) auto |
|
2097 |
||
67982
7643b005b29a
various new results on measures, integrals, etc., and some simplified proofs
paulson <lp15@cam.ac.uk>
parents:
67962
diff
changeset
|
2098 |
lemma space_restrict_space2 [simp]: "\<Omega> \<in> sets M \<Longrightarrow> space (restrict_space M \<Omega>) = \<Omega>" |
57025 | 2099 |
by (simp add: space_restrict_space sets.sets_into_space) |
56994 | 2100 |
|
67399 | 2101 |
lemma sets_restrict_space: "sets (restrict_space M \<Omega>) = ((\<inter>) \<Omega>) ` sets M" |
58588 | 2102 |
unfolding restrict_space_def |
2103 |
proof (subst sets_measure_of) |
|
67399 | 2104 |
show "(\<inter>) \<Omega> ` sets M \<subseteq> Pow (\<Omega> \<inter> space M)" |
58588 | 2105 |
by (auto dest: sets.sets_into_space) |
2106 |
have "sigma_sets (\<Omega> \<inter> space M) {((\<lambda>x. x) -` X) \<inter> (\<Omega> \<inter> space M) | X. X \<in> sets M} = |
|
57025 | 2107 |
(\<lambda>X. X \<inter> (\<Omega> \<inter> space M)) ` sets M" |
58588 | 2108 |
by (subst sigma_sets_vimage_commute[symmetric, where \<Omega>' = "space M"]) |
2109 |
(auto simp add: sets.sigma_sets_eq) |
|
2110 |
moreover have "{((\<lambda>x. x) -` X) \<inter> (\<Omega> \<inter> space M) | X. X \<in> sets M} = (\<lambda>X. X \<inter> (\<Omega> \<inter> space M)) ` sets M" |
|
2111 |
by auto |
|
67399 | 2112 |
moreover have "(\<lambda>X. X \<inter> (\<Omega> \<inter> space M)) ` sets M = ((\<inter>) \<Omega>) ` sets M" |
58588 | 2113 |
by (intro image_cong) (auto dest: sets.sets_into_space) |
67399 | 2114 |
ultimately show "sigma_sets (\<Omega> \<inter> space M) ((\<inter>) \<Omega> ` sets M) = (\<inter>) \<Omega> ` sets M" |
58588 | 2115 |
by simp |
57025 | 2116 |
qed |
56994 | 2117 |
|
62083 | 2118 |
lemma restrict_space_sets_cong: |
2119 |
"A = B \<Longrightarrow> sets M = sets N \<Longrightarrow> sets (restrict_space M A) = sets (restrict_space N B)" |
|
2120 |
by (auto simp: sets_restrict_space) |
|
2121 |
||
60063 | 2122 |
lemma sets_restrict_space_count_space : |
2123 |
"sets (restrict_space (count_space A) B) = sets (count_space (A \<inter> B))" |
|
2124 |
by(auto simp add: sets_restrict_space) |
|
2125 |
||
59361
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents:
59092
diff
changeset
|
2126 |
lemma sets_restrict_UNIV[simp]: "sets (restrict_space M UNIV) = sets M" |
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents:
59092
diff
changeset
|
2127 |
by (auto simp add: sets_restrict_space) |
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents:
59092
diff
changeset
|
2128 |
|
59415 | 2129 |
lemma sets_restrict_restrict_space: |
2130 |
"sets (restrict_space (restrict_space M A) B) = sets (restrict_space M (A \<inter> B))" |
|
2131 |
unfolding sets_restrict_space image_comp by (intro image_cong) auto |
|
2132 |
||
56994 | 2133 |
lemma sets_restrict_space_iff: |
57025 | 2134 |
"\<Omega> \<inter> space M \<in> sets M \<Longrightarrow> A \<in> sets (restrict_space M \<Omega>) \<longleftrightarrow> (A \<subseteq> \<Omega> \<and> A \<in> sets M)" |
2135 |
proof (subst sets_restrict_space, safe) |
|
2136 |
fix A assume "\<Omega> \<inter> space M \<in> sets M" and A: "A \<in> sets M" |
|
2137 |
then have "(\<Omega> \<inter> space M) \<inter> A \<in> sets M" |
|
2138 |
by rule |
|
2139 |
also have "(\<Omega> \<inter> space M) \<inter> A = \<Omega> \<inter> A" |
|
2140 |
using sets.sets_into_space[OF A] by auto |
|
2141 |
finally show "\<Omega> \<inter> A \<in> sets M" |
|
2142 |
by auto |
|
2143 |
qed auto |
|
56994 | 2144 |
|
59000 | 2145 |
lemma sets_restrict_space_cong: "sets M = sets N \<Longrightarrow> sets (restrict_space M \<Omega>) = sets (restrict_space N \<Omega>)" |
2146 |
by (simp add: sets_restrict_space) |
|
2147 |
||
2148 |
lemma restrict_space_eq_vimage_algebra: |
|
2149 |
"\<Omega> \<subseteq> space M \<Longrightarrow> sets (restrict_space M \<Omega>) = sets (vimage_algebra \<Omega> (\<lambda>x. x) M)" |
|
2150 |
unfolding restrict_space_def |
|
2151 |
apply (subst sets_measure_of) |
|
2152 |
apply (auto simp add: image_subset_iff dest: sets.sets_into_space) [] |
|
2153 |
apply (auto simp add: sets_vimage_algebra intro!: arg_cong2[where f=sigma_sets]) |
|
2154 |
done |
|
2155 |
||
62975
1d066f6ab25d
Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents:
62390
diff
changeset
|
2156 |
lemma sets_Collect_restrict_space_iff: |
59000 | 2157 |
assumes "S \<in> sets M" |
2158 |
shows "{x\<in>space (restrict_space M S). P x} \<in> sets (restrict_space M S) \<longleftrightarrow> {x\<in>space M. x \<in> S \<and> P x} \<in> sets M" |
|
2159 |
proof - |
|
2160 |
have "{x\<in>S. P x} = {x\<in>space M. x \<in> S \<and> P x}" |
|
2161 |
using sets.sets_into_space[OF assms] by auto |
|
2162 |
then show ?thesis |
|
2163 |
by (subst sets_restrict_space_iff) (auto simp add: space_restrict_space assms) |
|
2164 |
qed |
|
2165 |
||
56994 | 2166 |
lemma measurable_restrict_space1: |
59415 | 2167 |
assumes f: "f \<in> measurable M N" |
57025 | 2168 |
shows "f \<in> measurable (restrict_space M \<Omega>) N" |
56994 | 2169 |
unfolding measurable_def |
2170 |
proof (intro CollectI conjI ballI) |
|
2171 |
show sp: "f \<in> space (restrict_space M \<Omega>) \<rightarrow> space N" |
|
59415 | 2172 |
using measurable_space[OF f] by (auto simp: space_restrict_space) |
56994 | 2173 |
|
2174 |
fix A assume "A \<in> sets N" |
|
57025 | 2175 |
have "f -` A \<inter> space (restrict_space M \<Omega>) = (f -` A \<inter> space M) \<inter> (\<Omega> \<inter> space M)" |
59415 | 2176 |
by (auto simp: space_restrict_space) |
56994 | 2177 |
also have "\<dots> \<in> sets (restrict_space M \<Omega>)" |
59415 | 2178 |
unfolding sets_restrict_space |
61808 | 2179 |
using measurable_sets[OF f \<open>A \<in> sets N\<close>] by blast |
56994 | 2180 |
finally show "f -` A \<inter> space (restrict_space M \<Omega>) \<in> sets (restrict_space M \<Omega>)" . |
2181 |
qed |
|
2182 |
||
59415 | 2183 |
lemma measurable_restrict_space2_iff: |
2184 |
"f \<in> measurable M (restrict_space N \<Omega>) \<longleftrightarrow> (f \<in> measurable M N \<and> f \<in> space M \<rightarrow> \<Omega>)" |
|
2185 |
proof - |
|
2186 |
have "\<And>A. f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f -` \<Omega> \<inter> f -` A \<inter> space M = f -` A \<inter> space M" |
|
2187 |
by auto |
|
2188 |
then show ?thesis |
|
2189 |
by (auto simp: measurable_def space_restrict_space Pi_Int[symmetric] sets_restrict_space) |
|
2190 |
qed |
|
2191 |
||
56994 | 2192 |
lemma measurable_restrict_space2: |
59415 | 2193 |
"f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f \<in> measurable M N \<Longrightarrow> f \<in> measurable M (restrict_space N \<Omega>)" |
2194 |
by (simp add: measurable_restrict_space2_iff) |
|
56994 | 2195 |
|
59415 | 2196 |
lemma measurable_piecewise_restrict: |
2197 |
assumes I: "countable C" |
|
2198 |
and X: "\<And>\<Omega>. \<Omega> \<in> C \<Longrightarrow> \<Omega> \<inter> space M \<in> sets M" "space M \<subseteq> \<Union>C" |
|
2199 |
and f: "\<And>\<Omega>. \<Omega> \<in> C \<Longrightarrow> f \<in> measurable (restrict_space M \<Omega>) N" |
|
2200 |
shows "f \<in> measurable M N" |
|
2201 |
proof (rule measurableI) |
|
2202 |
fix x assume "x \<in> space M" |
|
2203 |
with X obtain \<Omega> where "\<Omega> \<in> C" "x \<in> \<Omega>" "x \<in> space M" by auto |
|
2204 |
then show "f x \<in> space N" |
|
2205 |
by (auto simp: space_restrict_space intro: f measurable_space) |
|
57138
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents:
57137
diff
changeset
|
2206 |
next |
59415 | 2207 |
fix A assume A: "A \<in> sets N" |
2208 |
have "f -` A \<inter> space M = (\<Union>\<Omega>\<in>C. (f -` A \<inter> (\<Omega> \<inter> space M)))" |
|
2209 |
using X by (auto simp: subset_eq) |
|
57138
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents:
57137
diff
changeset
|
2210 |
also have "\<dots> \<in> sets M" |
59415 | 2211 |
using measurable_sets[OF f A] X I |
2212 |
by (intro sets.countable_UN') (auto simp: sets_restrict_space_iff space_restrict_space) |
|
2213 |
finally show "f -` A \<inter> space M \<in> sets M" . |
|
57138
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents:
57137
diff
changeset
|
2214 |
qed |
7b3146180291
generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents:
57137
diff
changeset
|
2215 |
|
59415 | 2216 |
lemma measurable_piecewise_restrict_iff: |
2217 |
"countable C \<Longrightarrow> (\<And>\<Omega>. \<Omega> \<in> C \<Longrightarrow> \<Omega> \<inter> space M \<in> sets M) \<Longrightarrow> space M \<subseteq> (\<Union>C) \<Longrightarrow> |
|
2218 |
f \<in> measurable M N \<longleftrightarrow> (\<forall>\<Omega>\<in>C. f \<in> measurable (restrict_space M \<Omega>) N)" |
|
2219 |
by (auto intro: measurable_piecewise_restrict measurable_restrict_space1) |
|
2220 |
||
2221 |
lemma measurable_If_restrict_space_iff: |
|
2222 |
"{x\<in>space M. P x} \<in> sets M \<Longrightarrow> |
|
2223 |
(\<lambda>x. if P x then f x else g x) \<in> measurable M N \<longleftrightarrow> |
|
2224 |
(f \<in> measurable (restrict_space M {x. P x}) N \<and> g \<in> measurable (restrict_space M {x. \<not> P x}) N)" |
|
2225 |
by (subst measurable_piecewise_restrict_iff[where C="{{x. P x}, {x. \<not> P x}}"]) |
|
2226 |
(auto simp: Int_def sets.sets_Collect_neg space_restrict_space conj_commute[of _ "x \<in> space M" for x] |
|
2227 |
cong: measurable_cong') |
|
2228 |
||
2229 |
lemma measurable_If: |
|
2230 |
"f \<in> measurable M M' \<Longrightarrow> g \<in> measurable M M' \<Longrightarrow> {x\<in>space M. P x} \<in> sets M \<Longrightarrow> |
|
2231 |
(\<lambda>x. if P x then f x else g x) \<in> measurable M M'" |
|
2232 |
unfolding measurable_If_restrict_space_iff by (auto intro: measurable_restrict_space1) |
|
2233 |
||
2234 |
lemma measurable_If_set: |
|
2235 |
assumes measure: "f \<in> measurable M M'" "g \<in> measurable M M'" |
|
2236 |
assumes P: "A \<inter> space M \<in> sets M" |
|
2237 |
shows "(\<lambda>x. if x \<in> A then f x else g x) \<in> measurable M M'" |
|
2238 |
proof (rule measurable_If[OF measure]) |
|
2239 |
have "{x \<in> space M. x \<in> A} = A \<inter> space M" by auto |
|
61808 | 2240 |
thus "{x \<in> space M. x \<in> A} \<in> sets M" using \<open>A \<inter> space M \<in> sets M\<close> by auto |
59415 | 2241 |
qed |
59361
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents:
59092
diff
changeset
|
2242 |
|
59415 | 2243 |
lemma measurable_restrict_space_iff: |
2244 |
"\<Omega> \<inter> space M \<in> sets M \<Longrightarrow> c \<in> space N \<Longrightarrow> |
|
2245 |
f \<in> measurable (restrict_space M \<Omega>) N \<longleftrightarrow> (\<lambda>x. if x \<in> \<Omega> then f x else c) \<in> measurable M N" |
|
2246 |
by (subst measurable_If_restrict_space_iff) |
|
2247 |
(simp_all add: Int_def conj_commute measurable_const) |
|
2248 |
||
2249 |
lemma restrict_space_singleton: "{x} \<in> sets M \<Longrightarrow> sets (restrict_space M {x}) = sets (count_space {x})" |
|
2250 |
using sets_restrict_space_iff[of "{x}" M] |
|
2251 |
by (auto simp add: sets_restrict_space_iff dest!: subset_singletonD) |
|
2252 |
||
2253 |
lemma measurable_restrict_countable: |
|
2254 |
assumes X[intro]: "countable X" |
|
2255 |
assumes sets[simp]: "\<And>x. x \<in> X \<Longrightarrow> {x} \<in> sets M" |
|
2256 |
assumes space[simp]: "\<And>x. x \<in> X \<Longrightarrow> f x \<in> space N" |
|
2257 |
assumes f: "f \<in> measurable (restrict_space M (- X)) N" |
|
2258 |
shows "f \<in> measurable M N" |
|
2259 |
using f sets.countable[OF sets X] |
|
2260 |
by (intro measurable_piecewise_restrict[where M=M and C="{- X} \<union> ((\<lambda>x. {x}) ` X)"]) |
|
2261 |
(auto simp: Diff_Int_distrib2 Compl_eq_Diff_UNIV Int_insert_left sets.Diff restrict_space_singleton |
|
2262 |
simp del: sets_count_space cong: measurable_cong_sets) |
|
2263 |
||
2264 |
lemma measurable_discrete_difference: |
|
2265 |
assumes f: "f \<in> measurable M N" |
|
2266 |
assumes X: "countable X" "\<And>x. x \<in> X \<Longrightarrow> {x} \<in> sets M" "\<And>x. x \<in> X \<Longrightarrow> g x \<in> space N" |
|
2267 |
assumes eq: "\<And>x. x \<in> space M \<Longrightarrow> x \<notin> X \<Longrightarrow> f x = g x" |
|
2268 |
shows "g \<in> measurable M N" |
|
2269 |
by (rule measurable_restrict_countable[OF X]) |
|
2270 |
(auto simp: eq[symmetric] space_restrict_space cong: measurable_cong' intro: f measurable_restrict_space1) |
|
59361
fd5da2434be4
piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents:
59092
diff
changeset
|
2271 |
|
64008
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
2272 |
lemma measurable_count_space_extend: "A \<subseteq> B \<Longrightarrow> f \<in> space M \<rightarrow> A \<Longrightarrow> f \<in> M \<rightarrow>\<^sub>M count_space B \<Longrightarrow> f \<in> M \<rightarrow>\<^sub>M count_space A" |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
2273 |
by (auto simp: measurable_def) |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63627
diff
changeset
|
2274 |
|
33271
7be66dee1a5a
New theory Probability, which contains a development of measure theory
paulson
parents:
diff
changeset
|
2275 |
end |