src/HOL/Probability/Caratheodory.thy
author bulwahn
Fri, 11 Mar 2011 15:21:13 +0100
changeset 41932 e8f113ce8a94
parent 41689 3e39b0e730d6
child 41981 cdf7693bbe08
permissions -rw-r--r--
adapting Quickcheck_Narrowing and example file to new names
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
     1
header {*Caratheodory Extension Theorem*}
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
     2
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
     3
theory Caratheodory
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
     4
  imports Sigma_Algebra Positive_Extended_Real
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
     5
begin
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
text{*From the Hurd/Coble measure theory development, translated by Lawrence Paulson.*}
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
     8
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
     9
subsection {* Measure Spaces *}
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    10
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    11
record 'a measure_space = "'a algebra" +
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    12
  measure :: "'a set \<Rightarrow> pextreal"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    13
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    14
definition positive where "positive M f \<longleftrightarrow> f {} = (0::pextreal)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    15
  -- "Positive is enforced by the type"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    16
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    17
definition additive where "additive M f \<longleftrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    18
  (\<forall>x \<in> sets M. \<forall>y \<in> sets M. x \<inter> y = {} \<longrightarrow> f (x \<union> y) = f x + f y)"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    19
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    20
definition countably_additive where "countably_additive M f \<longleftrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    21
  (\<forall>A. range A \<subseteq> sets M \<longrightarrow> disjoint_family A \<longrightarrow> (\<Union>i. A i) \<in> sets M \<longrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    22
    (\<Sum>\<^isub>\<infinity> n. f (A n)) = f (\<Union>i. A i))"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    23
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    24
definition increasing where "increasing M f \<longleftrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    25
  (\<forall>x \<in> sets M. \<forall>y \<in> sets M. x \<subseteq> y \<longrightarrow> f x \<le> f y)"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    26
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    27
definition subadditive where "subadditive M f \<longleftrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    28
  (\<forall>x \<in> sets M. \<forall>y \<in> sets M. x \<inter> y = {} \<longrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    29
    f (x \<union> y) \<le> f x + f y)"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    30
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    31
definition countably_subadditive where "countably_subadditive M f \<longleftrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    32
  (\<forall>A. range A \<subseteq> sets M \<longrightarrow> disjoint_family A \<longrightarrow> (\<Union>i. A i) \<in> sets M \<longrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    33
    f (\<Union>i. A i) \<le> (\<Sum>\<^isub>\<infinity> n. f (A n)))"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    34
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    35
definition lambda_system where "lambda_system M f = {l \<in> sets M.
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    36
  \<forall>x \<in> sets M. f (l \<inter> x) + f ((space M - l) \<inter> x) = f x}"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    37
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    38
definition outer_measure_space where "outer_measure_space M f \<longleftrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    39
  positive M f \<and> increasing M f \<and> countably_subadditive M f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    40
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    41
definition measure_set where "measure_set M f X = {r.
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    42
  \<exists>A. range A \<subseteq> sets M \<and> disjoint_family A \<and> X \<subseteq> (\<Union>i. A i) \<and> (\<Sum>\<^isub>\<infinity> i. f (A i)) = r}"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    43
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    44
locale measure_space = sigma_algebra M for M :: "('a, 'b) measure_space_scheme" +
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    45
  assumes empty_measure [simp]: "measure M {} = 0"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    46
      and ca: "countably_additive M (measure M)"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    47
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    48
abbreviation (in measure_space) "\<mu> \<equiv> measure M"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    49
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    50
lemma increasingD:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    51
  "increasing M f \<Longrightarrow> x \<subseteq> y \<Longrightarrow> x\<in>sets M \<Longrightarrow> y\<in>sets M \<Longrightarrow> f x \<le> f y"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    52
  by (auto simp add: increasing_def)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    53
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    54
lemma subadditiveD:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    55
  "subadditive M f \<Longrightarrow> x \<inter> y = {} \<Longrightarrow> x \<in> sets M \<Longrightarrow> y \<in> sets M
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    56
    \<Longrightarrow> f (x \<union> y) \<le> f x + f y"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    57
  by (auto simp add: subadditive_def)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    58
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    59
lemma additiveD:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    60
  "additive M f \<Longrightarrow> x \<inter> y = {} \<Longrightarrow> x \<in> sets M \<Longrightarrow> y \<in> sets M
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    61
    \<Longrightarrow> f (x \<union> y) = f x + f y"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    62
  by (auto simp add: additive_def)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    63
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    64
lemma countably_additiveD:
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
    65
  "countably_additive M f \<Longrightarrow> range A \<subseteq> sets M \<Longrightarrow> disjoint_family A
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    66
    \<Longrightarrow> (\<Union>i. A i) \<in> sets M \<Longrightarrow> (\<Sum>\<^isub>\<infinity> n. f (A n)) = f (\<Union>i. A i)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    67
  by (simp add: countably_additive_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    68
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    69
lemma countably_subadditiveD:
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    70
  "countably_subadditive M f \<Longrightarrow> range A \<subseteq> sets M \<Longrightarrow> disjoint_family A \<Longrightarrow>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    71
   (\<Union>i. A i) \<in> sets M \<Longrightarrow> f (\<Union>i. A i) \<le> psuminf (f o A)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    72
  by (auto simp add: countably_subadditive_def o_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    73
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    74
lemma countably_additiveI:
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    75
  "(\<And>A. range A \<subseteq> sets M \<Longrightarrow> disjoint_family A \<Longrightarrow> (\<Union>i. A i) \<in> sets M
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
    76
    \<Longrightarrow> (\<Sum>\<^isub>\<infinity> n. f (A n)) = f (\<Union>i. A i)) \<Longrightarrow> countably_additive M f"
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
    77
  by (simp add: countably_additive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    78
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
    79
section "Extend binary sets"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    80
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
    81
lemma LIMSEQ_binaryset:
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    82
  assumes f: "f {} = 0"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    83
  shows  "(\<lambda>n. \<Sum>i = 0..<n. f (binaryset A B i)) ----> f A + f B"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    84
proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    85
  have "(\<lambda>n. \<Sum>i = 0..< Suc (Suc n). f (binaryset A B i)) = (\<lambda>n. f A + f B)"
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
    86
    proof
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    87
      fix n
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    88
      show "(\<Sum>i\<Colon>nat = 0\<Colon>nat..<Suc (Suc n). f (binaryset A B i)) = f A + f B"
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
    89
        by (induct n)  (auto simp add: binaryset_def f)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    90
    qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    91
  moreover
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
    92
  have "... ----> f A + f B" by (rule LIMSEQ_const)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    93
  ultimately
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
    94
  have "(\<lambda>n. \<Sum>i = 0..< Suc (Suc n). f (binaryset A B i)) ----> f A + f B"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    95
    by metis
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    96
  hence "(\<lambda>n. \<Sum>i = 0..< n+2. f (binaryset A B i)) ----> f A + f B"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    97
    by simp
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    98
  thus ?thesis by (rule LIMSEQ_offset [where k=2])
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
    99
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   100
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   101
lemma binaryset_sums:
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   102
  assumes f: "f {} = 0"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   103
  shows  "(\<lambda>n. f (binaryset A B n)) sums (f A + f B)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   104
    by (simp add: sums_def LIMSEQ_binaryset [where f=f, OF f])
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   105
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   106
lemma suminf_binaryset_eq:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   107
  fixes f :: "'a set \<Rightarrow> real"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   108
  shows "f {} = 0 \<Longrightarrow> (\<Sum>n. f (binaryset A B n)) = f A + f B"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   109
  by (metis binaryset_sums sums_unique)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   110
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   111
lemma binaryset_psuminf:
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   112
  assumes "f {} = 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   113
  shows "(\<Sum>\<^isub>\<infinity> n. f (binaryset A B n)) = f A + f B" (is "?suminf = ?sum")
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   114
proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   115
  have *: "{..<2} = {0, 1::nat}" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   116
  have "\<forall>n\<ge>2. f (binaryset A B n) = 0"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   117
    unfolding binaryset_def
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   118
    using assms by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   119
  hence "?suminf = (\<Sum>N<2. f (binaryset A B N))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   120
    by (rule psuminf_finite)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   121
  also have "... = ?sum" unfolding * binaryset_def
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   122
    by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   123
  finally show ?thesis .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   124
qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   125
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   126
subsection {* Lambda Systems *}
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   127
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   128
lemma (in algebra) lambda_system_eq:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   129
  shows "lambda_system M f = {l \<in> sets M.
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   130
    \<forall>x \<in> sets M. f (x \<inter> l) + f (x - l) = f x}"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   131
proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   132
  have [simp]: "!!l x. l \<in> sets M \<Longrightarrow> x \<in> sets M \<Longrightarrow> (space M - l) \<inter> x = x - l"
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   133
    by (metis Int_Diff Int_absorb1 Int_commute sets_into_space)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   134
  show ?thesis
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   135
    by (auto simp add: lambda_system_def) (metis Int_commute)+
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   136
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   137
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   138
lemma (in algebra) lambda_system_empty:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   139
  "positive M f \<Longrightarrow> {} \<in> lambda_system M f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   140
  by (auto simp add: positive_def lambda_system_eq algebra_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   141
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   142
lemma lambda_system_sets:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   143
  "x \<in> lambda_system M f \<Longrightarrow> x \<in> sets M"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   144
  by (simp add: lambda_system_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   145
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   146
lemma (in algebra) lambda_system_Compl:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   147
  fixes f:: "'a set \<Rightarrow> pextreal"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   148
  assumes x: "x \<in> lambda_system M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   149
  shows "space M - x \<in> lambda_system M f"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   150
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   151
  have "x \<subseteq> space M"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   152
    by (metis sets_into_space lambda_system_sets x)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   153
  hence "space M - (space M - x) = x"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   154
    by (metis double_diff equalityE)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   155
  with x show ?thesis
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   156
    by (force simp add: lambda_system_def ac_simps)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   157
qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   158
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   159
lemma (in algebra) lambda_system_Int:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   160
  fixes f:: "'a set \<Rightarrow> pextreal"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   161
  assumes xl: "x \<in> lambda_system M f" and yl: "y \<in> lambda_system M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   162
  shows "x \<inter> y \<in> lambda_system M f"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   163
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   164
  from xl yl show ?thesis
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   165
  proof (auto simp add: positive_def lambda_system_eq Int)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   166
    fix u
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   167
    assume x: "x \<in> sets M" and y: "y \<in> sets M" and u: "u \<in> sets M"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   168
       and fx: "\<forall>z\<in>sets M. f (z \<inter> x) + f (z - x) = f z"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   169
       and fy: "\<forall>z\<in>sets M. f (z \<inter> y) + f (z - y) = f z"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   170
    have "u - x \<inter> y \<in> sets M"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   171
      by (metis Diff Diff_Int Un u x y)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   172
    moreover
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   173
    have "(u - (x \<inter> y)) \<inter> y = u \<inter> y - x" by blast
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   174
    moreover
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   175
    have "u - x \<inter> y - y = u - y" by blast
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   176
    ultimately
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   177
    have ey: "f (u - x \<inter> y) = f (u \<inter> y - x) + f (u - y)" using fy
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   178
      by force
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   179
    have "f (u \<inter> (x \<inter> y)) + f (u - x \<inter> y)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   180
          = (f (u \<inter> (x \<inter> y)) + f (u \<inter> y - x)) + f (u - y)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   181
      by (simp add: ey ac_simps)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   182
    also have "... =  (f ((u \<inter> y) \<inter> x) + f (u \<inter> y - x)) + f (u - y)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   183
      by (simp add: Int_ac)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   184
    also have "... = f (u \<inter> y) + f (u - y)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   185
      using fx [THEN bspec, of "u \<inter> y"] Int y u
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   186
      by force
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   187
    also have "... = f u"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   188
      by (metis fy u)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   189
    finally show "f (u \<inter> (x \<inter> y)) + f (u - x \<inter> y) = f u" .
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   190
  qed
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   191
qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   192
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   193
lemma (in algebra) lambda_system_Un:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   194
  fixes f:: "'a set \<Rightarrow> pextreal"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   195
  assumes xl: "x \<in> lambda_system M f" and yl: "y \<in> lambda_system M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   196
  shows "x \<union> y \<in> lambda_system M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   197
proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   198
  have "(space M - x) \<inter> (space M - y) \<in> sets M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   199
    by (metis Diff_Un Un compl_sets lambda_system_sets xl yl)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   200
  moreover
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   201
  have "x \<union> y = space M - ((space M - x) \<inter> (space M - y))"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   202
    by auto  (metis subsetD lambda_system_sets sets_into_space xl yl)+
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   203
  ultimately show ?thesis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   204
    by (metis lambda_system_Compl lambda_system_Int xl yl)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   205
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   206
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   207
lemma (in algebra) lambda_system_algebra:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   208
  "positive M f \<Longrightarrow> algebra (M\<lparr>sets := lambda_system M f\<rparr>)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   209
  apply (auto simp add: algebra_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   210
  apply (metis lambda_system_sets set_mp sets_into_space)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   211
  apply (metis lambda_system_empty)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   212
  apply (metis lambda_system_Compl)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   213
  apply (metis lambda_system_Un)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   214
  done
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   215
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   216
lemma (in algebra) lambda_system_strong_additive:
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   217
  assumes z: "z \<in> sets M" and disj: "x \<inter> y = {}"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   218
      and xl: "x \<in> lambda_system M f" and yl: "y \<in> lambda_system M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   219
  shows "f (z \<inter> (x \<union> y)) = f (z \<inter> x) + f (z \<inter> y)"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   220
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   221
  have "z \<inter> x = (z \<inter> (x \<union> y)) \<inter> x" using disj by blast
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   222
  moreover
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   223
  have "z \<inter> y = (z \<inter> (x \<union> y)) - x" using disj by blast
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   224
  moreover
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   225
  have "(z \<inter> (x \<union> y)) \<in> sets M"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   226
    by (metis Int Un lambda_system_sets xl yl z)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   227
  ultimately show ?thesis using xl yl
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   228
    by (simp add: lambda_system_eq)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   229
qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   230
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   231
lemma (in algebra) lambda_system_additive:
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   232
     "additive (M (|sets := lambda_system M f|)) f"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   233
proof (auto simp add: additive_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   234
  fix x and y
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   235
  assume disj: "x \<inter> y = {}"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   236
     and xl: "x \<in> lambda_system M f" and yl: "y \<in> lambda_system M f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   237
  hence  "x \<in> sets M" "y \<in> sets M" by (blast intro: lambda_system_sets)+
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   238
  thus "f (x \<union> y) = f x + f y"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   239
    using lambda_system_strong_additive [OF top disj xl yl]
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   240
    by (simp add: Un)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   241
qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   242
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   243
lemma (in algebra) countably_subadditive_subadditive:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   244
  assumes f: "positive M f" and cs: "countably_subadditive M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   245
  shows  "subadditive M f"
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   246
proof (auto simp add: subadditive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   247
  fix x y
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   248
  assume x: "x \<in> sets M" and y: "y \<in> sets M" and "x \<inter> y = {}"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   249
  hence "disjoint_family (binaryset x y)"
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   250
    by (auto simp add: disjoint_family_on_def binaryset_def)
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   251
  hence "range (binaryset x y) \<subseteq> sets M \<longrightarrow>
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   252
         (\<Union>i. binaryset x y i) \<in> sets M \<longrightarrow>
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   253
         f (\<Union>i. binaryset x y i) \<le> (\<Sum>\<^isub>\<infinity> n. f (binaryset x y n))"
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   254
    using cs by (simp add: countably_subadditive_def)
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   255
  hence "{x,y,{}} \<subseteq> sets M \<longrightarrow> x \<union> y \<in> sets M \<longrightarrow>
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   256
         f (x \<union> y) \<le> (\<Sum>\<^isub>\<infinity> n. f (binaryset x y n))"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   257
    by (simp add: range_binaryset_eq UN_binaryset_eq)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   258
  thus "f (x \<union> y) \<le>  f x + f y" using f x y
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   259
    by (auto simp add: Un o_def binaryset_psuminf positive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   260
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   261
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   262
lemma (in algebra) additive_sum:
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   263
  fixes A:: "nat \<Rightarrow> 'a set"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   264
  assumes f: "positive M f" and ad: "additive M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   265
      and A: "range A \<subseteq> sets M"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   266
      and disj: "disjoint_family A"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   267
  shows  "setsum (f \<circ> A) {0..<n} = f (\<Union>i\<in>{0..<n}. A i)"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   268
proof (induct n)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   269
  case 0 show ?case using f by (simp add: positive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   270
next
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   271
  case (Suc n)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   272
  have "A n \<inter> (\<Union>i\<in>{0..<n}. A i) = {}" using disj
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   273
    by (auto simp add: disjoint_family_on_def neq_iff) blast
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   274
  moreover
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   275
  have "A n \<in> sets M" using A by blast
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   276
  moreover have "(\<Union>i\<in>{0..<n}. A i) \<in> sets M"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   277
    by (metis A UNION_in_sets atLeast0LessThan)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   278
  moreover
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   279
  ultimately have "f (A n \<union> (\<Union>i\<in>{0..<n}. A i)) = f (A n) + f(\<Union>i\<in>{0..<n}. A i)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   280
    using ad UNION_in_sets A by (auto simp add: additive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   281
  with Suc.hyps show ?case using ad
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   282
    by (auto simp add: atLeastLessThanSuc additive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   283
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   284
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   285
lemma (in algebra) increasing_additive_bound:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   286
  fixes A:: "nat \<Rightarrow> 'a set" and  f :: "'a set \<Rightarrow> pextreal"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   287
  assumes f: "positive M f" and ad: "additive M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   288
      and inc: "increasing M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   289
      and A: "range A \<subseteq> sets M"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   290
      and disj: "disjoint_family A"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   291
  shows  "psuminf (f \<circ> A) \<le> f (space M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   292
proof (safe intro!: psuminf_bound)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   293
  fix N
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   294
  have "setsum (f \<circ> A) {0..<N} = f (\<Union>i\<in>{0..<N}. A i)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   295
    by (rule additive_sum [OF f ad A disj])
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   296
  also have "... \<le> f (space M)" using space_closed A
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   297
    by (blast intro: increasingD [OF inc] UNION_in_sets top)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   298
  finally show "setsum (f \<circ> A) {..<N} \<le> f (space M)" by (simp add: atLeast0LessThan)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   299
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   300
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   301
lemma lambda_system_increasing:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   302
 "increasing M f \<Longrightarrow> increasing (M (|sets := lambda_system M f|)) f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   303
  by (simp add: increasing_def lambda_system_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   304
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   305
lemma lambda_system_positive:
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   306
  "positive M f \<Longrightarrow> positive (M (|sets := lambda_system M f|)) f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   307
  by (simp add: positive_def lambda_system_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   308
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   309
lemma (in algebra) lambda_system_strong_sum:
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   310
  fixes A:: "nat \<Rightarrow> 'a set" and f :: "'a set \<Rightarrow> pextreal"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   311
  assumes f: "positive M f" and a: "a \<in> sets M"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   312
      and A: "range A \<subseteq> lambda_system M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   313
      and disj: "disjoint_family A"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   314
  shows  "(\<Sum>i = 0..<n. f (a \<inter>A i)) = f (a \<inter> (\<Union>i\<in>{0..<n}. A i))"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   315
proof (induct n)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   316
  case 0 show ?case using f by (simp add: positive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   317
next
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   318
  case (Suc n)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   319
  have 2: "A n \<inter> UNION {0..<n} A = {}" using disj
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   320
    by (force simp add: disjoint_family_on_def neq_iff)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   321
  have 3: "A n \<in> lambda_system M f" using A
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   322
    by blast
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   323
  have 4: "UNION {0..<n} A \<in> lambda_system M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   324
    using A algebra.UNION_in_sets [OF local.lambda_system_algebra, of f, OF f]
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   325
    by simp
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   326
  from Suc.hyps show ?case
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   327
    by (simp add: atLeastLessThanSuc lambda_system_strong_additive [OF a 2 3 4])
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   328
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   329
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   330
lemma (in sigma_algebra) lambda_system_caratheodory:
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   331
  assumes oms: "outer_measure_space M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   332
      and A: "range A \<subseteq> lambda_system M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   333
      and disj: "disjoint_family A"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   334
  shows  "(\<Union>i. A i) \<in> lambda_system M f \<and> psuminf (f \<circ> A) = f (\<Union>i. A i)"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   335
proof -
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   336
  have pos: "positive M f" and inc: "increasing M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   337
   and csa: "countably_subadditive M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   338
    by (metis oms outer_measure_space_def)+
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   339
  have sa: "subadditive M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   340
    by (metis countably_subadditive_subadditive csa pos)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   341
  have A': "range A \<subseteq> sets (M(|sets := lambda_system M f|))" using A
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   342
    by simp
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   343
  have alg_ls: "algebra (M(|sets := lambda_system M f|))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   344
    by (rule lambda_system_algebra) (rule pos)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   345
  have A'': "range A \<subseteq> sets M"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   346
     by (metis A image_subset_iff lambda_system_sets)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   347
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   348
  have U_in: "(\<Union>i. A i) \<in> sets M"
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   349
    by (metis A'' countable_UN)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   350
  have U_eq: "f (\<Union>i. A i) = psuminf (f o A)"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   351
  proof (rule antisym)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   352
    show "f (\<Union>i. A i) \<le> psuminf (f \<circ> A)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   353
      by (rule countably_subadditiveD [OF csa A'' disj U_in])
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   354
    show "psuminf (f \<circ> A) \<le> f (\<Union>i. A i)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   355
      by (rule psuminf_bound, unfold atLeast0LessThan[symmetric])
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   356
         (metis algebra.additive_sum [OF alg_ls] pos disj UN_Un Un_UNIV_right
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   357
                lambda_system_positive lambda_system_additive
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   358
                subset_Un_eq increasingD [OF inc] A' A'' UNION_in_sets U_in)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   359
  qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   360
  {
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   361
    fix a
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   362
    assume a [iff]: "a \<in> sets M"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   363
    have "f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i)) = f a"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   364
    proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   365
      show ?thesis
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   366
      proof (rule antisym)
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   367
        have "range (\<lambda>i. a \<inter> A i) \<subseteq> sets M" using A''
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   368
          by blast
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   369
        moreover
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   370
        have "disjoint_family (\<lambda>i. a \<inter> A i)" using disj
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   371
          by (auto simp add: disjoint_family_on_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   372
        moreover
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   373
        have "a \<inter> (\<Union>i. A i) \<in> sets M"
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   374
          by (metis Int U_in a)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   375
        ultimately
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   376
        have "f (a \<inter> (\<Union>i. A i)) \<le> psuminf (f \<circ> (\<lambda>i. a \<inter> i) \<circ> A)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   377
          using countably_subadditiveD [OF csa, of "(\<lambda>i. a \<inter> A i)"]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   378
          by (simp add: o_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   379
        hence "f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i)) \<le>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   380
            psuminf (f \<circ> (\<lambda>i. a \<inter> i) \<circ> A) + f (a - (\<Union>i. A i))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   381
          by (rule add_right_mono)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   382
        moreover
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   383
        have "psuminf (f \<circ> (\<lambda>i. a \<inter> i) \<circ> A) + f (a - (\<Union>i. A i)) \<le> f a"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   384
          proof (safe intro!: psuminf_bound_add)
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   385
            fix n
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   386
            have UNION_in: "(\<Union>i\<in>{0..<n}. A i) \<in> sets M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   387
              by (metis A'' UNION_in_sets)
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   388
            have le_fa: "f (UNION {0..<n} A \<inter> a) \<le> f a" using A''
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   389
              by (blast intro: increasingD [OF inc] A'' UNION_in_sets)
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   390
            have ls: "(\<Union>i\<in>{0..<n}. A i) \<in> lambda_system M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   391
              using algebra.UNION_in_sets [OF lambda_system_algebra [of f, OF pos]]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   392
              by (simp add: A)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   393
            hence eq_fa: "f a = f (a \<inter> (\<Union>i\<in>{0..<n}. A i)) + f (a - (\<Union>i\<in>{0..<n}. A i))"
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   394
              by (simp add: lambda_system_eq UNION_in)
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   395
            have "f (a - (\<Union>i. A i)) \<le> f (a - (\<Union>i\<in>{0..<n}. A i))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   396
              by (blast intro: increasingD [OF inc] UNION_eq_Union_image
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   397
                               UNION_in U_in)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   398
            thus "setsum (f \<circ> (\<lambda>i. a \<inter> i) \<circ> A) {..<n} + f (a - (\<Union>i. A i)) \<le> f a"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   399
              by (simp add: lambda_system_strong_sum pos A disj eq_fa add_left_mono atLeast0LessThan[symmetric])
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   400
          qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   401
        ultimately show "f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i)) \<le> f a"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   402
          by (rule order_trans)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   403
      next
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   404
        have "f a \<le> f (a \<inter> (\<Union>i. A i) \<union> (a - (\<Union>i. A i)))"
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   405
          by (blast intro:  increasingD [OF inc] U_in)
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   406
        also have "... \<le>  f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i))"
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   407
          by (blast intro: subadditiveD [OF sa] U_in)
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   408
        finally show "f a \<le> f (a \<inter> (\<Union>i. A i)) + f (a - (\<Union>i. A i))" .
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   409
        qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   410
     qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   411
  }
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   412
  thus  ?thesis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   413
    by (simp add: lambda_system_eq sums_iff U_eq U_in)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   414
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   415
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   416
lemma (in sigma_algebra) caratheodory_lemma:
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   417
  assumes oms: "outer_measure_space M f"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   418
  shows "measure_space \<lparr> space = space M, sets = lambda_system M f, measure = f \<rparr>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   419
    (is "measure_space ?M")
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   420
proof -
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   421
  have pos: "positive M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   422
    by (metis oms outer_measure_space_def)
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   423
  have alg: "algebra ?M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   424
    using lambda_system_algebra [of f, OF pos]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   425
    by (simp add: algebra_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   426
  then moreover
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   427
  have "sigma_algebra ?M"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   428
    using lambda_system_caratheodory [OF oms]
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   429
    by (simp add: sigma_algebra_disjoint_iff)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   430
  moreover
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   431
  have "measure_space_axioms ?M"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   432
    using pos lambda_system_caratheodory [OF oms]
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   433
    by (simp add: measure_space_axioms_def positive_def lambda_system_sets
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   434
                  countably_additive_def o_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   435
  ultimately
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   436
  show ?thesis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   437
    by intro_locales (auto simp add: sigma_algebra_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   438
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   439
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   440
lemma (in algebra) additive_increasing:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   441
  assumes posf: "positive M f" and addf: "additive M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   442
  shows "increasing M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   443
proof (auto simp add: increasing_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   444
  fix x y
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   445
  assume xy: "x \<in> sets M" "y \<in> sets M" "x \<subseteq> y"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   446
  have "f x \<le> f x + f (y-x)" ..
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   447
  also have "... = f (x \<union> (y-x))" using addf
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   448
    by (auto simp add: additive_def) (metis Diff_disjoint Un_Diff_cancel Diff xy(1,2))
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   449
  also have "... = f y"
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   450
    by (metis Un_Diff_cancel Un_absorb1 xy(3))
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   451
  finally show "f x \<le> f y" .
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   452
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   453
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   454
lemma (in algebra) countably_additive_additive:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   455
  assumes posf: "positive M f" and ca: "countably_additive M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   456
  shows "additive M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   457
proof (auto simp add: additive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   458
  fix x y
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   459
  assume x: "x \<in> sets M" and y: "y \<in> sets M" and "x \<inter> y = {}"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   460
  hence "disjoint_family (binaryset x y)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   461
    by (auto simp add: disjoint_family_on_def binaryset_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   462
  hence "range (binaryset x y) \<subseteq> sets M \<longrightarrow>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   463
         (\<Union>i. binaryset x y i) \<in> sets M \<longrightarrow>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   464
         f (\<Union>i. binaryset x y i) = (\<Sum>\<^isub>\<infinity> n. f (binaryset x y n))"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   465
    using ca
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   466
    by (simp add: countably_additive_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   467
  hence "{x,y,{}} \<subseteq> sets M \<longrightarrow> x \<union> y \<in> sets M \<longrightarrow>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   468
         f (x \<union> y) = (\<Sum>\<^isub>\<infinity> n. f (binaryset x y n))"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   469
    by (simp add: range_binaryset_eq UN_binaryset_eq)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   470
  thus "f (x \<union> y) = f x + f y" using posf x y
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   471
    by (auto simp add: Un binaryset_psuminf positive_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   472
qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   473
39096
hoelzl
parents: 38656
diff changeset
   474
lemma inf_measure_nonempty:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   475
  assumes f: "positive M f" and b: "b \<in> sets M" and a: "a \<subseteq> b" "{} \<in> sets M"
39096
hoelzl
parents: 38656
diff changeset
   476
  shows "f b \<in> measure_set M f a"
hoelzl
parents: 38656
diff changeset
   477
proof -
hoelzl
parents: 38656
diff changeset
   478
  have "psuminf (f \<circ> (\<lambda>i. {})(0 := b)) = setsum (f \<circ> (\<lambda>i. {})(0 := b)) {..<1::nat}"
hoelzl
parents: 38656
diff changeset
   479
    by (rule psuminf_finite) (simp add: f[unfolded positive_def])
hoelzl
parents: 38656
diff changeset
   480
  also have "... = f b"
hoelzl
parents: 38656
diff changeset
   481
    by simp
hoelzl
parents: 38656
diff changeset
   482
  finally have "psuminf (f \<circ> (\<lambda>i. {})(0 := b)) = f b" .
hoelzl
parents: 38656
diff changeset
   483
  thus ?thesis using assms
hoelzl
parents: 38656
diff changeset
   484
    by (auto intro!: exI [of _ "(\<lambda>i. {})(0 := b)"]
hoelzl
parents: 38656
diff changeset
   485
             simp: measure_set_def disjoint_family_on_def split_if_mem2 comp_def)
hoelzl
parents: 38656
diff changeset
   486
qed
hoelzl
parents: 38656
diff changeset
   487
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   488
lemma (in algebra) inf_measure_agrees:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   489
  assumes posf: "positive M f" and ca: "countably_additive M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   490
      and s: "s \<in> sets M"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   491
  shows "Inf (measure_set M f s) = f s"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   492
  unfolding Inf_pextreal_def
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   493
proof (safe intro!: Greatest_equality)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   494
  fix z
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   495
  assume z: "z \<in> measure_set M f s"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   496
  from this obtain A where
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   497
    A: "range A \<subseteq> sets M" and disj: "disjoint_family A"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   498
    and "s \<subseteq> (\<Union>x. A x)" and si: "psuminf (f \<circ> A) = z"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   499
    by (auto simp add: measure_set_def comp_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   500
  hence seq: "s = (\<Union>i. A i \<inter> s)" by blast
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   501
  have inc: "increasing M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   502
    by (metis additive_increasing ca countably_additive_additive posf)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   503
  have sums: "psuminf (\<lambda>i. f (A i \<inter> s)) = f (\<Union>i. A i \<inter> s)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   504
    proof (rule countably_additiveD [OF ca])
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   505
      show "range (\<lambda>n. A n \<inter> s) \<subseteq> sets M" using A s
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   506
        by blast
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   507
      show "disjoint_family (\<lambda>n. A n \<inter> s)" using disj
35582
b16d99a72dc9 Add Lebesgue integral and probability space.
hoelzl
parents: 33536
diff changeset
   508
        by (auto simp add: disjoint_family_on_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   509
      show "(\<Union>i. A i \<inter> s) \<in> sets M" using A s
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   510
        by (metis UN_extend_simps(4) s seq)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   511
    qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   512
  hence "f s = psuminf (\<lambda>i. f (A i \<inter> s))"
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   513
    using seq [symmetric] by (simp add: sums_iff)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   514
  also have "... \<le> psuminf (f \<circ> A)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   515
    proof (rule psuminf_le)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   516
      fix n show "f (A n \<inter> s) \<le> (f \<circ> A) n" using A s
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   517
        by (force intro: increasingD [OF inc])
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   518
    qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   519
  also have "... = z" by (rule si)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   520
  finally show "f s \<le> z" .
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   521
next
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   522
  fix y
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   523
  assume y: "\<forall>u \<in> measure_set M f s. y \<le> u"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   524
  thus "y \<le> f s"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   525
    by (blast intro: inf_measure_nonempty [of _ f, OF posf s subset_refl])
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   526
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   527
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   528
lemma inf_measure_empty:
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   529
  assumes posf: "positive M f" "{} \<in> sets M"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   530
  shows "Inf (measure_set M f {}) = 0"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   531
proof (rule antisym)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   532
  show "Inf (measure_set M f {}) \<le> 0"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   533
    by (metis complete_lattice_class.Inf_lower `{} \<in> sets M`
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   534
              inf_measure_nonempty[OF posf] subset_refl posf[unfolded positive_def])
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   535
qed simp
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   536
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   537
lemma (in algebra) inf_measure_positive:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   538
  "positive M f \<Longrightarrow> positive M (\<lambda>x. Inf (measure_set M f x))"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   539
  by (simp add: positive_def inf_measure_empty)
33271
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 (in algebra) inf_measure_increasing:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   542
  assumes posf: "positive M f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   543
  shows "increasing \<lparr> space = space M, sets = Pow (space M) \<rparr>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   544
                    (\<lambda>x. Inf (measure_set M f x))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   545
apply (auto simp add: increasing_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   546
apply (rule complete_lattice_class.Inf_greatest)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   547
apply (rule complete_lattice_class.Inf_lower)
37032
58a0757031dd speed up some proofs and fix some warnings
huffman
parents: 36649
diff changeset
   548
apply (clarsimp simp add: measure_set_def, rule_tac x=A in exI, blast)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   549
done
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   550
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   551
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   552
lemma (in algebra) inf_measure_le:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   553
  assumes posf: "positive M f" and inc: "increasing M f"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   554
      and x: "x \<in> {r . \<exists>A. range A \<subseteq> sets M \<and> s \<subseteq> (\<Union>i. A i) \<and> psuminf (f \<circ> A) = r}"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   555
  shows "Inf (measure_set M f s) \<le> x"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   556
proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   557
  from x
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   558
  obtain A where A: "range A \<subseteq> sets M" and ss: "s \<subseteq> (\<Union>i. A i)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   559
             and xeq: "psuminf (f \<circ> A) = x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   560
    by auto
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   561
  have dA: "range (disjointed A) \<subseteq> sets M"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   562
    by (metis A range_disjointed_sets)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   563
  have "\<forall>n.(f o disjointed A) n \<le> (f \<circ> A) n" unfolding comp_def
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   564
    by (metis increasingD [OF inc] UNIV_I dA image_subset_iff disjointed_subset A comp_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   565
  hence sda: "psuminf (f o disjointed A) \<le> psuminf (f \<circ> A)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   566
    by (blast intro: psuminf_le)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   567
  hence ley: "psuminf (f o disjointed A) \<le> x"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   568
    by (metis xeq)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   569
  hence y: "psuminf (f o disjointed A) \<in> measure_set M f s"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   570
    apply (auto simp add: measure_set_def)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   571
    apply (rule_tac x="disjointed A" in exI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   572
    apply (simp add: disjoint_family_disjointed UN_disjointed_eq ss dA comp_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   573
    done
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   574
  show ?thesis
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   575
    by (blast intro: y order_trans [OF _ ley] posf complete_lattice_class.Inf_lower)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   576
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   577
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   578
lemma (in algebra) inf_measure_close:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   579
  assumes posf: "positive M f" and e: "0 < e" and ss: "s \<subseteq> (space M)"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   580
  shows "\<exists>A. range A \<subseteq> sets M \<and> disjoint_family A \<and> s \<subseteq> (\<Union>i. A i) \<and>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   581
               psuminf (f \<circ> A) \<le> Inf (measure_set M f s) + e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   582
proof (cases "Inf (measure_set M f s) = \<omega>")
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   583
  case False
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   584
  obtain l where "l \<in> measure_set M f s" "l \<le> Inf (measure_set M f s) + e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   585
    using Inf_close[OF False e] by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   586
  thus ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   587
    by (auto intro!: exI[of _ l] simp: measure_set_def comp_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   588
next
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   589
  case True
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   590
  have "measure_set M f s \<noteq> {}"
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   591
    by (metis emptyE ss inf_measure_nonempty [of _ f, OF posf top _ empty_sets])
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   592
  then obtain l where "l \<in> measure_set M f s" by auto
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   593
  moreover from True have "l \<le> Inf (measure_set M f s) + e" by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   594
  ultimately show ?thesis
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   595
    by (auto intro!: exI[of _ l] simp: measure_set_def comp_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   596
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   597
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   598
lemma (in algebra) inf_measure_countably_subadditive:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   599
  assumes posf: "positive M f" and inc: "increasing M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   600
  shows "countably_subadditive (| space = space M, sets = Pow (space M) |)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   601
                  (\<lambda>x. Inf (measure_set M f x))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   602
  unfolding countably_subadditive_def o_def
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   603
proof (safe, simp, rule pextreal_le_epsilon)
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   604
  fix A :: "nat \<Rightarrow> 'a set" and e :: pextreal
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   605
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   606
  let "?outer n" = "Inf (measure_set M f (A n))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   607
  assume A: "range A \<subseteq> Pow (space M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   608
     and disj: "disjoint_family A"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   609
     and sb: "(\<Union>i. A i) \<subseteq> space M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   610
     and e: "0 < e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   611
  hence "\<exists>BB. \<forall>n. range (BB n) \<subseteq> sets M \<and> disjoint_family (BB n) \<and>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   612
                   A n \<subseteq> (\<Union>i. BB n i) \<and>
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   613
                   psuminf (f o BB n) \<le> ?outer n + e * (1/2)^(Suc n)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   614
    apply (safe intro!: choice inf_measure_close [of f, OF posf _])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   615
    using e sb by (cases e, auto simp add: not_le mult_pos_pos)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   616
  then obtain BB
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   617
    where BB: "\<And>n. (range (BB n) \<subseteq> sets M)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   618
      and disjBB: "\<And>n. disjoint_family (BB n)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   619
      and sbBB: "\<And>n. A n \<subseteq> (\<Union>i. BB n i)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   620
      and BBle: "\<And>n. psuminf (f o BB n) \<le> ?outer n + e * (1/2)^(Suc n)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   621
    by auto blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   622
  have sll: "(\<Sum>\<^isub>\<infinity> n. psuminf (f o BB n)) \<le> psuminf ?outer + e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   623
    proof -
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   624
      have "(\<Sum>\<^isub>\<infinity> n. psuminf (f o BB n)) \<le> (\<Sum>\<^isub>\<infinity> n. ?outer n + e*(1/2) ^ Suc n)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   625
        by (rule psuminf_le[OF BBle])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   626
      also have "... = psuminf ?outer + e"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   627
        using psuminf_half_series by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   628
      finally show ?thesis .
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   629
    qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   630
  def C \<equiv> "(split BB) o prod_decode"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   631
  have C: "!!n. C n \<in> sets M"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   632
    apply (rule_tac p="prod_decode n" in PairE)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   633
    apply (simp add: C_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   634
    apply (metis BB subsetD rangeI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   635
    done
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   636
  have sbC: "(\<Union>i. A i) \<subseteq> (\<Union>i. C i)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   637
    proof (auto simp add: C_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   638
      fix x i
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   639
      assume x: "x \<in> A i"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   640
      with sbBB [of i] obtain j where "x \<in> BB i j"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   641
        by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   642
      thus "\<exists>i. x \<in> split BB (prod_decode i)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   643
        by (metis prod_encode_inverse prod.cases)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   644
    qed
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   645
  have "(f \<circ> C) = (f \<circ> (\<lambda>(x, y). BB x y)) \<circ> prod_decode"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   646
    by (rule ext)  (auto simp add: C_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   647
  moreover have "psuminf ... = (\<Sum>\<^isub>\<infinity> n. psuminf (f o BB n))" using BBle
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   648
    by (force intro!: psuminf_2dimen simp: o_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   649
  ultimately have Csums: "psuminf (f \<circ> C) = (\<Sum>\<^isub>\<infinity> n. psuminf (f o BB n))" by simp
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   650
  have "Inf (measure_set M f (\<Union>i. A i)) \<le> (\<Sum>\<^isub>\<infinity> n. psuminf (f o BB n))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   651
    apply (rule inf_measure_le [OF posf(1) inc], auto)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   652
    apply (rule_tac x="C" in exI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   653
    apply (auto simp add: C sbC Csums)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   654
    done
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   655
  also have "... \<le> (\<Sum>\<^isub>\<infinity>n. Inf (measure_set M f (A n))) + e" using sll
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   656
    by blast
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   657
  finally show "Inf (measure_set M f (\<Union>i. A i)) \<le> psuminf ?outer + e" .
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   658
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   659
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   660
lemma (in algebra) inf_measure_outer:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   661
  "\<lbrakk> positive M f ; increasing M f \<rbrakk>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   662
   \<Longrightarrow> outer_measure_space \<lparr> space = space M, sets = Pow (space M) \<rparr>
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   663
                          (\<lambda>x. Inf (measure_set M f x))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   664
  by (simp add: outer_measure_space_def inf_measure_empty
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   665
                inf_measure_increasing inf_measure_countably_subadditive positive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   666
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   667
(*MOVE UP*)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   668
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   669
lemma (in algebra) algebra_subset_lambda_system:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   670
  assumes posf: "positive M f" and inc: "increasing M f"
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   671
      and add: "additive M f"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   672
  shows "sets M \<subseteq> lambda_system (| space = space M, sets = Pow (space M) |)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   673
                                (\<lambda>x. Inf (measure_set M f x))"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   674
proof (auto dest: sets_into_space
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   675
            simp add: algebra.lambda_system_eq [OF algebra_Pow])
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   676
  fix x s
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   677
  assume x: "x \<in> sets M"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   678
     and s: "s \<subseteq> space M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   679
  have [simp]: "!!x. x \<in> sets M \<Longrightarrow> s \<inter> (space M - x) = s-x" using s
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   680
    by blast
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   681
  have "Inf (measure_set M f (s\<inter>x)) + Inf (measure_set M f (s-x))
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   682
        \<le> Inf (measure_set M f s)"
41023
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   683
    proof (rule pextreal_le_epsilon)
9118eb4eb8dc it is known as the extended reals, not the infinite reals
hoelzl
parents: 40859
diff changeset
   684
      fix e :: pextreal
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   685
      assume e: "0 < e"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   686
      from inf_measure_close [of f, OF posf e s]
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   687
      obtain A where A: "range A \<subseteq> sets M" and disj: "disjoint_family A"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   688
                 and sUN: "s \<subseteq> (\<Union>i. A i)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   689
                 and l: "psuminf (f \<circ> A) \<le> Inf (measure_set M f s) + e"
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   690
        by auto
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   691
      have [simp]: "!!x. x \<in> sets M \<Longrightarrow>
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   692
                      (f o (\<lambda>z. z \<inter> (space M - x)) o A) = (f o (\<lambda>z. z - x) o A)"
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   693
        by (rule ext, simp, metis A Int_Diff Int_space_eq2 range_subsetD)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   694
      have  [simp]: "!!n. f (A n \<inter> x) + f (A n - x) = f (A n)"
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   695
        by (subst additiveD [OF add, symmetric])
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   696
           (auto simp add: x range_subsetD [OF A] Int_Diff_Un Int_Diff_disjoint)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   697
      { fix u
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   698
        assume u: "u \<in> sets M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   699
        have [simp]: "\<And>n. f (A n \<inter> u) \<le> f (A n)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   700
          by (simp add: increasingD [OF inc] u Int range_subsetD [OF A])
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   701
        have 2: "Inf (measure_set M f (s \<inter> u)) \<le> psuminf (f \<circ> (\<lambda>z. z \<inter> u) \<circ> A)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   702
          proof (rule complete_lattice_class.Inf_lower)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   703
            show "psuminf (f \<circ> (\<lambda>z. z \<inter> u) \<circ> A) \<in> measure_set M f (s \<inter> u)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   704
              apply (simp add: measure_set_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   705
              apply (rule_tac x="(\<lambda>z. z \<inter> u) o A" in exI)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   706
              apply (auto simp add: disjoint_family_subset [OF disj] o_def)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   707
              apply (blast intro: u range_subsetD [OF A])
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   708
              apply (blast dest: subsetD [OF sUN])
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   709
              done
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   710
          qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   711
      } note lesum = this
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   712
      have inf1: "Inf (measure_set M f (s\<inter>x)) \<le> psuminf (f o (\<lambda>z. z\<inter>x) o A)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   713
        and inf2: "Inf (measure_set M f (s \<inter> (space M - x)))
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   714
                   \<le> psuminf (f o (\<lambda>z. z \<inter> (space M - x)) o A)"
33536
fd28b7399f2b eliminated hard tabulators;
wenzelm
parents: 33271
diff changeset
   715
        by (metis Diff lesum top x)+
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   716
      hence "Inf (measure_set M f (s\<inter>x)) + Inf (measure_set M f (s-x))
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   717
           \<le> psuminf (f o (\<lambda>s. s\<inter>x) o A) + psuminf (f o (\<lambda>s. s-x) o A)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   718
        by (simp add: x add_mono)
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   719
      also have "... \<le> psuminf (f o A)"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   720
        by (simp add: x psuminf_add[symmetric] o_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   721
      also have "... \<le> Inf (measure_set M f s) + e"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   722
        by (rule l)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   723
      finally show "Inf (measure_set M f (s\<inter>x)) + Inf (measure_set M f (s-x))
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   724
        \<le> Inf (measure_set M f s) + e" .
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   725
    qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   726
  moreover
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   727
  have "Inf (measure_set M f s)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   728
       \<le> Inf (measure_set M f (s\<inter>x)) + Inf (measure_set M f (s-x))"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   729
    proof -
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   730
    have "Inf (measure_set M f s) = Inf (measure_set M f ((s\<inter>x) \<union> (s-x)))"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   731
      by (metis Un_Diff_Int Un_commute)
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   732
    also have "... \<le> Inf (measure_set M f (s\<inter>x)) + Inf (measure_set M f (s-x))"
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   733
      apply (rule subadditiveD)
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   734
      apply (rule algebra.countably_subadditive_subadditive[OF algebra_Pow])
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   735
      apply (simp add: positive_def inf_measure_empty[OF posf])
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   736
      apply (rule inf_measure_countably_subadditive)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   737
      using s by (auto intro!: posf inc)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   738
    finally show ?thesis .
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   739
    qed
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   740
  ultimately
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   741
  show "Inf (measure_set M f (s\<inter>x)) + Inf (measure_set M f (s-x))
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   742
        = Inf (measure_set M f s)"
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   743
    by (rule order_antisym)
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   744
qed
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   745
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   746
lemma measure_down:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   747
  "measure_space N \<Longrightarrow> sigma_algebra M \<Longrightarrow> sets M \<subseteq> sets N \<Longrightarrow> measure N = measure M \<Longrightarrow> measure_space M"
38656
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   748
  by (simp add: measure_space_def measure_space_axioms_def positive_def
d5d342611edb Rewrite the Probability theory.
hoelzl
parents: 37591
diff changeset
   749
                countably_additive_def)
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   750
     blast
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   751
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   752
theorem (in algebra) caratheodory:
41689
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   753
  assumes posf: "positive M f" and ca: "countably_additive M f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   754
  shows "\<exists>\<mu> :: 'a set \<Rightarrow> pextreal. (\<forall>s \<in> sets M. \<mu> s = f s) \<and>
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   755
            measure_space \<lparr> space = space M, sets = sets (sigma M), measure = \<mu> \<rparr>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   756
proof -
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   757
  have inc: "increasing M f"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   758
    by (metis additive_increasing ca countably_additive_additive posf)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   759
  let ?infm = "(\<lambda>x. Inf (measure_set M f x))"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   760
  def ls \<equiv> "lambda_system (|space = space M, sets = Pow (space M)|) ?infm"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   761
  have mls: "measure_space \<lparr>space = space M, sets = ls, measure = ?infm\<rparr>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   762
    using sigma_algebra.caratheodory_lemma
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   763
            [OF sigma_algebra_Pow  inf_measure_outer [OF posf inc]]
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   764
    by (simp add: ls_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   765
  hence sls: "sigma_algebra (|space = space M, sets = ls, measure = ?infm|)"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   766
    by (simp add: measure_space_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   767
  have "sets M \<subseteq> ls"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   768
    by (simp add: ls_def)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   769
       (metis ca posf inc countably_additive_additive algebra_subset_lambda_system)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   770
  hence sgs_sb: "sigma_sets (space M) (sets M) \<subseteq> ls"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   771
    using sigma_algebra.sigma_sets_subset [OF sls, of "sets M"]
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   772
    by simp
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   773
  have "measure_space \<lparr> space = space M, sets = sets (sigma M), measure = ?infm \<rparr>"
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   774
    unfolding sigma_def
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   775
    by (rule measure_down [OF mls], rule sigma_algebra_sigma_sets)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   776
       (simp_all add: sgs_sb space_closed)
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   777
  thus ?thesis using inf_measure_agrees [OF posf ca]
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   778
    by (intro exI[of _ ?infm]) auto
3e39b0e730d6 the measure valuation is again part of the measure_space type, instead of an explicit parameter to the locale;
hoelzl
parents: 41023
diff changeset
   779
qed
33271
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   780
7be66dee1a5a New theory Probability, which contains a development of measure theory
paulson
parents:
diff changeset
   781
end