| author | hellerar | 
| Thu, 02 Sep 2010 15:31:38 +0200 | |
| changeset 39094 | 67da17aced5a | 
| parent 38656 | d5d342611edb | 
| child 39090 | a2d38b8b693e | 
| permissions | -rw-r--r-- | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
1  | 
(* Title: Sigma_Algebra.thy  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
2  | 
Author: Stefan Richter, Markus Wenzel, TU Muenchen  | 
| 38656 | 3  | 
Plus material from the Hurd/Coble measure theory development,  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
4  | 
translated by Lawrence Paulson.  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
5  | 
*)  | 
| 
 
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  | 
header {* Sigma Algebras *}
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
8  | 
|
| 38656 | 9  | 
theory Sigma_Algebra imports Main Countable FuncSet begin  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
10  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
11  | 
text {* Sigma algebras are an elementary concept in measure
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
12  | 
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
 | 
13  | 
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
 | 
14  | 
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
 | 
15  | 
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
 | 
16  | 
subsets of the universe. A sigma algebra is such a set that has  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
17  | 
three very natural and desirable properties. *}  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
18  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
19  | 
subsection {* Algebras *}
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
20  | 
|
| 38656 | 21  | 
record 'a algebra =  | 
22  | 
space :: "'a set"  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
23  | 
sets :: "'a set set"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
24  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
25  | 
locale algebra =  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
26  | 
fixes M  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
27  | 
assumes space_closed: "sets M \<subseteq> Pow (space M)"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
28  | 
     and  empty_sets [iff]: "{} \<in> sets M"
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
29  | 
and compl_sets [intro]: "!!a. a \<in> sets M \<Longrightarrow> space M - a \<in> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
30  | 
and Un [intro]: "!!a b. a \<in> sets M \<Longrightarrow> b \<in> sets M \<Longrightarrow> a \<union> b \<in> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
31  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
32  | 
lemma (in algebra) top [iff]: "space M \<in> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
33  | 
by (metis Diff_empty compl_sets empty_sets)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
34  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
35  | 
lemma (in algebra) sets_into_space: "x \<in> sets M \<Longrightarrow> x \<subseteq> space M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
36  | 
by (metis PowD contra_subsetD space_closed)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
37  | 
|
| 38656 | 38  | 
lemma (in algebra) Int [intro]:  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
39  | 
assumes a: "a \<in> sets M" and b: "b \<in> sets M" shows "a \<inter> b \<in> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
40  | 
proof -  | 
| 38656 | 41  | 
have "((space M - a) \<union> (space M - b)) \<in> sets M"  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
42  | 
by (metis a b compl_sets Un)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
43  | 
moreover  | 
| 38656 | 44  | 
have "a \<inter> b = space M - ((space M - a) \<union> (space M - b))"  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
45  | 
using space_closed a b  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
46  | 
by blast  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
47  | 
ultimately show ?thesis  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
48  | 
by (metis compl_sets)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
49  | 
qed  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
50  | 
|
| 38656 | 51  | 
lemma (in algebra) Diff [intro]:  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
52  | 
assumes a: "a \<in> sets M" and b: "b \<in> sets M" shows "a - b \<in> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
53  | 
proof -  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
54  | 
have "(a \<inter> (space M - b)) \<in> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
55  | 
by (metis a b compl_sets Int)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
56  | 
moreover  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
57  | 
have "a - b = (a \<inter> (space M - b))"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
58  | 
by (metis Int_Diff Int_absorb1 Int_commute a sets_into_space)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
59  | 
ultimately show ?thesis  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
60  | 
by metis  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
61  | 
qed  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
62  | 
|
| 38656 | 63  | 
lemma (in algebra) finite_union [intro]:  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
64  | 
"finite X \<Longrightarrow> X \<subseteq> sets M \<Longrightarrow> Union X \<in> sets M"  | 
| 38656 | 65  | 
by (induct set: finite) (auto simp add: Un)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
66  | 
|
| 38656 | 67  | 
lemma algebra_iff_Int:  | 
68  | 
"algebra M \<longleftrightarrow>  | 
|
69  | 
       sets M \<subseteq> Pow (space M) & {} \<in> sets M &
 | 
|
70  | 
(\<forall>a \<in> sets M. space M - a \<in> sets M) &  | 
|
71  | 
(\<forall>a \<in> sets M. \<forall> b \<in> sets M. a \<inter> b \<in> sets M)"  | 
|
72  | 
proof (auto simp add: algebra.Int, auto simp add: algebra_def)  | 
|
73  | 
fix a b  | 
|
74  | 
assume ab: "sets M \<subseteq> Pow (space M)"  | 
|
75  | 
"\<forall>a\<in>sets M. space M - a \<in> sets M"  | 
|
76  | 
"\<forall>a\<in>sets M. \<forall>b\<in>sets M. a \<inter> b \<in> sets M"  | 
|
77  | 
"a \<in> sets M" "b \<in> sets M"  | 
|
78  | 
hence "a \<union> b = space M - ((space M - a) \<inter> (space M - b))"  | 
|
79  | 
by blast  | 
|
80  | 
also have "... \<in> sets M"  | 
|
81  | 
by (metis ab)  | 
|
82  | 
finally show "a \<union> b \<in> sets M" .  | 
|
83  | 
qed  | 
|
84  | 
||
85  | 
lemma (in algebra) insert_in_sets:  | 
|
86  | 
  assumes "{x} \<in> sets M" "A \<in> sets M" shows "insert x A \<in> sets M"
 | 
|
87  | 
proof -  | 
|
88  | 
  have "{x} \<union> A \<in> sets M" using assms by (rule Un)
 | 
|
89  | 
thus ?thesis by auto  | 
|
90  | 
qed  | 
|
91  | 
||
92  | 
lemma (in algebra) Int_space_eq1 [simp]: "x \<in> sets M \<Longrightarrow> space M \<inter> x = x"  | 
|
93  | 
by (metis Int_absorb1 sets_into_space)  | 
|
94  | 
||
95  | 
lemma (in algebra) Int_space_eq2 [simp]: "x \<in> sets M \<Longrightarrow> x \<inter> space M = x"  | 
|
96  | 
by (metis Int_absorb2 sets_into_space)  | 
|
97  | 
||
98  | 
lemma (in algebra) restricted_algebra:  | 
|
99  | 
assumes "S \<in> sets M"  | 
|
100  | 
shows "algebra (M\<lparr> space := S, sets := (\<lambda>A. S \<inter> A) ` sets M \<rparr>)"  | 
|
101  | 
(is "algebra ?r")  | 
|
102  | 
using assms by unfold_locales auto  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
103  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
104  | 
subsection {* Sigma Algebras *}
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
105  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
106  | 
locale sigma_algebra = algebra +  | 
| 38656 | 107  | 
assumes countable_nat_UN [intro]:  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
108  | 
"!!A. range A \<subseteq> sets M \<Longrightarrow> (\<Union>i::nat. A i) \<in> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
109  | 
|
| 38656 | 110  | 
lemma countable_UN_eq:  | 
111  | 
fixes A :: "'i::countable \<Rightarrow> 'a set"  | 
|
112  | 
shows "(range A \<subseteq> sets M \<longrightarrow> (\<Union>i. A i) \<in> sets M) \<longleftrightarrow>  | 
|
113  | 
(range (A \<circ> from_nat) \<subseteq> sets M \<longrightarrow> (\<Union>i. (A \<circ> from_nat) i) \<in> sets M)"  | 
|
114  | 
proof -  | 
|
115  | 
let ?A' = "A \<circ> from_nat"  | 
|
116  | 
have *: "(\<Union>i. ?A' i) = (\<Union>i. A i)" (is "?l = ?r")  | 
|
117  | 
proof safe  | 
|
118  | 
fix x i assume "x \<in> A i" thus "x \<in> ?l"  | 
|
119  | 
by (auto intro!: exI[of _ "to_nat i"])  | 
|
120  | 
next  | 
|
121  | 
fix x i assume "x \<in> ?A' i" thus "x \<in> ?r"  | 
|
122  | 
by (auto intro!: exI[of _ "from_nat i"])  | 
|
123  | 
qed  | 
|
124  | 
have **: "range ?A' = range A"  | 
|
125  | 
using surj_range[OF surj_from_nat]  | 
|
126  | 
by (auto simp: image_compose intro!: imageI)  | 
|
127  | 
show ?thesis unfolding * ** ..  | 
|
128  | 
qed  | 
|
129  | 
||
130  | 
lemma (in sigma_algebra) countable_UN[intro]:  | 
|
131  | 
fixes A :: "'i::countable \<Rightarrow> 'a set"  | 
|
132  | 
assumes "A`X \<subseteq> sets M"  | 
|
133  | 
shows "(\<Union>x\<in>X. A x) \<in> sets M"  | 
|
134  | 
proof -  | 
|
135  | 
  let "?A i" = "if i \<in> X then A i else {}"
 | 
