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