src/HOL/Probability/Infinite_Product_Measure.thy
author hoelzl
Tue, 05 Apr 2011 19:55:04 +0200
changeset 42257 08d717c82828
parent 42166 efd229daeb2c
child 42865 36353d913424
permissions -rw-r--r--
prove measurable_into_infprod_algebra and measure_infprod
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42147
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     1
(*  Title:      HOL/Probability/Infinite_Product_Measure.thy
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     2
    Author:     Johannes Hölzl, TU München
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     3
*)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     4
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     5
header {*Infinite Product Measure*}
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     6
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     7
theory Infinite_Product_Measure
42148
d596e7bb251f rename Probability_Space to Probability_Measure
hoelzl
parents: 42147
diff changeset
     8
  imports Probability_Measure
42147
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
     9
begin
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    10
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    11
lemma restrict_extensional_sub[intro]: "A \<subseteq> B \<Longrightarrow> restrict f A \<in> extensional B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    12
  unfolding restrict_def extensional_def by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    13
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    14
lemma restrict_restrict[simp]: "restrict (restrict f A) B = restrict f (A \<inter> B)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    15
  unfolding restrict_def by (simp add: fun_eq_iff)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    16
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    17
lemma split_merge: "P (merge I x J y i) \<longleftrightarrow> (i \<in> I \<longrightarrow> P (x i)) \<and> (i \<in> J - I \<longrightarrow> P (y i)) \<and> (i \<notin> I \<union> J \<longrightarrow> P undefined)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    18
  unfolding merge_def by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    19
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    20
lemma extensional_merge_sub: "I \<union> J \<subseteq> K \<Longrightarrow> merge I x J y \<in> extensional K"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    21
  unfolding merge_def extensional_def by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    22
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    23
lemma injective_vimage_restrict:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    24
  assumes J: "J \<subseteq> I"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    25
  and sets: "A \<subseteq> (\<Pi>\<^isub>E i\<in>J. S i)" "B \<subseteq> (\<Pi>\<^isub>E i\<in>J. S i)" and ne: "(\<Pi>\<^isub>E i\<in>I. S i) \<noteq> {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    26
  and eq: "(\<lambda>x. restrict x J) -` A \<inter> (\<Pi>\<^isub>E i\<in>I. S i) = (\<lambda>x. restrict x J) -` B \<inter> (\<Pi>\<^isub>E i\<in>I. S i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    27
  shows "A = B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    28