|
136  | 
from assms have "range ?A \<subseteq> sets M" by auto  | 
|
137  | 
with countable_nat_UN[of "?A \<circ> from_nat"] countable_UN_eq[of ?A M]  | 
|
138  | 
have "(\<Union>x. ?A x) \<in> sets M" by auto  | 
|
139  | 
moreover have "(\<Union>x. ?A x) = (\<Union>x\<in>X. A x)" by (auto split: split_if_asm)  | 
|
140  | 
ultimately show ?thesis by simp  | 
|
141  | 
qed  | 
|
142  | 
||
143  | 
lemma (in sigma_algebra) finite_UN:  | 
|
144  | 
assumes "finite I" and "\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets M"  | 
|
145  | 
shows "(\<Union>i\<in>I. A i) \<in> sets M"  | 
|
146  | 
using assms by induct auto  | 
|
147  | 
||
| 
33533
 
40b44cb20c8c
New theory Probability/Borel.thy, and some associated lemmas
 
paulson 
parents: 
33271 
diff
changeset
 | 
148  | 
lemma (in sigma_algebra) countable_INT [intro]:  | 
| 38656 | 149  | 
fixes A :: "'i::countable \<Rightarrow> 'a set"  | 
150  | 
  assumes A: "A`X \<subseteq> sets M" "X \<noteq> {}"
 | 
|
151  | 
shows "(\<Inter>i\<in>X. A i) \<in> sets M"  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
152  | 
proof -  | 
| 38656 | 153  | 
from A have "\<forall>i\<in>X. A i \<in> sets M" by fast  | 
154  | 
hence "space M - (\<Union>i\<in>X. space M - A i) \<in> sets M" by blast  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
155  | 
moreover  | 
| 38656 | 156  | 
have "(\<Inter>i\<in>X. A i) = space M - (\<Union>i\<in>X. space M - A i)" using space_closed A  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
157  | 
by blast  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
158  | 
ultimately show ?thesis by metis  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
159  | 
qed  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
160  | 
|
| 38656 | 161  | 
lemma (in sigma_algebra) finite_INT:  | 
162  | 
  assumes "finite I" "I \<noteq> {}" "\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets M"
 | 
|
163  | 
shows "(\<Inter>i\<in>I. A i) \<in> sets M"  | 
|
164  | 
using assms by (induct rule: finite_ne_induct) auto  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
165  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
166  | 
lemma algebra_Pow:  | 
| 38656 | 167  | 
"algebra \<lparr> space = sp, sets = Pow sp, \<dots> = X \<rparr>"  | 
168  | 
by (auto simp add: algebra_def)  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
169  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
170  | 
lemma sigma_algebra_Pow:  | 
| 38656 | 171  | 
"sigma_algebra \<lparr> space = sp, sets = Pow sp, \<dots> = X \<rparr>"  | 
172  | 
by (auto simp add: sigma_algebra_def sigma_algebra_axioms_def algebra_Pow)  | 
|
173  | 
||
174  | 
lemma sigma_algebra_iff:  | 
|
175  | 
"sigma_algebra M \<longleftrightarrow>  | 
|
176  | 
algebra M \<and> (\<forall>A. range A \<subseteq> sets M \<longrightarrow> (\<Union>i::nat. A i) \<in> sets M)"  | 
|
177  | 
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
 | 
178  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
179  | 
subsection {* Binary Unions *}
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
180  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
181  | 
definition binary :: "'a \<Rightarrow> 'a \<Rightarrow> nat \<Rightarrow> 'a"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
182  | 
where "binary a b = (\<lambda>\<^isup>x. b)(0 := a)"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
183  | 
|
| 38656 | 184  | 
lemma range_binary_eq: "range(binary a b) = {a,b}"
 | 
185  | 
by (auto simp add: binary_def)  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
186  | 
|
| 38656 | 187  | 
lemma Un_range_binary: "a \<union> b = (\<Union>i::nat. binary a b i)"  | 
188  | 
by (simp add: UNION_eq_Union_image range_binary_eq)  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
189  | 
|
| 38656 | 190  | 
lemma Int_range_binary: "a \<inter> b = (\<Inter>i::nat. binary a b i)"  | 
191  | 
by (simp add: INTER_eq_Inter_image range_binary_eq)  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
192  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
193  | 
lemma sigma_algebra_iff2:  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
194  | 
"sigma_algebra M \<longleftrightarrow>  | 
| 38656 | 195  | 
sets M \<subseteq> Pow (space M) \<and>  | 
196  | 
       {} \<in> sets M \<and> (\<forall>s \<in> sets M. space M - s \<in> sets M) \<and>
 | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
197  | 
(\<forall>A. range A \<subseteq> sets M \<longrightarrow> (\<Union>i::nat. A i) \<in> sets M)"  | 
| 38656 | 198  | 
by (auto simp add: range_binary_eq sigma_algebra_def sigma_algebra_axioms_def  | 
199  | 
algebra_def Un_range_binary)  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
200  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
201  | 
subsection {* Initial Sigma Algebra *}
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
202  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
203  | 
text {*Sigma algebras can naturally be created as the closure of any set of
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
204  | 
sets with regard to the properties just postulated. *}  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
205  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
206  | 
inductive_set  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
207  | 
sigma_sets :: "'a set \<Rightarrow> 'a set set \<Rightarrow> 'a set set"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
208  | 
for sp :: "'a set" and A :: "'a set set"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
209  | 
where  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
210  | 
Basic: "a \<in> A \<Longrightarrow> a \<in> sigma_sets sp A"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
211  | 
  | Empty: "{} \<in> sigma_sets sp A"
 | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
212  | 
| 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
 | 
213  | 
| 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
 | 
214  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
215  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
216  | 
definition  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
217  | 
sigma where  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
218  | 
"sigma sp A = (| space = sp, sets = sigma_sets sp A |)"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
219  | 
|
| 38656 | 220  | 
lemma sets_sigma: "sets (sigma A B) = sigma_sets A B"  | 
221  | 
unfolding sigma_def by simp  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
222  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
223  | 
lemma space_sigma [simp]: "space (sigma X B) = X"  | 
| 38656 | 224  | 
by (simp add: sigma_def)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
225  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
226  | 
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
 | 
227  | 
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
 | 
228  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
229  | 
lemma sigma_sets_into_sp: "A \<subseteq> Pow sp \<Longrightarrow> x \<in> sigma_sets sp A \<Longrightarrow> x \<subseteq> sp"  | 
| 38656 | 230  | 
by (erule sigma_sets.induct, auto)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
231  | 
|
| 38656 | 232  | 
lemma sigma_sets_Un:  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
233  | 
"a \<in> sigma_sets sp A \<Longrightarrow> b \<in> sigma_sets sp A \<Longrightarrow> a \<union> b \<in> sigma_sets sp A"  | 
| 38656 | 234  | 
apply (simp add: Un_range_binary range_binary_eq)  | 
| 37032 | 235  | 
apply (rule Union, simp add: binary_def COMBK_def fun_upd_apply)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
236  | 
done  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
237  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
238  | 
lemma sigma_sets_Inter:  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
239  | 
assumes Asb: "A \<subseteq> Pow sp"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
240  | 
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
 | 
