src/HOL/Probability/Infinite_Product_Measure.thy
changeset 50042 6fe18351e9dd
parent 50041 afe886a04198
child 50087 635d73673b5e
     1.1 --- a/src/HOL/Probability/Infinite_Product_Measure.thy	Fri Nov 09 14:14:45 2012 +0100
     1.2 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy	Fri Nov 09 14:31:26 2012 +0100
     1.3 @@ -8,33 +8,6 @@
     1.4    imports Probability_Measure Caratheodory Projective_Family
     1.5  begin
     1.6  
     1.7 -lemma split_merge: "P (merge I J (x,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)"
     1.8 -  unfolding merge_def by auto
     1.9 -
    1.10 -lemma extensional_merge_sub: "I \<union> J \<subseteq> K \<Longrightarrow> merge I J (x, y) \<in> extensional K"
    1.11 -  unfolding merge_def extensional_def by auto
    1.12 -
    1.13 -lemma injective_vimage_restrict:
    1.14 -  assumes J: "J \<subseteq> I"
    1.15 -  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> {}"
    1.16 -  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)"
    1.17 -  shows "A = B"
    1.18 -proof  (intro set_eqI)
    1.19 -  fix x
    1.20 -  from ne obtain y where y: "\<And>i. i \<in> I \<Longrightarrow> y i \<in> S i" by auto
    1.21 -  have "J \<inter> (I - J) = {}" by auto
    1.22 -  show "x \<in> A \<longleftrightarrow> x \<in> B"
    1.23 -  proof cases
    1.24 -    assume x: "x \<in> (\<Pi>\<^isub>E i\<in>J. S i)"
    1.25 -    have "x \<in> A \<longleftrightarrow> merge J (I - J) (x,y) \<in> (\<lambda>x. restrict x J) -` A \<inter> (\<Pi>\<^isub>E i\<in>I. S i)"
    1.26 -      using y x `J \<subseteq> I` by (auto simp add: Pi_iff extensional_restrict extensional_merge_sub split: split_merge)
    1.27 -    then show "x \<in> A \<longleftrightarrow> x \<in> B"
    1.28 -      using y x `J \<subseteq> I` by (auto simp add: Pi_iff extensional_restrict extensional_merge_sub eq split: split_merge)
    1.29 -  next
    1.30 -    assume "x \<notin> (\<Pi>\<^isub>E i\<in>J. S i)" with sets show "x \<in> A \<longleftrightarrow> x \<in> B" by auto
    1.31 -  qed
    1.32 -qed
    1.33 -
    1.34  lemma (in product_prob_space) distr_restrict:
    1.35    assumes "J \<noteq> {}" "J \<subseteq> K" "finite K"
    1.36    shows "(\<Pi>\<^isub>M i\<in>J. M i) = distr (\<Pi>\<^isub>M i\<in>K. M i) (\<Pi>\<^isub>M i\<in>J. M i) (\<lambda>f. restrict f J)" (is "?P = ?D")
    1.37 @@ -94,195 +67,6 @@
    1.38    show "emeasure (Pi\<^isub>M J M) (space (Pi\<^isub>M J M)) = 1" by (rule f.emeasure_space_1)
    1.39  qed simp_all
    1.40  
    1.41 -lemma (in projective_family) prod_emb_injective:
    1.42 -  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)"
    1.43 -  assumes "prod_emb L M J X = prod_emb L M J Y"
    1.44 -  shows "X = Y"
    1.45 -proof (rule injective_vimage_restrict)
    1.46 -  show "X \<subseteq> (\<Pi>\<^isub>E i\<in>J. space (M i))" "Y \<subseteq> (\<Pi>\<^isub>E i\<in>J. space (M i))"
    1.47 -    using sets[THEN sets_into_space] by (auto simp: space_PiM)
    1.48 -  have "\<forall>i\<in>L. \<exists>x. x \<in> space (M i)"
    1.49 -  proof
    1.50 -    fix i assume "i \<in> L"
    1.51 -    interpret prob_space "P {i}" using prob_space by simp
    1.52 -    from not_empty show "\<exists>x. x \<in> space (M i)" by (auto simp add: proj_space space_PiM)
    1.53 -  qed
    1.54 -  from bchoice[OF this]
    1.55 -  show "(\<Pi>\<^isub>E i\<in>L. space (M i)) \<noteq> {}" by auto
    1.56 -  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))"
    1.57 -    using `prod_emb L M J X = prod_emb L M J Y` by (simp add: prod_emb_def)
    1.58 -qed fact
    1.59 -
    1.60 -abbreviation (in projective_family)
    1.61 -  "emb L K X \<equiv> prod_emb L M K X"
    1.62 -
    1.63 -definition (in projective_family) generator :: "('i \<Rightarrow> 'a) set set" where
    1.64 -  "generator = (\<Union>J\<in>{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emb I J ` sets (Pi\<^isub>M J M))"
    1.65 -
    1.66 -lemma (in projective_family) generatorI':
    1.67 -  "J \<noteq> {} \<Longrightarrow> finite J \<Longrightarrow> J \<subseteq> I \<Longrightarrow> X \<in> sets (Pi\<^isub>M J M) \<Longrightarrow> emb I J X \<in> generator"
    1.68 -  unfolding generator_def by auto
    1.69 -
    1.70 -lemma (in projective_family) algebra_generator:
    1.71 -  assumes "I \<noteq> {}" shows "algebra (\<Pi>\<^isub>E i\<in>I. space (M i)) generator" (is "algebra ?\<Omega> ?G")
    1.72 -  unfolding algebra_def algebra_axioms_def ring_of_sets_iff
    1.73 -proof (intro conjI ballI)
    1.74 -  let ?G = generator
    1.75 -  show "?G \<subseteq> Pow ?\<Omega>"
    1.76 -    by (auto simp: generator_def prod_emb_def)
    1.77 -  from `I \<noteq> {}` obtain i where "i \<in> I" by auto
    1.78 -  then show "{} \<in> ?G"
    1.79 -    by (auto intro!: exI[of _ "{i}"] image_eqI[where x="\<lambda>i. {}"]
    1.80 -             simp: sigma_sets.Empty generator_def prod_emb_def)
    1.81 -  from `i \<in> I` show "?\<Omega> \<in> ?G"
    1.82 -    by (auto intro!: exI[of _ "{i}"] image_eqI[where x="Pi\<^isub>E {i} (\<lambda>i. space (M i))"]
    1.83 -             simp: generator_def prod_emb_def)
    1.84 -  fix A assume "A \<in> ?G"
    1.85 -  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"
    1.86 -    by (auto simp: generator_def)
    1.87 -  fix B assume "B \<in> ?G"
    1.88 -  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"
    1.89 -    by (auto simp: generator_def)
    1.90 -  let ?RA = "emb (JA \<union> JB) JA XA"
    1.91 -  let ?RB = "emb (JA \<union> JB) JB XB"
    1.92 -  have *: "A - B = emb I (JA \<union> JB) (?RA - ?RB)" "A \<union> B = emb I (JA \<union> JB) (?RA \<union> ?RB)"
    1.93 -    using XA A XB B by auto
    1.94 -  show "A - B \<in> ?G" "A \<union> B \<in> ?G"
    1.95 -    unfolding * using XA XB by (safe intro!: generatorI') auto
    1.96 -qed
    1.97 -
    1.98 -lemma (in projective_family) sets_PiM_generator:
    1.99 -  "sets (PiM I M) = sigma_sets (\<Pi>\<^isub>E i\<in>I. space (M i)) generator"
   1.100 -proof cases
   1.101 -  assume "I = {}" then show ?thesis
   1.102 -    unfolding generator_def
   1.103 -    by (auto simp: sets_PiM_empty sigma_sets_empty_eq cong: conj_cong)
   1.104 -next
   1.105 -  assume "I \<noteq> {}"
   1.106 -  show ?thesis
   1.107 -  proof
   1.108 -    show "sets (Pi\<^isub>M I M) \<subseteq> sigma_sets (\<Pi>\<^isub>E i\<in>I. space (M i)) generator"
   1.109 -      unfolding sets_PiM
   1.110 -    proof (safe intro!: sigma_sets_subseteq)
   1.111 -      fix A assume "A \<in> prod_algebra I M" with `I \<noteq> {}` show "A \<in> generator"
   1.112 -        by (auto intro!: generatorI' sets_PiM_I_finite elim!: prod_algebraE)
   1.113 -    qed
   1.114 -  qed (auto simp: generator_def space_PiM[symmetric] intro!: sigma_sets_subset)
   1.115 -qed
   1.116 -
   1.117 -lemma (in projective_family) generatorI:
   1.118 -  "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> generator"
   1.119 -  unfolding generator_def by auto
   1.120 -
   1.121 -definition (in projective_family)
   1.122 -  "\<mu>G A =
   1.123 -    (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 = emeasure (PiP J M P) X))"
   1.124 -
   1.125 -lemma (in projective_family) \<mu>G_spec:
   1.126 -  assumes J: "J \<noteq> {}" "finite J" "J \<subseteq> I" "A = emb I J X" "X \<in> sets (Pi\<^isub>M J M)"
   1.127 -  shows "\<mu>G A = emeasure (PiP J M P) X"
   1.128 -  unfolding \<mu>G_def
   1.129 -proof (intro the_equality allI impI ballI)
   1.130 -  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)"
   1.131 -  have "emeasure (PiP K M P) Y = emeasure (PiP (K \<union> J) M P) (emb (K \<union> J) K Y)"
   1.132 -    using K J by simp
   1.133 -  also have "emb (K \<union> J) K Y = emb (K \<union> J) J X"
   1.134 -    using K J by (simp add: prod_emb_injective[of "K \<union> J" I])
   1.135 -  also have "emeasure (PiP (K \<union> J) M P) (emb (K \<union> J) J X) = emeasure (PiP J M P) X"
   1.136 -    using K J by simp
   1.137 -  finally show "emeasure (PiP J M P) X = emeasure (PiP K M P) Y" ..
   1.138 -qed (insert J, force)
   1.139 -
   1.140 -lemma (in projective_family) \<mu>G_eq:
   1.141 -  "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) = emeasure (PiP J M P) X"
   1.142 -  by (intro \<mu>G_spec) auto
   1.143 -
   1.144 -lemma (in projective_family) generator_Ex:
   1.145 -  assumes *: "A \<in> generator"
   1.146 -  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 = emeasure (PiP J M P) X"
   1.147 -proof -
   1.148 -  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)"
   1.149 -    unfolding generator_def by auto
   1.150 -  with \<mu>G_spec[OF this] show ?thesis by auto
   1.151 -qed
   1.152 -
   1.153 -lemma (in projective_family) generatorE:
   1.154 -  assumes A: "A \<in> generator"
   1.155 -  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 = emeasure (PiP J M P) X"
   1.156 -proof -
   1.157 -  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"
   1.158 -    "\<mu>G A = emeasure (PiP J M P) X" by auto
   1.159 -  then show thesis by (intro that) auto
   1.160 -qed
   1.161 -
   1.162 -lemma (in projective_family) merge_sets:
   1.163 -  "J \<inter> K = {} \<Longrightarrow> A \<in> sets (Pi\<^isub>M (J \<union> K) M) \<Longrightarrow> x \<in> space (Pi\<^isub>M J M) \<Longrightarrow> (\<lambda>y. merge J K (x,y)) -` A \<inter> space (Pi\<^isub>M K M) \<in> sets (Pi\<^isub>M K M)"
   1.164 -  by simp
   1.165 -
   1.166 -lemma (in projective_family) merge_emb:
   1.167 -  assumes "K \<subseteq> I" "J \<subseteq> I" and y: "y \<in> space (Pi\<^isub>M J M)"
   1.168 -  shows "((\<lambda>x. merge J (I - J) (y, x)) -` emb I K X \<inter> space (Pi\<^isub>M I M)) =
   1.169 -    emb I (K - J) ((\<lambda>x. merge J (K - J) (y, x)) -` emb (J \<union> K) K X \<inter> space (Pi\<^isub>M (K - J) M))"
   1.170 -proof -
   1.171 -  have [simp]: "\<And>x J K L. merge J K (y, restrict x L) = merge J (K \<inter> L) (y, x)"
   1.172 -    by (auto simp: restrict_def merge_def)
   1.173 -  have [simp]: "\<And>x J K L. restrict (merge J K (y, x)) L = merge (J \<inter> L) (K \<inter> L) (y, x)"
   1.174 -    by (auto simp: restrict_def merge_def)
   1.175 -  have [simp]: "(I - J) \<inter> K = K - J" using `K \<subseteq> I` `J \<subseteq> I` by auto
   1.176 -  have [simp]: "(K - J) \<inter> (K \<union> J) = K - J" by auto
   1.177 -  have [simp]: "(K - J) \<inter> K = K - J" by auto
   1.178 -  from y `K \<subseteq> I` `J \<subseteq> I` show ?thesis
   1.179 -    by (simp split: split_merge add: prod_emb_def Pi_iff extensional_merge_sub set_eq_iff space_PiM)
   1.180 -       auto
   1.181 -qed
   1.182 -
   1.183 -lemma (in projective_family) positive_\<mu>G:
   1.184 -  assumes "I \<noteq> {}"
   1.185 -  shows "positive generator \<mu>G"
   1.186 -proof -
   1.187 -  interpret G!: algebra "\<Pi>\<^isub>E i\<in>I. space (M i)" generator by (rule algebra_generator) fact
   1.188 -  show ?thesis
   1.189 -  proof (intro positive_def[THEN iffD2] conjI ballI)
   1.190 -    from generatorE[OF G.empty_sets] guess J X . note this[simp]
   1.191 -    have "X = {}"
   1.192 -      by (rule prod_emb_injective[of J I]) simp_all
   1.193 -    then show "\<mu>G {} = 0" by simp
   1.194 -  next
   1.195 -    fix A assume "A \<in> generator"
   1.196 -    from generatorE[OF this] guess J X . note this[simp]
   1.197 -    show "0 \<le> \<mu>G A" by (simp add: emeasure_nonneg)
   1.198 -  qed
   1.199 -qed
   1.200 -
   1.201 -lemma (in projective_family) additive_\<mu>G:
   1.202 -  assumes "I \<noteq> {}"
   1.203 -  shows "additive generator \<mu>G"
   1.204 -proof -
   1.205 -  interpret G!: algebra "\<Pi>\<^isub>E i\<in>I. space (M i)" generator by (rule algebra_generator) fact
   1.206 -  show ?thesis
   1.207 -  proof (intro additive_def[THEN iffD2] ballI impI)
   1.208 -    fix A assume "A \<in> generator" with generatorE guess J X . note J = this
   1.209 -    fix B assume "B \<in> generator" with generatorE guess K Y . note K = this
   1.210 -    assume "A \<inter> B = {}"
   1.211 -    have JK: "J \<union> K \<noteq> {}" "J \<union> K \<subseteq> I" "finite (J \<union> K)"
   1.212 -      using J K by auto
   1.213 -    have JK_disj: "emb (J \<union> K) J X \<inter> emb (J \<union> K) K Y = {}"
   1.214 -      apply (rule prod_emb_injective[of "J \<union> K" I])
   1.215 -      apply (insert `A \<inter> B = {}` JK J K)
   1.216 -      apply (simp_all add: Int prod_emb_Int)
   1.217 -      done
   1.218 -    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)"
   1.219 -      using J K by simp_all
   1.220 -    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))"
   1.221 -      by simp
   1.222 -    also have "\<dots> = emeasure (PiP (J \<union> K) M P) (emb (J \<union> K) J X \<union> emb (J \<union> K) K Y)"
   1.223 -      using JK J(1, 4) K(1, 4) by (simp add: \<mu>G_eq Un del: prod_emb_Un)
   1.224 -    also have "\<dots> = \<mu>G A + \<mu>G B"
   1.225 -      using J K JK_disj by (simp add: plus_emeasure[symmetric])
   1.226 -    finally show "\<mu>G (A \<union> B) = \<mu>G A + \<mu>G B" .
   1.227 -  qed
   1.228 -qed
   1.229 -
   1.230  lemma (in product_prob_space) PiP_PiM_finite[simp]:
   1.231    assumes "J \<noteq> {}" "finite J" "J \<subseteq> I" shows "PiP J M (\<lambda>J. PiM J M) = PiM J M"
   1.232    using assms by (simp add: PiP_finite)