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