241  | 
proof -  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
242  | 
assume ai: "\<And>i::nat. a i \<in> sigma_sets sp A"  | 
| 38656 | 243  | 
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
 | 
244  | 
by (rule sigma_sets.Compl)  | 
| 38656 | 245  | 
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
 | 
246  | 
by (rule sigma_sets.Union)  | 
| 38656 | 247  | 
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
 | 
248  | 
by (rule sigma_sets.Compl)  | 
| 38656 | 249  | 
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
 | 
250  | 
by auto  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
251  | 
also have "... = (\<Inter>i. a i)" using ai  | 
| 38656 | 252  | 
by (blast dest: sigma_sets_into_sp [OF Asb])  | 
253  | 
finally show ?thesis .  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
254  | 
qed  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
255  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
256  | 
lemma sigma_sets_INTER:  | 
| 38656 | 257  | 
assumes Asb: "A \<subseteq> Pow sp"  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
258  | 
      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
 | 
259  | 
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
 | 
260  | 
proof -  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
261  | 
from ai have "\<And>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
 | 
262  | 
by (simp add: sigma_sets.intros sigma_sets_top)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
263  | 
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
 | 
264  | 
by (rule sigma_sets_Inter [OF Asb])  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
265  | 
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
 | 
266  | 
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
 | 
267  | 
finally show ?thesis .  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
268  | 
qed  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
269  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
270  | 
lemma (in sigma_algebra) sigma_sets_subset:  | 
| 38656 | 271  | 
assumes a: "a \<subseteq> sets M"  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
272  | 
shows "sigma_sets (space M) a \<subseteq> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
273  | 
proof  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
274  | 
fix x  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
275  | 
assume "x \<in> sigma_sets (space M) a"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
276  | 
from this show "x \<in> sets M"  | 
| 38656 | 277  | 
by (induct rule: sigma_sets.induct, auto) (metis a subsetD)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
278  | 
qed  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
279  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
280  | 
lemma (in sigma_algebra) sigma_sets_eq:  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
281  | 
"sigma_sets (space M) (sets M) = sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
282  | 
proof  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
283  | 
show "sets M \<subseteq> sigma_sets (space M) (sets M)"  | 
| 37032 | 284  | 
by (metis Set.subsetI sigma_sets.Basic)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
285  | 
next  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
286  | 
show "sigma_sets (space M) (sets M) \<subseteq> sets M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
287  | 
by (metis sigma_sets_subset subset_refl)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
288  | 
qed  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
289  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
290  | 
lemma sigma_algebra_sigma_sets:  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
291  | 
"a \<subseteq> Pow (space M) \<Longrightarrow> sets M = sigma_sets (space M) a \<Longrightarrow> sigma_algebra M"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
292  | 
apply (auto simp add: sigma_algebra_def sigma_algebra_axioms_def  | 
| 38656 | 293  | 
algebra_def sigma_sets.Empty sigma_sets.Compl sigma_sets_Un)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
294  | 
apply (blast dest: sigma_sets_into_sp)  | 
| 37032 | 295  | 
apply (rule sigma_sets.Union, fast)  | 
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
296  | 
done  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
297  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
298  | 
lemma sigma_algebra_sigma:  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
299  | 
"a \<subseteq> Pow X \<Longrightarrow> sigma_algebra (sigma X a)"  | 
| 38656 | 300  | 
apply (rule sigma_algebra_sigma_sets)  | 
301  | 
apply (auto simp add: sigma_def)  | 
|
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
302  | 
done  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
303  | 
|
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
304  | 
lemma (in sigma_algebra) sigma_subset:  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
305  | 
"a \<subseteq> sets M ==> sets (sigma (space M) a) \<subseteq> (sets M)"  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
306  | 
by (simp add: sigma_def sigma_sets_subset)  | 
| 
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
307  | 
|
| 38656 | 308  | 
lemma (in sigma_algebra) restriction_in_sets:  | 
309  | 
fixes A :: "nat \<Rightarrow> 'a set"  | 
|
310  | 
assumes "S \<in> sets M"  | 
|
311  | 
and *: "range A \<subseteq> (\<lambda>A. S \<inter> A) ` sets M" (is "_ \<subseteq> ?r")  | 
|
312  | 
shows "range A \<subseteq> sets M" "(\<Union>i. A i) \<in> (\<lambda>A. S \<inter> A) ` sets M"  | 
|
313  | 
proof -  | 
|
314  | 
  { fix i have "A i \<in> ?r" using * by auto
 | 
|
315  | 
hence "\<exists>B. A i = B \<inter> S \<and> B \<in> sets M" by auto  | 
|
316  | 
hence "A i \<subseteq> S" "A i \<in> sets M" using `S \<in> sets M` by auto }  | 
|
317  | 
thus "range A \<subseteq> sets M" "(\<Union>i. A i) \<in> (\<lambda>A. S \<inter> A) ` sets M"  | 
|
318  | 
by (auto intro!: image_eqI[of _ _ "(\<Union>i. A i)"])  | 
|
319  | 
qed  | 
|
320  | 
||
321  | 
lemma (in sigma_algebra) restricted_sigma_algebra:  | 
|
322  | 
assumes "S \<in> sets M"  | 
|
323  | 
shows "sigma_algebra (M\<lparr> space := S, sets := (\<lambda>A. S \<inter> A) ` sets M \<rparr>)"  | 
|
324  | 
(is "sigma_algebra ?r")  | 
|
325  | 
unfolding sigma_algebra_def sigma_algebra_axioms_def  | 
|
326  | 
proof safe  | 
|
327  | 
show "algebra ?r" using restricted_algebra[OF assms] .  | 
|
328  | 
next  | 
|
329  | 
fix A :: "nat \<Rightarrow> 'a set" assume "range A \<subseteq> sets ?r"  | 
|
330  | 
from restriction_in_sets[OF assms this[simplified]]  | 
|
331  | 
show "(\<Union>i. A i) \<in> sets ?r" by simp  | 
|
332  | 
qed  | 
|
333  | 
||
334  | 
section {* Measurable functions *}
 | 
|
335  | 
||
336  | 
definition  | 
|
337  | 
  "measurable A B = {f \<in> space A -> space B. \<forall>y \<in> sets B. f -` y \<inter> space A \<in> sets A}"
 | 
|
338  | 
||
339  | 
lemma (in sigma_algebra) measurable_sigma:  | 
|
340  | 
assumes B: "B \<subseteq> Pow X"  | 
|
341  | 
and f: "f \<in> space M -> X"  | 
|
342  | 
and ba: "\<And>y. y \<in> B \<Longrightarrow> (f -` y) \<inter> space M \<in> sets M"  | 
|
343  | 
shows "f \<in> measurable M (sigma X B)"  | 
|
344  | 
proof -  | 
|
345  | 
  have "sigma_sets X B \<subseteq> {y . (f -` y) \<inter> space M \<in> sets M & y \<subseteq> X}"
 | 
