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