src/HOL/Probability/Product_Measure.thy
author hoelzl
Fri Mar 26 18:03:01 2010 +0100 (2010-03-26)
changeset 35977 30d42bfd0174
parent 35833 7b7ae5aa396d
child 36649 bfd8c550faa6
permissions -rw-r--r--
Added finite measure space.
hoelzl@35833
     1
theory Product_Measure
hoelzl@35833
     2
imports "~~/src/HOL/Probability/Lebesgue"
hoelzl@35833
     3
begin
hoelzl@35833
     4
hoelzl@35833
     5
definition
hoelzl@35833
     6
  "prod_measure M M' = (\<lambda>a. measure_space.integral M (\<lambda>s0. measure M' ((\<lambda>s1. (s0, s1)) -` a)))"
hoelzl@35833
     7
hoelzl@35833
     8
definition
hoelzl@35833
     9
  "prod_measure_space M M' \<equiv>
hoelzl@35833
    10
    \<lparr> space = space M \<times> space M',
hoelzl@35833
    11
      sets = sets (sigma (space M \<times> space M') (prod_sets (sets M) (sets M'))),
hoelzl@35833
    12
      measure = prod_measure M M' \<rparr>"
hoelzl@35833
    13
hoelzl@35833
    14
lemma prod_measure_times:
hoelzl@35833
    15
  assumes "measure_space M" and "measure_space M'" and a: "a \<in> sets M"
hoelzl@35833
    16
  shows "prod_measure M M' (a \<times> a') = measure M a * measure M' a'"
hoelzl@35833
    17
proof -
hoelzl@35833
    18
  interpret M: measure_space M by fact
hoelzl@35833
    19
  interpret M': measure_space M' by fact
hoelzl@35833
    20
hoelzl@35833
    21
  { fix \<omega>
hoelzl@35833
    22
    have "(\<lambda>\<omega>'. (\<omega>, \<omega>')) -` (a \<times> a') = (if \<omega> \<in> a then a' else {})"
hoelzl@35833
    23
      by auto
hoelzl@35833
    24
    hence "measure M' ((\<lambda>\<omega>'. (\<omega>, \<omega>')) -` (a \<times> a')) =
hoelzl@35833
    25
      measure M' a' * indicator_fn a \<omega>"
hoelzl@35833
    26
      unfolding indicator_fn_def by auto }
hoelzl@35833
    27
  note vimage_eq_indicator = this
hoelzl@35833
    28
hoelzl@35833
    29
  show ?thesis
hoelzl@35833
    30
    unfolding prod_measure_def vimage_eq_indicator
hoelzl@35833
    31
      M.integral_cmul_indicator(1)[OF `a \<in> sets M`]
hoelzl@35833
    32
    by simp
hoelzl@35833
    33
qed
hoelzl@35833
    34
hoelzl@35977
    35
lemma finite_prod_measure_space:
hoelzl@35977
    36
  assumes "finite_measure_space M" and "finite_measure_space M'"
hoelzl@35977
    37
  shows "prod_measure_space M M' =
hoelzl@35977
    38
      \<lparr> space = space M \<times> space M',