|
346  | 
proof clarify  | 
|
347  | 
fix x  | 
|
348  | 
assume "x \<in> sigma_sets X B"  | 
|
349  | 
thus "f -` x \<inter> space M \<in> sets M \<and> x \<subseteq> X"  | 
|
350  | 
proof induct  | 
|
351  | 
case (Basic a)  | 
|
352  | 
thus ?case  | 
|
353  | 
by (auto simp add: ba) (metis B subsetD PowD)  | 
|
354  | 
next  | 
|
355  | 
case Empty  | 
|
356  | 
thus ?case  | 
|
357  | 
by auto  | 
|
358  | 
next  | 
|
359  | 
case (Compl a)  | 
|
360  | 
have [simp]: "f -` X \<inter> space M = space M"  | 
|
361  | 
by (auto simp add: funcset_mem [OF f])  | 
|
362  | 
thus ?case  | 
|
363  | 
by (auto simp add: vimage_Diff Diff_Int_distrib2 compl_sets Compl)  | 
|
364  | 
next  | 
|
365  | 
case (Union a)  | 
|
366  | 
thus ?case  | 
|
367  | 
by (simp add: vimage_UN, simp only: UN_extend_simps(4))  | 
|
368  | 
(blast intro: countable_UN)  | 
|
369  | 
qed  | 
|
370  | 
qed  | 
|
371  | 
thus ?thesis  | 
|
372  | 
by (simp add: measurable_def sigma_algebra_axioms sigma_algebra_sigma B f)  | 
|
373  | 
(auto simp add: sigma_def)  | 
|
374  | 
qed  | 
|
375  | 
||
376  | 
lemma measurable_cong:  | 
|
377  | 
assumes "\<And> w. w \<in> space M \<Longrightarrow> f w = g w"  | 
|
378  | 
shows "f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable M M'"  | 
|
379  | 
unfolding measurable_def using assms  | 
|
380  | 
by (simp cong: vimage_inter_cong Pi_cong)  | 
|
381  | 
||
382  | 
lemma measurable_space:  | 
|
383  | 
"f \<in> measurable M A \<Longrightarrow> x \<in> space M \<Longrightarrow> f x \<in> space A"  | 
|
384  | 
unfolding measurable_def by auto  | 
|
385  | 
||
386  | 
lemma measurable_sets:  | 
|
387  | 
"f \<in> measurable M A \<Longrightarrow> S \<in> sets A \<Longrightarrow> f -` S \<inter> space M \<in> sets M"  | 
|
388  | 
unfolding measurable_def by auto  | 
|
389  | 
||
390  | 
lemma (in sigma_algebra) measurable_subset:  | 
|
391  | 
"(\<And>S. S \<in> sets A \<Longrightarrow> S \<subseteq> space A) \<Longrightarrow> measurable M A \<subseteq> measurable M (sigma (space A) (sets A))"  | 
|
392  | 
by (auto intro: measurable_sigma measurable_sets measurable_space)  | 
|
393  | 
||
394  | 
lemma measurable_eqI:  | 
|
395  | 
"\<lbrakk> space m1 = space m1' ; space m2 = space m2' ;  | 
|
396  | 
sets m1 = sets m1' ; sets m2 = sets m2' \<rbrakk>  | 
|
397  | 
\<Longrightarrow> measurable m1 m2 = measurable m1' m2'"  | 
|
398  | 
by (simp add: measurable_def sigma_algebra_iff2)  | 
|
399  | 
||
400  | 
lemma (in sigma_algebra) measurable_const[intro, simp]:  | 
|
401  | 
assumes "c \<in> space M'"  | 
|
402  | 
shows "(\<lambda>x. c) \<in> measurable M M'"  | 
|
403  | 
using assms by (auto simp add: measurable_def)  | 
|
404  | 
||
405  | 
lemma (in sigma_algebra) measurable_If:  | 
|
406  | 
assumes measure: "f \<in> measurable M M'" "g \<in> measurable M M'"  | 
|
407  | 
  assumes P: "{x\<in>space M. P x} \<in> sets M"
 | 
|
408  | 
shows "(\<lambda>x. if P x then f x else g x) \<in> measurable M M'"  | 
|
409  | 
unfolding measurable_def  | 
|
410  | 
proof safe  | 
|
411  | 
fix x assume "x \<in> space M"  | 
|
412  | 
thus "(if P x then f x else g x) \<in> space M'"  | 
|
413  | 
using measure unfolding measurable_def by auto  | 
|
414  | 
next  | 
|
415  | 
fix A assume "A \<in> sets M'"  | 
|
416  | 
hence *: "(\<lambda>x. if P x then f x else g x) -` A \<inter> space M =  | 
|
417  | 
    ((f -` A \<inter> space M) \<inter> {x\<in>space M. P x}) \<union>
 | 
|
418  | 
    ((g -` A \<inter> space M) \<inter> (space M - {x\<in>space M. P x}))"
 | 
|
419  | 
using measure unfolding measurable_def by (auto split: split_if_asm)  | 
|
420  | 
show "(\<lambda>x. if P x then f x else g x) -` A \<inter> space M \<in> sets M"  | 
|
421  | 
using `A \<in> sets M'` measure P unfolding * measurable_def  | 
|
422  | 
by (auto intro!: Un)  | 
|
423  | 
qed  | 
|
424  | 
||
425  | 
lemma (in sigma_algebra) measurable_If_set:  | 
|
426  | 
assumes measure: "f \<in> measurable M M'" "g \<in> measurable M M'"  | 
|
427  | 
assumes P: "A \<in> sets M"  | 
|
428  | 
shows "(\<lambda>x. if x \<in> A then f x else g x) \<in> measurable M M'"  | 
|
429  | 
proof (rule measurable_If[OF measure])  | 
|
430  | 
  have "{x \<in> space M. x \<in> A} = A" using `A \<in> sets M` sets_into_space by auto
 | 
|
431  | 
  thus "{x \<in> space M. x \<in> A} \<in> sets M" using `A \<in> sets M` by auto
 | 
|
432  | 
qed  | 
|
433  | 
||
434  | 
lemma (in algebra) measurable_ident[intro, simp]: "id \<in> measurable M M"  | 
|
435  | 
by (auto simp add: measurable_def)  | 
|
436  | 
||
437  | 
lemma measurable_comp[intro]:  | 
|
438  | 
fixes f :: "'a \<Rightarrow> 'b" and g :: "'b \<Rightarrow> 'c"  | 
|
439  | 
shows "f \<in> measurable a b \<Longrightarrow> g \<in> measurable b c \<Longrightarrow> (g o f) \<in> measurable a c"  | 
|
440  | 
apply (auto simp add: measurable_def vimage_compose)  | 
|
441  | 
apply (subgoal_tac "f -` g -` y \<inter> space a = f -` (g -` y \<inter> space b) \<inter> space a")  | 
|
442  | 
apply force+  | 
|
443  | 
done  | 
|
444  | 
||
445  | 
lemma measurable_strong:  | 
|
446  | 
fixes f :: "'a \<Rightarrow> 'b" and g :: "'b \<Rightarrow> 'c"  | 
|
447  | 
assumes f: "f \<in> measurable a b" and g: "g \<in> (space b -> space c)"  | 
|
448  | 
and a: "sigma_algebra a" and b: "sigma_algebra b" and c: "sigma_algebra c"  | 
|
449  | 
and t: "f ` (space a) \<subseteq> t"  | 
|
450  | 
and cb: "\<And>s. s \<in> sets c \<Longrightarrow> (g -` s) \<inter> t \<in> sets b"  | 
|
451  | 
shows "(g o f) \<in> measurable a c"  | 
|
452  | 
proof -  | 
|
453  | 
have fab: "f \<in> (space a -> space b)"  | 
|
454  | 
and ba: "\<And>y. y \<in> sets b \<Longrightarrow> (f -` y) \<inter> (space a) \<in> sets a" using f  | 
|
455  | 
by (auto simp add: measurable_def)  | 
|
456  | 
have eq: "f -` g -` y \<inter> space a = f -` (g -` y \<inter> t) \<inter> space a" using t  | 
|
457  | 
by force  | 
|
458  | 
show ?thesis  | 
|
459  | 
apply (auto simp add: measurable_def vimage_compose a c)  | 
|
460  | 
apply (metis funcset_mem fab g)  | 
|
461  | 
apply (subst eq, metis ba cb)  | 
|
462  | 
done  | 
|
463  | 
qed  | 
|
464  | 
||
465  | 
lemma measurable_mono1:  | 
|
466  | 
"a \<subseteq> b \<Longrightarrow> sigma_algebra \<lparr>space = X, sets = b\<rparr>  | 
|
467  | 
\<Longrightarrow> measurable \<lparr>space = X, sets = a\<rparr> c \<subseteq> measurable \<lparr>space = X, sets = b\<rparr> c"  | 
|
468  | 
by (auto simp add: measurable_def)  | 
|
469  | 
||
470  | 
lemma measurable_up_sigma:  | 
|
471  | 
"measurable A M \<subseteq> measurable (sigma (space A) (sets A)) M"  | 
|
472  | 
unfolding measurable_def  | 
|
473  | 
by (auto simp: sigma_def intro: sigma_sets.Basic)  | 
|
474  | 
||
475  | 
lemma (in sigma_algebra) measurable_range_reduce:  | 
|
476  | 
   "\<lbrakk> f \<in> measurable M \<lparr>space = s, sets = Pow s\<rparr> ; s \<noteq> {} \<rbrakk>
 | 
