src/HOL/Analysis/Sigma_Algebra.thy
author haftmann
Thu, 19 Jun 2025 17:15:40 +0200
changeset 82734 89347c0cc6a3
parent 82513 8281047b896d
permissions -rw-r--r--
treat map_filter similar to list_all, list_ex, list_ex1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63627
6ddb43c6b711 rename HOL-Multivariate_Analysis to HOL-Analysis.
hoelzl
parents: 63626
diff changeset
     1
(*  Title:      HOL/Analysis/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
69676
56acd449da41 chapters for analysis manual
immler
parents: 69661
diff changeset
     8
chapter \<open>Measure and Integration Theory\<close>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
     9
41413
64cd30d6b0b8 explicit file specifications -- avoid secondary load path;
wenzelm
parents: 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
66453
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 64008
diff changeset
    13
  "HOL-Library.Countable_Set"
68188
2af1f142f855 move FuncSet back to HOL-Library (amending 493b818e8e10)
immler
parents: 68073
diff changeset
    14
  "HOL-Library.FuncSet"
66453
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 64008
diff changeset
    15
  "HOL-Library.Indicator_Function"
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 64008
diff changeset
    16
  "HOL-Library.Extended_Nonnegative_Real"
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 64008
diff changeset
    17
  "HOL-Library.Disjoint_Sets"
41413
64cd30d6b0b8 explicit file specifications -- avoid secondary load path;
wenzelm
parents: 41095
diff changeset
    18
begin
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    19
69676
56acd449da41 chapters for analysis manual
immler
parents: 69661
diff changeset
    20
56acd449da41 chapters for analysis manual
immler
parents: 69661
diff changeset
    21
section \<open>Sigma Algebra\<close>
56acd449da41 chapters for analysis manual
immler
parents: 69661
diff changeset
    22
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
    23
text \<open>Sigma algebras are an elementary concept in measure
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    24
  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
    25
  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
    26
  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
    27
  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
    28
  subsets of the universe. A sigma algebra is such a set that has
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
    29
  three very natural and desirable properties.\<close>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    30
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
    31
subsection \<open>Families of sets\<close>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    32
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
    33
locale\<^marker>\<open>tag important\<close> subset_class =
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
    34
  fixes \<Omega> :: "'a set" and M :: "'a set set"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
    35
  assumes space_closed: "M \<subseteq> Pow \<Omega>"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    36
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
    37
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
    38
  by (metis PowD contra_subsetD space_closed)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    39
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
    40
subsubsection \<open>Semiring of sets\<close>
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    41
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
    42
locale\<^marker>\<open>tag important\<close> semiring_of_sets = subset_class +
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    43
  assumes empty_sets[iff]: "{} \<in> M"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    44
  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
    45
  assumes Diff_cover:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    46
    "\<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
    47
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    48
lemma (in semiring_of_sets) finite_INT[intro]:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    49
  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
    50
  shows "(\<Inter>i\<in>I. A i) \<in> M"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    51
  using assms by (induct rule: finite_ne_induct) auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    52
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    53
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
    54
  by (metis Int_absorb1 sets_into_space)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    55
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    56
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
    57
  by (metis Int_absorb2 sets_into_space)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    58
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    59
lemma (in semiring_of_sets) sets_Collect_conj:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    60
  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
    61
  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
    62
proof -
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    63
  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
    64
    by auto
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    65
  with assms show ?thesis by auto
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    66
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    67
50002
ce0d316b5b44 add measurability prover; add support for Borel sets
hoelzl
parents: 49834
diff changeset
    68
lemma (in semiring_of_sets) sets_Collect_finite_All':
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    69
  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
    70
  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
    71
proof -
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    72
  have "{x\<in>\<Omega>. \<forall>i\<in>S. P i x} = (\<Inter>i\<in>S. {x\<in>\<Omega>. P i x})"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
    73
    using \<open>S \<noteq> {}\<close> by auto
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    74
  with assms show ?thesis by auto
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
67962
0acdcd8f4ba1 a first shot at tagging for HOL-Analysis manual
immler
parents: 67399
diff changeset
    77
subsubsection \<open>Ring of sets\<close>
0acdcd8f4ba1 a first shot at tagging for HOL-Analysis manual
immler
parents: 67399
diff changeset
    78
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
    79
locale\<^marker>\<open>tag important\<close> ring_of_sets = semiring_of_sets +
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    80
  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
    81
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
    82
lemma (in ring_of_sets) finite_Union [intro]:
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61847
diff changeset
    83
  "finite X \<Longrightarrow> X \<subseteq> M \<Longrightarrow> \<Union>X \<in> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
    84
  by (induct set: finite) (auto simp add: Un)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    85
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
    86
lemma (in ring_of_sets) finite_UN[intro]:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
    87
  assumes "finite I" and "\<And>i. i \<in> I \<Longrightarrow> A i \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
    88
  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
    89
  using assms by induct auto
cdf7693bbe08 reworked Probability theory: measures are not type restricted to positive extended reals
hoelzl
parents: 41959
diff changeset
    90
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    91
lemma (in ring_of_sets) Diff [intro]:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    92
  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
    93
  using Diff_cover[OF assms] by auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    94
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    95
lemma ring_of_setsI:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    96
  assumes space_closed: "M \<subseteq> Pow \<Omega>"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    97
  assumes empty_sets[iff]: "{} \<in> M"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
    98
  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
    99
  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
   100
  shows "ring_of_sets \<Omega> M"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   101
proof
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   102
  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
   103
  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
   104
    by (intro exI[of _ "{a - b}"]) (auto simp: disjoint_def)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   105
  have "a \<inter> b = a - (a - b)" by auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   106
  also have "\<dots> \<in> M" using ab by auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   107
  finally show "a \<inter> b \<in> M" .
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   108
qed fact+
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   109
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   110
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
   111
proof
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   112
  assume "ring_of_sets \<Omega> M"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   113
  then interpret ring_of_sets \<Omega> M .
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   114
  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
   115
    using space_closed by auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   116
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
   117
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   118
lemma (in ring_of_sets) insert_in_sets:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   119
  assumes "{x} \<in> M" "A \<in> M" shows "insert x A \<in> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   120
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   121
  have "{x} \<union> A \<in> M" using assms by (rule Un)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   122
  thus ?thesis by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   123
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   124
42867
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   125
lemma (in ring_of_sets) sets_Collect_disj:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   126
  assumes "{x\<in>\<Omega>. P x} \<in> M" "{x\<in>\<Omega>. Q x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   127
  shows "{x\<in>\<Omega>. Q x \<or> P x} \<in> M"
42867
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   128
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   129
  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
   130
    by auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   131
  with assms show ?thesis by auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   132
qed
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   133
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   134
lemma (in ring_of_sets) sets_Collect_finite_Ex:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   135
  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
   136
  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
   137
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   138
  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
   139
    by auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   140
  with assms show ?thesis by auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   141
qed
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   142
67962
0acdcd8f4ba1 a first shot at tagging for HOL-Analysis manual
immler
parents: 67399
diff changeset
   143
subsubsection \<open>Algebra of sets\<close>
0acdcd8f4ba1 a first shot at tagging for HOL-Analysis manual
immler
parents: 67399
diff changeset
   144
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   145
locale\<^marker>\<open>tag important\<close> algebra = ring_of_sets +
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   146
  assumes top [iff]: "\<Omega> \<in> M"
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   147
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   148
lemma (in algebra) compl_sets [intro]:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   149
  "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
   150
  by auto
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   151
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
   152
proposition algebra_iff_Un:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   153
  "algebra \<Omega> M \<longleftrightarrow>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   154
    M \<subseteq> Pow \<Omega> \<and>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   155
    {} \<in> M \<and>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   156
    (\<forall>a \<in> M. \<Omega> - a \<in> M) \<and>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   157
    (\<forall>a \<in> M. \<forall> b \<in> M. a \<union> b \<in> M)" (is "_ \<longleftrightarrow> ?Un")
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
   158
proof
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   159
  assume "algebra \<Omega> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   160
  then interpret algebra \<Omega> M .
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   161
  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
   162
next
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   163
  assume ?Un
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   164
  then have "\<Omega> \<in> M" by auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   165
  interpret ring_of_sets \<Omega> M
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   166
  proof (rule ring_of_setsI)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   167
    show \<Omega>: "M \<subseteq> Pow \<Omega>" "{} \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   168
      using \<open>?Un\<close> by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   169
    fix a b assume a: "a \<in> M" and b: "b \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   170
    then show "a \<union> b \<in> M" using \<open>?Un\<close> by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   171
    have "a - b = \<Omega> - ((\<Omega> - a) \<union> b)"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   172
      using \<Omega> a b by auto
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   173
    then show "a - b \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   174
      using a b  \<open>?Un\<close> by auto
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   175
  qed
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   176
  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
   177
qed
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   178
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
   179
proposition algebra_iff_Int:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   180
     "algebra \<Omega> M \<longleftrightarrow>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   181
       M \<subseteq> Pow \<Omega> & {} \<in> M &
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   182
       (\<forall>a \<in> M. \<Omega> - a \<in> M) &
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   183
       (\<forall>a \<in> M. \<forall> b \<in> M. a \<inter> b \<in> M)" (is "_ \<longleftrightarrow> ?Int")
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
   184
proof
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   185
  assume "algebra \<Omega> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   186
  then interpret algebra \<Omega> M .
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   187
  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
   188
next
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   189
  assume ?Int
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   190
  show "algebra \<Omega> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   191
    unfolding algebra_iff_Un
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   192
  proof (intro conjI ballI)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   193
    show \<Omega>: "M \<subseteq> Pow \<Omega>" "{} \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   194
      using \<open>?Int\<close> by auto
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   195
    from \<open>?Int\<close> show "\<And>a. a \<in> M \<Longrightarrow> \<Omega> - a \<in> M" by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   196
    fix a b assume M: "a \<in> M" "b \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   197
    hence "a \<union> b = \<Omega> - ((\<Omega> - a) \<inter> (\<Omega> - b))"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   198
      using \<Omega> by blast
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   199
    also have "... \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   200
      using M \<open>?Int\<close> by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   201
    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
   202
  qed
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   203
qed
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   204
42867
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   205
lemma (in algebra) sets_Collect_neg:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   206
  assumes "{x\<in>\<Omega>. P x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   207
  shows "{x\<in>\<Omega>. \<not> P x} \<in> M"
42867
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   208
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   209
  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
   210
  with assms show ?thesis by auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   211
qed
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   212
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   213
lemma (in algebra) sets_Collect_imp:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   214
  "{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
   215
  unfolding imp_conv_disj by (intro sets_Collect_disj sets_Collect_neg)
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   216
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   217
lemma (in algebra) sets_Collect_const:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   218
  "{x\<in>\<Omega>. P} \<in> M"
42867
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   219
  by (cases P) auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   220
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   221
lemma algebra_single_set:
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   222
  "X \<subseteq> S \<Longrightarrow> algebra S { {}, X, S - X, S }"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   223
  by (auto simp: algebra_iff_Int)
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   224
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   225
subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Restricted algebras\<close>
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39090
diff changeset
   226
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39090
diff changeset
   227
abbreviation (in algebra)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
   228
  "restricted_space A \<equiv> ((\<inter>) A) ` M"
39092
98de40859858 move lemmas to correct theory files
hoelzl
parents: 39090
diff changeset
   229
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   230
lemma (in algebra) restricted_algebra:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   231
  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
   232
  using assms by (auto simp: algebra_iff_Int)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   233
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   234
subsubsection \<open>Sigma Algebras\<close>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   235
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   236
locale\<^marker>\<open>tag important\<close> sigma_algebra = algebra +
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   237
  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
   238
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   239
lemma (in algebra) is_sigma_algebra:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   240
  assumes "finite M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   241
  shows "sigma_algebra \<Omega> M"
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   242
proof
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   243
  fix A :: "nat \<Rightarrow> 'a set" assume "range A \<subseteq> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   244
  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
   245
    by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   246
  also have "(\<Union>s\<in>M \<inter> range A. s) \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   247
    using \<open>finite M\<close> by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   248
  finally show "(\<Union>i. A i) \<in> M" .
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   249
qed
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   250
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   251
lemma countable_UN_eq:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   252
  fixes A :: "'i::countable \<Rightarrow> 'a set"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   253
  shows "(range A \<subseteq> M \<longrightarrow> (\<Union>i. A i) \<in> M) \<longleftrightarrow>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   254
    (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
   255
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   256
  let ?A' = "A \<circ> from_nat"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   257
  have *: "(\<Union>i. ?A' i) = (\<Union>i. A i)"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   258
    by (metis fun.set_map surj_from_nat)
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   259
  have "A ` range from_nat = range A"
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   260
    using surj_from_nat by simp
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   261
  then have **: "range ?A' = range A"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   262
    by (metis image_comp)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   263
  show ?thesis unfolding * ** ..
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   264
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   265
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   266
lemma (in sigma_algebra) countable_Union [intro]:
61952
546958347e05 prefer symbols for "Union", "Inter";
wenzelm
parents: 61847
diff changeset
   267
  assumes "countable X" "X \<subseteq> M" shows "\<Union>X \<in> M"
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   268
proof cases
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   269
  assume "X \<noteq> {}"
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   270
  hence "\<Union>X = (\<Union>n. from_nat_into X n)"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   271
    using assms by (auto cong del: SUP_cong)
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   272
  also have "\<dots> \<in> M" using assms
69712
dc85b5b3a532 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 69676
diff changeset
   273
    by (auto intro!: countable_nat_UN) (metis \<open>X \<noteq> {}\<close> from_nat_into subsetD)
50245
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   274
  finally show ?thesis .
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   275
qed simp
dea9363887a6 based countable topological basis on Countable_Set
immler
parents: 50244
diff changeset
   276
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   277
lemma (in sigma_algebra) countable_UN[intro]:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   278
  fixes A :: "'i::countable \<Rightarrow> 'a set"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   279
  assumes "A`X \<subseteq> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   280
  shows  "(\<Union>x\<in>X. A x) \<in> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   281
proof -
46731
5302e932d1e5 avoid undeclared variables in let bindings;
wenzelm
parents: 44890
diff changeset
   282
  let ?A = "\<lambda>i. if i \<in> X then A i else {}"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   283
  from assms have "range ?A \<subseteq> M" by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   284
  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
   285
  have "(\<Union>x. ?A x) \<in> M" by auto
62390
842917225d56 more canonical names
nipkow
parents: 62343
diff changeset
   286
  moreover have "(\<Union>x. ?A x) = (\<Union>x\<in>X. A x)" by (auto split: if_split_asm)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   287
  ultimately show ?thesis by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   288
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   289
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   290
lemma (in sigma_algebra) countable_UN':
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   291
  fixes A :: "'i \<Rightarrow> 'a set"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   292
  assumes X: "countable X"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   293
  assumes A: "A`X \<subseteq> M"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   294
  shows  "(\<Union>x\<in>X. A x) \<in> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   295
  using A X countable_Union countable_image by blast
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   296
61633
64e6d712af16 add lemmas
Andreas Lochbihler
parents: 61610
diff changeset
   297
lemma (in sigma_algebra) countable_UN'':
64e6d712af16 add lemmas
Andreas Lochbihler
parents: 61610
diff changeset
   298
  "\<lbrakk> countable X; \<And>x y. x \<in> X \<Longrightarrow> A x \<in> M \<rbrakk> \<Longrightarrow> (\<Union>x\<in>X. A x) \<in> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   299
  by blast
61633
64e6d712af16 add lemmas
Andreas Lochbihler
parents: 61610
diff changeset
   300
33533
40b44cb20c8c New theory Probability/Borel.thy, and some associated lemmas
paulson
parents: 33271
diff changeset
   301
lemma (in sigma_algebra) countable_INT [intro]:
38656
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: "A`X \<subseteq> M" "X \<noteq> {}"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   304
  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
   305
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   306
  from A have "\<forall>i\<in>X. A i \<in> M" by fast
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   307
  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
   308
  moreover
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   309
  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
   310
    by blast
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   311
  ultimately show ?thesis by metis
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   312
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   313
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   314
lemma (in sigma_algebra) countable_INT':
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   315
  fixes A :: "'i \<Rightarrow> 'a set"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   316
  assumes X: "countable X" "X \<noteq> {}"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   317
  assumes A: "A`X \<subseteq> M"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   318
  shows  "(\<Inter>x\<in>X. A x) \<in> M"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   319
proof -
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   320
  have "(\<Inter>x\<in>X. A x) = (\<Inter>i\<in>to_nat_on X ` X. A (from_nat_into X i))"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   321
    using X by auto
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   322
  also have "\<dots> \<in> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   323
    using A X by (intro countable_INT) auto
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   324
  finally show ?thesis .
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   325
qed
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   326
59088
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
   327
lemma (in sigma_algebra) countable_INT'':
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
   328
  "UNIV \<in> M \<Longrightarrow> countable I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> F i \<in> M) \<Longrightarrow> (\<Inter>i\<in>I. F i) \<in> M"
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
   329
  by (cases "I = {}") (auto intro: countable_INT')
57275
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   330
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   331
lemma (in sigma_algebra) countable:
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   332
  assumes "\<And>a. a \<in> A \<Longrightarrow> {a} \<in> M" "countable A"
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   333
  shows "A \<in> M"
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   334
proof -
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   335
  have "(\<Union>a\<in>A. {a}) \<in> M"
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   336
    using assms by (intro countable_UN') auto
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   337
  also have "(\<Union>a\<in>A. {a}) = A" by auto
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   338
  finally show ?thesis by auto
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   339
qed
0ddb5b755cdc moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents: 57138
diff changeset
   340
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   341
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
   342
  by (auto simp: ring_of_sets_iff)
42145
8448713d48b7 proved caratheodory_empty_continuous
hoelzl
parents: 42067
diff changeset
   343
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   344
lemma algebra_Pow: "algebra sp (Pow sp)"
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   345
  by (auto simp: algebra_iff_Un)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   346
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   347
lemma sigma_algebra_iff:
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   348
  "sigma_algebra \<Omega> M \<longleftrightarrow> 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
   349
  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
   350
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   351
lemma sigma_algebra_Pow: "sigma_algebra sp (Pow sp)"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   352
  by (auto simp: sigma_algebra_iff algebra_iff_Int)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   353
42867
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   354
lemma (in sigma_algebra) sets_Collect_countable_All:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   355
  assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   356
  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
   357
proof -
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   358
  have "{x\<in>\<Omega>. \<forall>i. 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
   359
  with assms show ?thesis by auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   360
qed
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   361
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   362
lemma (in sigma_algebra) sets_Collect_countable_Ex:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   363
  assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   364
  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
   365
proof -
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   366
  have "{x\<in>\<Omega>. \<exists>i. 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
   367
  with assms show ?thesis by auto
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   368
qed
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   369
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   370
lemma (in sigma_algebra) sets_Collect_countable_Ex':
54418
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   371
  assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   372
  assumes "countable I"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   373
  shows "{x\<in>\<Omega>. \<exists>i\<in>I. P i x} \<in> M"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   374
proof -
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   375
  have "{x\<in>\<Omega>. \<exists>i\<in>I. P i x} = (\<Union>i\<in>I. {x\<in>\<Omega>. P i x})" by auto
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
   376
  with assms show ?thesis
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   377
    by (auto intro!: countable_UN')
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   378
qed
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 50387
diff changeset
   379
54418
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   380
lemma (in sigma_algebra) sets_Collect_countable_All':
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   381
  assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M"
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   382
  assumes "countable I"
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   383
  shows "{x\<in>\<Omega>. \<forall>i\<in>I. P i x} \<in> M"
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   384
proof -
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   385
  have "{x\<in>\<Omega>. \<forall>i\<in>I. P i x} = (\<Inter>i\<in>I. {x\<in>\<Omega>. P i x}) \<inter> \<Omega>" by auto
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
   386
  with assms show ?thesis
54418
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   387
    by (cases "I = {}") (auto intro!: countable_INT')
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   388
qed
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   389
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   390
lemma (in sigma_algebra) sets_Collect_countable_Ex1':
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   391
  assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M"
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   392
  assumes "countable I"
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   393
  shows "{x\<in>\<Omega>. \<exists>!i\<in>I. P i x} \<in> M"
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   394
proof -
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   395
  have "{x\<in>\<Omega>. \<exists>!i\<in>I. P i x} = {x\<in>\<Omega>. \<exists>i\<in>I. P i x \<and> (\<forall>j\<in>I. P j x \<longrightarrow> i = j)}"
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   396
    by auto
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
   397
  with assms show ?thesis
54418
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   398
    by (auto intro!: sets_Collect_countable_All' sets_Collect_countable_Ex' sets_Collect_conj sets_Collect_imp sets_Collect_const)
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   399
qed
3b8e33d1a39a measure of a countable union
hoelzl
parents: 54417
diff changeset
   400
42867
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   401
lemmas (in sigma_algebra) sets_Collect =
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   402
  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
   403
  sets_Collect_countable_All sets_Collect_countable_Ex sets_Collect_countable_All
760094e49a2c Collect intro-rules for sigma-algebras
hoelzl
parents: 42864
diff changeset
   404
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   405
lemma (in sigma_algebra) sets_Collect_countable_Ball:
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   406
  assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   407
  shows "{x\<in>\<Omega>. \<forall>i::'i::countable\<in>X. P i x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   408
  unfolding Ball_def by (intro sets_Collect assms)
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   409
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   410
lemma (in sigma_algebra) sets_Collect_countable_Bex:
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   411
  assumes "\<And>i. {x\<in>\<Omega>. P i x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   412
  shows "{x\<in>\<Omega>. \<exists>i::'i::countable\<in>X. P i x} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   413
  unfolding Bex_def by (intro sets_Collect assms)
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   414
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   415
lemma sigma_algebra_single_set:
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   416
  assumes "X \<subseteq> S"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   417
  shows "sigma_algebra S { {}, X, S - X, S }"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   418
  using algebra.is_sigma_algebra[OF algebra_single_set[OF \<open>X \<subseteq> S\<close>]] by simp
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   419
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   420
subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Binary Unions\<close>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   421
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   422
definition binary :: "'a \<Rightarrow> 'a \<Rightarrow> nat \<Rightarrow> 'a"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   423
  where "binary a b =  (\<lambda>x. b)(0 := a)"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   424
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   425
lemma range_binary_eq: "range(binary a b) = {a,b}"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   426
  by (auto simp add: binary_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   427
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   428
lemma Un_range_binary: "a \<union> b = (\<Union>i::nat. binary a b i)"
69546
27dae626822b prefer naming convention from datatype package for strong congruence rules
haftmann
parents: 69313
diff changeset
   429
  by (simp add: range_binary_eq cong del: SUP_cong_simp)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   430
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   431
lemma Int_range_binary: "a \<inter> b = (\<Inter>i::nat. binary a b i)"
69546
27dae626822b prefer naming convention from datatype package for strong congruence rules
haftmann
parents: 69313
diff changeset
   432
  by (simp add: range_binary_eq cong del: INF_cong_simp)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   433
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   434
lemma sigma_algebra_iff2:
69768
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   435
  "sigma_algebra \<Omega> M \<longleftrightarrow>
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   436
    M \<subseteq> Pow \<Omega> \<and> {} \<in> M \<and> (\<forall>s \<in> M. \<Omega> - s \<in> M)
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   437
    \<and> (\<forall>A. range A \<subseteq> M \<longrightarrow>(\<Union> i::nat. A i) \<in> M)" (is "?P \<longleftrightarrow> ?R \<and> ?S \<and> ?V \<and> ?W")
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   438
proof
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   439
  assume ?P
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   440
  then interpret sigma_algebra \<Omega> M .
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   441
  from space_closed show "?R \<and> ?S \<and> ?V \<and> ?W"
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   442
    by auto
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   443
next
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   444
  assume "?R \<and> ?S \<and> ?V \<and> ?W"
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   445
  then have ?R ?S ?V ?W
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   446
    by simp_all
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   447
  show ?P
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   448
  proof (rule sigma_algebra.intro)
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   449
    show "sigma_algebra_axioms M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   450
      using \<open>?W\<close> sigma_algebra_axioms_def by blast
69768
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   451
    from \<open>?W\<close> have *: "range (binary a b) \<subseteq> M \<Longrightarrow> \<Union> (range (binary a b)) \<in> M" for a b
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   452
      by auto
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   453
    show "algebra \<Omega> M"
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   454
      unfolding algebra_iff_Un using \<open>?R\<close> \<open>?S\<close> \<open>?V\<close> *
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   455
      by (auto simp add: range_binary_eq)
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   456
  qed
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   457
qed
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
   458
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   459
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   460
subsubsection \<open>Initial Sigma Algebra\<close>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   461
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   462
text\<^marker>\<open>tag important\<close> \<open>Sigma algebras can naturally be created as the closure of any set of
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   463
  M with regard to the properties just postulated.\<close>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   464
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   465
inductive_set\<^marker>\<open>tag important\<close> sigma_sets :: "'a set \<Rightarrow> 'a set set \<Rightarrow> 'a set set"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   466
  for sp :: "'a set" and A :: "'a set set"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   467
  where
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   468
    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
   469
  | Empty: "{} \<in> sigma_sets sp A"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   470
  | 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
   471
  | 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
   472
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   473
lemma (in sigma_algebra) sigma_sets_subset:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   474
  assumes a: "a \<subseteq> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   475
  shows "sigma_sets \<Omega> a \<subseteq> M"
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   476
proof
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   477
  fix x
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   478
  assume "x \<in> sigma_sets \<Omega> a"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   479
  then show "x \<in> M"
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   480
    by (induct rule: sigma_sets.induct, auto) (metis a subsetD)
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   481
qed
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   482
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   483
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
   484
  by (erule sigma_sets.induct, auto)
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   485
79583
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
   486
lemma sigma_sets_finite: "\<lbrakk>x \<in> sigma_sets \<Omega> (Pow \<Omega>); finite \<Omega>\<rbrakk> \<Longrightarrow> finite x"
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
   487
  by (meson finite_subset order.refl sigma_sets_into_sp)
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
   488
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   489
lemma sigma_algebra_sigma_sets:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   490
     "a \<subseteq> Pow \<Omega> \<Longrightarrow> sigma_algebra \<Omega> (sigma_sets \<Omega> a)"
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   491
  by (auto simp add: sigma_algebra_iff2 dest: sigma_sets_into_sp
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   492
           intro!: sigma_sets.Union sigma_sets.Empty sigma_sets.Compl)
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   493
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   494
lemma sigma_sets_least_sigma_algebra:
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   495
  assumes "A \<subseteq> Pow S"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   496
  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
   497
proof safe
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   498
  fix B X assume "A \<subseteq> B" and sa: "sigma_algebra S B"
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   499
    and X: "X \<in> sigma_sets S A"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   500
  from sigma_algebra.sigma_sets_subset[OF sa, simplified, OF \<open>A \<subseteq> B\<close>] X
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   501
  show "X \<in> B" by auto
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   502
next
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   503
  fix X assume "X \<in> \<Inter>{B. A \<subseteq> B \<and> sigma_algebra S B}"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   504
  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
   505
     by simp
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   506
  have "A \<subseteq> sigma_sets S A" using assms by auto
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   507
  moreover have "sigma_algebra S (sigma_sets S A)"
41543
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   508
    using assms by (intro sigma_algebra_sigma_sets[of A]) auto
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   509
  ultimately show "X \<in> sigma_sets S A" by auto
646a1399e792 tuned theorem order
hoelzl
parents: 41413
diff changeset
   510
qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   511
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   512
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
   513
  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
   514
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   515
lemma binary_in_sigma_sets:
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   516
  "binary a b i \<in> sigma_sets sp A" if "a \<in> sigma_sets sp A" and "b \<in> sigma_sets sp A"
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   517
  using that by (simp add: binary_def)
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   518
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   519
lemma sigma_sets_Un:
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   520
  "a \<union> b \<in> sigma_sets sp A" if "a \<in> sigma_sets sp A" and "b \<in> sigma_sets sp A"
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   521
  using that by (simp add: Un_range_binary binary_in_sigma_sets Union)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   522
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   523
lemma sigma_sets_Inter:
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   524
  assumes Asb: "A \<subseteq> Pow sp"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   525
  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
   526
proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   527
  assume ai: "\<And>i::nat. a i \<in> sigma_sets sp A"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   528
  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
   529
    by (rule sigma_sets.Compl)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   530
  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
   531
    by (rule sigma_sets.Union)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   532
  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
   533
    by (rule sigma_sets.Compl)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   534
  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
   535
    by auto
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   536
  also have "... = (\<Inter>i. a i)" using ai
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   537
    by (blast dest: sigma_sets_into_sp [OF Asb])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   538
  finally show ?thesis .
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   539
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   540
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   541
lemma sigma_sets_INTER:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   542
  assumes Asb: "A \<subseteq> Pow sp"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   543
      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
   544
  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
   545
proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   546
  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
   547
    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
   548
  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
   549
    by (rule sigma_sets_Inter [OF Asb])
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   550
  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
   551
    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
   552
  finally show ?thesis .
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   553
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   554
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62083
diff changeset
   555
lemma sigma_sets_UNION:
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   556
  "countable B \<Longrightarrow> (\<And>b. b \<in> B \<Longrightarrow> b \<in> sigma_sets X A) \<Longrightarrow> \<Union> B \<in> sigma_sets X A"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62083
diff changeset
   557
  using from_nat_into [of B] range_from_nat_into [of B] sigma_sets.Union [of "from_nat_into B" X A]
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69597
diff changeset
   558
  by (cases "B = {}") (simp_all add: sigma_sets.Empty cong del: SUP_cong)
51683
baefa3b461c2 generalize Borel-set properties from real/ereal/ordered_euclidean_spaces to order_topology and real_normed_vector
hoelzl
parents: 50526
diff changeset
   559
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   560
lemma (in sigma_algebra) sigma_sets_eq: "sigma_sets \<Omega> M = M"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   561
  using sigma_sets_subset by blast
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   562
42981
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   563
lemma sigma_sets_eqI:
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   564
  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
   565
  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
   566
  shows "sigma_sets M A = sigma_sets M B"
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   567
proof (intro set_eqI iffI)
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   568
  fix a assume "a \<in> sigma_sets M A"
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   569
  from this A show "a \<in> sigma_sets M B"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   570
    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
   571
next
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   572
  fix b assume "b \<in> sigma_sets M B"
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   573
  from this B show "b \<in> sigma_sets M A"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   574
    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
   575
qed
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
   576
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   577
lemma sigma_sets_subseteq: 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   578
  assumes "A \<subseteq> B" 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   579
  shows "sigma_sets X A \<subseteq> sigma_sets X B"
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   580
proof
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   581
  fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   582
    by induct (insert \<open>A \<subseteq> B\<close>, auto intro: sigma_sets.intros(2-))
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   583
qed
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   584
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   585
lemma sigma_sets_mono: 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   586
  assumes "A \<subseteq> sigma_sets X B" 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   587
  shows "sigma_sets X A \<subseteq> sigma_sets X B"
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   588
proof
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   589
  fix x assume "x \<in> sigma_sets X A" 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   590
  then show "x \<in> sigma_sets X B"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   591
    by induct (insert \<open>A \<subseteq> sigma_sets X B\<close>, auto intro: sigma_sets.intros(2-))
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   592
qed
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   593
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   594
lemma sigma_sets_mono': 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   595
  assumes "A \<subseteq> B" 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   596
  shows "sigma_sets X A \<subseteq> sigma_sets X B"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   597
  by (simp add: assms sigma_sets_subseteq)
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   598
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   599
lemma sigma_sets_superset_generator: "A \<subseteq> sigma_sets X A"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   600
  by auto
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   601
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   602
lemma (in sigma_algebra) restriction_in_sets:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   603
  fixes A :: "nat \<Rightarrow> 'a set"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   604
  assumes "S \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   605
  and *: "range A \<subseteq> (\<lambda>A. S \<inter> A) ` M" (is "_ \<subseteq> ?r")
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   606
  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
   607
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   608
  { fix i have "A i \<in> ?r" using * by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   609
    hence "\<exists>B. A i = B \<inter> S \<and> B \<in> M" by auto
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   610
    hence "A i \<subseteq> S" "A i \<in> M" using \<open>S \<in> M\<close> by auto }
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   611
  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
   612
    by (auto intro!: image_eqI[of _ _ "(\<Union>i. A i)"])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   613
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   614
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   615
lemma (in sigma_algebra) restricted_sigma_algebra:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   616
  assumes "S \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   617
  shows "sigma_algebra S (restricted_space S)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   618
  unfolding sigma_algebra_def sigma_algebra_axioms_def
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   619
  using assms restricted_algebra restriction_in_sets(2) by presburger
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   620
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   621
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
   622
  assumes "A \<in> sigma_sets sp st" "A \<subseteq> sp"
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
   623
  shows "(\<inter>) A ` sigma_sets sp st = sigma_sets A ((\<inter>) A ` st)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   624
proof (intro equalityI subsetI)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
   625
  fix x assume "x \<in> (\<inter>) A ` sigma_sets sp st"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   626
  then obtain y where "y \<in> sigma_sets sp st" "x = y \<inter> A" by auto
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
   627
  then have "x \<in> sigma_sets (A \<inter> sp) ((\<inter>) A ` st)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   628
  proof (induct arbitrary: x)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   629
    case (Compl a)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   630
    then show ?case
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   631
      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
   632
  next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   633
    case (Union a)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   634
    then show ?case
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   635
      by (auto intro!: sigma_sets.Union
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   636
               simp add: UN_extend_simps simp del: UN_simps)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   637
  qed (auto intro!: sigma_sets.intros(2-))
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
   638
  then show "x \<in> sigma_sets A ((\<inter>) A ` st)"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   639
    using \<open>A \<subseteq> sp\<close> by (simp add: Int_absorb2)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   640
next
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
   641
  fix x assume "x \<in> sigma_sets A ((\<inter>) A ` st)"
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
   642
  then show "x \<in> (\<inter>) A ` sigma_sets sp st"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   643
  proof induct
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   644
    case (Compl a)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   645
    then obtain x where "a = A \<inter> x" "x \<in> sigma_sets sp st" by auto
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   646
    then show ?case using \<open>A \<subseteq> sp\<close>
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   647
      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
   648
  next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   649
    case (Union a)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   650
    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
   651
      by (auto simp: image_iff Bex_def)
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   652
    then obtain f where "\<forall>x. f x \<in> sigma_sets sp st \<and> a x = A \<inter> f x"
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   653
      by metis
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   654
    then show ?case
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   655
      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
   656
               simp add: image_iff)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   657
  qed (auto intro!: sigma_sets.intros(2-))
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   658
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   659
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   660
lemma sigma_sets_empty_eq: "sigma_sets A {} = {{}, A}"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   661
proof (intro set_eqI iffI)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   662
  fix a assume "a \<in> sigma_sets A {}" then show "a \<in> {{}, A}"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   663
    by induct blast+
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   664
qed (auto intro: sigma_sets.Empty sigma_sets_top)
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   665
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   666
lemma sigma_sets_single[simp]: "sigma_sets A {A} = {{}, A}"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   667
proof (intro set_eqI iffI)
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   668
  fix x assume "x \<in> sigma_sets A {A}"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   669
  then show "x \<in> {{}, A}"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   670
    by induct blast+
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   671
next
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   672
  fix x assume "x \<in> {{}, A}"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   673
  then show "x \<in> sigma_sets A {A}"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   674
    by (auto intro: sigma_sets.Empty sigma_sets_top)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   675
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
   676
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   677
lemma sigma_sets_sigma_sets_eq:
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   678
  "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
   679
  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
   680
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   681
lemma sigma_sets_singleton:
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   682
  assumes "X \<subseteq> S"
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   683
  shows "sigma_sets S { X } = { {}, X, S - X, S }"
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   684
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   685
  interpret sigma_algebra S "{ {}, X, S - X, S }"
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   686
    by (rule sigma_algebra_single_set) fact
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   687
  have "sigma_sets S { X } \<subseteq> sigma_sets S { {}, X, S - X, S }"
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   688
    by (rule sigma_sets_subseteq) simp
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   689
  moreover have "\<dots> = { {}, X, S - X, S }"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   690
    using sigma_sets_eq by simp
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   691
  moreover
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   692
  { fix A assume "A \<in> { {}, X, S - X, S }"
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   693
    then have "A \<in> sigma_sets S { X }"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   694
      by (auto intro: sigma_sets.intros(2-) sigma_sets_top) }
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   695
  ultimately have "sigma_sets S { X } = sigma_sets S { {}, X, S - X, S }"
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   696
    by (intro antisym) auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   697
  with sigma_sets_eq show ?thesis by simp
42984
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   698
qed
43864e7475df add lemma sigma_sets_singleton
hoelzl
parents: 42981
diff changeset
   699
42863
b9ff5a0aa12c add restrict_sigma
hoelzl
parents: 42145
diff changeset
   700
lemma restricted_sigma:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   701
  assumes S: "S \<in> sigma_sets \<Omega> M" and M: "M \<subseteq> Pow \<Omega>"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   702
  shows "algebra.restricted_space (sigma_sets \<Omega> M) S = sigma_sets S (algebra.restricted_space M S)"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   703
  by (meson M S sigma_sets_Int sigma_sets_into_sp)
42863
b9ff5a0aa12c add restrict_sigma
hoelzl
parents: 42145
diff changeset
   704
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   705
lemma sigma_sets_vimage_commute:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   706
  assumes X: "X \<in> \<Omega> \<rightarrow> \<Omega>'"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   707
  shows "{X -` A \<inter> \<Omega> |A. A \<in> sigma_sets \<Omega>' M'}
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   708
       = 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
   709
proof
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   710
  show "?L \<subseteq> ?R"
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   711
  proof clarify
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   712
    fix A assume "A \<in> sigma_sets \<Omega>' M'"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   713
    then show "X -` A \<inter> \<Omega> \<in> ?R"
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   714
    proof induct
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   715
      case Empty then show ?case
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   716
        by (auto intro!: sigma_sets.Empty)
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   717
    next
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   718
      case (Compl B)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   719
      have [simp]: "X -` (\<Omega>' - B) \<inter> \<Omega> = \<Omega> - (X -` B \<inter> \<Omega>)"
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   720
        by (auto simp add: funcset_mem [OF X])
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   721
      with Compl show ?case
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   722
        by (auto intro!: sigma_sets.Compl)
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   723
    next
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   724
      case (Union F)
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   725
      then show ?case
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   726
        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
   727
                 intro!: sigma_sets.Union)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   728
    qed auto
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   729
  qed
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   730
  show "?R \<subseteq> ?L"
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   731
  proof clarify
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   732
    fix A assume "A \<in> ?R"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   733
    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
   734
    proof induct
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   735
      case (Basic B) then show ?case by auto
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   736
    next
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   737
      case Empty then show ?case
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   738
        by (auto intro!: sigma_sets.Empty exI[of _ "{}"])
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   739
    next
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   740
      case (Compl B)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   741
      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
   742
      then have [simp]: "\<Omega> - B = X -` (\<Omega>' - A) \<inter> \<Omega>"
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   743
        by (auto simp add: funcset_mem [OF X])
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   744
      with A(2) show ?case
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   745
        by (auto intro: sigma_sets.Compl)
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   746
    next
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   747
      case (Union F)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   748
      then have "\<forall>i. \<exists>B. F i = X -` B \<inter> \<Omega> \<and> B \<in> sigma_sets \<Omega>' M'" by auto
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   749
      then obtain A where "\<forall>x. F x = X -` A x \<inter> \<Omega> \<and> A x \<in> sigma_sets \<Omega>' M'"
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   750
        by metis
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   751
      then show ?case
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   752
        by (auto simp: vimage_UN[symmetric] intro: sigma_sets.Union)
42987
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   753
    qed
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   754
  qed
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   755
qed
73e2d802ea41 add lemma indep_rv_finite
hoelzl
parents: 42984
diff changeset
   756
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   757
lemma (in ring_of_sets) UNION_in_sets:
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   758
  fixes A:: "nat \<Rightarrow> 'a set"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   759
  assumes A: "range A \<subseteq> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   760
  shows  "(\<Union>i\<in>{0..<n}. A i) \<in> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   761
proof (induct n)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   762
  case 0 show ?case by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   763
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   764
  case (Suc n)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   765
  thus ?case
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   766
    using assms by blast
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   767
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   768
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   769
lemma (in ring_of_sets) range_disjointed_sets:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   770
  assumes A: "range A \<subseteq> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   771
  shows  "range (disjointed A) \<subseteq> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   772
proof -
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   773
  have "A n - (\<Union>i\<in>{0..<n}. A i) \<in> M" for n
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   774
    using UNION_in_sets by (metis A Diff UNIV_I image_subset_iff)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   775
  then show ?thesis
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   776
    by (auto simp: disjointed_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   777
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   778
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   779
lemma (in algebra) range_disjointed_sets':
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   780
  "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
   781
  using range_disjointed_sets .
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
   782
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   783
lemma sigma_algebra_disjoint_iff:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   784
  "sigma_algebra \<Omega> M \<longleftrightarrow> algebra \<Omega> M \<and>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   785
    (\<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
   786
proof (auto simp add: sigma_algebra_iff)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   787
  fix A :: "nat \<Rightarrow> 'a set"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   788
  assume M: "algebra \<Omega> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   789
     and A: "range A \<subseteq> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   790
     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
   791
  hence "range (disjointed A) \<subseteq> M \<longrightarrow>
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   792
         disjoint_family (disjointed A) \<longrightarrow>
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   793
         (\<Union>i. disjointed A i) \<in> M" by blast
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   794
  hence "(\<Union>i. disjointed A i) \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   795
    by (simp add: algebra.range_disjointed_sets'[of \<Omega>] M A disjoint_family_disjointed)
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   796
  thus "(\<Union>i::nat. A i) \<in> M" by (simp add: UN_disjointed_eq)
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   797
qed
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   798
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   799
subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Ring generated by a semiring\<close>
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   800
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
   801
definition (in semiring_of_sets) generated_ring :: "'a set set" where
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   802
  "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
   803
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   804
lemma (in semiring_of_sets) generated_ringE[elim?]:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   805
  assumes "a \<in> generated_ring"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   806
  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
   807
  using assms unfolding generated_ring_def by auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   808
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   809
lemma (in semiring_of_sets) generated_ringI[intro?]:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   810
  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
   811
  shows "a \<in> generated_ring"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   812
  using assms unfolding generated_ring_def by auto
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   813
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   814
lemma (in semiring_of_sets) generated_ringI_Basic:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   815
  "A \<in> M \<Longrightarrow> A \<in> generated_ring"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   816
  using generated_ring_def by auto
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   817
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   818
lemma (in semiring_of_sets) generated_ring_disjoint_Un[intro]:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   819
  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
   820
  and "a \<inter> b = {}"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   821
  shows "a \<union> b \<in> generated_ring"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   822
proof -
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   823
  from a b obtain Ca Cb
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   824
    where "finite Ca" "disjoint Ca" "Ca \<subseteq> M" "a = \<Union> Ca"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   825
      and "finite Cb" "disjoint Cb" "Cb \<subseteq> M" "b = \<Union> Cb"
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   826
    using generated_ringE by metis
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   827
  then show ?thesis
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   828
    by (metis (mono_tags) Union_Un_distrib
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   829
        \<open>a \<inter> b = {}\<close> disjoint_union finite_Un generated_ringI le_sup_iff)
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   830
qed
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   831
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   832
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
   833
  by (auto simp: generated_ring_def disjoint_def)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   834
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   835
lemma (in semiring_of_sets) generated_ring_disjoint_Union:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   836
  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
   837
  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
   838
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   839
lemma (in semiring_of_sets) generated_ring_disjoint_UNION:
69313
b021008c5397 removed legacy input syntax
haftmann
parents: 69284
diff changeset
   840
  "finite I \<Longrightarrow> disjoint (A ` I) \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> A i \<in> generated_ring) \<Longrightarrow> \<Union>(A ` I) \<in> generated_ring"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62083
diff changeset
   841
  by (intro generated_ring_disjoint_Union) auto
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   842
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   843
lemma (in semiring_of_sets) generated_ring_Int:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   844
  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
   845
  shows "a \<inter> b \<in> generated_ring"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   846
proof -
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   847
  from a b obtain Ca Cb
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   848
    where Ca: "finite Ca" "disjoint Ca" "Ca \<subseteq> M" "a = \<Union> Ca"
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   849
      and Cb: "finite Cb" "disjoint Cb" "Cb \<subseteq> M" "b = \<Union> Cb"
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   850
    using generated_ringE by metis
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62975
diff changeset
   851
  define C where "C = (\<lambda>(a,b). a \<inter> b)` (Ca\<times>Cb)"
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   852
  show ?thesis
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   853
  proof
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   854
    show "disjoint C"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   855
    proof (simp add: disjoint_def C_def, intro ballI impI)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   856
      fix a1 b1 a2 b2 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   857
      assume sets: "a1 \<in> Ca" "b1 \<in> Cb" "a2 \<in> Ca" "b2 \<in> Cb"
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   858
      assume "a1 \<inter> b1 \<noteq> a2 \<inter> b2"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   859
      then have "a1 \<noteq> a2 \<or> b1 \<noteq> b2" by auto
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   860
      with Ca Cb show "(a1 \<inter> b1) \<inter> (a2 \<inter> b2) = {}"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   861
        by (metis (no_types, opaque_lifting) boolean_algebra.conj_zero_left
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   862
            disjoint_def inf.left_commute inf_assoc sets)
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   863
    qed
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   864
  qed (use Ca Cb in \<open>auto simp: C_def\<close>)
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   865
qed
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   866
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   867
lemma (in semiring_of_sets) generated_ring_Inter:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   868
  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
   869
  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
   870
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   871
lemma (in semiring_of_sets) generated_ring_INTER:
69313
b021008c5397 removed legacy input syntax
haftmann
parents: 69284
diff changeset
   872
  "finite I \<Longrightarrow> I \<noteq> {} \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> A i \<in> generated_ring) \<Longrightarrow> \<Inter>(A ` I) \<in> generated_ring"
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62083
diff changeset
   873
  by (intro generated_ring_Inter) auto
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   874
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   875
lemma (in semiring_of_sets) generating_ring:
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   876
  "ring_of_sets \<Omega> generated_ring"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   877
proof (rule ring_of_setsI)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   878
  let ?R = generated_ring
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   879
  show "?R \<subseteq> Pow \<Omega>"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   880
    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
   881
  show "{} \<in> ?R" by (rule generated_ring_empty)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   882
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   883
  {
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   884
    fix a b assume "a \<in> ?R" "b \<in> ?R"
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   885
    then obtain Ca Cb
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   886
      where Ca: "finite Ca" "disjoint Ca" "Ca \<subseteq> M" "a = \<Union> Ca"
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   887
        and Cb: "finite Cb" "disjoint Cb" "Cb \<subseteq> M" "b = \<Union> Cb"
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   888
      using generated_ringE by metis
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   889
    show "a - b \<in> ?R"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   890
    proof cases
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   891
      assume "Cb = {}" with Cb \<open>a \<in> ?R\<close> show ?thesis
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   892
        by simp
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   893
    next
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   894
      assume "Cb \<noteq> {}"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   895
      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
   896
      also have "\<dots> \<in> ?R"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   897
      proof (intro generated_ring_INTER generated_ring_disjoint_UNION)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   898
        fix a b assume "a \<in> Ca" "b \<in> Cb"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   899
        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
   900
          by (auto simp add: generated_ring_def)
62343
24106dc44def prefer abbreviations for compound operators INFIMUM and SUPREMUM
haftmann
parents: 62083
diff changeset
   901
            (metis DiffI Diff_eq_empty_iff empty_iff)
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   902
      next
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   903
        show "disjoint ((\<lambda>a'. \<Inter>b'\<in>Cb. a' - b')`Ca)"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   904
          using Ca by (auto simp add: disjoint_def \<open>Cb \<noteq> {}\<close>)
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   905
      next
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   906
        show "finite Ca" "finite Cb" "Cb \<noteq> {}" by fact+
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   907
      qed
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   908
      finally show "a - b \<in> ?R" .
74362
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   909
    qed
0135a0c77b64 tuned proofs --- avoid 'guess';
wenzelm
parents: 70136
diff changeset
   910
  }
47762
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   911
  note Diff = this
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   912
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   913
  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
   914
  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
   915
  also have "\<dots> \<in> ?R"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   916
    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
   917
  finally show "a \<union> b \<in> ?R" .
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   918
qed
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   919
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   920
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
   921
proof
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   922
  interpret M: sigma_algebra \<Omega> "sigma_sets \<Omega> M"
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   923
    using space_closed by (rule sigma_algebra_sigma_sets)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   924
  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
   925
    by (blast intro!: sigma_sets_mono elim: generated_ringE)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   926
qed (auto intro!: generated_ringI_Basic sigma_sets_mono)
d31085f07f60 add Caratheodories theorem for semi-rings of sets
hoelzl
parents: 47756
diff changeset
   927
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   928
subsubsection\<^marker>\<open>tag unimportant\<close> \<open>A Two-Element Series\<close>
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   929
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
   930
definition binaryset :: "'a set \<Rightarrow> 'a set \<Rightarrow> nat \<Rightarrow> 'a set"
50252
4aa34bd43228 eliminated slightly odd identifiers;
wenzelm
parents: 50245
diff changeset
   931
  where "binaryset A B = (\<lambda>x. {})(0 := A, Suc 0 := B)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   932
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   933
lemma range_binaryset_eq: "range(binaryset A B) = {A,B,{}}"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   934
  by (auto simp add: binaryset_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   935
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   936
lemma UN_binaryset_eq: "(\<Union>i. binaryset A B i) = A \<union> B"
69546
27dae626822b prefer naming convention from datatype package for strong congruence rules
haftmann
parents: 69313
diff changeset
   937
  by (simp add: range_binaryset_eq cong del: SUP_cong_simp)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   938
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
   939
subsubsection \<open>Closed CDI\<close>
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   940
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
   941
definition\<^marker>\<open>tag important\<close> closed_cdi :: "'a set \<Rightarrow> 'a set set \<Rightarrow> bool" where
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   942
  "closed_cdi \<Omega> M \<longleftrightarrow>
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   943
   M \<subseteq> Pow \<Omega> &
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   944
   (\<forall>s \<in> M. \<Omega> - s \<in> M) &
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   945
   (\<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
   946
        (\<Union>i. A i) \<in> M) &
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   947
   (\<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
   948
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   949
inductive_set
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   950
  smallest_ccdi_sets :: "'a set \<Rightarrow> 'a set set \<Rightarrow> 'a set set"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   951
  for \<Omega> M
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   952
  where
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   953
    Basic [intro]:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   954
      "a \<in> M \<Longrightarrow> a \<in> smallest_ccdi_sets \<Omega> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   955
  | Compl [intro]:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   956
      "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
   957
  | Inc:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   958
      "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
   959
       \<Longrightarrow> (\<Union>i. A i) \<in> smallest_ccdi_sets \<Omega> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   960
  | Disj:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   961
      "range A \<in> Pow(smallest_ccdi_sets \<Omega> M) \<Longrightarrow> disjoint_family A
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   962
       \<Longrightarrow> (\<Union>i::nat. A i) \<in> smallest_ccdi_sets \<Omega> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   963
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   964
lemma (in subset_class) smallest_closed_cdi1: "M \<subseteq> smallest_ccdi_sets \<Omega> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   965
  by auto
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   966
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   967
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
   968
  apply (rule subsetI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   969
  apply (erule smallest_ccdi_sets.induct)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   970
  apply (auto intro: range_subsetD dest: sets_into_space)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   971
  done
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   972
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   973
lemma (in subset_class) smallest_closed_cdi2: "closed_cdi \<Omega> (smallest_ccdi_sets \<Omega> M)"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
   974
  by (simp add: closed_cdi_def smallest_ccdi_sets smallest_ccdi_sets.intros)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   975
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   976
lemma closed_cdi_subset: "closed_cdi \<Omega> M \<Longrightarrow> M \<subseteq> Pow \<Omega>"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   977
  by (simp add: closed_cdi_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   978
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   979
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
   980
  by (simp add: closed_cdi_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   981
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   982
lemma closed_cdi_Inc:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   983
  "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
   984
  by (simp add: closed_cdi_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   985
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   986
lemma closed_cdi_Disj:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   987
  "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
   988
  by (simp add: closed_cdi_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   989
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   990
lemma closed_cdi_Un:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   991
  assumes cdi: "closed_cdi \<Omega> M" and empty: "{} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   992
      and A: "A \<in> M" and B: "B \<in> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   993
      and disj: "A \<inter> B = {}"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   994
    shows "A \<union> B \<in> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   995
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
   996
  have ra: "range (binaryset A B) \<subseteq> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   997
   by (simp add: range_binaryset_eq empty A B)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   998
 have di:  "disjoint_family (binaryset A B)" using disj
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
   999
   by (simp add: disjoint_family_on_def binaryset_def Int_commute)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1000
 from closed_cdi_Disj [OF cdi ra di]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1001
 show ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1002
   by (simp add: UN_binaryset_eq)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1003
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1004
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1005
lemma (in algebra) smallest_ccdi_sets_Un:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1006
  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
  1007
      and disj: "A \<inter> B = {}"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1008
    shows "A \<union> B \<in> smallest_ccdi_sets \<Omega> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1009
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1010
  have ra: "range (binaryset A B) \<in> Pow (smallest_ccdi_sets \<Omega> M)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1011
    by (simp add: range_binaryset_eq  A B smallest_ccdi_sets.Basic)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1012
  have di:  "disjoint_family (binaryset A B)" using disj
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1013
    by (simp add: disjoint_family_on_def binaryset_def Int_commute)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1014
  from Disj [OF ra di]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1015
  show ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1016
    by (simp add: UN_binaryset_eq)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1017
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1018
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1019
lemma (in algebra) smallest_ccdi_sets_Int1:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1020
  assumes a: "a \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1021
  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
  1022
proof (induct rule: smallest_ccdi_sets.induct)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1023
  case (Basic x)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1024
  thus ?case
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1025
    by (metis a Int smallest_ccdi_sets.Basic)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1026
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1027
  case (Compl x)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1028
  have 0: "(\<Omega> - a) \<inter> (a \<inter> x) = {}"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1029
    by blast
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1030
  have "a \<inter> (\<Omega> - x) = \<Omega> - ((\<Omega> - a) \<union> (a \<inter> x))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1031
    by blast
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1032
  also have "... \<in> smallest_ccdi_sets \<Omega> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1033
    by (intro 0 smallest_ccdi_sets.intros smallest_ccdi_sets_Un Compl.hyps assms)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1034
  finally show ?case .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1035
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1036
  case (Inc A)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1037
  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
  1038
    by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1039
  moreover have "(\<lambda>i. a \<inter> A i) 0 = {}"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1040
    by (simp add: Inc)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1041
  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
  1042
    by blast
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1043
  ultimately have "(\<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
  1044
    by (rule smallest_ccdi_sets.Inc)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1045
  moreover have "(\<Union>i. (\<lambda>i. a \<inter> A i) i) = a \<inter> (\<Union>i. A i)"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1046
    by blast
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1047
  ultimately show ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1048
    by metis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1049
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1050
  case (Disj A)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1051
  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
  1052
    by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1053
  moreover have "disjoint_family (\<lambda>i. a \<inter> A i)" using Disj
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1054
    by (auto simp add: disjoint_family_on_def)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1055
  ultimately have "(\<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
  1056
    by (rule smallest_ccdi_sets.Disj)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1057
  moreover have "(\<Union>i. (\<lambda>i. a \<inter> A i) i) = a \<inter> (\<Union>i. A i)"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1058
    by blast
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1059
  ultimately show ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1060
    by metis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1061
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1062
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1063
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1064
lemma (in algebra) smallest_ccdi_sets_Int:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1065
  assumes b: "b \<in> smallest_ccdi_sets \<Omega> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1066
  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
  1067
proof (induct rule: smallest_ccdi_sets.induct)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1068
  case (Basic x)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1069
  thus ?case
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1070
    by (metis b smallest_ccdi_sets_Int1)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1071
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1072
  case (Compl x)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1073
  have "(\<Omega> - x) \<inter> b = \<Omega> - (x \<inter> b \<union> (\<Omega> - b))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1074
    by blast
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1075
  also have "... \<in> smallest_ccdi_sets \<Omega> M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1076
    by (metis Compl(2) Diff_disjoint Int_Diff Int_commute Int_empty_right b
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1077
           smallest_ccdi_sets.Compl smallest_ccdi_sets_Un)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1078
  finally show ?case .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1079
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1080
  case (Inc A)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1081
  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
  1082
    by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1083
  moreover have "(\<lambda>i. A i \<inter> b) 0 = {}"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1084
    by (simp add: Inc)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1085
  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
  1086
    by blast
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1087
  ultimately have "(\<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
  1088
    by (rule smallest_ccdi_sets.Inc)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1089
  moreover have "(\<Union>i. (\<lambda>i. A i \<inter> b) i) = (\<Union>i. A i) \<inter> b"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1090
    by blast
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1091
  ultimately show ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1092
    by metis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1093
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1094
  case (Disj A)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1095
  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
  1096
    by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1097
  moreover have "disjoint_family (\<lambda>i. A i \<inter> b)" using Disj
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1098
    by (auto simp add: disjoint_family_on_def)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1099
  ultimately have "(\<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
  1100
    by (rule smallest_ccdi_sets.Disj)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1101
  moreover have "(\<Union>i. (\<lambda>i. A i \<inter> b) i) = (\<Union>i. A i) \<inter> b"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1102
    by blast
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1103
  ultimately show ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1104
    by metis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1105
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1106
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1107
lemma (in algebra) sigma_property_disjoint_lemma:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1108
  assumes sbC: "M \<subseteq> C"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1109
      and ccdi: "closed_cdi \<Omega> C"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1110
  shows "sigma_sets \<Omega> M \<subseteq> C"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1111
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1112
  have "smallest_ccdi_sets \<Omega> M \<in> {B . M \<subseteq> B \<and> sigma_algebra \<Omega> B}"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1113
    using smallest_ccdi_sets
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1114
    by (auto simp: sigma_algebra_disjoint_iff algebra_iff_Int
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1115
            smallest_ccdi_sets_Int intro: smallest_ccdi_sets.Disj)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1116
  hence "sigma_sets (\<Omega>) (M) \<subseteq> smallest_ccdi_sets \<Omega> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1117
    by (simp add: sigma_algebra.sigma_sets_subset)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1118
  also have "... \<subseteq> C"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1119
  proof
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1120
    fix x
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1121
    assume x: "x \<in> smallest_ccdi_sets \<Omega> M"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1122
    thus "x \<in> C"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1123
    proof (induct rule: smallest_ccdi_sets.induct)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1124
      case (Basic x)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1125
      thus ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1126
        by (metis Basic subsetD sbC)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1127
    next
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1128
      case (Compl x)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1129
      thus ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1130
        by (blast intro: closed_cdi_Compl [OF ccdi, simplified])
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1131
    next
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1132
      case (Inc A)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1133
      thus ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1134
        by (auto intro: closed_cdi_Inc [OF ccdi, simplified])
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1135
    next
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1136
      case (Disj A)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1137
      thus ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1138
        by (auto intro: closed_cdi_Disj [OF ccdi, simplified])
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1139
    qed
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1140
  qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1141
  finally show ?thesis .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1142
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1143
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1144
lemma (in algebra) sigma_property_disjoint:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1145
  assumes sbC: "M \<subseteq> C"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1146
      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
  1147
      and inc: "!!A. range A \<subseteq> C \<inter> sigma_sets (\<Omega>) (M)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1148
                     \<Longrightarrow> A 0 = {} \<Longrightarrow> (!!n. A n \<subseteq> A (Suc n))
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1149
                     \<Longrightarrow> (\<Union>i. A i) \<in> C"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1150
      and disj: "!!A. range A \<subseteq> C \<inter> sigma_sets (\<Omega>) (M)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1151
                      \<Longrightarrow> disjoint_family A \<Longrightarrow> (\<Union>i::nat. A i) \<in> C"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1152
  shows "sigma_sets (\<Omega>) (M) \<subseteq> C"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1153
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1154
  have "sigma_sets (\<Omega>) (M) \<subseteq> C \<inter> sigma_sets (\<Omega>) (M)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1155
    proof (rule sigma_property_disjoint_lemma)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1156
      show "M \<subseteq> C \<inter> sigma_sets (\<Omega>) (M)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1157
        by (metis Int_greatest Set.subsetI sbC sigma_sets.Basic)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1158
    next
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1159
      show "closed_cdi \<Omega> (C \<inter> sigma_sets (\<Omega>) (M))"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1160
        unfolding closed_cdi_def compl inc disj
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1161
        by (auto simp: image_subset_iff compl inc disj le_infI2 sigma_algebra.sigma_sets_subset sigma_algebra_Pow
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1162
            space_closed intro: sigma_sets.intros)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1163
    qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1164
  thus ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1165
    by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1166
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37032
diff changeset
  1167
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1168
subsubsection \<open>Dynkin systems\<close>
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1169
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1170
locale\<^marker>\<open>tag important\<close> Dynkin_system = subset_class +
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1171
  assumes space: "\<Omega> \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1172
    and   compl[intro!]: "\<And>A. A \<in> M \<Longrightarrow> \<Omega> - A \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1173
    and   UN[intro!]: "\<And>A. disjoint_family A \<Longrightarrow> range A \<subseteq> M
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1174
                           \<Longrightarrow> (\<Union>i::nat. A i) \<in> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1175
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1176
lemma (in Dynkin_system) empty[intro, simp]: "{} \<in> M"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1177
  using space compl[of "\<Omega>"] by simp
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1178
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1179
lemma (in Dynkin_system) diff:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1180
  assumes sets: "D \<in> M" "E \<in> M" and "D \<subseteq> E"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1181
  shows "E - D \<in> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1182
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1183
  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
  1184
  have "range ?f = {D, \<Omega> - E, {}}"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1185
    by (auto simp: image_iff)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1186
  moreover have "D \<union> (\<Omega> - E) = (\<Union>i. ?f i)"
62390
842917225d56 more canonical names
nipkow
parents: 62343
diff changeset
  1187
    by (auto simp: image_iff split: if_split_asm)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1188
  moreover
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 51683
diff changeset
  1189
  have "disjoint_family ?f" unfolding disjoint_family_on_def
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1190
    using \<open>D \<in> M\<close>[THEN sets_into_space] \<open>D \<subseteq> E\<close> by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1191
  ultimately have "\<Omega> - (D \<union> (\<Omega> - E)) \<in> M"
69768
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
  1192
    using sets UN by auto fastforce
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1193
  also have "\<Omega> - (D \<union> (\<Omega> - E)) = E - D"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1194
    using assms sets_into_space by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1195
  finally show ?thesis .
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1196
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1197
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1198
lemma Dynkin_systemI:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1199
  assumes "\<And> A. A \<in> M \<Longrightarrow> A \<subseteq> \<Omega>" "\<Omega> \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1200
  assumes "\<And> A. A \<in> M \<Longrightarrow> \<Omega> - A \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1201
  assumes "\<And> A. disjoint_family A \<Longrightarrow> range A \<subseteq> M
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1202
          \<Longrightarrow> (\<Union>i::nat. A i) \<in> M"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1203
  shows "Dynkin_system \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1204
  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
  1205
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1206
lemma Dynkin_systemI':
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1207
  assumes "\<And> A. A \<in> M \<Longrightarrow> A \<subseteq> \<Omega>"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1208
  assumes empty: "{} \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1209
  assumes Diff: "\<And> A. A \<in> M \<Longrightarrow> \<Omega> - A \<in> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1210
  assumes "\<And>A. disjoint_family A \<Longrightarrow> range A \<subseteq> M \<Longrightarrow> (\<Union>i::nat. A i) \<in> M"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1211
  shows "Dynkin_system \<Omega> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1212
  using Diff[OF empty]  assms by (simp add: Dynkin_systemI)
42988
d8f3fc934ff6 add lemma indep_distribution_eq_measure
hoelzl
parents: 42987
diff changeset
  1213
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1214
lemma Dynkin_system_trivial:
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1215
  shows "Dynkin_system A (Pow A)"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1216
  by (rule Dynkin_systemI) auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1217
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1218
lemma sigma_algebra_imp_Dynkin_system:
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1219
  assumes "sigma_algebra \<Omega> M" shows "Dynkin_system \<Omega> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1220
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1221
  interpret sigma_algebra \<Omega> M by fact
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1222
  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
  1223
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1224
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1225
subsubsection "Intersection sets systems"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1226
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1227
definition\<^marker>\<open>tag important\<close> Int_stable :: "'a set set \<Rightarrow> bool" where
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1228
"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
  1229
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1230
lemma (in algebra) Int_stable: "Int_stable M"
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1231
  unfolding Int_stable_def by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1232
64008
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  1233
lemma Int_stableI_image:
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  1234
  "(\<And>i j. i \<in> I \<Longrightarrow> j \<in> I \<Longrightarrow> \<exists>k\<in>I. A i \<inter> A j = A k) \<Longrightarrow> Int_stable (A ` I)"
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  1235
  by (auto simp: Int_stable_def image_def)
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  1236
42981
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
  1237
lemma Int_stableI:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1238
  "(\<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
  1239
  unfolding Int_stable_def by auto
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
  1240
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
  1241
lemma Int_stableD:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1242
  "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
  1243
  unfolding Int_stable_def by auto
fe7f5a26e4c6 add lemma indep_sets_collect_sigma
hoelzl
parents: 42867
diff changeset
  1244
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1245
lemma (in Dynkin_system) sigma_algebra_eq_Int_stable:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1246
  "sigma_algebra \<Omega> M \<longleftrightarrow> Int_stable M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1247
proof
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1248
  assume "sigma_algebra \<Omega> M" then show "Int_stable M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1249
    unfolding sigma_algebra_def using algebra.Int_stable by auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1250
next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1251
  assume "Int_stable M"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1252
  show "sigma_algebra \<Omega> M"
42065
2b98b4c2e2f1 add ring_of_sets and subset_class as basis for algebra
hoelzl
parents: 41983
diff changeset
  1253
    unfolding sigma_algebra_disjoint_iff algebra_iff_Un
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1254
  proof (intro conjI ballI allI impI)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1255
    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
  1256
  next
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1257
    fix A B assume "A \<in> M" "B \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1258
    then have "A \<union> B = \<Omega> - ((\<Omega> - A) \<inter> (\<Omega> - B))"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1259
              "\<Omega> - A \<in> M" "\<Omega> - B \<in> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1260
      using sets_into_space by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1261
    then show "A \<union> B \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1262
      using \<open>Int_stable M\<close> unfolding Int_stable_def by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1263
  qed auto
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1264
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1265
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1266
subsubsection "Smallest Dynkin systems"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1267
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1268
definition\<^marker>\<open>tag important\<close> Dynkin :: "'a set \<Rightarrow> 'a set set \<Rightarrow> 'a set set" where
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1269
  "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
  1270
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1271
lemma Dynkin_system_Dynkin:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1272
  assumes "M \<subseteq> Pow (\<Omega>)"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1273
  shows "Dynkin_system \<Omega> (Dynkin \<Omega> M)"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1274
proof (rule Dynkin_systemI)
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1275
  fix A assume "A \<in> Dynkin \<Omega> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1276
  moreover
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1277
  { fix D assume "A \<in> D" and d: "Dynkin_system \<Omega> D"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1278
    then have "A \<subseteq> \<Omega>" by (auto simp: Dynkin_system_def subset_class_def) }
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1279
  moreover have "{D. Dynkin_system \<Omega> D \<and> M \<subseteq> D} \<noteq> {}"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1280
    using assms Dynkin_system_trivial by fastforce
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1281
  ultimately show "A \<subseteq> \<Omega>"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1282
    unfolding Dynkin_def using assms
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1283
    by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1284
next
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1285
  show "\<Omega> \<in> Dynkin \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1286
    unfolding Dynkin_def using Dynkin_system.space by fastforce
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1287
next
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1288
  fix A assume "A \<in> Dynkin \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1289
  then show "\<Omega> - A \<in> Dynkin \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1290
    unfolding Dynkin_def using Dynkin_system.compl by force
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1291
next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1292
  fix A :: "nat \<Rightarrow> 'a set"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1293
  assume A: "disjoint_family A" "range A \<subseteq> Dynkin \<Omega> M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1294
  then show "(\<Union>i. A i) \<in> Dynkin \<Omega> M" unfolding Dynkin_def
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1295
    by (auto intro!: Dynkin_system.UN)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1296
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1297
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1298
lemma Dynkin_Basic[intro]: "A \<in> M \<Longrightarrow> A \<in> Dynkin \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1299
  unfolding Dynkin_def by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1300
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1301
lemma (in Dynkin_system) restricted_Dynkin_system:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1302
  assumes "D \<in> M"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1303
  shows "Dynkin_system \<Omega> {Q. Q \<subseteq> \<Omega> \<and> Q \<inter> D \<in> M}"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1304
proof (rule Dynkin_systemI, simp_all)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1305
  have "\<Omega> \<inter> D = D"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1306
    using \<open>D \<in> M\<close> sets_into_space by auto
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1307
  then show "\<Omega> \<inter> D \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1308
    using \<open>D \<in> M\<close> by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1309
next
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1310
  fix A assume "A \<subseteq> \<Omega> \<and> A \<inter> D \<in> M"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1311
  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
  1312
    by auto
69284
3273692de24a more [simp]
nipkow
parents: 69164
diff changeset
  1313
  ultimately show "(\<Omega> - A) \<inter> D \<in> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1314
    using  \<open>D \<in> M\<close> by (auto intro: diff)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1315
next
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1316
  fix A :: "nat \<Rightarrow> 'a set"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1317
  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
  1318
  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
  1319
    "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
  1320
    by ((fastforce simp: disjoint_family_on_def)+)
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1321
  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
  1322
    by (auto simp del: UN_simps)
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1323
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1324
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1325
lemma (in Dynkin_system) Dynkin_subset:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1326
  assumes "N \<subseteq> M"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1327
  shows "Dynkin \<Omega> N \<subseteq> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1328
proof -
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1329
  have "Dynkin_system \<Omega> M" ..
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1330
  then have "Dynkin_system \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1331
    using assms unfolding Dynkin_system_def Dynkin_system_axioms_def subset_class_def by simp
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1332
  with \<open>N \<subseteq> M\<close> show ?thesis by (auto simp add: Dynkin_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1333
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1334
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1335
lemma sigma_eq_Dynkin:
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1336
  assumes sets: "M \<subseteq> Pow \<Omega>"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1337
  assumes "Int_stable M"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1338
  shows "sigma_sets \<Omega> M = Dynkin \<Omega> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1339
proof -
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1340
  have "Dynkin \<Omega> M \<subseteq> sigma_sets (\<Omega>) (M)"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1341
    using sigma_algebra_imp_Dynkin_system
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1342
    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
  1343
  moreover
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1344
  interpret Dynkin_system \<Omega> "Dynkin \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1345
    using Dynkin_system_Dynkin[OF sets] .
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1346
  have "sigma_algebra \<Omega> (Dynkin \<Omega> M)"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1347
    unfolding sigma_algebra_eq_Int_stable Int_stable_def
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1348
  proof (intro ballI)
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1349
    fix A B assume "A \<in> Dynkin \<Omega> M" "B \<in> Dynkin \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1350
    let ?D = "\<lambda>E. {Q. Q \<subseteq> \<Omega> \<and> Q \<inter> E \<in> Dynkin \<Omega> M}"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1351
    have "M \<subseteq> ?D B"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1352
    proof
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1353
      fix E assume "E \<in> M"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1354
      then have "M \<subseteq> ?D E" "E \<in> Dynkin \<Omega> M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1355
        using sets_into_space \<open>Int_stable M\<close> by (auto simp: Int_stable_def)
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1356
      then have "Dynkin \<Omega> M \<subseteq> ?D E"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1357
        using restricted_Dynkin_system \<open>E \<in> Dynkin \<Omega> M\<close>
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1358
        by (intro Dynkin_system.Dynkin_subset) simp_all
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1359
      then have "B \<in> ?D E"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1360
        using \<open>B \<in> Dynkin \<Omega> M\<close> by auto
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1361
      then have "E \<inter> B \<in> Dynkin \<Omega> M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1362
        by (subst Int_commute) simp
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1363
      then show "E \<in> ?D B"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1364
        using sets \<open>E \<in> M\<close> by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1365
    qed
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1366
    then have "Dynkin \<Omega> M \<subseteq> ?D B"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1367
      using restricted_Dynkin_system \<open>B \<in> Dynkin \<Omega> M\<close>
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1368
      by (intro Dynkin_system.Dynkin_subset) simp_all
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1369
    then show "A \<inter> B \<in> Dynkin \<Omega> M"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1370
      using \<open>A \<in> Dynkin \<Omega> M\<close> sets_into_space by auto
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1371
  qed
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1372
  from sigma_algebra.sigma_sets_subset[OF this, of "M"]
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1373
  have "sigma_sets (\<Omega>) (M) \<subseteq> Dynkin \<Omega> M" by auto
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1374
  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
  1375
  then show ?thesis
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1376
    by (auto simp: Dynkin_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1377
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1378
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1379
lemma (in Dynkin_system) Dynkin_idem:
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1380
  "Dynkin \<Omega> M = M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1381
proof -
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1382
  have "Dynkin \<Omega> M = M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1383
    using Dynkin_subset by blast
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1384
  then show ?thesis
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1385
    by (auto simp: Dynkin_def)
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1386
qed
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1387
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1388
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
  1389
  assumes "Int_stable E"
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1390
  and E: "E \<subseteq> M" "M \<subseteq> sigma_sets \<Omega> E"
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1391
  shows "sigma_sets \<Omega> E = M"
40859
de0b30e6c2d2 Support product spaces on sigma finite measures.
hoelzl
parents: 40702
diff changeset
  1392
proof -
47694
05663f75964c reworked Probability theory
hoelzl
parents: 46731
diff changeset
  1393
  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
  1394
    using E sets_into_space by force
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1395
  then have *: "sigma_sets \<Omega> E = Dynkin \<Omega> E"
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1396
    using \<open>Int_stable E\<close> by (rule sigma_eq_Dynkin)
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1397
  then have "Dynkin \<Omega> E = M"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1398
    using assms Dynkin_subset[OF \<open>E \<subseteq> M\<close>] by simp
53374
a14d2a854c02 tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents: 51683
diff changeset
  1399
  with * show ?thesis
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1400
    using assms by (auto simp: Dynkin_def)
42864
403e1cba1123 add measurable_Least
hoelzl
parents: 42863
diff changeset
  1401
qed
403e1cba1123 add measurable_Least
hoelzl
parents: 42863
diff changeset
  1402
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1403
subsubsection \<open>Induction rule for intersection-stable generators\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1404
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1405
text\<^marker>\<open>tag important\<close> \<open>The reason to introduce Dynkin-systems is the following induction rules for \<open>\<sigma>\<close>-algebras
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1406
generated by a generator closed under intersection.\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1407
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
  1408
proposition sigma_sets_induct_disjoint[consumes 3, case_names basic empty compl union]:
49789
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1409
  assumes "Int_stable G"
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1410
    and closed: "G \<subseteq> Pow \<Omega>"
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1411
    and A: "A \<in> sigma_sets \<Omega> G"
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1412
  assumes basic: "\<And>A. A \<in> G \<Longrightarrow> P A"
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1413
    and empty: "P {}"
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1414
    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
  1415
    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
  1416
  shows "P A"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
  1417
proof -
49789
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1418
  let ?D = "{ A \<in> sigma_sets \<Omega> G. P A }"
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1419
  interpret sigma_algebra \<Omega> "sigma_sets \<Omega> G"
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1420
    using closed by (rule sigma_algebra_sigma_sets)
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1421
  from compl[OF _ empty] closed have space: "P \<Omega>" by simp
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1422
  interpret Dynkin_system \<Omega> ?D
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 60772
diff changeset
  1423
    by standard (auto dest: sets_into_space intro!: space compl union)
49789
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1424
  have "sigma_sets \<Omega> G = ?D"
69555
b07ccc6fb13f dynkin -> Dynkin
nipkow
parents: 69554
diff changeset
  1425
    by (rule Dynkin_lemma) (auto simp: basic \<open>Int_stable G\<close>)
49789
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1426
  with A show ?thesis by auto
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1427
qed
e0a4cb91a8a9 add induction rule for intersection-stable sigma-sets
hoelzl
parents: 49782
diff changeset
  1428
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1429
subsection \<open>Measure type\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1430
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1431
definition\<^marker>\<open>tag important\<close> positive :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> bool" where
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
  1432
  "positive M \<mu> \<longleftrightarrow> \<mu> {} = 0"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1433
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1434
definition\<^marker>\<open>tag important\<close> countably_additive :: "'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> bool" where
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1435
"countably_additive M f \<longleftrightarrow>
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1436
  (\<forall>A. range A \<subseteq> M \<longrightarrow> disjoint_family A \<longrightarrow> (\<Union>i. A i) \<in> M \<longrightarrow>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1437
    (\<Sum>i. f (A i)) = f (\<Union>i. A i))"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1438
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1439
definition\<^marker>\<open>tag important\<close> measure_space :: "'a set \<Rightarrow> 'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> bool" where
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1440
"measure_space \<Omega> A \<mu> \<longleftrightarrow>
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1441
  sigma_algebra \<Omega> A \<and> positive A \<mu> \<and> countably_additive A \<mu>"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1442
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1443
typedef\<^marker>\<open>tag important\<close> 'a measure =
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1444
  "{(\<Omega>::'a set, A, \<mu>). (\<forall>a\<in>-A. \<mu> a = 0) \<and> measure_space \<Omega> A \<mu> }"
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1445
proof
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1446
  have "sigma_algebra UNIV {{}, UNIV}"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1447
    by (auto simp: sigma_algebra_iff2)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1448
  then show "(UNIV, {{}, UNIV}, \<lambda>A. 0) \<in> {(\<Omega>, A, \<mu>). (\<forall>a\<in>-A. \<mu> a = 0) \<and> measure_space \<Omega> A \<mu>} "
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1449
    by (auto simp: measure_space_def positive_def countably_additive_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1450
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1451
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1452
definition\<^marker>\<open>tag important\<close> space :: "'a measure \<Rightarrow> 'a set" where
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1453
  "space M = fst (Rep_measure M)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1454
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1455
definition\<^marker>\<open>tag important\<close> sets :: "'a measure \<Rightarrow> 'a set set" where
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1456
  "sets M = fst (snd (Rep_measure M))"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1457
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1458
definition\<^marker>\<open>tag important\<close> emeasure :: "'a measure \<Rightarrow> 'a set \<Rightarrow> ennreal" where
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1459
  "emeasure M = snd (snd (Rep_measure M))"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1460
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1461
definition\<^marker>\<open>tag important\<close> measure :: "'a measure \<Rightarrow> 'a set \<Rightarrow> real" where
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
  1462
  "measure M A = enn2real (emeasure M A)"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1463
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1464
declare [[coercion sets]]
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1465
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1466
declare [[coercion measure]]
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1467
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1468
declare [[coercion emeasure]]
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1469
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1470
lemma measure_space: "measure_space (space M) (sets M) (emeasure M)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1471
  by (cases M) (auto simp: space_def sets_def emeasure_def Abs_measure_inverse)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1472
61605
1bf7b186542e qualifier is mandatory by default;
wenzelm
parents: 61384
diff changeset
  1473
interpretation sets: sigma_algebra "space M" "sets M" for M :: "'a measure"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1474
  using measure_space[of M] by (auto simp: measure_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1475
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1476
definition\<^marker>\<open>tag important\<close> measure_of :: "'a set \<Rightarrow> 'a set set \<Rightarrow> ('a set \<Rightarrow> ennreal) \<Rightarrow> 'a measure"
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1477
  where
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1478
    "measure_of \<Omega> A \<mu> \<equiv>
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1479
      Abs_measure (\<Omega>, if A \<subseteq> Pow \<Omega> then sigma_sets \<Omega> A else {{}, \<Omega>},
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1480
        \<lambda>a. if a \<in> sigma_sets \<Omega> A \<and> measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> then \<mu> a else 0)"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1481
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1482
abbreviation "sigma \<Omega> A \<equiv> measure_of \<Omega> A (\<lambda>x. 0)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1483
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1484
lemma measure_space_0: "A \<subseteq> Pow \<Omega> \<Longrightarrow> measure_space \<Omega> (sigma_sets \<Omega> A) (\<lambda>x. 0)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1485
  unfolding measure_space_def
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1486
  by (auto intro!: sigma_algebra_sigma_sets simp: positive_def countably_additive_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1487
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1488
lemma sigma_algebra_trivial: "sigma_algebra \<Omega> {{}, \<Omega>}"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1489
  by unfold_locales(fastforce intro: exI[where x="{{}}"] exI[where x="{\<Omega>}"])+
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1490
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1491
lemma measure_space_0': "measure_space \<Omega> {{}, \<Omega>} (\<lambda>x. 0)"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1492
  by(simp add: measure_space_def positive_def countably_additive_def sigma_algebra_trivial)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1493
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1494
lemma measure_space_closed:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1495
  assumes "measure_space \<Omega> M \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1496
  shows "M \<subseteq> Pow \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1497
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1498
  interpret sigma_algebra \<Omega> M using assms by(simp add: measure_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1499
  show ?thesis by(rule space_closed)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1500
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1501
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1502
lemma (in ring_of_sets) positive_cong_eq:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1503
  "(\<And>a. a \<in> M \<Longrightarrow> \<mu>' a = \<mu> a) \<Longrightarrow> positive M \<mu>' = positive M \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1504
  by (auto simp add: positive_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1505
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1506
lemma (in sigma_algebra) countably_additive_eq:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1507
  "(\<And>a. a \<in> M \<Longrightarrow> \<mu>' a = \<mu> a) \<Longrightarrow> countably_additive M \<mu>' = countably_additive M \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1508
  unfolding countably_additive_def
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1509
  by (intro arg_cong[where f=All] ext) (auto simp add: countably_additive_def subset_eq)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1510
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1511
lemma measure_space_eq:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1512
  assumes closed: "A \<subseteq> Pow \<Omega>" and eq: "\<And>a. a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> a = \<mu>' a"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1513
  shows "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1514
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1515
  interpret sigma_algebra \<Omega> "sigma_sets \<Omega> A" using closed by (rule sigma_algebra_sigma_sets)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1516
  from positive_cong_eq[OF eq, of "\<lambda>i. i"] countably_additive_eq[OF eq, of "\<lambda>i. i"] show ?thesis
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1517
    by (auto simp: measure_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1518
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1519
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1520
lemma measure_of_eq:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1521
  assumes closed: "A \<subseteq> Pow \<Omega>" and eq: "(\<And>a. a \<in> sigma_sets \<Omega> A \<Longrightarrow> \<mu> a = \<mu>' a)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1522
  shows "measure_of \<Omega> A \<mu> = measure_of \<Omega> A \<mu>'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1523
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1524
  have "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1525
    using assms by (rule measure_space_eq)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1526
  with eq show ?thesis
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1527
    by (auto simp add: measure_of_def intro!: arg_cong[where f=Abs_measure])
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1528
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1529
79583
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1530
lemma measure_space_Pow_eq:
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1531
  assumes "\<And>X. X \<in> Pow \<Omega> \<Longrightarrow> \<mu> X = \<mu>' X"
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1532
  shows "measure_space \<Omega> (Pow \<Omega>) \<mu> = measure_space \<Omega> (Pow \<Omega>) \<mu>'"
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1533
  by (smt (verit, best) assms measure_space_eq sigma_algebra.sigma_sets_eq sigma_algebra_Pow subset_eq)
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1534
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1535
lemma
76834
4645ca4457db Continued proof simplifications
paulson <lp15@cam.ac.uk>
parents: 76832
diff changeset
  1536
  shows space_measure_of_conv: "space (measure_of \<Omega> A \<mu>) = \<Omega>" (is ?space)
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1537
    and sets_measure_of_conv: "sets (measure_of \<Omega> A \<mu>) = 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1538
                                 (if A \<subseteq> Pow \<Omega> then sigma_sets \<Omega> A else {{}, \<Omega>})" (is ?sets)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1539
    and emeasure_measure_of_conv: "emeasure (measure_of \<Omega> A \<mu>) =
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1540
                                 (\<lambda>B. if B \<in> sigma_sets \<Omega> A \<and> measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> then \<mu> B else 0)" (is ?emeasure)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1541
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1542
  have "?space \<and> ?sets \<and> ?emeasure"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1543
  proof(cases "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>")
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1544
    case True
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1545
    from measure_space_closed[OF this] sigma_sets_superset_generator[of A \<Omega>]
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1546
    have "A \<subseteq> Pow \<Omega>" by simp
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1547
    hence "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu> = measure_space \<Omega> (sigma_sets \<Omega> A)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1548
      (\<lambda>a. if a \<in> sigma_sets \<Omega> A then \<mu> a else 0)"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1549
      by (simp add: True measure_space_eq)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1550
    with True \<open>A \<subseteq> Pow \<Omega>\<close> show ?thesis
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1551
      by(simp add: measure_of_def space_def sets_def emeasure_def Abs_measure_inverse)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1552
  next
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1553
    case False thus ?thesis
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1554
      by(cases "A \<subseteq> Pow \<Omega>")(simp_all add: Abs_measure_inverse measure_of_def sets_def space_def emeasure_def measure_space_0 measure_space_0')
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1555
  qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1556
  thus ?space ?sets ?emeasure by simp_all
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1557
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1558
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1559
lemma [simp]:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1560
  assumes A: "A \<subseteq> Pow \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1561
  shows sets_measure_of: "sets (measure_of \<Omega> A \<mu>) = sigma_sets \<Omega> A"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1562
    and space_measure_of: "space (measure_of \<Omega> A \<mu>) = \<Omega>"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1563
  using assms by(simp_all add: sets_measure_of_conv space_measure_of_conv)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1564
64008
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  1565
lemma space_in_measure_of[simp]: "\<Omega> \<in> sets (measure_of \<Omega> M \<mu>)"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1566
  by (metis sets.top space_measure_of_conv)
64008
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  1567
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1568
lemma (in sigma_algebra) sets_measure_of_eq[simp]: "sets (measure_of \<Omega> M \<mu>) = M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1569
  using space_closed by (auto intro!: sigma_sets_eq)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1570
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1571
lemma (in sigma_algebra) space_measure_of_eq[simp]: "space (measure_of \<Omega> M \<mu>) = \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1572
  by (rule space_measure_of_conv)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1573
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1574
lemma measure_of_subset: "M \<subseteq> Pow \<Omega> \<Longrightarrow> M' \<subseteq> M \<Longrightarrow> sets (measure_of \<Omega> M' \<mu>) \<subseteq> sets (measure_of \<Omega> M \<mu>')"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1575
  by (auto intro!: sigma_sets_subseteq)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1576
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1577
lemma emeasure_sigma: "emeasure (sigma \<Omega> A) = (\<lambda>x. 0)"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1578
  unfolding measure_of_def emeasure_def
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1579
  by (subst Abs_measure_inverse)
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1580
     (auto simp: measure_space_def positive_def countably_additive_def
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1581
           intro!: sigma_algebra_sigma_sets sigma_algebra_trivial)
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1582
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1583
lemma sigma_sets_mono'':
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1584
  assumes "A \<in> sigma_sets C D"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1585
  assumes "B \<subseteq> D"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1586
  assumes "D \<subseteq> Pow C"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1587
  shows "sigma_sets A B \<subseteq> sigma_sets C D"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1588
proof
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1589
  fix x assume "x \<in> sigma_sets A B"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1590
  thus "x \<in> sigma_sets C D"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1591
  proof induct
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1592
    case (Basic a) with assms have "a \<in> D" by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1593
    thus ?case ..
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1594
  next
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1595
    case Empty show ?case by (rule sigma_sets.Empty)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1596
  next
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1597
    from assms have "A \<in> sets (sigma C D)" by (subst sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>])
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1598
    moreover case (Compl a) hence "a \<in> sets (sigma C D)" by (subst sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>])
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1599
    ultimately have "A - a \<in> sets (sigma C D)" ..
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1600
    thus ?case by (subst (asm) sets_measure_of[OF \<open>D \<subseteq> Pow C\<close>])
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1601
  next
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1602
    case (Union a)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1603
    thus ?case by (intro sigma_sets.Union)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1604
  qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1605
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1606
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1607
lemma in_measure_of[intro, simp]: "M \<subseteq> Pow \<Omega> \<Longrightarrow> A \<in> M \<Longrightarrow> A \<in> sets (measure_of \<Omega> M \<mu>)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1608
  by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1609
58606
9c66f7c541fb add Giry monad
hoelzl
parents: 58588
diff changeset
  1610
lemma space_empty_iff: "space N = {} \<longleftrightarrow> sets N = {{}}"
9c66f7c541fb add Giry monad
hoelzl
parents: 58588
diff changeset
  1611
  by (metis Pow_empty Sup_bot_conv(1) cSup_singleton empty_iff
9c66f7c541fb add Giry monad
hoelzl
parents: 58588
diff changeset
  1612
            sets.sigma_sets_eq sets.space_closed sigma_sets_top subset_singletonD)
9c66f7c541fb add Giry monad
hoelzl
parents: 58588
diff changeset
  1613
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69566
diff changeset
  1614
subsubsection \<open>Constructing simple \<^typ>\<open>'a measure\<close>\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1615
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
  1616
proposition emeasure_measure_of:
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1617
  assumes M: "M = measure_of \<Omega> A \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1618
  assumes ms: "A \<subseteq> Pow \<Omega>" "positive (sets M) \<mu>" "countably_additive (sets M) \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1619
  assumes X: "X \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1620
  shows "emeasure M X = \<mu> X"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68403
diff changeset
  1621
proof -
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1622
  interpret sigma_algebra \<Omega> "sigma_sets \<Omega> A" by (rule sigma_algebra_sigma_sets) fact
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1623
  have "measure_space \<Omega> (sigma_sets \<Omega> A) \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1624
    using ms M by (simp add: measure_space_def sigma_algebra_sigma_sets)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1625
  thus ?thesis using X ms
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1626
    by(simp add: M emeasure_measure_of_conv sets_measure_of_conv)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1627
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1628
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1629
lemma emeasure_measure_of_sigma:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1630
  assumes ms: "sigma_algebra \<Omega> M" "positive M \<mu>" "countably_additive M \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1631
  assumes A: "A \<in> M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1632
  shows "emeasure (measure_of \<Omega> M \<mu>) A = \<mu> A"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1633
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1634
  interpret sigma_algebra \<Omega> M by fact
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1635
  have "measure_space \<Omega> (sigma_sets \<Omega> M) \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1636
    using ms sigma_sets_eq by (simp add: measure_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1637
  thus ?thesis by(simp add: emeasure_measure_of_conv A)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1638
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1639
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1640
lemma measure_cases[cases type: measure]:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1641
  obtains (measure) \<Omega> A \<mu> where "x = Abs_measure (\<Omega>, A, \<mu>)" "\<forall>a\<in>-A. \<mu> a = 0" "measure_space \<Omega> A \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1642
  by atomize_elim (cases x, auto)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1643
60772
a0cfa9050fa8 Measures form a CCPO
hoelzl
parents: 60727
diff changeset
  1644
lemma sets_le_imp_space_le: "sets A \<subseteq> sets B \<Longrightarrow> space A \<subseteq> space B"
a0cfa9050fa8 Measures form a CCPO
hoelzl
parents: 60727
diff changeset
  1645
  by (auto dest: sets.sets_into_space)
a0cfa9050fa8 Measures form a CCPO
hoelzl
parents: 60727
diff changeset
  1646
a0cfa9050fa8 Measures form a CCPO
hoelzl
parents: 60727
diff changeset
  1647
lemma sets_eq_imp_space_eq: "sets M = sets M' \<Longrightarrow> space M = space M'"
a0cfa9050fa8 Measures form a CCPO
hoelzl
parents: 60727
diff changeset
  1648
  by (auto intro!: antisym sets_le_imp_space_le)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1649
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1650
lemma emeasure_notin_sets: "A \<notin> sets M \<Longrightarrow> emeasure M A = 0"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1651
  by (cases M) (auto simp: sets_def emeasure_def Abs_measure_inverse measure_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1652
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1653
lemma emeasure_neq_0_sets: "emeasure M A \<noteq> 0 \<Longrightarrow> A \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1654
  using emeasure_notin_sets[of A M] by blast
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1655
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1656
lemma measure_notin_sets: "A \<notin> sets M \<Longrightarrow> measure M A = 0"
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
  1657
  by (simp add: measure_def emeasure_notin_sets zero_ennreal.rep_eq)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1658
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1659
lemma measure_eqI:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1660
  fixes M N :: "'a measure"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1661
  assumes "sets M = sets N" and eq: "\<And>A. A \<in> sets M \<Longrightarrow> emeasure M A = emeasure N A"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1662
  shows "M = N"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1663
proof (cases M N rule: measure_cases[case_product measure_cases])
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1664
  case (measure_measure \<Omega> A \<mu> \<Omega>' A' \<mu>')
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1665
  interpret M: sigma_algebra \<Omega> A using measure_measure by (auto simp: measure_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1666
  interpret N: sigma_algebra \<Omega>' A' using measure_measure by (auto simp: measure_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1667
  have "A = sets M" "A' = sets N"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1668
    using measure_measure by (simp_all add: sets_def Abs_measure_inverse)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1669
  with \<open>sets M = sets N\<close> have AA': "A = A'" by simp
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1670
  moreover have "\<Omega> = \<Omega>'"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1671
    using M.sets_into_space M.top N.sets_into_space AA' by auto 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1672
  moreover
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1673
  have "\<mu> B = \<mu>' B" for B
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1674
  proof cases
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1675
    assume "B \<in> A"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1676
    with eq \<open>A = sets M\<close> have "emeasure M B = emeasure N B" by simp
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1677
    with measure_measure show "\<mu> B = \<mu>' B"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1678
      by (simp add: emeasure_def Abs_measure_inverse)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1679
  next
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1680
    assume "B \<notin> A"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1681
    with \<open>A = sets M\<close> \<open>A' = sets N\<close> \<open>A = A'\<close> have "B \<notin> sets M" "B \<notin> sets N"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1682
      by auto
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1683
    then have "emeasure M B = 0" "emeasure N B = 0"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1684
      by (simp_all add: emeasure_notin_sets)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1685
    with measure_measure show "\<mu> B = \<mu>' B"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1686
      by (simp add: emeasure_def Abs_measure_inverse)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1687
  qed 
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1688
  ultimately show "M = N"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1689
    using measure_measure by presburger
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1690
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1691
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1692
lemma sigma_eqI:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1693
  assumes [simp]: "M \<subseteq> Pow \<Omega>" "N \<subseteq> Pow \<Omega>" "sigma_sets \<Omega> M = sigma_sets \<Omega> N"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1694
  shows "sigma \<Omega> M = sigma \<Omega> N"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1695
  by (simp add: emeasure_sigma measure_eqI)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1696
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1697
subsubsection \<open>Measurable functions\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1698
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1699
definition\<^marker>\<open>tag important\<close> measurable :: "'a measure \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) set"
80914
d97fdabd9e2b standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
wenzelm
parents: 79583
diff changeset
  1700
  (infixr \<open>\<rightarrow>\<^sub>M\<close> 60) where
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1701
"measurable A B = {f \<in> space A \<rightarrow> space B. \<forall>y \<in> sets B. f -` y \<inter> space A \<in> sets A}"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1702
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1703
lemma measurableI:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1704
  "(\<And>x. x \<in> space M \<Longrightarrow> f x \<in> space N) \<Longrightarrow> (\<And>A. A \<in> sets N \<Longrightarrow> f -` A \<inter> space M \<in> sets M) \<Longrightarrow>
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1705
    f \<in> measurable M N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1706
  by (auto simp: measurable_def)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1707
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1708
lemma measurable_space:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1709
  "f \<in> measurable M A \<Longrightarrow> x \<in> space M \<Longrightarrow> f x \<in> space A"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1710
   unfolding measurable_def by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1711
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1712
lemma measurable_sets:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1713
  "f \<in> measurable M A \<Longrightarrow> S \<in> sets A \<Longrightarrow> f -` S \<inter> space M \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1714
   unfolding measurable_def by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1715
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1716
lemma measurable_sets_Collect:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1717
  assumes f: "f \<in> measurable M N" and P: "{x\<in>space N. P x} \<in> sets N" shows "{x\<in>space M. P (f x)} \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1718
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1719
  have "f -` {x \<in> space N. P x} \<inter> space M = {x\<in>space M. P (f x)}"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1720
    using measurable_space[OF f] by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1721
  with measurable_sets[OF f P] show ?thesis
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1722
    by simp
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1723
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1724
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1725
lemma measurable_sigma_sets:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1726
  assumes B: "sets N = sigma_sets \<Omega> A" "A \<subseteq> Pow \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1727
      and f: "f \<in> space M \<rightarrow> \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1728
      and ba: "\<And>y. y \<in> A \<Longrightarrow> (f -` y) \<inter> space M \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1729
  shows "f \<in> measurable M N"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1730
proof -
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1731
  interpret A: sigma_algebra \<Omega> "sigma_sets \<Omega> A" using B(2) 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1732
    by (rule sigma_algebra_sigma_sets)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1733
  have \<Omega>: "\<Omega> = space N"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1734
    by (metis A.Int_space_eq2 A.top assms(1) sets.Int_space_eq1 sets.top)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1735
  have "f -` X \<inter> space M \<in> sets M \<and> X \<subseteq> \<Omega>" if "X \<in> sigma_sets \<Omega> A" for X
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1736
    using that
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1737
  proof induct
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1738
    case (Basic a) then show ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1739
      by (auto simp add: ba) (metis B(2) subsetD PowD)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1740
  next
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1741
    case (Compl a)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1742
    have [simp]: "f -` \<Omega> \<inter> space M = space M"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1743
      by (auto simp add: funcset_mem [OF f])
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1744
    then show ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1745
      by (auto simp add: vimage_Diff Diff_Int_distrib2 sets.compl_sets Compl)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1746
  next
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1747
    case (Union a)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1748
    then have "(\<Union>x. f -` a x \<inter> space M) \<in> sets M"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1749
      by blast
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1750
    then show ?case
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1751
      by (metis UN_extend_simps(4) UN_least Union.hyps(2) vimage_UN)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1752
  qed auto 
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1753
  with f show ?thesis
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1754
    by (auto simp add: measurable_def B \<Omega>)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1755
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1756
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1757
lemma measurable_measure_of:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1758
  assumes B: "N \<subseteq> Pow \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1759
      and f: "f \<in> space M \<rightarrow> \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1760
      and ba: "\<And>y. y \<in> N \<Longrightarrow> (f -` y) \<inter> space M \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1761
  shows "f \<in> measurable M (measure_of \<Omega> N \<mu>)"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1762
  by (simp add: B ba f measurable_sigma_sets)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1763
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1764
lemma measurable_iff_measure_of:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1765
  assumes "N \<subseteq> Pow \<Omega>" "f \<in> space M \<rightarrow> \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1766
  shows "f \<in> measurable M (measure_of \<Omega> N \<mu>) \<longleftrightarrow> (\<forall>A\<in>N. f -` A \<inter> space M \<in> sets M)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1767
  by (metis assms in_measure_of measurable_measure_of assms measurable_sets)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1768
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1769
lemma measurable_cong_sets:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1770
  assumes sets: "sets M = sets M'" "sets N = sets N'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1771
  shows "measurable M N = measurable M' N'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1772
  using sets[THEN sets_eq_imp_space_eq] sets by (simp add: measurable_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1773
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1774
lemma measurable_cong:
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1775
  assumes "\<And>w. w \<in> space M \<Longrightarrow> f w = g w"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1776
  shows "f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable M M'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1777
  unfolding measurable_def using assms
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1778
  by (simp cong: vimage_inter_cong Pi_cong)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1779
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1780
lemma measurable_cong':
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1781
  assumes "\<And>w. w \<in> space M =simp=> f w = g w"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1782
  shows "f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable M M'"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1783
  unfolding measurable_def using assms
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1784
  by (simp cong: vimage_inter_cong Pi_cong add: simp_implies_def)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1785
69546
27dae626822b prefer naming convention from datatype package for strong congruence rules
haftmann
parents: 69313
diff changeset
  1786
lemma measurable_cong_simp:
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1787
  "M = N \<Longrightarrow> M' = N' \<Longrightarrow> (\<And>w. w \<in> space M \<Longrightarrow> f w = g w) \<Longrightarrow>
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1788
    f \<in> measurable M M' \<longleftrightarrow> g \<in> measurable N N'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1789
  by (metis measurable_cong)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1790
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1791
lemma measurable_compose:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1792
  assumes f: "f \<in> measurable M N" and g: "g \<in> measurable N L"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1793
  shows "(\<lambda>x. g (f x)) \<in> measurable M L"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1794
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1795
  have "\<And>A. (\<lambda>x. g (f x)) -` A \<inter> space M = f -` (g -` A \<inter> space N) \<inter> space M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1796
    using measurable_space[OF f] by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1797
  with measurable_space[OF f] measurable_space[OF g] show ?thesis
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1798
    by (metis f g measurableI measurable_sets)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1799
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1800
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1801
lemma measurable_comp:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1802
  "f \<in> measurable M N \<Longrightarrow> g \<in> measurable N L \<Longrightarrow> g \<circ> f \<in> measurable M L"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1803
  using measurable_compose[of f M N g L] by (simp add: comp_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1804
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1805
lemma measurable_const:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1806
  "c \<in> space M' \<Longrightarrow> (\<lambda>x. c) \<in> measurable M M'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1807
  by (auto simp add: measurable_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1808
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1809
lemma measurable_ident: "id \<in> measurable M M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1810
  by (auto simp add: measurable_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1811
59048
7dc8ac6f0895 add congruence solver to measurability prover
hoelzl
parents: 59000
diff changeset
  1812
lemma measurable_id: "(\<lambda>x. x) \<in> measurable M M"
7dc8ac6f0895 add congruence solver to measurability prover
hoelzl
parents: 59000
diff changeset
  1813
  by (simp add: measurable_def)
7dc8ac6f0895 add congruence solver to measurability prover
hoelzl
parents: 59000
diff changeset
  1814
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1815
lemma measurable_ident_sets:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1816
  assumes eq: "sets M = sets M'" shows "(\<lambda>x. x) \<in> measurable M M'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1817
  using measurable_ident[of M]
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1818
  unfolding id_def measurable_def eq sets_eq_imp_space_eq[OF eq] .
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1819
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1820
lemma sets_Least:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1821
  assumes meas: "\<And>i::nat. {x\<in>space M. P i x} \<in> M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1822
  shows "(\<lambda>x. LEAST j. P j x) -` A \<inter> space M \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1823
proof -
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1824
  have "(\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M \<in> sets M" for i
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1825
  proof cases
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1826
    assume i: "(LEAST j. False) = i"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1827
    have "(\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M =
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1828
          {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}))"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1829
    proof -
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1830
      have 1: "P (LEAST j. P j x) x" if "P i x" for x i
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1831
        using that by (meson LeastI)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1832
      have 2: False if "j < (LEAST j. P j x)" and "P j x" for x j
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1833
        using that not_less_Least by blast
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1834
      have "(LEAST j. P j x) = i"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1835
        if "\<forall>j<i. \<not> P j x" and "P i x" for x
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1836
        using that by (metis 1 2 antisym_conv3 )
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1837
      with 1 2 show ?thesis
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1838
        by (auto simp: i)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1839
    qed
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1840
    with meas show ?thesis
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1841
      by (auto intro!: sets.Int)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1842
  next
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1843
    assume i: "(LEAST j. False) \<noteq> i"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1844
    then have "(\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M =
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1845
        {x\<in>space M. P i x} \<inter> (space M - (\<Union>j<i. {x\<in>space M. P j x}))"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1846
    proof (simp add: set_eq_iff, safe)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1847
      fix x assume neq: "(LEAST j. False) \<noteq> (LEAST j. P j x)"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1848
      have "\<exists>j. P j x"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1849
        by (rule ccontr) (insert neq, auto)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1850
      then show "P (LEAST j. P j x) x" by (rule LeastI_ex)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1851
    qed (auto dest: Least_le intro!: Least_equality)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1852
    with meas show ?thesis
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1853
      by auto
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1854
  qed 
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1855
  then have "(\<Union>i\<in>A. (\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M) \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1856
    by (intro sets.countable_UN) auto
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1857
  moreover 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1858
  have "(\<Union>i\<in>A. (\<lambda>x. LEAST j. P j x) -` {i} \<inter> space M) =
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1859
        (\<lambda>x. LEAST j. P j x) -` A \<inter> space M" 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  1860
    by auto
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1861
  ultimately show ?thesis by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1862
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1863
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1864
lemma measurable_mono1:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1865
  "M' \<subseteq> Pow \<Omega> \<Longrightarrow> M \<subseteq> M' \<Longrightarrow>
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1866
    measurable (measure_of \<Omega> M \<mu>) N \<subseteq> measurable (measure_of \<Omega> M' \<mu>') N"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1867
  using measure_of_subset[of M' \<Omega> M] by (auto simp add: measurable_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1868
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1869
subsubsection \<open>Counting space\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1870
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1871
definition\<^marker>\<open>tag important\<close> count_space :: "'a set \<Rightarrow> 'a measure" where
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1872
"count_space \<Omega> = measure_of \<Omega> (Pow \<Omega>) (\<lambda>A. if finite A then of_nat (card A) else \<infinity>)"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1873
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
  1874
lemma
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1875
  shows space_count_space[simp]: "space (count_space \<Omega>) = \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1876
    and sets_count_space[simp]: "sets (count_space \<Omega>) = Pow \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1877
  using sigma_sets_into_sp[of "Pow \<Omega>" \<Omega>]
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1878
  by (auto simp: count_space_def)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1879
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1880
lemma measurable_count_space_eq1[simp]:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1881
  "f \<in> measurable (count_space A) M \<longleftrightarrow> f \<in> A \<rightarrow> space M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1882
 unfolding measurable_def by simp
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1883
79583
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1884
lemma finite_count_space: "finite \<Omega> \<Longrightarrow> count_space \<Omega> = measure_of \<Omega> (Pow \<Omega>) card"
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1885
  unfolding count_space_def
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1886
  by (smt (verit, best) PowD Pow_top count_space_def finite_subset measure_of_eq sets_count_space sets_measure_of)
a521c241e946 Further lemmas concerning complexity and measures
paulson <lp15@cam.ac.uk>
parents: 76834
diff changeset
  1887
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1888
lemma measurable_compose_countable':
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1889
  assumes f: "\<And>i. i \<in> I \<Longrightarrow> (\<lambda>x. f i x) \<in> measurable M N"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1890
  and g: "g \<in> measurable M (count_space I)" and I: "countable I"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1891
  shows "(\<lambda>x. f (g x) x) \<in> measurable M N"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1892
  unfolding measurable_def
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1893
proof safe
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1894
  fix x assume "x \<in> space M" then show "f (g x) x \<in> space N"
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1895
    using measurable_space[OF f] g[THEN measurable_space] by auto
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1896
next
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1897
  fix A assume A: "A \<in> sets N"
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1898
  have "(\<lambda>x. f (g x) x) -` A \<inter> space M = (\<Union>i\<in>I. (g -` {i} \<inter> space M) \<inter> (f i -` A \<inter> space M))"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  1899
    using measurable_space[OF g] by auto
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1900
  also have "\<dots> \<in> sets M"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1901
    using f[THEN measurable_sets, OF _ A] g[THEN measurable_sets]
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1902
    by (auto intro!: sets.countable_UN' I intro: sets.Int[OF measurable_sets measurable_sets])
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1903
  finally show "(\<lambda>x. f (g x) x) -` A \<inter> space M \<in> sets M" .
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1904
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1905
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1906
lemma measurable_count_space_eq_countable:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1907
  assumes "countable A"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1908
  shows "f \<in> measurable M (count_space A) \<longleftrightarrow> (f \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M))"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1909
proof -
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1910
  { fix X assume "X \<subseteq> A" "f \<in> space M \<rightarrow> A"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1911
    with \<open>countable A\<close> have "f -` X \<inter> space M = (\<Union>a\<in>X. f -` {a} \<inter> space M)" "countable X"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1912
      by (auto dest: countable_subset)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1913
    moreover assume "\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1914
    ultimately have "f -` X \<inter> space M \<in> sets M"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1915
      using \<open>X \<subseteq> A\<close> by (auto intro!: sets.countable_UN' simp del: UN_simps) }
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1916
  then show ?thesis
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1917
    unfolding measurable_def by auto
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1918
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1919
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1920
lemma measurable_count_space_eq2:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1921
  "finite A \<Longrightarrow> f \<in> measurable M (count_space A) \<longleftrightarrow> (f \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M))"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1922
  by (intro measurable_count_space_eq_countable countable_finite)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1923
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1924
lemma measurable_count_space_eq2_countable:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1925
  fixes f :: "'a => 'c::countable"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1926
  shows "f \<in> measurable M (count_space A) \<longleftrightarrow> (f \<in> space M \<rightarrow> A \<and> (\<forall>a\<in>A. f -` {a} \<inter> space M \<in> sets M))"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1927
  by (intro measurable_count_space_eq_countable countableI_type)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1928
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1929
lemma measurable_compose_countable:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1930
  assumes f: "\<And>i::'i::countable. (\<lambda>x. f i x) \<in> measurable M N" and g: "g \<in> measurable M (count_space UNIV)"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1931
  shows "(\<lambda>x. f (g x) x) \<in> measurable M N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1932
  by (rule measurable_compose_countable'[OF assms]) auto
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1933
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1934
lemma measurable_count_space_const:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1935
  "(\<lambda>x. c) \<in> measurable M (count_space UNIV)"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1936
  by (simp add: measurable_const)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1937
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1938
lemma measurable_count_space:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1939
  "f \<in> measurable (count_space A) (count_space UNIV)"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1940
  by simp
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1941
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1942
lemma measurable_compose_rev:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1943
  assumes f: "f \<in> measurable L N" and g: "g \<in> measurable M L"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1944
  shows "(\<lambda>x. f (g x)) \<in> measurable M N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1945
  using measurable_compose[OF g f] .
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  1946
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
  1947
lemma measurable_empty_iff:
58606
9c66f7c541fb add Giry monad
hoelzl
parents: 58588
diff changeset
  1948
  "space N = {} \<Longrightarrow> f \<in> measurable M N \<longleftrightarrow> space M = {}"
9c66f7c541fb add Giry monad
hoelzl
parents: 58588
diff changeset
  1949
  by (auto simp add: measurable_def Pi_iff)
9c66f7c541fb add Giry monad
hoelzl
parents: 58588
diff changeset
  1950
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  1951
subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Extend measure\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1952
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1953
definition extend_measure :: "'a set \<Rightarrow> 'b set \<Rightarrow> ('b \<Rightarrow> 'a set) \<Rightarrow> ('b \<Rightarrow> ennreal) \<Rightarrow> 'a measure"
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1954
  where
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  1955
"extend_measure \<Omega> I G \<mu> =
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1956
  (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)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1957
      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>')
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1958
      else measure_of \<Omega> (G`I) (\<lambda>_. 0))"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1959
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1960
lemma space_extend_measure: "G ` I \<subseteq> Pow \<Omega> \<Longrightarrow> space (extend_measure \<Omega> I G \<mu>) = \<Omega>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1961
  unfolding extend_measure_def by simp
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1962
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1963
lemma sets_extend_measure: "G ` I \<subseteq> Pow \<Omega> \<Longrightarrow> sets (extend_measure \<Omega> I G \<mu>) = sigma_sets \<Omega> (G`I)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1964
  unfolding extend_measure_def by simp
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1965
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1966
lemma emeasure_extend_measure:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1967
  assumes M: "M = extend_measure \<Omega> I G \<mu>"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1968
    and eq: "\<And>i. i \<in> I \<Longrightarrow> \<mu>' (G i) = \<mu> i"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1969
    and ms: "G ` I \<subseteq> Pow \<Omega>" "positive (sets M) \<mu>'" "countably_additive (sets M) \<mu>'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1970
    and "i \<in> I"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1971
  shows "emeasure M (G i) = \<mu> i"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1972
proof cases
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1973
  assume *: "(\<forall>i\<in>I. \<mu> i = 0)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1974
  with M have M_eq: "M = measure_of \<Omega> (G`I) (\<lambda>_. 0)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1975
   by (simp add: extend_measure_def)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1976
  from measure_space_0[OF ms(1)] ms \<open>i\<in>I\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1977
  have "emeasure M (G i) = 0"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1978
    by (intro emeasure_measure_of[OF M_eq]) (auto simp add: M measure_space_def sets_extend_measure)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1979
  with \<open>i\<in>I\<close> * show ?thesis
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1980
    by simp
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1981
next
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62975
diff changeset
  1982
  define P where "P \<mu>' \<longleftrightarrow> (\<forall>i\<in>I. \<mu>' (G i) = \<mu> i) \<and> measure_space \<Omega> (sigma_sets \<Omega> (G`I)) \<mu>'" for \<mu>'
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1983
  assume "\<not> (\<forall>i\<in>I. \<mu> i = 0)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1984
  moreover
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1985
  have "measure_space (space M) (sets M) \<mu>'"
61169
4de9ff3ea29a tuned proofs -- less legacy;
wenzelm
parents: 60772
diff changeset
  1986
    using ms unfolding measure_space_def by auto standard
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1987
  with ms eq have "\<exists>\<mu>'. P \<mu>'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1988
    unfolding P_def
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1989
    by (intro exI[of _ \<mu>']) (auto simp add: M space_extend_measure sets_extend_measure)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1990
  ultimately have M_eq: "M = measure_of \<Omega> (G`I) (Eps P)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1991
    by (simp add: M extend_measure_def P_def[symmetric])
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1992
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1993
  from \<open>\<exists>\<mu>'. P \<mu>'\<close> have P: "P (Eps P)" by (rule someI_ex)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1994
  show "emeasure M (G i) = \<mu> i"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1995
  proof (subst emeasure_measure_of[OF M_eq])
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1996
    have sets_M: "sets M = sigma_sets \<Omega> (G`I)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1997
      using M_eq ms by (auto simp: sets_extend_measure)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  1998
    then show "G i \<in> sets M" using \<open>i \<in> I\<close> by auto
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  1999
    show "positive (sets M) (Eps P)" "countably_additive (sets M) (Eps P)" "Eps P (G i) = \<mu> i"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  2000
      using P \<open>i\<in>I\<close> by (auto simp add: sets_M measure_space_def P_def)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2001
  qed fact
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2002
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2003
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2004
lemma emeasure_extend_measure_Pair:
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2005
  assumes M: "M = extend_measure \<Omega> {(i, j). I i j} (\<lambda>(i, j). G i j) (\<lambda>(i, j). \<mu> i j)"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2006
    and eq: "\<And>i j. I i j \<Longrightarrow> \<mu>' (G i j) = \<mu> i j"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2007
    and ms: "\<And>i j. I i j \<Longrightarrow> G i j \<in> Pow \<Omega>" "positive (sets M) \<mu>'" "countably_additive (sets M) \<mu>'"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2008
    and "I i j"
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2009
  shows "emeasure M (G i j) = \<mu> i j"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  2010
  using emeasure_extend_measure[OF M _ _ ms(2,3), of "(i,j)"] eq ms(1) \<open>I i j\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2011
  by (auto simp: subset_eq)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2012
69566
c41954ee87cf more antiquotations -- less LaTeX macros;
wenzelm
parents: 69555
diff changeset
  2013
subsection \<open>The smallest \<open>\<sigma>\<close>-algebra regarding a function\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2014
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69768
diff changeset
  2015
definition\<^marker>\<open>tag important\<close> vimage_algebra :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b measure \<Rightarrow> 'a measure" where
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2016
  "vimage_algebra X f M = sigma X {f -` A \<inter> X | A. A \<in> sets M}"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2017
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2018
lemma space_vimage_algebra[simp]: "space (vimage_algebra X f M) = X"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2019
  unfolding vimage_algebra_def by (rule space_measure_of) auto
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2020
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2021
lemma sets_vimage_algebra: "sets (vimage_algebra X f M) = sigma_sets X {f -` A \<inter> X | A. A \<in> sets M}"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2022
  unfolding vimage_algebra_def by (rule sets_measure_of) auto
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2023
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2024
lemma sets_vimage_algebra2:
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2025
  "f \<in> X \<rightarrow> space M \<Longrightarrow> sets (vimage_algebra X f M) = {f -` A \<inter> X | A. A \<in> sets M}"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2026
  using sigma_sets_vimage_commute[of f X "space M" "sets M"]
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2027
  unfolding sets_vimage_algebra sets.sigma_sets_eq by simp
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2028
59092
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2029
lemma sets_vimage_algebra_cong: "sets M = sets N \<Longrightarrow> sets (vimage_algebra X f M) = sets (vimage_algebra X f N)"
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2030
  by (simp add: sets_vimage_algebra)
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2031
59092
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2032
lemma vimage_algebra_cong:
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2033
  assumes "X = Y"
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2034
  assumes "\<And>x. x \<in> Y \<Longrightarrow> f x = g x"
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2035
  assumes "sets M = sets N"
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2036
  shows "vimage_algebra X f M = vimage_algebra Y g N"
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2037
  by (auto simp: vimage_algebra_def assms intro!: arg_cong2[where f=sigma])
d469103c0737 add integral substitution theorems from Manuel Eberl, Jeremy Avigad, Luke Serafin, and Sudeep Kanav
hoelzl
parents: 59088
diff changeset
  2038
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2039
lemma in_vimage_algebra: "A \<in> sets M \<Longrightarrow> f -` A \<inter> X \<in> sets (vimage_algebra X f M)"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2040
  by (auto simp: vimage_algebra_def)
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2041
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2042
lemma sets_image_in_sets:
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2043
  assumes N: "space N = X"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2044
  assumes f: "f \<in> measurable N M"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2045
  shows "sets (vimage_algebra X f M) \<subseteq> sets N"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2046
  unfolding sets_vimage_algebra N[symmetric]
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2047
  by (rule sets.sigma_sets_subset) (auto intro!: measurable_sets f)
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2048
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2049
lemma measurable_vimage_algebra1: "f \<in> X \<rightarrow> space M \<Longrightarrow> f \<in> measurable (vimage_algebra X f M) M"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2050
  unfolding measurable_def by (auto intro: in_vimage_algebra)
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2051
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2052
lemma measurable_vimage_algebra2:
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2053
  assumes g: "g \<in> space N \<rightarrow> X" and f: "(\<lambda>x. f (g x)) \<in> measurable N M"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2054
  shows "g \<in> measurable N (vimage_algebra X f M)"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2055
  unfolding vimage_algebra_def
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2056
proof (rule measurable_measure_of)
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2057
  fix A assume "A \<in> {f -` A \<inter> X | A. A \<in> sets M}"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2058
  then obtain Y where Y: "Y \<in> sets M" and A: "A = f -` Y \<inter> X"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2059
    by auto
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2060
  then have "g -` A \<inter> space N = (\<lambda>x. f (g x)) -` Y \<inter> space N"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2061
    using g by auto
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2062
  also have "\<dots> \<in> sets N"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2063
    using f Y by (rule measurable_sets)
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2064
  finally show "g -` A \<inter> space N \<in> sets N" .
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2065
qed (insert g, auto)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2066
59088
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2067
lemma vimage_algebra_sigma:
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2068
  assumes X: "X \<subseteq> Pow \<Omega>'" and f: "f \<in> \<Omega> \<rightarrow> \<Omega>'"
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2069
  shows "vimage_algebra \<Omega> f (sigma \<Omega>' X) = sigma \<Omega> {f -` A \<inter> \<Omega> | A. A \<in> X }" (is "?V = ?S")
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2070
proof (rule measure_eqI)
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2071
  have \<Omega>: "{f -` A \<inter> \<Omega> |A. A \<in> X} \<subseteq> Pow \<Omega>" by auto
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2072
  show "sets ?V = sets ?S"
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2073
    using sigma_sets_vimage_commute[OF f, of X]
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2074
    by (simp add: space_measure_of_conv f sets_vimage_algebra2 \<Omega> X)
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2075
qed (simp add: vimage_algebra_def emeasure_sigma)
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2076
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2077
lemma vimage_algebra_vimage_algebra_eq:
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2078
  assumes *: "f \<in> X \<rightarrow> Y" "g \<in> Y \<rightarrow> space M"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2079
  shows "vimage_algebra X f (vimage_algebra Y g M) = vimage_algebra X (\<lambda>x. g (f x)) M"
59088
ff2bd4a14ddb generalized (borel_)measurable_SUP/INF/lfp/gfp; tuned proofs for sigma-closure of product spaces
hoelzl
parents: 59048
diff changeset
  2080
    (is "?VV = ?V")
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2081
proof (rule measure_eqI)
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2082
  have "(\<lambda>x. g (f x)) \<in> X \<rightarrow> space M" "\<And>A. A \<inter> f -` Y \<inter> X = A \<inter> X"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2083
    using * by auto
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2084
  with * show "sets ?VV = sets ?V"
68403
223172b97d0b reorient -> split; documented split
nipkow
parents: 68188
diff changeset
  2085
    by (simp add: sets_vimage_algebra2 vimage_comp comp_def flip: ex_simps)
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2086
qed (simp add: vimage_algebra_def emeasure_sigma)
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2087
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  2088
subsubsection \<open>Restricted Space Sigma Algebra\<close>
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2089
69554
4d4aedf9e57f tuned layout
nipkow
parents: 69546
diff changeset
  2090
definition restrict_space :: "'a measure \<Rightarrow> 'a set \<Rightarrow> 'a measure" where
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
  2091
  "restrict_space M \<Omega> = measure_of (\<Omega> \<inter> space M) (((\<inter>) \<Omega>) ` sets M) (emeasure M)"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2092
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2093
lemma space_restrict_space: "space (restrict_space M \<Omega>) = \<Omega> \<inter> space M"
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2094
  using sets.sets_into_space unfolding restrict_space_def by (subst space_measure_of) auto
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2095
67982
7643b005b29a various new results on measures, integrals, etc., and some simplified proofs
paulson <lp15@cam.ac.uk>
parents: 67962
diff changeset
  2096
lemma space_restrict_space2 [simp]: "\<Omega> \<in> sets M \<Longrightarrow> space (restrict_space M \<Omega>) = \<Omega>"
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2097
  by (simp add: space_restrict_space sets.sets_into_space)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2098
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
  2099
lemma sets_restrict_space: "sets (restrict_space M \<Omega>) = ((\<inter>) \<Omega>) ` sets M"
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2100
  unfolding restrict_space_def
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2101
proof (subst sets_measure_of)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
  2102
  show "(\<inter>) \<Omega> ` sets M \<subseteq> Pow (\<Omega> \<inter> space M)"
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2103
    by (auto dest: sets.sets_into_space)
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2104
  have "sigma_sets (\<Omega> \<inter> space M) {((\<lambda>x. x) -` X) \<inter> (\<Omega> \<inter> space M) | X. X \<in> sets M} =
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2105
    (\<lambda>X. X \<inter> (\<Omega> \<inter> space M)) ` sets M"
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2106
    by (subst sigma_sets_vimage_commute[symmetric, where \<Omega>' = "space M"])
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2107
       (auto simp add: sets.sigma_sets_eq)
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2108
  moreover have "{((\<lambda>x. x) -` X) \<inter> (\<Omega> \<inter> space M) | X. X \<in> sets M} = (\<lambda>X. X \<inter> (\<Omega> \<inter> space M)) `  sets M"
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2109
    by auto
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
  2110
  moreover have "(\<lambda>X. X \<inter> (\<Omega> \<inter> space M)) `  sets M = ((\<inter>) \<Omega>) ` sets M"
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2111
    by (intro image_cong) (auto dest: sets.sets_into_space)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66453
diff changeset
  2112
  ultimately show "sigma_sets (\<Omega> \<inter> space M) ((\<inter>) \<Omega> ` sets M) = (\<inter>) \<Omega> ` sets M"
58588
93d87fd1583d add measure space for (coinductive) streams
hoelzl
parents: 57512
diff changeset
  2113
    by simp
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2114
qed
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2115
62083
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 61952
diff changeset
  2116
lemma restrict_space_sets_cong:
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 61952
diff changeset
  2117
  "A = B \<Longrightarrow> sets M = sets N \<Longrightarrow> sets (restrict_space M A) = sets (restrict_space N B)"
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 61952
diff changeset
  2118
  by (auto simp: sets_restrict_space)
7582b39f51ed add the proof of the central limit theorem
hoelzl
parents: 61952
diff changeset
  2119
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2120
lemma sets_restrict_space_count_space:
60063
81835db730e8 add lemmas about restrict_space
Andreas Lochbihler
parents: 59415
diff changeset
  2121
  "sets (restrict_space (count_space A) B) = sets (count_space (A \<inter> B))"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2122
  by(auto simp add: sets_restrict_space)
60063
81835db730e8 add lemmas about restrict_space
Andreas Lochbihler
parents: 59415
diff changeset
  2123
59361
fd5da2434be4 piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents: 59092
diff changeset
  2124
lemma sets_restrict_UNIV[simp]: "sets (restrict_space M UNIV) = sets M"
fd5da2434be4 piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents: 59092
diff changeset
  2125
  by (auto simp add: sets_restrict_space)
fd5da2434be4 piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents: 59092
diff changeset
  2126
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2127
lemma sets_restrict_restrict_space:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2128
  "sets (restrict_space (restrict_space M A) B) = sets (restrict_space M (A \<inter> B))"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2129
  unfolding sets_restrict_space image_comp by (intro image_cong) auto
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2130
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2131
lemma sets_restrict_space_iff:
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2132
  "\<Omega> \<inter> space M \<in> sets M \<Longrightarrow> A \<in> sets (restrict_space M \<Omega>) \<longleftrightarrow> (A \<subseteq> \<Omega> \<and> A \<in> sets M)"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2133
  unfolding sets_restrict_space
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2134
proof (safe)
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2135
  fix A assume "\<Omega> \<inter> space M \<in> sets M" and A: "A \<in> sets M"
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2136
  then have "(\<Omega> \<inter> space M) \<inter> A \<in> sets M"
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2137
    by rule
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2138
  also have "(\<Omega> \<inter> space M) \<inter> A = \<Omega> \<inter> A"
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2139
    using sets.sets_into_space[OF A] by auto
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2140
  finally show "\<Omega> \<inter> A \<in> sets M"
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2141
    by auto
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2142
qed auto
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2143
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2144
lemma sets_restrict_space_cong: "sets M = sets N \<Longrightarrow> sets (restrict_space M \<Omega>) = sets (restrict_space N \<Omega>)"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2145
  by (simp add: sets_restrict_space)
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2146
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2147
lemma restrict_space_eq_vimage_algebra:
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2148
  assumes "\<Omega> \<subseteq> space M"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2149
  shows "sets (restrict_space M \<Omega>) = sets (vimage_algebra \<Omega> (\<lambda>x. x) M)"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2150
proof -
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2151
  have \<section>: "sets.restricted_space M \<Omega> \<subseteq> Pow (\<Omega> \<inter> space M)"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2152
    using sets.space_closed by auto
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2153
  show ?thesis
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2154
  unfolding restrict_space_def using assms 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2155
  by (auto simp add: sets_measure_of [OF \<section>] sets_vimage_algebra intro!: arg_cong2[where f=sigma_sets])
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2156
qed
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2157
62975
1d066f6ab25d Probability: move emeasure and nn_integral from ereal to ennreal
hoelzl
parents: 62390
diff changeset
  2158
lemma sets_Collect_restrict_space_iff:
59000
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2159
  assumes "S \<in> sets M"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2160
  shows "{x\<in>space (restrict_space M S). P x} \<in> sets (restrict_space M S) \<longleftrightarrow> {x\<in>space M. x \<in> S \<and> P x} \<in> sets M"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2161
proof -
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2162
  have "{x\<in>S. P x} = {x\<in>space M. x \<in> S \<and> P x}"
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2163
    using sets.sets_into_space[OF assms] by auto
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2164
  then show ?thesis
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2165
    by (subst sets_restrict_space_iff) (auto simp add: space_restrict_space assms)
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2166
qed
6eb0725503fc import general theorems from AFP/Markov_Models
hoelzl
parents: 58876
diff changeset
  2167
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2168
lemma measurable_restrict_space1:
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2169
  assumes f: "f \<in> measurable M N"
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2170
  shows "f \<in> measurable (restrict_space M \<Omega>) N"
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2171
  unfolding measurable_def
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2172
proof (intro CollectI conjI ballI)
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2173
  show sp: "f \<in> space (restrict_space M \<Omega>) \<rightarrow> space N"
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2174
    using measurable_space[OF f] by (auto simp: space_restrict_space)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2175
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2176
  fix A assume "A \<in> sets N"
57025
e7fd64f82876 add various lemmas
hoelzl
parents: 56994
diff changeset
  2177
  have "f -` A \<inter> space (restrict_space M \<Omega>) = (f -` A \<inter> space M) \<inter> (\<Omega> \<inter> space M)"
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2178
    by (auto simp: space_restrict_space)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2179
  also have "\<dots> \<in> sets (restrict_space M \<Omega>)"
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2180
    unfolding sets_restrict_space
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61633
diff changeset
  2181
    using measurable_sets[OF f \<open>A \<in> sets N\<close>] by blast
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2182
  finally show "f -` A \<inter> space (restrict_space M \<Omega>) \<in> sets (restrict_space M \<Omega>)" .
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2183
qed
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2184
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2185
lemma measurable_restrict_space2_iff:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2186
  "f \<in> measurable M (restrict_space N \<Omega>) \<longleftrightarrow> (f \<in> measurable M N \<and> f \<in> space M \<rightarrow> \<Omega>)"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2187
proof -
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2188
  have "\<And>A. f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f -` \<Omega> \<inter> f -` A \<inter> space M = f -` A \<inter> space M"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2189
    by auto
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2190
  then show ?thesis
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2191
    by (auto simp: measurable_def space_restrict_space Pi_Int[symmetric] sets_restrict_space)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2192
qed
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2193
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2194
lemma measurable_restrict_space2:
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2195
  "f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f \<in> measurable M N \<Longrightarrow> f \<in> measurable M (restrict_space N \<Omega>)"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2196
  by (simp add: measurable_restrict_space2_iff)
56994
8d5e5ec1cac3 fixed document generation for HOL-Probability
hoelzl
parents: 56993
diff changeset
  2197
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2198
lemma measurable_piecewise_restrict:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2199
  assumes I: "countable C"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2200
    and X: "\<And>\<Omega>. \<Omega> \<in> C \<Longrightarrow> \<Omega> \<inter> space M \<in> sets M" "space M \<subseteq> \<Union>C"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2201
    and f: "\<And>\<Omega>. \<Omega> \<in> C \<Longrightarrow> f \<in> measurable (restrict_space M \<Omega>) N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2202
  shows "f \<in> measurable M N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2203
proof (rule measurableI)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2204
  fix x assume "x \<in> space M"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2205
  with X obtain \<Omega> where "\<Omega> \<in> C" "x \<in> \<Omega>" "x \<in> space M" by auto
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2206
  then show "f x \<in> space N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2207
    by (auto simp: space_restrict_space intro: f measurable_space)
57138
7b3146180291 generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents: 57137
diff changeset
  2208
next
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2209
  fix A assume A: "A \<in> sets N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2210
  have "f -` A \<inter> space M = (\<Union>\<Omega>\<in>C. (f -` A \<inter> (\<Omega> \<inter> space M)))"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2211
    using X by (auto simp: subset_eq)
57138
7b3146180291 generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents: 57137
diff changeset
  2212
  also have "\<dots> \<in> sets M"
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2213
    using measurable_sets[OF f A] X I
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2214
    by (intro sets.countable_UN') (auto simp: sets_restrict_space_iff space_restrict_space)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2215
  finally show "f -` A \<inter> space M \<in> sets M" .
57138
7b3146180291 generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents: 57137
diff changeset
  2216
qed
7b3146180291 generalizd measurability on restricted space; rule for integrability on compact sets
hoelzl
parents: 57137
diff changeset
  2217
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2218
lemma measurable_piecewise_restrict_iff:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2219
  "countable C \<Longrightarrow> (\<And>\<Omega>. \<Omega> \<in> C \<Longrightarrow> \<Omega> \<inter> space M \<in> sets M) \<Longrightarrow> space M \<subseteq> (\<Union>C) \<Longrightarrow>
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2220
    f \<in> measurable M N \<longleftrightarrow> (\<forall>\<Omega>\<in>C. f \<in> measurable (restrict_space M \<Omega>) N)"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2221
  by (auto intro: measurable_piecewise_restrict measurable_restrict_space1)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2222
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2223
lemma measurable_If_restrict_space_iff:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2224
  "{x\<in>space M. P x} \<in> sets M \<Longrightarrow>
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2225
    (\<lambda>x. if P x then f x else g x) \<in> measurable M N \<longleftrightarrow>
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2226
    (f \<in> measurable (restrict_space M {x. P x}) N \<and> g \<in> measurable (restrict_space M {x. \<not> P x}) N)"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2227
  by (subst measurable_piecewise_restrict_iff[where C="{{x. P x}, {x. \<not> P x}}"])
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2228
     (auto simp: Int_def sets.sets_Collect_neg space_restrict_space conj_commute[of _ "x \<in> space M" for x]
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2229
           cong: measurable_cong')
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2230
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2231
lemma measurable_If:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2232
  "f \<in> measurable M M' \<Longrightarrow> g \<in> measurable M M' \<Longrightarrow> {x\<in>space M. P x} \<in> sets M \<Longrightarrow>
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2233
    (\<lambda>x. if P x then f x else g x) \<in> measurable M M'"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2234
  unfolding measurable_If_restrict_space_iff by (auto intro: measurable_restrict_space1)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2235
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2236
lemma measurable_If_set:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2237
  assumes measure: "f \<in> measurable M M'" "g \<in> measurable M M'"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2238
  assumes P: "A \<inter> space M \<in> sets M"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2239
  shows "(\<lambda>x. if x \<in> A then f x else g x) \<in> measurable M M'"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2240
proof (rule measurable_If[OF measure])
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2241
  have "{x \<in> space M. x \<in> A} = A \<inter> space M" 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2242
    by auto
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2243
  thus "{x \<in> space M. x \<in> A} \<in> sets M" 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2244
    using \<open>A \<inter> space M \<in> sets M\<close> by auto
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2245
qed
59361
fd5da2434be4 piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents: 59092
diff changeset
  2246
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2247
lemma measurable_restrict_space_iff:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2248
  "\<Omega> \<inter> space M \<in> sets M \<Longrightarrow> c \<in> space N \<Longrightarrow>
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2249
    f \<in> measurable (restrict_space M \<Omega>) N \<longleftrightarrow> (\<lambda>x. if x \<in> \<Omega> then f x else c) \<in> measurable M N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2250
  by (subst measurable_If_restrict_space_iff)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2251
     (simp_all add: Int_def conj_commute measurable_const)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2252
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2253
lemma restrict_space_singleton: "{x} \<in> sets M \<Longrightarrow> sets (restrict_space M {x}) = sets (count_space {x})"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2254
  using sets_restrict_space_iff[of "{x}" M]
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2255
  by (auto simp add: sets_restrict_space_iff dest!: subset_singletonD)
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2256
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2257
lemma measurable_restrict_countable:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2258
  assumes X[intro]: "countable X"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2259
  assumes sets[simp]: "\<And>x. x \<in> X \<Longrightarrow> {x} \<in> sets M"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2260
  assumes space[simp]: "\<And>x. x \<in> X \<Longrightarrow> f x \<in> space N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2261
  assumes f: "f \<in> measurable (restrict_space M (- X)) N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2262
  shows "f \<in> measurable M N"
82513
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2263
proof (intro measurable_piecewise_restrict [where M = M])
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2264
  fix \<Omega> :: "'a set"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2265
  show "\<Omega> \<in> {- X} \<union> (\<lambda>x. {x}) ` X \<Longrightarrow> \<Omega> \<inter> space M \<in> sets M"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2266
    using sets.countable[OF sets X] by(auto simp: Diff_Int_distrib2 Compl_eq_Diff_UNIV)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2267
  show "\<Omega> \<in> {- X} \<union> (\<lambda>x. {x}) ` X \<Longrightarrow> f \<in> restrict_space M \<Omega> \<rightarrow>\<^sub>M N"
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2268
    using f 
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2269
    by(auto simp: restrict_space_singleton simp del: sets_count_space  cong: measurable_cong_sets)
8281047b896d Simplified old proofs
paulson <lp15@cam.ac.uk>
parents: 80914
diff changeset
  2270
qed auto
59415
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2271
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2272
lemma measurable_discrete_difference:
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2273
  assumes f: "f \<in> measurable M N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2274
  assumes X: "countable X" "\<And>x. x \<in> X \<Longrightarrow> {x} \<in> sets M" "\<And>x. x \<in> X \<Longrightarrow> g x \<in> space N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2275
  assumes eq: "\<And>x. x \<in> space M \<Longrightarrow> x \<notin> X \<Longrightarrow> f x = g x"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2276
  shows "g \<in> measurable M N"
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2277
  by (rule measurable_restrict_countable[OF X])
854fe701c984 tuned measurability proofs
hoelzl
parents: 59361
diff changeset
  2278
     (auto simp: eq[symmetric] space_restrict_space cong: measurable_cong' intro: f measurable_restrict_space1)
59361
fd5da2434be4 piecewise measurability using restrict_space; cleanup Borel_Space
hoelzl
parents: 59092
diff changeset
  2279
64008
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  2280
lemma measurable_count_space_extend: "A \<subseteq> B \<Longrightarrow> f \<in> space M \<rightarrow> A \<Longrightarrow> f \<in> M \<rightarrow>\<^sub>M count_space B \<Longrightarrow> f \<in> M \<rightarrow>\<^sub>M count_space A"
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  2281
  by (auto simp: measurable_def)
17a20ca86d62 HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents: 63627
diff changeset
  2282
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
  2283
end