hoelzl@35977
    39
        sets = Pow (space M \<times> space M'),
hoelzl@35977
    40
        measure = prod_measure M M' \<rparr>"
hoelzl@35977
    41
proof -
hoelzl@35977
    42
  interpret M: finite_measure_space M by fact
hoelzl@35977
    43
  interpret M': finite_measure_space M' by fact
hoelzl@35977
    44
  show ?thesis using M.finite_space M'.finite_space
hoelzl@35977
    45
    by (simp add: sigma_prod_sets_finite M.sets_eq_Pow M'.sets_eq_Pow
hoelzl@35977
    46
      prod_measure_space_def)
hoelzl@35977
    47
qed
hoelzl@35833
    48
hoelzl@35977
    49
lemma finite_measure_space_finite_prod_measure:
hoelzl@35977
    50
  assumes "finite_measure_space M" and "finite_measure_space M'"
hoelzl@35977
    51
  shows "finite_measure_space (prod_measure_space M M')"
hoelzl@35977
    52
proof (rule finite_Pow_additivity_sufficient)
hoelzl@35977
    53
  interpret M: finite_measure_space M by fact
hoelzl@35977
    54
  interpret M': finite_measure_space M' by fact
hoelzl@35833
    55
hoelzl@35977
    56
  from M.finite_space M'.finite_space
hoelzl@35977
    57
  show "finite (space (prod_measure_space M M'))" and
hoelzl@35977
    58
    "sets (prod_measure_space M M') = Pow (space (prod_measure_space M M'))"
hoelzl@35977
    59
    by (simp_all add: finite_prod_measure_space[OF assms])
hoelzl@35833
    60
hoelzl@35833
    61
  show "additive (prod_measure_space M M') (measure (prod_measure_space M M'))"
hoelzl@35977
    62
    unfolding additive_def finite_prod_measure_space[OF assms]
hoelzl@35977
    63
  proof (simp, safe)
hoelzl@35977
    64
    fix x y assume subs: "x \<subseteq> space M \<times> space M'" "y \<subseteq> space M \<times> space M'"
hoelzl@35833
    65
      and disj_x_y: "x \<inter> y = {}"
hoelzl@35977
    66
    have "\<And>z. measure M' (Pair z -` x \<union> Pair z -` y) =
hoelzl@35977
    67
        measure M' (Pair z -` x) + measure M' (Pair z -` y)"
hoelzl@35977
    68
      using disj_x_y subs by (subst M'.measure_additive) (auto simp: M'.sets_eq_Pow)
hoelzl@35977
    69
    thus "prod_measure M M' (x \<union> y) = prod_measure M M' x + prod_measure M M' y"
hoelzl@35977
    70
      unfolding prod_measure_def M.integral_finite_singleton
hoelzl@35833
    71
      by (simp_all add: setsum_addf[symmetric] field_simps)
hoelzl@35833
    72
  qed
hoelzl@35833
    73
hoelzl@35833
    74
  show "positive (prod_measure_space M M') (measure (prod_measure_space M M'))"
hoelzl@35833
    75
    unfolding positive_def
hoelzl@35977
    76
    by (auto intro!: setsum_nonneg mult_nonneg_nonneg M'.positive M.positive
hoelzl@35977
    77
      simp add: M.integral_zero finite_prod_measure_space[OF assms]
hoelzl@35977
    78
        prod_measure_def M.integral_finite_singleton
hoelzl@35977
    79
        M.sets_eq_Pow M'.sets_eq_Pow)
hoelzl@35833
    80
qed
hoelzl@35833
    81
hoelzl@35977
    82
lemma finite_measure_space_finite_prod_measure_alterantive:
hoelzl@35977
    83
  assumes M: "finite_measure_space M" and M': "finite_measure_space M'"
hoelzl@35977
    84
  shows "finite_measure_space \<lparr> space = space M \<times> space M', sets = Pow (space M \<times> space M'), measure = prod_measure M M' \<rparr>"
hoelzl@35977
    85
    (is "finite_measure_space ?M")
hoelzl@35977
    86
proof -
hoelzl@35977
    87
  interpret M: finite_measure_space M by fact
hoelzl@35977
    88
  interpret M': finite_measure_space M' by fact
hoelzl@35833
    89
hoelzl@35977
    90
  show ?thesis
hoelzl@35977
    91
    using finite_measure_space_finite_prod_measure[OF assms]
hoelzl@35977
    92
    unfolding prod_measure_space_def M.sets_eq_Pow M'.sets_eq_Pow
hoelzl@35977
    93
    using M.finite_space M'.finite_space
hoelzl@35977
    94
    by (simp add: sigma_prod_sets_finite)
hoelzl@35833
    95
qed
hoelzl@35833
    96
hoelzl@35833
    97
end