|
477  | 
\<Longrightarrow> f \<in> measurable M \<lparr>space = s \<inter> (f ` space M), sets = Pow (s \<inter> (f ` space M))\<rparr>"  | 
|
478  | 
by (simp add: measurable_def sigma_algebra_Pow del: Pow_Int_eq) blast  | 
|
479  | 
||
480  | 
lemma (in sigma_algebra) measurable_Pow_to_Pow:  | 
|
481  | 
"(sets M = Pow (space M)) \<Longrightarrow> f \<in> measurable M \<lparr>space = UNIV, sets = Pow UNIV\<rparr>"  | 
|
482  | 
by (auto simp add: measurable_def sigma_algebra_def sigma_algebra_axioms_def algebra_def)  | 
|
483  | 
||
484  | 
lemma (in sigma_algebra) measurable_Pow_to_Pow_image:  | 
|
485  | 
"sets M = Pow (space M)  | 
|
486  | 
\<Longrightarrow> f \<in> measurable M \<lparr>space = f ` space M, sets = Pow (f ` space M)\<rparr>"  | 
|
487  | 
by (simp add: measurable_def sigma_algebra_Pow) intro_locales  | 
|
488  | 
||
489  | 
lemma (in sigma_algebra) sigma_algebra_preimages:  | 
|
490  | 
fixes f :: "'x \<Rightarrow> 'a"  | 
|
491  | 
assumes "f \<in> A \<rightarrow> space M"  | 
|
492  | 
shows "sigma_algebra \<lparr> space = A, sets = (\<lambda>M. f -` M \<inter> A) ` sets M \<rparr>"  | 
|
493  | 
(is "sigma_algebra \<lparr> space = _, sets = ?F ` sets M \<rparr>")  | 
|
494  | 
proof (simp add: sigma_algebra_iff2, safe)  | 
|
495  | 
  show "{} \<in> ?F ` sets M" by blast
 | 
|
496  | 
next  | 
|
497  | 
fix S assume "S \<in> sets M"  | 
|
498  | 
moreover have "A - ?F S = ?F (space M - S)"  | 
|
499  | 
using assms by auto  | 
|
500  | 
ultimately show "A - ?F S \<in> ?F ` sets M"  | 
|
501  | 
by blast  | 
|
502  | 
next  | 
|
503  | 
fix S :: "nat \<Rightarrow> 'x set" assume *: "range S \<subseteq> ?F ` sets M"  | 
|
504  | 
have "\<forall>i. \<exists>b. b \<in> sets M \<and> S i = ?F b"  | 
|
505  | 
proof safe  | 
|
506  | 
fix i  | 
|
507  | 
have "S i \<in> ?F ` sets M" using * by auto  | 
|
508  | 
then show "\<exists>b. b \<in> sets M \<and> S i = ?F b" by auto  | 
|
509  | 
qed  | 
|
510  | 
from choice[OF this] obtain b where b: "range b \<subseteq> sets M" "\<And>i. S i = ?F (b i)"  | 
|
511  | 
by auto  | 
|
512  | 
then have "(\<Union>i. S i) = ?F (\<Union>i. b i)" by auto  | 
|
513  | 
then show "(\<Union>i. S i) \<in> ?F ` sets M" using b(1) by blast  | 
|
514  | 
qed  | 
|
515  | 
||
516  | 
section "Disjoint families"  | 
|
517  | 
||
518  | 
definition  | 
|
519  | 
disjoint_family_on where  | 
|
520  | 
  "disjoint_family_on A S \<longleftrightarrow> (\<forall>m\<in>S. \<forall>n\<in>S. m \<noteq> n \<longrightarrow> A m \<inter> A n = {})"
 | 
|
521  | 
||
522  | 
abbreviation  | 
|
523  | 
"disjoint_family A \<equiv> disjoint_family_on A UNIV"  | 
|
524  | 
||
525  | 
lemma range_subsetD: "range f \<subseteq> B \<Longrightarrow> f i \<in> B"  | 
|
526  | 
by blast  | 
|
527  | 
||
528  | 
lemma Int_Diff_disjoint: "A \<inter> B \<inter> (A - B) = {}"
 | 
|
529  | 
by blast  | 
|
530  | 
||
531  | 
lemma Int_Diff_Un: "A \<inter> B \<union> (A - B) = A"  | 
|
532  | 
by blast  | 
|
533  | 
||
534  | 
lemma disjoint_family_subset:  | 
|
535  | 
"disjoint_family A \<Longrightarrow> (!!x. B x \<subseteq> A x) \<Longrightarrow> disjoint_family B"  | 
|
536  | 
by (force simp add: disjoint_family_on_def)  | 
|
537  | 
||
538  | 
lemma disjoint_family_on_mono:  | 
|
539  | 
"A \<subseteq> B \<Longrightarrow> disjoint_family_on f B \<Longrightarrow> disjoint_family_on f A"  | 
|
540  | 
unfolding disjoint_family_on_def by auto  | 
|
541  | 
||
542  | 
lemma disjoint_family_Suc:  | 
|
543  | 
assumes Suc: "!!n. A n \<subseteq> A (Suc n)"  | 
|
544  | 
shows "disjoint_family (\<lambda>i. A (Suc i) - A i)"  | 
|
545  | 
proof -  | 
|
546  | 
  {
 | 
|
547  | 
fix m  | 
|
548  | 
have "!!n. A n \<subseteq> A (m+n)"  | 
|
549  | 
proof (induct m)  | 
|
550  | 
case 0 show ?case by simp  | 
|
551  | 
next  | 
|
552  | 
case (Suc m) thus ?case  | 
|
553  | 
by (metis Suc_eq_plus1 assms nat_add_commute nat_add_left_commute subset_trans)  | 
|
554  | 
qed  | 
|
555  | 
}  | 
|
556  | 
hence "!!m n. m < n \<Longrightarrow> A m \<subseteq> A n"  | 
|
557  | 
by (metis add_commute le_add_diff_inverse nat_less_le)  | 
|
558  | 
thus ?thesis  | 
|
559  | 
by (auto simp add: disjoint_family_on_def)  | 
|
560  | 
(metis insert_absorb insert_subset le_SucE le_antisym not_leE)  | 
|
561  | 
qed  | 
|
562  | 
||
563  | 
definition disjointed :: "(nat \<Rightarrow> 'a set) \<Rightarrow> nat \<Rightarrow> 'a set "  | 
|
564  | 
  where "disjointed A n = A n - (\<Union>i\<in>{0..<n}. A i)"
 | 
|
565  | 
||
566  | 
lemma finite_UN_disjointed_eq: "(\<Union>i\<in>{0..<n}. disjointed A i) = (\<Union>i\<in>{0..<n}. A i)"
 | 
|
567  | 
proof (induct n)  | 
|
568  | 
case 0 show ?case by simp  | 
|
569  | 
next  | 
|
570  | 
case (Suc n)  | 
|
571  | 
thus ?case by (simp add: atLeastLessThanSuc disjointed_def)  | 
|
572  | 
qed  | 
|
573  | 
||
574  | 
lemma UN_disjointed_eq: "(\<Union>i. disjointed A i) = (\<Union>i. A i)"  | 
|
575  | 
apply (rule UN_finite2_eq [where k=0])  | 
|
576  | 
apply (simp add: finite_UN_disjointed_eq)  | 
|
577  | 
done  | 
|
578  | 
||
579  | 
lemma less_disjoint_disjointed: "m<n \<Longrightarrow> disjointed A m \<inter> disjointed A n = {}"
 | 