proof  (intro set_eqI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    29
  fix x
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    30
  from ne obtain y where y: "\<And>i. i \<in> I \<Longrightarrow> y i \<in> S i" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    31
  have "J \<inter> (I - J) = {}" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    32
  show "x \<in> A \<longleftrightarrow> x \<in> B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    33
  proof cases
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    34
    assume x: "x \<in> (\<Pi>\<^isub>E i\<in>J. S i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    35
    have "x \<in> A \<longleftrightarrow> merge J x (I - J) y \<in> (\<lambda>x. restrict x J) -` A \<inter> (\<Pi>\<^isub>E i\<in>I. S i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    36
      using y x `J \<subseteq> I` by (auto simp add: Pi_iff extensional_restrict extensional_merge_sub split: split_merge)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    37
    then show "x \<in> A \<longleftrightarrow> x \<in> B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    38
      using y x `J \<subseteq> I` by (auto simp add: Pi_iff extensional_restrict extensional_merge_sub eq split: split_merge)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    39
  next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    40
    assume "x \<notin> (\<Pi>\<^isub>E i\<in>J. S i)" with sets show "x \<in> A \<longleftrightarrow> x \<in> B" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    41
  qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    42
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    43
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    44
locale product_prob_space =
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    45
  fixes M :: "'i \<Rightarrow> ('a,'b) measure_space_scheme" and I :: "'i set"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    46
  assumes prob_spaces: "\<And>i. prob_space (M i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    47
  and I_not_empty: "I \<noteq> {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    48
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    49
locale finite_product_prob_space = product_prob_space M I
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    50
  for M :: "'i \<Rightarrow> ('a,'b) measure_space_scheme" and I :: "'i set" +
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    51
  assumes finite_index'[intro]: "finite I"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    52
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    53
sublocale product_prob_space \<subseteq> M: prob_space "M i" for i
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    54
  by (rule prob_spaces)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    55
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    56
sublocale product_prob_space \<subseteq> product_sigma_finite
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    57
  by default
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    58
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    59
sublocale finite_product_prob_space \<subseteq> finite_product_sigma_finite
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    60
  by default (fact finite_index')
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    61
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    62
sublocale finite_product_prob_space \<subseteq> prob_space "Pi\<^isub>M I M"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    63
proof
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    64
  show "measure P (space P) = 1"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    65
    by (simp add: measure_times measure_space_1 setprod_1)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    66
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    67
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    68
lemma (in product_prob_space) measure_preserving_restrict:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    69
  assumes "J \<noteq> {}" "J \<subseteq> K" "finite K"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    70
  shows "(\<lambda>f. restrict f J) \<in> measure_preserving (\<Pi>\<^isub>M i\<in>K. M i) (\<Pi>\<^isub>M i\<in>J. M i)" (is "?R \<in> _")
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    71
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    72
  interpret K: finite_product_prob_space M K
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    73
    by default (insert assms, auto)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    74
  have J: "J \<noteq> {}" "finite J" using assms by (auto simp add: finite_subset)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    75
  interpret J: finite_product_prob_space M J
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    76
    by default (insert J, auto)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    77
  from J.sigma_finite_pairs guess F .. note F = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    78
  then have [simp,intro]: "\<And>k i. k \<in> J \<Longrightarrow> F k i \<in> sets (M k)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    79
    by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    80
  let "?F i" = "\<Pi>\<^isub>E k\<in>J. F k i"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    81
  let ?J = "product_algebra_generator J M \<lparr> measure := measure (Pi\<^isub>M J M) \<rparr>"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    82
  have "?R \<in> measure_preserving (\<Pi>\<^isub>M i\<in>K. M i) (sigma ?J)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    83
  proof (rule K.measure_preserving_Int_stable)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    84
    show "Int_stable ?J"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    85
      by (auto simp: Int_stable_def product_algebra_generator_def PiE_Int)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    86
    show "range ?F \<subseteq> sets ?J" "incseq ?F" "(\<Union>i. ?F i) = space ?J"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    87
      using F by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    88
    show "\<And>i. measure ?J (?F i) \<noteq> \<infinity>"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    89
      using F by (simp add: J.measure_times setprod_PInf)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    90
    have "measure_space (Pi\<^isub>M J M)" by default
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    91
    then show "measure_space (sigma ?J)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    92
      by (simp add: product_algebra_def sigma_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    93
    show "?R \<in> measure_preserving (Pi\<^isub>M K M) ?J"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    94
    proof (simp add: measure_preserving_def measurable_def product_algebra_generator_def del: vimage_Int,
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    95
           safe intro!: restrict_extensional)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    96
      fix x k assume "k \<in> J" "x \<in> (\<Pi> i\<in>K. space (M i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    97
      then show "x k \<in> space (M k)" using `J \<subseteq> K` by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    98
    next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
    99
      fix E assume "E \<in> (\<Pi> i\<in>J. sets (M i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   100
      then have E: "\<And>j. j \<in> J \<Longrightarrow> E j \<in> sets (M j)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   101
      then have *: "?R -` Pi\<^isub>E J E \<inter> (\<Pi>\<^isub>E i\<in>K. space (M i)) = (\<Pi>\<^isub>E i\<in>K. if i \<in> J then E i else space (M i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   102
        (is "?X = Pi\<^isub>E K ?M")
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   103
        using `J \<subseteq> K` sets_into_space by (auto simp: Pi_iff split: split_if_asm) blast+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   104
      with E show "?X \<in> sets (Pi\<^isub>M K M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   105
        by (auto intro!: product_algebra_generatorI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   106
      have "measure (Pi\<^isub>M J M) (Pi\<^isub>E J E) = (\<Prod>i\<in>J. measure (M i) (?M i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   107
        using E by (simp add: J.measure_times)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   108
      also have "\<dots> = measure (Pi\<^isub>M K M) ?X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   109
        unfolding * using E `finite K` `J \<subseteq> K`
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   110
        by (auto simp: K.measure_times M.measure_space_1
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   111
                 cong del: setprod_cong
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   112
                 intro!: setprod_mono_one_left)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   113
      finally show "measure (Pi\<^isub>M J M) (Pi\<^isub>E J E) = measure (Pi\<^isub>M K M) ?X" .
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   114
    qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   115
  qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   116
  then show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   117
    by (simp add: product_algebra_def sigma_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   118
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   119
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   120
lemma (in product_prob_space) measurable_restrict:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   121
  assumes *: "J \<noteq> {}" "J \<subseteq> K" "finite K"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   122
  shows "(\<lambda>f. restrict f J) \<in> measurable (\<Pi>\<^isub>M i\<in>K. M i) (\<Pi>\<^isub>M i\<in>J. M i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   123
  using measure_preserving_restrict[OF *]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   124
  by (rule measure_preservingD2)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   125
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   126
definition (in product_prob_space)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   127
  "emb J K X = (\<lambda>x. restrict x K) -` X \<inter> space (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   128
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   129
lemma (in product_prob_space) emb_trans[simp]:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   130
  "J \<subseteq> K \<Longrightarrow> K \<subseteq> L \<Longrightarrow> emb L K (emb K J X) = emb L J X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   131
  by (auto simp add: Int_absorb1 emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   132
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   133
lemma (in product_prob_space) emb_empty[simp]:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   134
  "emb K J {} = {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   135
  by (simp add: emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   136
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   137
lemma (in product_prob_space) emb_Pi:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   138
  assumes "X \<in> (\<Pi> j\<in>J. sets (M j))" "J \<subseteq> K"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   139
  shows "emb K J (Pi\<^isub>E J X) = (\<Pi>\<^isub>E i\<in>K. if i \<in> J then X i else space (M i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   140
  using assms space_closed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   141
  by (auto simp: emb_def Pi_iff split: split_if_asm) blast+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   142
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   143
lemma (in product_prob_space) emb_injective:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   144
  assumes "J \<noteq> {}" "J \<subseteq> L" "finite J" and sets: "X \<in> sets (Pi\<^isub>M J M)" "Y \<in> sets (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   145
  assumes "emb L J X = emb L J Y"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   146
  shows "X = Y"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   147
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   148
  interpret J: finite_product_sigma_finite M J by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   149
  show "X = Y"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   150
  proof (rule injective_vimage_restrict)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   151
    show "X \<subseteq> (\<Pi>\<^isub>E i\<in>J. space (M i))" "Y \<subseteq> (\<Pi>\<^isub>E i\<in>J. space (M i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   152
      using J.sets_into_space sets by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   153
    have "\<forall>i\<in>L. \<exists>x. x \<in> space (M i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   154
      using M.not_empty by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   155
    from bchoice[OF this]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   156
    show "(\<Pi>\<^isub>E i\<in>L. space (M i)) \<noteq> {}" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   157
    show "(\<lambda>x. restrict x J) -` X \<inter> (\<Pi>\<^isub>E i\<in>L. space (M i)) = (\<lambda>x. restrict x J) -` Y \<inter> (\<Pi>\<^isub>E i\<in>L. space (M i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   158
      using `emb L J X = emb L J Y` by (simp add: emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   159
  qed fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   160
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   161
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   162
lemma (in product_prob_space) emb_id:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   163
  "B \<subseteq> (\<Pi>\<^isub>E i\<in>L. space (M i)) \<Longrightarrow> emb L L B = B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   164
  by (auto simp: emb_def Pi_iff subset_eq extensional_restrict)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   165
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   166
lemma (in product_prob_space) emb_simps:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   167
  shows "emb L K (A \<union> B) = emb L K A \<union> emb L K B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   168
    and "emb L K (A \<inter> B) = emb L K A \<inter> emb L K B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   169
    and "emb L K (A - B) = emb L K A - emb L K B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   170
  by (auto simp: emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   171
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   172
lemma (in product_prob_space) measurable_emb[intro,simp]:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   173
  assumes *: "J \<noteq> {}" "J \<subseteq> L" "finite L" "X \<in> sets (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   174
  shows "emb L J X \<in> sets (Pi\<^isub>M L M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   175
  using measurable_restrict[THEN measurable_sets, OF *] by (simp add: emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   176
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   177
lemma (in product_prob_space) measure_emb[intro,simp]:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   178
  assumes *: "J \<noteq> {}" "J \<subseteq> L" "finite L" "X \<in> sets (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   179
  shows "measure (Pi\<^isub>M L M) (emb L J X) = measure (Pi\<^isub>M J M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   180
  using measure_preserving_restrict[THEN measure_preservingD, OF *]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   181
  by (simp add: emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   182
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   183
definition (in product_prob_space) generator :: "('i \<Rightarrow> 'a) measure_space" where
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   184
  "generator = \<lparr>
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   185
    space = (\<Pi>\<^isub>E i\<in>I. space (M i)),
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   186
    sets = (\<Union>J\<in>{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emb I J ` sets (Pi\<^isub>M J M)),
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   187
    measure = undefined
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   188
  \<rparr>"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   189
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   190
lemma (in product_prob_space) generatorI:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   191
  "J \<noteq> {} \<Longrightarrow> finite J \<Longrightarrow> J \<subseteq> I \<Longrightarrow> X \<in> sets (Pi\<^isub>M J M) \<Longrightarrow> A = emb I J X \<Longrightarrow> A \<in> sets generator"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   192
  unfolding generator_def by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   193
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   194
lemma (in product_prob_space) generatorI':
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   195
  "J \<noteq> {} \<Longrightarrow> finite J \<Longrightarrow> J \<subseteq> I \<Longrightarrow> X \<in> sets (Pi\<^isub>M J M) \<Longrightarrow> emb I J X \<in> sets generator"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   196
  unfolding generator_def by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   197
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   198
lemma (in product_sigma_finite)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   199
  assumes "I \<inter> J = {}" "finite I" "finite J" and A: "A \<in> sets (Pi\<^isub>M (I \<union> J) M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   200
  shows measure_fold_integral:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   201
    "measure (Pi\<^isub>M (I \<union> J) M) A = (\<integral>\<^isup>+x. measure (Pi\<^isub>M J M) (merge I x J -` A \<inter> space (Pi\<^isub>M J M)) \<partial>Pi\<^isub>M I M)" (is ?I)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   202
    and measure_fold_measurable:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   203
    "(\<lambda>x. measure (Pi\<^isub>M J M) (merge I x J -` A \<inter> space (Pi\<^isub>M J M))) \<in> borel_measurable (Pi\<^isub>M I M)" (is ?B)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   204
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   205
  interpret I: finite_product_sigma_finite M I by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   206
  interpret J: finite_product_sigma_finite M J by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   207
  interpret IJ: pair_sigma_finite I.P J.P ..
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   208
  show ?I
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   209
    unfolding measure_fold[OF assms]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   210
    apply (subst IJ.pair_measure_alt)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   211
    apply (intro measurable_sets[OF _ A] measurable_merge assms)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   212
    apply (auto simp: vimage_compose[symmetric] comp_def space_pair_measure
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   213
      intro!: I.positive_integral_cong)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   214
    done
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   215
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   216
  have "(\<lambda>(x, y). merge I x J y) -` A \<inter> space (I.P \<Otimes>\<^isub>M J.P) \<in> sets (I.P \<Otimes>\<^isub>M J.P)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   217
    by (intro measurable_sets[OF _ A] measurable_merge assms)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   218
  from IJ.measure_cut_measurable_fst[OF this]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   219
  show ?B
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   220
    apply (auto simp: vimage_compose[symmetric] comp_def space_pair_measure)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   221
    apply (subst (asm) measurable_cong)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   222
    apply auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   223
    done
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   224
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   225
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   226
lemma (in prob_space) measure_le_1: "X \<in> sets M \<Longrightarrow> \<mu> X \<le> 1"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   227
  unfolding measure_space_1[symmetric]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   228
  using sets_into_space
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   229
  by (intro measure_mono) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   230
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   231
definition (in product_prob_space)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   232
  "\<mu>G A =
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   233
    (THE x. \<forall>J. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> J \<subseteq> I \<longrightarrow> (\<forall>X\<in>sets (Pi\<^isub>M J M). A = emb I J X \<longrightarrow> x = measure (Pi\<^isub>M J M) X))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   234
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   235
lemma (in product_prob_space) \<mu>G_spec:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   236
  assumes J: "J \<noteq> {}" "finite J" "J \<subseteq> I" "A = emb I J X" "X \<in> sets (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   237
  shows "\<mu>G A = measure (Pi\<^isub>M J M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   238
  unfolding \<mu>G_def
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   239
proof (intro the_equality allI impI ballI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   240
  fix K Y assume K: "K \<noteq> {}" "finite K" "K \<subseteq> I" "A = emb I K Y" "Y \<in> sets (Pi\<^isub>M K M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   241
  have "measure (Pi\<^isub>M K M) Y = measure (Pi\<^isub>M (K \<union> J) M) (emb (K \<union> J) K Y)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   242
    using K J by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   243
  also have "emb (K \<union> J) K Y = emb (K \<union> J) J X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   244
    using K J by (simp add: emb_injective[of "K \<union> J" I])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   245
  also have "measure (Pi\<^isub>M (K \<union> J) M) (emb (K \<union> J) J X) = measure (Pi\<^isub>M J M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   246
    using K J by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   247
  finally show "measure (Pi\<^isub>M J M) X = measure (Pi\<^isub>M K M) Y" ..
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   248
qed (insert J, force)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   249
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   250
lemma (in product_prob_space) \<mu>G_eq:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   251
  "J \<noteq> {} \<Longrightarrow> finite J \<Longrightarrow> J \<subseteq> I \<Longrightarrow> X \<in> sets (Pi\<^isub>M J M) \<Longrightarrow> \<mu>G (emb I J X) = measure (Pi\<^isub>M J M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   252
  by (intro \<mu>G_spec) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   253
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   254
lemma (in product_prob_space) generator_Ex:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   255
  assumes *: "A \<in> sets generator"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   256
  shows "\<exists>J X. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I \<and> X \<in> sets (Pi\<^isub>M J M) \<and> A = emb I J X \<and> \<mu>G A = measure (Pi\<^isub>M J M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   257
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   258
  from * obtain J X where J: "J \<noteq> {}" "finite J" "J \<subseteq> I" "A = emb I J X" "X \<in> sets (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   259
    unfolding generator_def by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   260
  with \<mu>G_spec[OF this] show ?thesis by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   261
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   262
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   263
lemma (in product_prob_space) generatorE:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   264
  assumes A: "A \<in> sets generator"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   265
  obtains J X where "J \<noteq> {}" "finite J" "J \<subseteq> I" "X \<in> sets (Pi\<^isub>M J M)" "emb I J X = A" "\<mu>G A = measure (Pi\<^isub>M J M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   266
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   267
  from generator_Ex[OF A] obtain X J where "J \<noteq> {}" "finite J" "J \<subseteq> I" "X \<in> sets (Pi\<^isub>M J M)" "emb I J X = A"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   268
    "\<mu>G A = measure (Pi\<^isub>M J M) X" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   269
  then show thesis by (intro that) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   270
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   271
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   272
lemma (in product_prob_space) merge_sets:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   273
  assumes "finite J" "finite K" "J \<inter> K = {}" and A: "A \<in> sets (Pi\<^isub>M (J \<union> K) M)" and x: "x \<in> space (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   274
  shows "merge J x K -` A \<inter> space (Pi\<^isub>M K M) \<in> sets (Pi\<^isub>M K M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   275
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   276
  interpret J: finite_product_sigma_algebra M J by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   277
  interpret K: finite_product_sigma_algebra M K by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   278
  interpret JK: pair_sigma_algebra J.P K.P ..
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   279
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   280
  from JK.measurable_cut_fst[OF
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   281
    measurable_merge[THEN measurable_sets, OF `J \<inter> K = {}`], OF A, of x] x
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   282
  show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   283
      by (simp add: space_pair_measure comp_def vimage_compose[symmetric])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   284
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   285
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   286
lemma (in product_prob_space) merge_emb:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   287
  assumes "K \<subseteq> I" "J \<subseteq> I" and y: "y \<in> space (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   288
  shows "(merge J y (I - J) -` emb I K X \<inter> space (Pi\<^isub>M I M)) =
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   289
    emb I (K - J) (merge J y (K - J) -` emb (J \<union> K) K X \<inter> space (Pi\<^isub>M (K - J) M))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   290
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   291
  have [simp]: "\<And>x J K L. merge J y K (restrict x L) = merge J y (K \<inter> L) x"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   292
    by (auto simp: restrict_def merge_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   293
  have [simp]: "\<And>x J K L. restrict (merge J y K x) L = merge (J \<inter> L) y (K \<inter> L) x"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   294
    by (auto simp: restrict_def merge_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   295
  have [simp]: "(I - J) \<inter> K = K - J" using `K \<subseteq> I` `J \<subseteq> I` by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   296
  have [simp]: "(K - J) \<inter> (K \<union> J) = K - J" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   297
  have [simp]: "(K - J) \<inter> K = K - J" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   298
  from y `K \<subseteq> I` `J \<subseteq> I` show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   299
    by (simp split: split_merge add: emb_def Pi_iff extensional_merge_sub set_eq_iff) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   300
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   301
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   302
definition (in product_prob_space) infprod_algebra :: "('i \<Rightarrow> 'a) measure_space" where
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   303
  "infprod_algebra = sigma generator \<lparr> measure :=
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   304
    (SOME \<mu>. (\<forall>s\<in>sets generator. \<mu> s = \<mu>G s) \<and>
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   305
       measure_space \<lparr>space = space generator, sets = sets (sigma generator), measure = \<mu>\<rparr>)\<rparr>"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   306
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   307
syntax
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   308
  "_PiP"  :: "[pttrn, 'i set, ('b, 'd) measure_space_scheme] => ('i => 'b, 'd) measure_space_scheme"  ("(3PIP _:_./ _)" 10)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   309
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   310
syntax (xsymbols)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   311
  "_PiP" :: "[pttrn, 'i set, ('b, 'd) measure_space_scheme] => ('i => 'b, 'd) measure_space_scheme"  ("(3\<Pi>\<^isub>P _\<in>_./ _)"   10)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   312
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   313
syntax (HTML output)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   314
  "_PiP" :: "[pttrn, 'i set, ('b, 'd) measure_space_scheme] => ('i => 'b, 'd) measure_space_scheme"  ("(3\<Pi>\<^isub>P _\<in>_./ _)"   10)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   315
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   316
abbreviation
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   317
  "Pi\<^isub>P I M \<equiv> product_prob_space.infprod_algebra M I"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   318
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   319
translations
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   320
  "PIP x:I. M" == "CONST Pi\<^isub>P I (%x. M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   321
42257
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   322
sublocale product_prob_space \<subseteq> G!: algebra generator
42147
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   323
proof
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   324
  let ?G = generator
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   325
  show "sets ?G \<subseteq> Pow (space ?G)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   326
    by (auto simp: generator_def emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   327
  from I_not_empty
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   328
  obtain i where "i \<in> I" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   329
  then show "{} \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   330
    by (auto intro!: exI[of _ "{i}"] image_eqI[where x="\<lambda>i. {}"]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   331
      simp: product_algebra_def sigma_def sigma_sets.Empty generator_def emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   332
  from `i \<in> I` show "space ?G \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   333
    by (auto intro!: exI[of _ "{i}"] image_eqI[where x="Pi\<^isub>E {i} (\<lambda>i. space (M i))"]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   334
      simp: generator_def emb_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   335
  fix A assume "A \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   336
  then obtain JA XA where XA: "JA \<noteq> {}" "finite JA" "JA \<subseteq> I" "XA \<in> sets (Pi\<^isub>M JA M)" and A: "A = emb I JA XA"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   337
    by (auto simp: generator_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   338
  fix B assume "B \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   339
  then obtain JB XB where XB: "JB \<noteq> {}" "finite JB" "JB \<subseteq> I" "XB \<in> sets (Pi\<^isub>M JB M)" and B: "B = emb I JB XB"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   340
    by (auto simp: generator_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   341
  let ?RA = "emb (JA \<union> JB) JA XA"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   342
  let ?RB = "emb (JA \<union> JB) JB XB"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   343
  interpret JAB: finite_product_sigma_algebra M "JA \<union> JB"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   344
    by default (insert XA XB, auto)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   345
  have *: "A - B = emb I (JA \<union> JB) (?RA - ?RB)" "A \<union> B = emb I (JA \<union> JB) (?RA \<union> ?RB)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   346
    using XA A XB B by (auto simp: emb_simps)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   347
  then show "A - B \<in> sets ?G" "A \<union> B \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   348
    using XA XB by (auto intro!: generatorI')
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   349
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   350
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   351
lemma (in product_prob_space) positive_\<mu>G: "positive generator \<mu>G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   352
proof (intro positive_def[THEN iffD2] conjI ballI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   353
  from generatorE[OF G.empty_sets] guess J X . note this[simp]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   354
  interpret J: finite_product_sigma_finite M J by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   355
  have "X = {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   356
    by (rule emb_injective[of J I]) simp_all
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   357
  then show "\<mu>G {} = 0" by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   358
next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   359
  fix A assume "A \<in> sets generator"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   360
  from generatorE[OF this] guess J X . note this[simp]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   361
  interpret J: finite_product_sigma_finite M J by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   362
  show "0 \<le> \<mu>G A" by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   363
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   364
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   365
lemma (in product_prob_space) additive_\<mu>G: "additive generator \<mu>G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   366
proof (intro additive_def[THEN iffD2] ballI impI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   367
  fix A assume "A \<in> sets generator" with generatorE guess J X . note J = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   368
  fix B assume "B \<in> sets generator" with generatorE guess K Y . note K = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   369
  assume "A \<inter> B = {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   370
  have JK: "J \<union> K \<noteq> {}" "J \<union> K \<subseteq> I" "finite (J \<union> K)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   371
    using J K by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   372
  interpret JK: finite_product_sigma_finite M "J \<union> K" by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   373
  have JK_disj: "emb (J \<union> K) J X \<inter> emb (J \<union> K) K Y = {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   374
    apply (rule emb_injective[of "J \<union> K" I])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   375
    apply (insert `A \<inter> B = {}` JK J K)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   376
    apply (simp_all add: JK.Int emb_simps)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   377
    done
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   378
  have AB: "A = emb I (J \<union> K) (emb (J \<union> K) J X)" "B = emb I (J \<union> K) (emb (J \<union> K) K Y)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   379
    using J K by simp_all
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   380
  then have "\<mu>G (A \<union> B) = \<mu>G (emb I (J \<union> K) (emb (J \<union> K) J X \<union> emb (J \<union> K) K Y))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   381
    by (simp add: emb_simps)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   382
  also have "\<dots> = measure (Pi\<^isub>M (J \<union> K) M) (emb (J \<union> K) J X \<union> emb (J \<union> K) K Y)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   383
    using JK J(1, 4) K(1, 4) by (simp add: \<mu>G_eq JK.Un)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   384
  also have "\<dots> = \<mu>G A + \<mu>G B"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   385
    using J K JK_disj by (simp add: JK.measure_additive[symmetric])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   386
  finally show "\<mu>G (A \<union> B) = \<mu>G A + \<mu>G B" .
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   387
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   388
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   389
lemma (in product_prob_space) finite_index_eq_finite_product:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   390
  assumes "finite I"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   391
  shows "sets (sigma generator) = sets (Pi\<^isub>M I M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   392
proof safe
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   393
  interpret I: finite_product_sigma_algebra M I by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   394
  have [simp]: "space generator = space (Pi\<^isub>M I M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   395
    by (simp add: generator_def product_algebra_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   396
  { fix A assume "A \<in> sets (sigma generator)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   397
    then show "A \<in> sets I.P" unfolding sets_sigma
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   398
    proof induct
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   399
      case (Basic A)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   400
      from generatorE[OF this] guess J X . note J = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   401
      with `finite I` have "emb I J X \<in> sets I.P" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   402
      with `emb I J X = A` show "A \<in> sets I.P" by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   403
    qed auto }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   404
  { fix A assume "A \<in> sets I.P"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   405
    moreover with I.sets_into_space have "emb I I A = A" by (intro emb_id) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   406
    ultimately show "A \<in> sets (sigma generator)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   407
      using `finite I` I_not_empty unfolding sets_sigma
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   408
      by (intro sigma_sets.Basic generatorI[of I A]) auto }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   409
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   410
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   411
lemma (in product_prob_space) extend_\<mu>G:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   412
  "\<exists>\<mu>. (\<forall>s\<in>sets generator. \<mu> s = \<mu>G s) \<and>
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   413
       measure_space \<lparr>space = space generator, sets = sets (sigma generator), measure = \<mu>\<rparr>"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   414
proof cases
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   415
  assume "finite I"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   416
  interpret I: finite_product_sigma_finite M I by default fact
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   417
  show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   418
  proof (intro exI[of _ "measure (Pi\<^isub>M I M)"] ballI conjI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   419
    fix A assume "A \<in> sets generator"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   420
    from generatorE[OF this] guess J X . note J = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   421
    from J(1-4) `finite I` show "measure I.P A = \<mu>G A"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   422
      unfolding J(6)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   423
      by (subst J(5)[symmetric]) (simp add: measure_emb)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   424
  next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   425
    have [simp]: "space generator = space (Pi\<^isub>M I M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   426
      by (simp add: generator_def product_algebra_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   427
    have "\<lparr>space = space generator, sets = sets (sigma generator), measure = measure I.P\<rparr>
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   428
      = I.P" (is "?P = _")
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   429
      by (auto intro!: measure_space.equality simp: finite_index_eq_finite_product[OF `finite I`])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   430
    then show "measure_space ?P" by simp default
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   431
  qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   432
next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   433
  let ?G = generator
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   434
  assume "\<not> finite I"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   435
  note \<mu>G_mono =
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   436
    G.additive_increasing[OF positive_\<mu>G additive_\<mu>G, THEN increasingD]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   437
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   438
  { fix Z J assume J: "J \<noteq> {}" "finite J" "J \<subseteq> I" and Z: "Z \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   439
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   440
    from `infinite I` `finite J` obtain k where k: "k \<in> I" "k \<notin> J"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   441
      by (metis rev_finite_subset subsetI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   442
    moreover from Z guess K' X' by (rule generatorE)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   443
    moreover def K \<equiv> "insert k K'"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   444
    moreover def X \<equiv> "emb K K' X'"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   445
    ultimately have K: "K \<noteq> {}" "finite K" "K \<subseteq> I" "X \<in> sets (Pi\<^isub>M K M)" "Z = emb I K X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   446
      "K - J \<noteq> {}" "K - J \<subseteq> I" "\<mu>G Z = measure (Pi\<^isub>M K M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   447
      by (auto simp: subset_insertI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   448
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   449
    let "?M y" = "merge J y (K - J) -` emb (J \<union> K) K X \<inter> space (Pi\<^isub>M (K - J) M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   450
    { fix y assume y: "y \<in> space (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   451
      note * = merge_emb[OF `K \<subseteq> I` `J \<subseteq> I` y, of X]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   452
      moreover
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   453
      have **: "?M y \<in> sets (Pi\<^isub>M (K - J) M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   454
        using J K y by (intro merge_sets) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   455
      ultimately
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   456
      have ***: "(merge J y (I - J) -` Z \<inter> space (Pi\<^isub>M I M)) \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   457
        using J K by (intro generatorI) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   458
      have "\<mu>G (merge J y (I - J) -` emb I K X \<inter> space (Pi\<^isub>M I M)) = measure (Pi\<^isub>M (K - J) M) (?M y)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   459
        unfolding * using K J by (subst \<mu>G_eq[OF _ _ _ **]) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   460
      note * ** *** this }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   461
    note merge_in_G = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   462
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   463
    have "finite (K - J)" using K by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   464
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   465
    interpret J: finite_product_prob_space M J by default fact+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   466
    interpret KmJ: finite_product_prob_space M "K - J" by default fact+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   467
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   468
    have "\<mu>G Z = measure (Pi\<^isub>M (J \<union> (K - J)) M) (emb (J \<union> (K - J)) K X)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   469
      using K J by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   470
    also have "\<dots> = (\<integral>\<^isup>+ x. measure (Pi\<^isub>M (K - J) M) (?M x) \<partial>Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   471
      using K J by (subst measure_fold_integral) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   472
    also have "\<dots> = (\<integral>\<^isup>+ y. \<mu>G (merge J y (I - J) -` Z \<inter> space (Pi\<^isub>M I M)) \<partial>Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   473
      (is "_ = (\<integral>\<^isup>+x. \<mu>G (?MZ x) \<partial>Pi\<^isub>M J M)")
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   474
    proof (intro J.positive_integral_cong)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   475
      fix x assume x: "x \<in> space (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   476
      with K merge_in_G(2)[OF this]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   477
      show "measure (Pi\<^isub>M (K - J) M) (?M x) = \<mu>G (?MZ x)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   478
        unfolding `Z = emb I K X` merge_in_G(1)[OF x] by (subst \<mu>G_eq) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   479
    qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   480
    finally have fold: "\<mu>G Z = (\<integral>\<^isup>+x. \<mu>G (?MZ x) \<partial>Pi\<^isub>M J M)" .
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   481
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   482
    { fix x assume x: "x \<in> space (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   483
      then have "\<mu>G (?MZ x) \<le> 1"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   484
        unfolding merge_in_G(4)[OF x] `Z = emb I K X`
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   485
        by (intro KmJ.measure_le_1 merge_in_G(2)[OF x]) }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   486
    note le_1 = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   487
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   488
    let "?q y" = "\<mu>G (merge J y (I - J) -` Z \<inter> space (Pi\<^isub>M I M))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   489
    have "?q \<in> borel_measurable (Pi\<^isub>M J M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   490
      unfolding `Z = emb I K X` using J K merge_in_G(3)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   491
      by (simp add: merge_in_G  \<mu>G_eq measure_fold_measurable
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   492
               del: space_product_algebra cong: measurable_cong)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   493
    note this fold le_1 merge_in_G(3) }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   494
  note fold = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   495
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   496
  show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   497
  proof (rule G.caratheodory_empty_continuous[OF positive_\<mu>G additive_\<mu>G])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   498
    fix A assume "A \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   499
    with generatorE guess J X . note JX = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   500
    interpret JK: finite_product_prob_space M J by default fact+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   501
    with JX show "\<mu>G A \<noteq> \<infinity>" by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   502
  next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   503
    fix A assume A: "range A \<subseteq> sets ?G" "decseq A" "(\<Inter>i. A i) = {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   504
    then have "decseq (\<lambda>i. \<mu>G (A i))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   505
      by (auto intro!: \<mu>G_mono simp: decseq_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   506
    moreover
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   507
    have "(INF i. \<mu>G (A i)) = 0"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   508
    proof (rule ccontr)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   509
      assume "(INF i. \<mu>G (A i)) \<noteq> 0" (is "?a \<noteq> 0")
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   510
      moreover have "0 \<le> ?a"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   511
        using A positive_\<mu>G by (auto intro!: le_INFI simp: positive_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   512
      ultimately have "0 < ?a" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   513
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   514
      have "\<forall>n. \<exists>J X. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I \<and> X \<in> sets (Pi\<^isub>M J M) \<and> A n = emb I J X \<and> \<mu>G (A n) = measure (Pi\<^isub>M J M) X"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   515
        using A by (intro allI generator_Ex) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   516
      then obtain J' X' where J': "\<And>n. J' n \<noteq> {}" "\<And>n. finite (J' n)" "\<And>n. J' n \<subseteq> I" "\<And>n. X' n \<in> sets (Pi\<^isub>M (J' n) M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   517
        and A': "\<And>n. A n = emb I (J' n) (X' n)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   518
        unfolding choice_iff by blast
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   519
      moreover def J \<equiv> "\<lambda>n. (\<Union>i\<le>n. J' i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   520
      moreover def X \<equiv> "\<lambda>n. emb (J n) (J' n) (X' n)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   521
      ultimately have J: "\<And>n. J n \<noteq> {}" "\<And>n. finite (J n)" "\<And>n. J n \<subseteq> I" "\<And>n. X n \<in> sets (Pi\<^isub>M (J n) M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   522
        by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   523
      with A' have A_eq: "\<And>n. A n = emb I (J n) (X n)" "\<And>n. A n \<in> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   524
        unfolding J_def X_def by (subst emb_trans) (insert A, auto)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   525
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   526
      have J_mono: "\<And>n m. n \<le> m \<Longrightarrow> J n \<subseteq> J m"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   527
        unfolding J_def by force
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   528
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   529
      interpret J: finite_product_prob_space M "J i" for i by default fact+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   530
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   531
      have a_le_1: "?a \<le> 1"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   532
        using \<mu>G_spec[of "J 0" "A 0" "X 0"] J A_eq
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   533
        by (auto intro!: INF_leI2[of 0] J.measure_le_1)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   534
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   535
      let "?M K Z y" = "merge K y (I - K) -` Z \<inter> space (Pi\<^isub>M I M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   536
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   537
      { fix Z k assume Z: "range Z \<subseteq> sets ?G" "decseq Z" "\<forall>n. ?a / 2^k \<le> \<mu>G (Z n)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   538
        then have Z_sets: "\<And>n. Z n \<in> sets ?G" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   539
        fix J' assume J': "J' \<noteq> {}" "finite J'" "J' \<subseteq> I"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   540
        interpret J': finite_product_prob_space M J' by default fact+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   541
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   542
        let "?q n y" = "\<mu>G (?M J' (Z n) y)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   543
        let "?Q n" = "?q n -` {?a / 2^(k+1) ..} \<inter> space (Pi\<^isub>M J' M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   544
        { fix n
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   545
          have "?q n \<in> borel_measurable (Pi\<^isub>M J' M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   546
            using Z J' by (intro fold(1)) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   547
          then have "?Q n \<in> sets (Pi\<^isub>M J' M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   548
            by (rule measurable_sets) auto }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   549
        note Q_sets = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   550
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   551
        have "?a / 2^(k+1) \<le> (INF n. measure (Pi\<^isub>M J' M) (?Q n))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   552
        proof (intro le_INFI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   553
          fix n
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   554
          have "?a / 2^k \<le> \<mu>G (Z n)" using Z by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   555
          also have "\<dots> \<le> (\<integral>\<^isup>+ x. indicator (?Q n) x + ?a / 2^(k+1) \<partial>Pi\<^isub>M J' M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   556
            unfolding fold(2)[OF J' `Z n \<in> sets ?G`]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   557
          proof (intro J'.positive_integral_mono)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   558
            fix x assume x: "x \<in> space (Pi\<^isub>M J' M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   559
            then have "?q n x \<le> 1 + 0"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   560
              using J' Z fold(3) Z_sets by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   561
            also have "\<dots> \<le> 1 + ?a / 2^(k+1)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   562
              using `0 < ?a` by (intro add_mono) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   563
            finally have "?q n x \<le> 1 + ?a / 2^(k+1)" .
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   564
            with x show "?q n x \<le> indicator (?Q n) x + ?a / 2^(k+1)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   565
              by (auto split: split_indicator simp del: power_Suc)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   566
          qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   567
          also have "\<dots> = measure (Pi\<^isub>M J' M) (?Q n) + ?a / 2^(k+1)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   568
            using `0 \<le> ?a` Q_sets J'.measure_space_1
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   569
            by (subst J'.positive_integral_add) auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   570
          finally show "?a / 2^(k+1) \<le> measure (Pi\<^isub>M J' M) (?Q n)" using `?a \<le> 1`
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   571
            by (cases rule: extreal2_cases[of ?a "measure (Pi\<^isub>M J' M) (?Q n)"])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   572
               (auto simp: field_simps)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   573
        qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   574
        also have "\<dots> = measure (Pi\<^isub>M J' M) (\<Inter>n. ?Q n)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   575
        proof (intro J'.continuity_from_above)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   576
          show "range ?Q \<subseteq> sets (Pi\<^isub>M J' M)" using Q_sets by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   577
          show "decseq ?Q"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   578
            unfolding decseq_def
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   579
          proof (safe intro!: vimageI[OF refl])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   580
            fix m n :: nat assume "m \<le> n"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   581
            fix x assume x: "x \<in> space (Pi\<^isub>M J' M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   582
            assume "?a / 2^(k+1) \<le> ?q n x"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   583
            also have "?q n x \<le> ?q m x"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   584
            proof (rule \<mu>G_mono)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   585
              from fold(4)[OF J', OF Z_sets x]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   586
              show "?M J' (Z n) x \<in> sets ?G" "?M J' (Z m) x \<in> sets ?G" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   587
              show "?M J' (Z n) x \<subseteq> ?M J' (Z m) x"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   588
                using `decseq Z`[THEN decseqD, OF `m \<le> n`] by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   589
            qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   590
            finally show "?a / 2^(k+1) \<le> ?q m x" .
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   591
          qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   592
        qed (intro J'.finite_measure Q_sets)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   593
        finally have "(\<Inter>n. ?Q n) \<noteq> {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   594
          using `0 < ?a` `?a \<le> 1` by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   595
        then have "\<exists>w\<in>space (Pi\<^isub>M J' M). \<forall>n. ?a / 2 ^ (k + 1) \<le> ?q n w" by auto }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   596
      note Ex_w = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   597
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   598
      let "?q k n y" = "\<mu>G (?M (J k) (A n) y)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   599
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   600
      have "\<forall>n. ?a / 2 ^ 0 \<le> \<mu>G (A n)" by (auto intro: INF_leI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   601
      from Ex_w[OF A(1,2) this J(1-3), of 0] guess w0 .. note w0 = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   602
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   603
      let "?P k wk w" =
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   604
        "w \<in> space (Pi\<^isub>M (J (Suc k)) M) \<and> restrict w (J k) = wk \<and> (\<forall>n. ?a / 2 ^ (Suc k + 1) \<le> ?q (Suc k) n w)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   605
      def w \<equiv> "nat_rec w0 (\<lambda>k wk. Eps (?P k wk))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   606
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   607
      { fix k have w: "w k \<in> space (Pi\<^isub>M (J k) M) \<and>
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   608
          (\<forall>n. ?a / 2 ^ (k + 1) \<le> ?q k n (w k)) \<and> (k \<noteq> 0 \<longrightarrow> restrict (w k) (J (k - 1)) = w (k - 1))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   609
        proof (induct k)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   610
          case 0 with w0 show ?case
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   611
            unfolding w_def nat_rec_0 by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   612
        next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   613
          case (Suc k)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   614
          then have wk: "w k \<in> space (Pi\<^isub>M (J k) M)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   615
          have "\<exists>w'. ?P k (w k) w'"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   616
          proof cases
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   617
            assume [simp]: "J k = J (Suc k)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   618
            show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   619
            proof (intro exI[of _ "w k"] conjI allI)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   620
              fix n
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   621
              have "?a / 2 ^ (Suc k + 1) \<le> ?a / 2 ^ (k + 1)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   622
                using `0 < ?a` `?a \<le> 1` by (cases ?a) (auto simp: field_simps)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   623
              also have "\<dots> \<le> ?q k n (w k)" using Suc by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   624
              finally show "?a / 2 ^ (Suc k + 1) \<le> ?q (Suc k) n (w k)" by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   625
            next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   626
              show "w k \<in> space (Pi\<^isub>M (J (Suc k)) M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   627
                using Suc by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   628
              then show "restrict (w k) (J k) = w k"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   629
                by (simp add: extensional_restrict)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   630
            qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   631
          next
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   632
            assume "J k \<noteq> J (Suc k)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   633
            with J_mono[of k "Suc k"] have "J (Suc k) - J k \<noteq> {}" (is "?D \<noteq> {}") by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   634
            have "range (\<lambda>n. ?M (J k) (A n) (w k)) \<subseteq> sets ?G"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   635
              "decseq (\<lambda>n. ?M (J k) (A n) (w k))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   636
              "\<forall>n. ?a / 2 ^ (k + 1) \<le> \<mu>G (?M (J k) (A n) (w k))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   637
              using `decseq A` fold(4)[OF J(1-3) A_eq(2), of "w k" k] Suc
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   638
              by (auto simp: decseq_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   639
            from Ex_w[OF this `?D \<noteq> {}`] J[of "Suc k"]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   640
            obtain w' where w': "w' \<in> space (Pi\<^isub>M ?D M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   641
              "\<forall>n. ?a / 2 ^ (Suc k + 1) \<le> \<mu>G (?M ?D (?M (J k) (A n) (w k)) w')" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   642
            let ?w = "merge (J k) (w k) ?D w'"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   643
            have [simp]: "\<And>x. merge (J k) (w k) (I - J k) (merge ?D w' (I - ?D) x) =
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   644
              merge (J (Suc k)) ?w (I - (J (Suc k))) x"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   645
              using J(3)[of "Suc k"] J(3)[of k] J_mono[of k "Suc k"]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   646
              by (auto intro!: ext split: split_merge)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   647
            have *: "\<And>n. ?M ?D (?M (J k) (A n) (w k)) w' = ?M (J (Suc k)) (A n) ?w"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   648
              using w'(1) J(3)[of "Suc k"]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   649
              by (auto split: split_merge intro!: extensional_merge_sub) force+
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   650
            show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   651
              apply (rule exI[of _ ?w])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   652
              using w' J_mono[of k "Suc k"] wk unfolding *
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   653
              apply (auto split: split_merge intro!: extensional_merge_sub ext)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   654
              apply (force simp: extensional_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   655
              done
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   656
          qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   657
          then have "?P k (w k) (w (Suc k))"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   658
            unfolding w_def nat_rec_Suc unfolding w_def[symmetric]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   659
            by (rule someI_ex)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   660
          then show ?case by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   661
        qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   662
        moreover
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   663
        then have "w k \<in> space (Pi\<^isub>M (J k) M)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   664
        moreover
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   665
        from w have "?a / 2 ^ (k + 1) \<le> ?q k k (w k)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   666
        then have "?M (J k) (A k) (w k) \<noteq> {}"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   667
          using positive_\<mu>G[unfolded positive_def] `0 < ?a` `?a \<le> 1`
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   668
          by (cases ?a) (auto simp: divide_le_0_iff power_le_zero_eq)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   669
        then obtain x where "x \<in> ?M (J k) (A k) (w k)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   670
        then have "merge (J k) (w k) (I - J k) x \<in> A k" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   671
        then have "\<exists>x\<in>A k. restrict x (J k) = w k"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   672
          using `w k \<in> space (Pi\<^isub>M (J k) M)`
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   673
          by (intro rev_bexI) (auto intro!: ext simp: extensional_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   674
        ultimately have "w k \<in> space (Pi\<^isub>M (J k) M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   675
          "\<exists>x\<in>A k. restrict x (J k) = w k"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   676
          "k \<noteq> 0 \<Longrightarrow> restrict (w k) (J (k - 1)) = w (k - 1)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   677
          by auto }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   678
      note w = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   679
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   680
      { fix k l i assume "k \<le> l" "i \<in> J k"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   681
        { fix l have "w k i = w (k + l) i"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   682
          proof (induct l)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   683
            case (Suc l)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   684
            from `i \<in> J k` J_mono[of k "k + l"] have "i \<in> J (k + l)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   685
            with w(3)[of "k + Suc l"]
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   686
            have "w (k + l) i = w (k + Suc l) i"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   687
              by (auto simp: restrict_def fun_eq_iff split: split_if_asm)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   688
            with Suc show ?case by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   689
          qed simp }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   690
        from this[of "l - k"] `k \<le> l` have "w l i = w k i" by simp }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   691
      note w_mono = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   692
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   693
      def w' \<equiv> "\<lambda>i. if i \<in> (\<Union>k. J k) then w (LEAST k. i \<in> J k) i else if i \<in> I then (SOME x. x \<in> space (M i)) else undefined"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   694
      { fix i k assume k: "i \<in> J k"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   695
        have "w k i = w (LEAST k. i \<in> J k) i"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   696
          by (intro w_mono Least_le k LeastI[of _ k])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   697
        then have "w' i = w k i"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   698
          unfolding w'_def using k by auto }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   699
      note w'_eq = this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   700
      have w'_simps1: "\<And>i. i \<notin> I \<Longrightarrow> w' i = undefined"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   701
        using J by (auto simp: w'_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   702
      have w'_simps2: "\<And>i. i \<notin> (\<Union>k. J k) \<Longrightarrow> i \<in> I \<Longrightarrow> w' i \<in> space (M i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   703
        using J by (auto simp: w'_def intro!: someI_ex[OF M.not_empty[unfolded ex_in_conv[symmetric]]])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   704
      { fix i assume "i \<in> I" then have "w' i \<in> space (M i)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   705
          using w(1) by (cases "i \<in> (\<Union>k. J k)") (force simp: w'_simps2 w'_eq)+ }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   706
      note w'_simps[simp] = w'_eq w'_simps1 w'_simps2 this
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   707
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   708
      have w': "w' \<in> space (Pi\<^isub>M I M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   709
        using w(1) by (auto simp add: Pi_iff extensional_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   710
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   711
      { fix n
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   712
        have "restrict w' (J n) = w n" using w(1)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   713
          by (auto simp add: fun_eq_iff restrict_def Pi_iff extensional_def)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   714
        with w[of n] obtain x where "x \<in> A n" "restrict x (J n) = restrict w' (J n)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   715
        then have "w' \<in> A n" unfolding A_eq using w' by (auto simp: emb_def) }
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   716
      then have "w' \<in> (\<Inter>i. A i)" by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   717
      with `(\<Inter>i. A i) = {}` show False by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   718
    qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   719
    ultimately show "(\<lambda>i. \<mu>G (A i)) ----> 0"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   720
      using LIMSEQ_extreal_INFI[of "\<lambda>i. \<mu>G (A i)"] by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   721
  qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   722
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   723
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   724
lemma (in product_prob_space) infprod_spec:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   725
  shows "(\<forall>s\<in>sets generator. measure (Pi\<^isub>P I M) s = \<mu>G s) \<and> measure_space (Pi\<^isub>P I M)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   726
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   727
  let ?P = "\<lambda>\<mu>. (\<forall>A\<in>sets generator. \<mu> A = \<mu>G A) \<and>
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   728
       measure_space \<lparr>space = space generator, sets = sets (sigma generator), measure = \<mu>\<rparr>"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   729
  have **: "measure infprod_algebra = (SOME \<mu>. ?P \<mu>)"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   730
    unfolding infprod_algebra_def by simp
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   731
  have *: "Pi\<^isub>P I M = \<lparr>space = space generator, sets = sets (sigma generator), measure = measure (Pi\<^isub>P I M)\<rparr>"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   732
    unfolding infprod_algebra_def by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   733
  show ?thesis
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   734
    apply (subst (2) *)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   735
    apply (unfold **)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   736
    apply (rule someI_ex[where P="?P"])
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   737
    apply (rule extend_\<mu>G)
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   738
    done
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   739
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   740
42257
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   741
sublocale product_prob_space \<subseteq> P: measure_space "Pi\<^isub>P I M"
42147
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   742
  using infprod_spec by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   743
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   744
lemma (in product_prob_space) measure_infprod_emb:
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   745
  assumes "J \<noteq> {}" "finite J" "J \<subseteq> I" "X \<in> sets (Pi\<^isub>M J M)"
42257
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   746
  shows "\<mu> (emb I J X) = measure (Pi\<^isub>M J M) X"
42147
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   747
proof -
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   748
  have "emb I J X \<in> sets generator"
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   749
    using assms by (rule generatorI')
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   750
  with \<mu>G_eq[OF assms] infprod_spec show ?thesis by auto
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   751
qed
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   752
42257
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   753
sublocale product_prob_space \<subseteq> P: prob_space "Pi\<^isub>P I M"
42166
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   754
proof
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   755
  obtain i where "i \<in> I" using I_not_empty by auto
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   756
  interpret i: finite_product_sigma_finite M "{i}" by default auto
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   757
  let ?X = "\<Pi>\<^isub>E i\<in>{i}. space (M i)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   758
  have "?X \<in> sets (Pi\<^isub>M {i} M)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   759
    by auto
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   760
  from measure_infprod_emb[OF _ _ _ this] `i \<in> I`
42257
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   761
  have "\<mu> (emb I {i} ?X) = measure (M i) (space (M i))"
42166
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   762
    by (simp add: i.measure_times)
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   763
  also have "emb I {i} ?X = space (Pi\<^isub>P I M)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   764
    using `i \<in> I` by (auto simp: emb_def infprod_algebra_def generator_def)
42257
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   765
  finally show "\<mu> (space (Pi\<^isub>P I M)) = 1"
42166
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   766
    using M.measure_space_1 by simp
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   767
qed
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   768
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   769
lemma (in product_prob_space) measurable_component:
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   770
  assumes "i \<in> I"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   771
  shows "(\<lambda>x. x i) \<in> measurable (Pi\<^isub>P I M) (M i)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   772
proof (unfold measurable_def, safe)
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   773
  fix x assume "x \<in> space (Pi\<^isub>P I M)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   774
  then show "x i \<in> space (M i)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   775
    using `i \<in> I` by (auto simp: infprod_algebra_def generator_def)
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   776
next
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   777
  fix A assume "A \<in> sets (M i)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   778
  with `i \<in> I` have
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   779
    "(\<Pi>\<^isub>E x \<in> {i}. A) \<in> sets (Pi\<^isub>M {i} M)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   780
    "(\<lambda>x. x i) -` A \<inter> space (Pi\<^isub>P I M) = emb I {i} (\<Pi>\<^isub>E x \<in> {i}. A)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   781
    by (auto simp: infprod_algebra_def generator_def emb_def)
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   782
  from generatorI[OF _ _ _ this] `i \<in> I`
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   783
  show "(\<lambda>x. x i) -` A \<inter> space (Pi\<^isub>P I M) \<in> sets (Pi\<^isub>P I M)"
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   784
    unfolding infprod_algebra_def by auto
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   785
qed
efd229daeb2c products of probability measures are probability measures
hoelzl
parents: 42148
diff changeset
   786
42257
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   787
lemma (in product_prob_space) emb_in_infprod_algebra[intro]:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   788
  fixes J assumes J: "finite J" "J \<subseteq> I" and X: "X \<in> sets (Pi\<^isub>M J M)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   789
  shows "emb I J X \<in> sets (\<Pi>\<^isub>P i\<in>I. M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   790
proof cases
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   791
  assume "J = {}"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   792
  with X have "emb I J X = space (\<Pi>\<^isub>P i\<in>I. M i) \<or> emb I J X = {}"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   793
    by (auto simp: emb_def infprod_algebra_def generator_def
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   794
                   product_algebra_def product_algebra_generator_def image_constant sigma_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   795
  then show ?thesis by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   796
next
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   797
  assume "J \<noteq> {}"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   798
  show ?thesis unfolding infprod_algebra_def
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   799
    by simp (intro in_sigma generatorI'  `J \<noteq> {}` J X)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   800
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   801
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   802
lemma (in product_prob_space) finite_measure_infprod_emb:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   803
  assumes "J \<noteq> {}" "finite J" "J \<subseteq> I" "X \<in> sets (Pi\<^isub>M J M)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   804
  shows "\<mu>' (emb I J X) = finite_measure.\<mu>' (Pi\<^isub>M J M) X"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   805
proof -
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   806
  interpret J: finite_product_prob_space M J by default fact+
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   807
  from assms have "emb I J X \<in> sets (Pi\<^isub>P I M)" by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   808
  with assms show "\<mu>' (emb I J X) = J.\<mu>' X"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   809
    unfolding \<mu>'_def J.\<mu>'_def
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   810
    unfolding measure_infprod_emb[OF assms]
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   811
    by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   812
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   813
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   814
lemma (in finite_product_prob_space) finite_measure_times:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   815
  assumes "\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   816
  shows "\<mu>' (Pi\<^isub>E I A) = (\<Prod>i\<in>I. M.\<mu>' i (A i))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   817
  using assms
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   818
  unfolding \<mu>'_def M.\<mu>'_def
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   819
  by (subst measure_times[OF assms])
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   820
     (auto simp: finite_measure_eq M.finite_measure_eq setprod_extreal)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   821
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   822
lemma (in product_prob_space) finite_measure_infprod_emb_Pi:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   823
  assumes J: "finite J" "J \<subseteq> I" "\<And>j. j \<in> J \<Longrightarrow> X j \<in> sets (M j)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   824
  shows "\<mu>' (emb I J (Pi\<^isub>E J X)) = (\<Prod>j\<in>J. M.\<mu>' j (X j))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   825
proof cases
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   826
  assume "J = {}"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   827
  then have "emb I J (Pi\<^isub>E J X) = space infprod_algebra"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   828
    by (auto simp: infprod_algebra_def generator_def sigma_def emb_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   829
  then show ?thesis using `J = {}` prob_space by simp
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   830
next
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   831
  assume "J \<noteq> {}"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   832
  interpret J: finite_product_prob_space M J by default fact+
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   833
  have "(\<Prod>i\<in>J. M.\<mu>' i (X i)) = J.\<mu>' (Pi\<^isub>E J X)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   834
    using J `J \<noteq> {}` by (subst J.finite_measure_times) auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   835
  also have "\<dots> = \<mu>' (emb I J (Pi\<^isub>E J X))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   836
    using J `J \<noteq> {}` by (intro finite_measure_infprod_emb[symmetric]) auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   837
  finally show ?thesis by simp
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   838
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   839
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   840
lemma sigma_sets_mono: assumes "A \<subseteq> sigma_sets X B" shows "sigma_sets X A \<subseteq> sigma_sets X B"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   841
proof
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   842
  fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   843
    by induct (insert `A \<subseteq> sigma_sets X B`, auto intro: sigma_sets.intros)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   844
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   845
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   846
lemma sigma_sets_mono': assumes "A \<subseteq> B" shows "sigma_sets X A \<subseteq> sigma_sets X B"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   847
proof
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   848
  fix x assume "x \<in> sigma_sets X A" then show "x \<in> sigma_sets X B"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   849
    by induct (insert `A \<subseteq> B`, auto intro: sigma_sets.intros)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   850
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   851
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   852
lemma sigma_sets_subseteq: "A \<subseteq> sigma_sets X A"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   853
  by (auto intro: sigma_sets.Basic)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   854
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   855
lemma (in product_prob_space) infprod_algebra_alt:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   856
  "Pi\<^isub>P I M = sigma \<lparr> space = space (Pi\<^isub>P I M),
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   857
    sets = (\<Union>J\<in>{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emb I J ` Pi\<^isub>E J ` (\<Pi> i \<in> J. sets (M i))),
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   858
    measure = measure (Pi\<^isub>P I M) \<rparr>"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   859
  (is "_ = sigma \<lparr> space = ?O, sets = ?M, measure = ?m \<rparr>")
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   860
proof (rule measure_space.equality)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   861
  let ?G = "\<Union>J\<in>{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emb I J ` sets (Pi\<^isub>M J M)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   862
  have "sigma_sets ?O ?M = sigma_sets ?O ?G"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   863
  proof (intro equalityI sigma_sets_mono UN_least)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   864
    fix J assume J: "J \<in> {J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   865
    have "emb I J ` Pi\<^isub>E J ` (\<Pi> i\<in>J. sets (M i)) \<subseteq> emb I J ` sets (Pi\<^isub>M J M)" by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   866
    also have "\<dots> \<subseteq> ?G" using J by (rule UN_upper)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   867
    also have "\<dots> \<subseteq> sigma_sets ?O ?G" by (rule sigma_sets_subseteq)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   868
    finally show "emb I J ` Pi\<^isub>E J ` (\<Pi> i\<in>J. sets (M i)) \<subseteq> sigma_sets ?O ?G" .
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   869
    have "emb I J ` sets (Pi\<^isub>M J M) = emb I J ` sigma_sets (space (Pi\<^isub>M J M)) (Pi\<^isub>E J ` (\<Pi> i \<in> J. sets (M i)))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   870
      by (simp add: sets_sigma product_algebra_generator_def product_algebra_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   871
    also have "\<dots> = sigma_sets (space (Pi\<^isub>M I M)) (emb I J ` Pi\<^isub>E J ` (\<Pi> i \<in> J. sets (M i)))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   872
      using J M.sets_into_space
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   873
      by (auto simp: emb_def_raw intro!: sigma_sets_vimage[symmetric]) blast
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   874
    also have "\<dots> \<subseteq> sigma_sets (space (Pi\<^isub>M I M)) ?M"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   875
      using J by (intro sigma_sets_mono') auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   876
    finally show "emb I J ` sets (Pi\<^isub>M J M) \<subseteq> sigma_sets ?O ?M"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   877
      by (simp add: infprod_algebra_def generator_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   878
  qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   879
  then show "sets (Pi\<^isub>P I M) = sets (sigma \<lparr> space = ?O, sets = ?M, measure = ?m \<rparr>)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   880
    by (simp_all add: infprod_algebra_def generator_def sets_sigma)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   881
qed simp_all
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   882
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   883
lemma (in product_prob_space) infprod_algebra_alt2:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   884
  "Pi\<^isub>P I M = sigma \<lparr> space = space (Pi\<^isub>P I M),
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   885
    sets = (\<Union>i\<in>I. (\<lambda>A. (\<lambda>x. x i) -` A \<inter> space (Pi\<^isub>P I M)) ` sets (M i)),
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   886
    measure = measure (Pi\<^isub>P I M) \<rparr>"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   887
  (is "_ = ?S")
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   888
proof (rule measure_space.equality)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   889
  let "sigma \<lparr> space = ?O, sets = ?A, \<dots> = _ \<rparr>" = ?S
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   890
  let ?G = "(\<Union>J\<in>{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emb I J ` Pi\<^isub>E J ` (\<Pi> i \<in> J. sets (M i)))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   891
  have "sets (Pi\<^isub>P I M) = sigma_sets ?O ?G"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   892
    by (subst infprod_algebra_alt) (simp add: sets_sigma)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   893
  also have "\<dots> = sigma_sets ?O ?A"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   894
  proof (intro equalityI sigma_sets_mono subsetI)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   895
    interpret A: sigma_algebra ?S
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   896
      by (rule sigma_algebra_sigma) auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   897
    fix A assume "A \<in> ?G"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   898
    then obtain J B where "finite J" "J \<noteq> {}" "J \<subseteq> I" "A = emb I J (Pi\<^isub>E J B)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   899
        and B: "\<And>i. i \<in> J \<Longrightarrow> B i \<in> sets (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   900
      by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   901
    then have A: "A = (\<Inter>j\<in>J. (\<lambda>x. x j) -` (B j) \<inter> space (Pi\<^isub>P I M))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   902
      by (auto simp: emb_def infprod_algebra_def generator_def Pi_iff)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   903
    { fix j assume "j\<in>J"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   904
      with `J \<subseteq> I` have "j \<in> I" by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   905
      with `j \<in> J` B have "(\<lambda>x. x j) -` (B j) \<inter> space (Pi\<^isub>P I M) \<in> sets ?S"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   906
        by (auto simp: sets_sigma intro: sigma_sets.Basic) }
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   907
    with `finite J` `J \<noteq> {}` have "A \<in> sets ?S"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   908
      unfolding A by (intro A.finite_INT) auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   909
    then show "A \<in> sigma_sets ?O ?A" by (simp add: sets_sigma)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   910
  next
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   911
    fix A assume "A \<in> ?A"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   912
    then obtain i B where i: "i \<in> I" "B \<in> sets (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   913
        and "A = (\<lambda>x. x i) -` B \<inter> space (Pi\<^isub>P I M)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   914
      by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   915
    then have "A = emb I {i} (Pi\<^isub>E {i} (\<lambda>_. B))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   916
      by (auto simp: emb_def infprod_algebra_def generator_def Pi_iff)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   917
    with i show "A \<in> sigma_sets ?O ?G"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   918
      by (intro sigma_sets.Basic UN_I[where a="{i}"]) auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   919
  qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   920
  finally show "sets (Pi\<^isub>P I M) = sets ?S"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   921
    by (simp add: sets_sigma)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   922
qed simp_all
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   923
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   924
lemma (in product_prob_space) measurable_into_infprod_algebra:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   925
  assumes "sigma_algebra N"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   926
  assumes f: "\<And>i. i \<in> I \<Longrightarrow> (\<lambda>x. f x i) \<in> measurable N (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   927
  assumes ext: "\<And>x. x \<in> space N \<Longrightarrow> f x \<in> extensional I"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   928
  shows "f \<in> measurable N (Pi\<^isub>P I M)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   929
proof -
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   930
  interpret N: sigma_algebra N by fact
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   931
  have f_in: "\<And>i. i \<in> I \<Longrightarrow> (\<lambda>x. f x i) \<in> space N \<rightarrow> space (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   932
    using f by (auto simp: measurable_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   933
  { fix i A assume i: "i \<in> I" "A \<in> sets (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   934
    then have "f -` (\<lambda>x. x i) -` A \<inter> f -` space infprod_algebra \<inter> space N = (\<lambda>x. f x i) -` A \<inter> space N"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   935
      using f_in ext by (auto simp: infprod_algebra_def generator_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   936
    also have "\<dots> \<in> sets N"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   937
      by (rule measurable_sets f i)+
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   938
    finally have "f -` (\<lambda>x. x i) -` A \<inter> f -` space infprod_algebra \<inter> space N \<in> sets N" . }
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   939
  with f_in ext show ?thesis
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   940
    by (subst infprod_algebra_alt2)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   941
       (auto intro!: N.measurable_sigma simp: Pi_iff infprod_algebra_def generator_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   942
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   943
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   944
subsection {* Sequence space *}
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   945
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   946
locale sequence_space = product_prob_space M "UNIV :: nat set" for M
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   947
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   948
lemma (in sequence_space) infprod_in_sets[intro]:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   949
  fixes E :: "nat \<Rightarrow> 'a set" assumes E: "\<And>i. E i \<in> sets (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   950
  shows "Pi UNIV E \<in> sets (Pi\<^isub>P UNIV M)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   951
proof -
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   952
  have "Pi UNIV E = (\<Inter>i. emb UNIV {..i} (\<Pi>\<^isub>E j\<in>{..i}. E j))"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   953
    using E E[THEN M.sets_into_space]
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   954
    by (auto simp: emb_def Pi_iff extensional_def) blast
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   955
  with E show ?thesis
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   956
    by (auto intro: emb_in_infprod_algebra)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   957
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   958
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   959
lemma (in sequence_space) measure_infprod:
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   960
  fixes E :: "nat \<Rightarrow> 'a set" assumes E: "\<And>i. E i \<in> sets (M i)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   961
  shows "(\<lambda>n. \<Prod>i\<le>n. M.\<mu>' i (E i)) ----> \<mu>' (Pi UNIV E)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   962
proof -
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   963
  let "?E n" = "emb UNIV {..n} (Pi\<^isub>E {.. n} E)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   964
  { fix n :: nat
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   965
    interpret n: finite_product_prob_space M "{..n}" by default auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   966
    have "(\<Prod>i\<le>n. M.\<mu>' i (E i)) = n.\<mu>' (Pi\<^isub>E {.. n} E)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   967
      using E by (subst n.finite_measure_times) auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   968
    also have "\<dots> = \<mu>' (?E n)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   969
      using E by (intro finite_measure_infprod_emb[symmetric]) auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   970
    finally have "(\<Prod>i\<le>n. M.\<mu>' i (E i)) = \<mu>' (?E n)" . }
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   971
  moreover have "Pi UNIV E = (\<Inter>n. ?E n)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   972
    using E E[THEN M.sets_into_space]
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   973
    by (auto simp: emb_def extensional_def Pi_iff) blast
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   974
  moreover have "range ?E \<subseteq> sets (Pi\<^isub>P UNIV M)"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   975
    using E by auto
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   976
  moreover have "decseq ?E"
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   977
    by (auto simp: emb_def Pi_iff decseq_def)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   978
  ultimately show ?thesis
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   979
    by (simp add: finite_continuity_from_above)
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   980
qed
08d717c82828 prove measurable_into_infprod_algebra and measure_infprod
hoelzl
parents: 42166
diff changeset
   981
42147
61d5d50ca74c add infinite product measure
hoelzl
parents:
diff changeset
   982
end