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