|
580  | 
by (auto simp add: disjointed_def)  | 
|
581  | 
||
582  | 
lemma disjoint_family_disjointed: "disjoint_family (disjointed A)"  | 
|
583  | 
by (simp add: disjoint_family_on_def)  | 
|
584  | 
(metis neq_iff Int_commute less_disjoint_disjointed)  | 
|
585  | 
||
586  | 
lemma disjointed_subset: "disjointed A n \<subseteq> A n"  | 
|
587  | 
by (auto simp add: disjointed_def)  | 
|
588  | 
||
589  | 
lemma (in algebra) UNION_in_sets:  | 
|
590  | 
fixes A:: "nat \<Rightarrow> 'a set"  | 
|
591  | 
assumes A: "range A \<subseteq> sets M "  | 
|
592  | 
  shows  "(\<Union>i\<in>{0..<n}. A i) \<in> sets M"
 | 
|
593  | 
proof (induct n)  | 
|
594  | 
case 0 show ?case by simp  | 
|
595  | 
next  | 
|
596  | 
case (Suc n)  | 
|
597  | 
thus ?case  | 
|
598  | 
by (simp add: atLeastLessThanSuc) (metis A Un UNIV_I image_subset_iff)  | 
|
599  | 
qed  | 
|
600  | 
||
601  | 
lemma (in algebra) range_disjointed_sets:  | 
|
602  | 
assumes A: "range A \<subseteq> sets M "  | 
|
603  | 
shows "range (disjointed A) \<subseteq> sets M"  | 
|
604  | 
proof (auto simp add: disjointed_def)  | 
|
605  | 
fix n  | 
|
606  | 
  show "A n - (\<Union>i\<in>{0..<n}. A i) \<in> sets M" using UNION_in_sets
 | 
|
607  | 
by (metis A Diff UNIV_I image_subset_iff)  | 
|
608  | 
qed  | 
|
609  | 
||
610  | 
lemma sigma_algebra_disjoint_iff:  | 
|
611  | 
"sigma_algebra M \<longleftrightarrow>  | 
|
612  | 
algebra M &  | 
|
613  | 
(\<forall>A. range A \<subseteq> sets M \<longrightarrow> disjoint_family A \<longrightarrow>  | 
|
614  | 
(\<Union>i::nat. A i) \<in> sets M)"  | 
|
615  | 
proof (auto simp add: sigma_algebra_iff)  | 
|
616  | 
fix A :: "nat \<Rightarrow> 'a set"  | 
|
617  | 
assume M: "algebra M"  | 
|
618  | 
and A: "range A \<subseteq> sets M"  | 
|
619  | 
and UnA: "\<forall>A. range A \<subseteq> sets M \<longrightarrow>  | 
|
620  | 
disjoint_family A \<longrightarrow> (\<Union>i::nat. A i) \<in> sets M"  | 
|
621  | 
hence "range (disjointed A) \<subseteq> sets M \<longrightarrow>  | 
|
622  | 
disjoint_family (disjointed A) \<longrightarrow>  | 
|
623  | 
(\<Union>i. disjointed A i) \<in> sets M" by blast  | 
|
624  | 
hence "(\<Union>i. disjointed A i) \<in> sets M"  | 
|
625  | 
by (simp add: algebra.range_disjointed_sets M A disjoint_family_disjointed)  | 
|
626  | 
thus "(\<Union>i::nat. A i) \<in> sets M" by (simp add: UN_disjointed_eq)  | 
|
627  | 
qed  | 
|
628  | 
||
629  | 
subsection {* A Two-Element Series *}
 | 
|
630  | 
||
631  | 
definition binaryset :: "'a set \<Rightarrow> 'a set \<Rightarrow> nat \<Rightarrow> 'a set "  | 
|
632  | 
  where "binaryset A B = (\<lambda>\<^isup>x. {})(0 := A, Suc 0 := B)"
 | 
|
633  | 
||
634  | 
lemma range_binaryset_eq: "range(binaryset A B) = {A,B,{}}"
 | 
|
635  | 
apply (simp add: binaryset_def)  | 
|
636  | 
apply (rule set_ext)  | 
|
637  | 
apply (auto simp add: image_iff)  | 
|
638  | 
done  | 
|
639  | 
||
640  | 
lemma UN_binaryset_eq: "(\<Union>i. binaryset A B i) = A \<union> B"  | 
|
641  | 
by (simp add: UNION_eq_Union_image range_binaryset_eq)  | 
|
642  | 
||
643  | 
section {* Closed CDI *}
 | 
|
644  | 
||
645  | 
definition  | 
|
646  | 
closed_cdi where  | 
|
647  | 
"closed_cdi M \<longleftrightarrow>  | 
|
648  | 
sets M \<subseteq> Pow (space M) &  | 
|
649  | 
(\<forall>s \<in> sets M. space M - s \<in> sets M) &  | 
|
650  | 
   (\<forall>A. (range A \<subseteq> sets M) & (A 0 = {}) & (\<forall>n. A n \<subseteq> A (Suc n)) \<longrightarrow>
 | 
|
651  | 
(\<Union>i. A i) \<in> sets M) &  | 
|
652  | 
(\<forall>A. (range A \<subseteq> sets M) & disjoint_family A \<longrightarrow> (\<Union>i::nat. A i) \<in> sets M)"  | 
|
653  | 
||
654  | 
||
655  | 
inductive_set  | 
|
656  | 
  smallest_ccdi_sets :: "('a, 'b) algebra_scheme \<Rightarrow> 'a set set"
 | 
|
657  | 
for M  | 
|
658  | 
where  | 
|
659  | 
Basic [intro]:  | 
|
660  | 
"a \<in> sets M \<Longrightarrow> a \<in> smallest_ccdi_sets M"  | 
|
661  | 
| Compl [intro]:  | 
|
662  | 
"a \<in> smallest_ccdi_sets M \<Longrightarrow> space M - a \<in> smallest_ccdi_sets M"  | 
|
663  | 
| Inc:  | 
|
664  | 
      "range A \<in> Pow(smallest_ccdi_sets M) \<Longrightarrow> A 0 = {} \<Longrightarrow> (\<And>n. A n \<subseteq> A (Suc n))
 | 
|
665  | 
\<Longrightarrow> (\<Union>i. A i) \<in> smallest_ccdi_sets M"  | 
|
666  | 
| Disj:  | 
|
667  | 
"range A \<in> Pow(smallest_ccdi_sets M) \<Longrightarrow> disjoint_family A  | 
|
668  | 
\<Longrightarrow> (\<Union>i::nat. A i) \<in> smallest_ccdi_sets M"  | 
|
669  | 
monos Pow_mono  | 
|
670  | 
||
671  | 
||
672  | 
definition  | 
|
673  | 
smallest_closed_cdi where  | 
|
674  | 
"smallest_closed_cdi M = (|space = space M, sets = smallest_ccdi_sets M|)"  | 
|
675  | 
||
676  | 
lemma space_smallest_closed_cdi [simp]:  | 
|
677  | 
"space (smallest_closed_cdi M) = space M"  | 
|
678  | 
by (simp add: smallest_closed_cdi_def)  | 
|
679  | 
||
680  | 
lemma (in algebra) smallest_closed_cdi1: "sets M \<subseteq> sets (smallest_closed_cdi M)"  | 
|
681  | 
by (auto simp add: smallest_closed_cdi_def)  | 
|
682  | 
||
683  | 
lemma (in algebra) smallest_ccdi_sets:  | 
|
684  | 
"smallest_ccdi_sets M \<subseteq> Pow (space M)"  | 
|
685  | 
apply (rule subsetI)  | 
|
686  | 
apply (erule smallest_ccdi_sets.induct)  | 
|
687  | 
apply (auto intro: range_subsetD dest: sets_into_space)  | 
|
688  | 
done  | 
|
689  | 
||
690  | 
lemma (in algebra) smallest_closed_cdi2: "closed_cdi (smallest_closed_cdi M)"  | 
|
691  | 
apply (auto simp add: closed_cdi_def smallest_closed_cdi_def smallest_ccdi_sets)  | 
|
692  | 
apply (blast intro: smallest_ccdi_sets.Inc smallest_ccdi_sets.Disj) +  | 
|
693  | 
done  | 
|
694  | 
||
695  | 
lemma (in algebra) smallest_closed_cdi3:  | 
|
696  | 
"sets (smallest_closed_cdi M) \<subseteq> Pow (space M)"  | 
|
697  | 
by (simp add: smallest_closed_cdi_def smallest_ccdi_sets)  | 
|
698  | 
||
699  | 
lemma closed_cdi_subset: "closed_cdi M \<Longrightarrow> sets M \<subseteq> Pow (space M)"  | 
|
700  | 
by (simp add: closed_cdi_def)  | 
|
701  | 
||
702  | 
lemma closed_cdi_Compl: "closed_cdi M \<Longrightarrow> s \<in> sets M \<Longrightarrow> space M - s \<in> sets M"  | 
|
703  | 
by (simp add: closed_cdi_def)  | 
|
704  | 
||
705  | 
lemma closed_cdi_Inc:  | 
|
706  | 
     "closed_cdi M \<Longrightarrow> range A \<subseteq> sets M \<Longrightarrow> A 0 = {} \<Longrightarrow> (!!n. A n \<subseteq> A (Suc n)) \<Longrightarrow>
 | 
|
707  | 
(\<Union>i. A i) \<in> sets M"  | 
|
708  | 
by (simp add: closed_cdi_def)  | 
|
709  | 
||
710  | 
lemma closed_cdi_Disj:  | 
|
711  | 
"closed_cdi M \<Longrightarrow> range A \<subseteq> sets M \<Longrightarrow> disjoint_family A \<Longrightarrow> (\<Union>i::nat. A i) \<in> sets M"  | 
|
712  | 
by (simp add: closed_cdi_def)  | 
|
713  | 
||
714  | 
lemma closed_cdi_Un:  | 
|
715  | 
  assumes cdi: "closed_cdi M" and empty: "{} \<in> sets M"
 | 
|
716  | 
and A: "A \<in> sets M" and B: "B \<in> sets M"  | 
|
717  | 
      and disj: "A \<inter> B = {}"
 | 
|
718  | 
shows "A \<union> B \<in> sets M"  | 
|
719  | 
proof -  | 
|
720  | 
have ra: "range (binaryset A B) \<subseteq> sets M"  | 
|
721  | 
by (simp add: range_binaryset_eq empty A B)  | 
|
722  | 
have di: "disjoint_family (binaryset A B)" using disj  | 
|
723  | 
by (simp add: disjoint_family_on_def binaryset_def Int_commute)  | 
|
724  | 
from closed_cdi_Disj [OF cdi ra di]  | 
|
725  | 
show ?thesis  | 
|
726  | 
by (simp add: UN_binaryset_eq)  | 
|
727  | 
qed  | 
|
728  | 
||
729  | 
lemma (in algebra) smallest_ccdi_sets_Un:  | 
|
730  | 
assumes A: "A \<in> smallest_ccdi_sets M" and B: "B \<in> smallest_ccdi_sets M"  | 
|
731  | 
      and disj: "A \<inter> B = {}"
 | 
|
732  | 
shows "A \<union> B \<in> smallest_ccdi_sets M"  | 
|
733  | 
proof -  | 
|
734  | 
have ra: "range (binaryset A B) \<in> Pow (smallest_ccdi_sets M)"  | 
|
735  | 
by (simp add: range_binaryset_eq A B smallest_ccdi_sets.Basic)  | 
|
736  | 
have di: "disjoint_family (binaryset A B)" using disj  | 
|
737  | 
by (simp add: disjoint_family_on_def binaryset_def Int_commute)  | 
|
738  | 
from Disj [OF ra di]  | 
|
739  | 
show ?thesis  | 
|
740  | 
by (simp add: UN_binaryset_eq)  | 
|
741  | 
qed  | 
|
742  | 
||
743  | 
lemma (in algebra) smallest_ccdi_sets_Int1:  | 
|
744  | 
assumes a: "a \<in> sets M"  | 
|
745  | 
shows "b \<in> smallest_ccdi_sets M \<Longrightarrow> a \<inter> b \<in> smallest_ccdi_sets M"  | 
|
746  | 
proof (induct rule: smallest_ccdi_sets.induct)  | 
|
747  | 
case (Basic x)  | 
|
748  | 
thus ?case  | 
|
749  | 
by (metis a Int smallest_ccdi_sets.Basic)  | 
|
750  | 
next  | 
|
751  | 
case (Compl x)  | 
|
752  | 
have "a \<inter> (space M - x) = space M - ((space M - a) \<union> (a \<inter> x))"  | 
|
753  | 
by blast  | 
|
754  | 
also have "... \<in> smallest_ccdi_sets M"  | 
|
755  | 
by (metis smallest_ccdi_sets.Compl a Compl(2) Diff_Int2 Diff_Int_distrib2  | 
|
756  | 
Diff_disjoint Int_Diff Int_empty_right Un_commute  | 
|
757  | 
smallest_ccdi_sets.Basic smallest_ccdi_sets.Compl  | 
|
758  | 
smallest_ccdi_sets_Un)  | 
|
759  | 
finally show ?case .  | 
|
760  | 
next  | 
|
761  | 
case (Inc A)  | 
|
762  | 
have 1: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) = a \<inter> (\<Union>i. A i)"  | 
|
763  | 
by blast  | 
|
764  | 
have "range (\<lambda>i. a \<inter> A i) \<in> Pow(smallest_ccdi_sets M)" using Inc  | 
|
765  | 
by blast  | 
|
766  | 
  moreover have "(\<lambda>i. a \<inter> A i) 0 = {}"
 | 
|
767  | 
by (simp add: Inc)  | 
|
768  | 
moreover have "!!n. (\<lambda>i. a \<inter> A i) n \<subseteq> (\<lambda>i. a \<inter> A i) (Suc n)" using Inc  | 
|
769  | 
by blast  | 
|
770  | 
ultimately have 2: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) \<in> smallest_ccdi_sets M"  | 
|
771  | 
by (rule smallest_ccdi_sets.Inc)  | 
|
772  | 
show ?case  | 
|
773  | 
by (metis 1 2)  | 
|
774  | 
next  | 
|
775  | 
case (Disj A)  | 
|
776  | 
have 1: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) = a \<inter> (\<Union>i. A i)"  | 
|
777  | 
by blast  | 
|
778  | 
have "range (\<lambda>i. a \<inter> A i) \<in> Pow(smallest_ccdi_sets M)" using Disj  | 
|
779  | 
by blast  | 
|
780  | 
moreover have "disjoint_family (\<lambda>i. a \<inter> A i)" using Disj  | 
|
781  | 
by (auto simp add: disjoint_family_on_def)  | 
|
782  | 
ultimately have 2: "(\<Union>i. (\<lambda>i. a \<inter> A i) i) \<in> smallest_ccdi_sets M"  | 
|
783  | 
by (rule smallest_ccdi_sets.Disj)  | 
|
784  | 
show ?case  | 
|
785  | 
by (metis 1 2)  | 
|
786  | 
qed  | 
|
787  | 
||
788  | 
||
789  | 
lemma (in algebra) smallest_ccdi_sets_Int:  | 
|
790  | 
assumes b: "b \<in> smallest_ccdi_sets M"  | 
|
791  | 
shows "a \<in> smallest_ccdi_sets M \<Longrightarrow> a \<inter> b \<in> smallest_ccdi_sets M"  | 
|
792  | 
proof (induct rule: smallest_ccdi_sets.induct)  | 
|
793  | 
case (Basic x)  | 
|
794  | 
thus ?case  | 
|
795  | 
by (metis b smallest_ccdi_sets_Int1)  | 
|
796  | 
next  | 
|
797  | 
case (Compl x)  | 
|
798  | 
have "(space M - x) \<inter> b = space M - (x \<inter> b \<union> (space M - b))"  | 
|
799  | 
by blast  | 
|
800  | 
also have "... \<in> smallest_ccdi_sets M"  | 
|
801  | 
by (metis Compl(2) Diff_disjoint Int_Diff Int_commute Int_empty_right b  | 
|
802  | 
smallest_ccdi_sets.Compl smallest_ccdi_sets_Un)  | 
|
803  | 
finally show ?case .  | 
|
804  | 
next  | 
|
805  | 
case (Inc A)  | 
|
806  | 
have 1: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) = (\<Union>i. A i) \<inter> b"  | 
|
807  | 
by blast  | 
|
808  | 
have "range (\<lambda>i. A i \<inter> b) \<in> Pow(smallest_ccdi_sets M)" using Inc  | 
|
809  | 
by blast  | 
|
810  | 
  moreover have "(\<lambda>i. A i \<inter> b) 0 = {}"
 | 
|
811  | 
by (simp add: Inc)  | 
|
812  | 
moreover have "!!n. (\<lambda>i. A i \<inter> b) n \<subseteq> (\<lambda>i. A i \<inter> b) (Suc n)" using Inc  | 
|
813  | 
by blast  | 
|
814  | 
ultimately have 2: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) \<in> smallest_ccdi_sets M"  | 
|
815  | 
by (rule smallest_ccdi_sets.Inc)  | 
|
816  | 
show ?case  | 
|
817  | 
by (metis 1 2)  | 
|
818  | 
next  | 
|
819  | 
case (Disj A)  | 
|
820  | 
have 1: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) = (\<Union>i. A i) \<inter> b"  | 
|
821  | 
by blast  | 
|
822  | 
have "range (\<lambda>i. A i \<inter> b) \<in> Pow(smallest_ccdi_sets M)" using Disj  | 
|
823  | 
by blast  | 
|
824  | 
moreover have "disjoint_family (\<lambda>i. A i \<inter> b)" using Disj  | 
|
825  | 
by (auto simp add: disjoint_family_on_def)  | 
|
826  | 
ultimately have 2: "(\<Union>i. (\<lambda>i. A i \<inter> b) i) \<in> smallest_ccdi_sets M"  | 
|
827  | 
by (rule smallest_ccdi_sets.Disj)  | 
|
828  | 
show ?case  | 
|
829  | 
by (metis 1 2)  | 
|
830  | 
qed  | 
|
831  | 
||
832  | 
lemma (in algebra) sets_smallest_closed_cdi_Int:  | 
|
833  | 
"a \<in> sets (smallest_closed_cdi M) \<Longrightarrow> b \<in> sets (smallest_closed_cdi M)  | 
|
834  | 
\<Longrightarrow> a \<inter> b \<in> sets (smallest_closed_cdi M)"  | 
|
835  | 
by (simp add: smallest_ccdi_sets_Int smallest_closed_cdi_def)  | 
|
836  | 
||
837  | 
lemma (in algebra) sigma_property_disjoint_lemma:  | 
|
838  | 
assumes sbC: "sets M \<subseteq> C"  | 
|
839  | 
and ccdi: "closed_cdi (|space = space M, sets = C|)"  | 
|
840  | 
shows "sigma_sets (space M) (sets M) \<subseteq> C"  | 
|
841  | 
proof -  | 
|
842  | 
  have "smallest_ccdi_sets M \<in> {B . sets M \<subseteq> B \<and> sigma_algebra (|space = space M, sets = B|)}"
 | 
|
843  | 
apply (auto simp add: sigma_algebra_disjoint_iff algebra_iff_Int  | 
|
844  | 
smallest_ccdi_sets_Int)  | 
|
845  | 
apply (metis Union_Pow_eq Union_upper subsetD smallest_ccdi_sets)  | 
|
846  | 
apply (blast intro: smallest_ccdi_sets.Disj)  | 
|
847  | 
done  | 
|
848  | 
hence "sigma_sets (space M) (sets M) \<subseteq> smallest_ccdi_sets M"  | 
|
849  | 
by clarsimp  | 
|
850  | 
(drule sigma_algebra.sigma_sets_subset [where a="sets M"], auto)  | 
|
851  | 
also have "... \<subseteq> C"  | 
|
852  | 
proof  | 
|
853  | 
fix x  | 
|
854  | 
assume x: "x \<in> smallest_ccdi_sets M"  | 
|
855  | 
thus "x \<in> C"  | 
|
856  | 
proof (induct rule: smallest_ccdi_sets.induct)  | 
|
857  | 
case (Basic x)  | 
|
858  | 
thus ?case  | 
|
859  | 
by (metis Basic subsetD sbC)  | 
|
860  | 
next  | 
|
861  | 
case (Compl x)  | 
|
862  | 
thus ?case  | 
|
863  | 
by (blast intro: closed_cdi_Compl [OF ccdi, simplified])  | 
|
864  | 
next  | 
|
865  | 
case (Inc A)  | 
|
866  | 
thus ?case  | 
|
867  | 
by (auto intro: closed_cdi_Inc [OF ccdi, simplified])  | 
|
868  | 
next  | 
|
869  | 
case (Disj A)  | 
|
870  | 
thus ?case  | 
|
871  | 
by (auto intro: closed_cdi_Disj [OF ccdi, simplified])  | 
|
872  | 
qed  | 
|
873  | 
qed  | 
|
874  | 
finally show ?thesis .  | 
|
875  | 
qed  | 
|
876  | 
||
877  | 
lemma (in algebra) sigma_property_disjoint:  | 
|
878  | 
assumes sbC: "sets M \<subseteq> C"  | 
|
879  | 
and compl: "!!s. s \<in> C \<inter> sigma_sets (space M) (sets M) \<Longrightarrow> space M - s \<in> C"  | 
|
880  | 
and inc: "!!A. range A \<subseteq> C \<inter> sigma_sets (space M) (sets M)  | 
|
881  | 
                     \<Longrightarrow> A 0 = {} \<Longrightarrow> (!!n. A n \<subseteq> A (Suc n))
 | 
|
882  | 
\<Longrightarrow> (\<Union>i. A i) \<in> C"  | 
|
883  | 
and disj: "!!A. range A \<subseteq> C \<inter> sigma_sets (space M) (sets M)  | 
|
884  | 
\<Longrightarrow> disjoint_family A \<Longrightarrow> (\<Union>i::nat. A i) \<in> C"  | 
|
885  | 
shows "sigma_sets (space M) (sets M) \<subseteq> C"  | 
|
886  | 
proof -  | 
|
887  | 
have "sigma_sets (space M) (sets M) \<subseteq> C \<inter> sigma_sets (space M) (sets M)"  | 
|
888  | 
proof (rule sigma_property_disjoint_lemma)  | 
|
889  | 
show "sets M \<subseteq> C \<inter> sigma_sets (space M) (sets M)"  | 
|
890  | 
by (metis Int_greatest Set.subsetI sbC sigma_sets.Basic)  | 
|
891  | 
next  | 
|
892  | 
show "closed_cdi \<lparr>space = space M, sets = C \<inter> sigma_sets (space M) (sets M)\<rparr>"  | 
|
893  | 
by (simp add: closed_cdi_def compl inc disj)  | 
|
894  | 
(metis PowI Set.subsetI le_infI2 sigma_sets_into_sp space_closed  | 
|
895  | 
IntE sigma_sets.Compl range_subsetD sigma_sets.Union)  | 
|
896  | 
qed  | 
|
897  | 
thus ?thesis  | 
|
898  | 
by blast  | 
|
899  | 
qed  | 
|
900  | 
||
| 
33271
 
7be66dee1a5a
New theory Probability, which contains a development of measure theory
 
paulson 
parents:  
diff
changeset
 | 
901  | 
end  |