src/HOL/Probability/Projective_Family.thy
changeset 53015 a1119cf551e8
parent 50252 4aa34bd43228
child 57418 6ab1c7cb0b8d
     1.1 --- a/src/HOL/Probability/Projective_Family.thy	Tue Aug 13 14:20:22 2013 +0200
     1.2 +++ b/src/HOL/Probability/Projective_Family.thy	Tue Aug 13 16:25:47 2013 +0200
     1.3 @@ -11,27 +11,27 @@
     1.4  
     1.5  lemma (in product_prob_space) distr_restrict:
     1.6    assumes "J \<noteq> {}" "J \<subseteq> K" "finite K"
     1.7 -  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.8 +  shows "(\<Pi>\<^sub>M i\<in>J. M i) = distr (\<Pi>\<^sub>M i\<in>K. M i) (\<Pi>\<^sub>M i\<in>J. M i) (\<lambda>f. restrict f J)" (is "?P = ?D")
     1.9  proof (rule measure_eqI_generator_eq)
    1.10    have "finite J" using `J \<subseteq> K` `finite K` by (auto simp add: finite_subset)
    1.11    interpret J: finite_product_prob_space M J proof qed fact
    1.12    interpret K: finite_product_prob_space M K proof qed fact
    1.13  
    1.14 -  let ?J = "{Pi\<^isub>E J E | E. \<forall>i\<in>J. E i \<in> sets (M i)}"
    1.15 -  let ?F = "\<lambda>i. \<Pi>\<^isub>E k\<in>J. space (M k)"
    1.16 -  let ?\<Omega> = "(\<Pi>\<^isub>E k\<in>J. space (M k))"
    1.17 +  let ?J = "{Pi\<^sub>E J E | E. \<forall>i\<in>J. E i \<in> sets (M i)}"
    1.18 +  let ?F = "\<lambda>i. \<Pi>\<^sub>E k\<in>J. space (M k)"
    1.19 +  let ?\<Omega> = "(\<Pi>\<^sub>E k\<in>J. space (M k))"
    1.20    show "Int_stable ?J"
    1.21      by (rule Int_stable_PiE)
    1.22    show "range ?F \<subseteq> ?J" "(\<Union>i. ?F i) = ?\<Omega>"
    1.23      using `finite J` by (auto intro!: prod_algebraI_finite)
    1.24    { fix i show "emeasure ?P (?F i) \<noteq> \<infinity>" by simp }
    1.25    show "?J \<subseteq> Pow ?\<Omega>" by (auto simp: Pi_iff dest: sets.sets_into_space)
    1.26 -  show "sets (\<Pi>\<^isub>M i\<in>J. M i) = sigma_sets ?\<Omega> ?J" "sets ?D = sigma_sets ?\<Omega> ?J"
    1.27 +  show "sets (\<Pi>\<^sub>M i\<in>J. M i) = sigma_sets ?\<Omega> ?J" "sets ?D = sigma_sets ?\<Omega> ?J"
    1.28      using `finite J` by (simp_all add: sets_PiM prod_algebra_eq_finite Pi_iff)
    1.29  
    1.30    fix X assume "X \<in> ?J"
    1.31 -  then obtain E where [simp]: "X = Pi\<^isub>E J E" and E: "\<forall>i\<in>J. E i \<in> sets (M i)" by auto
    1.32 -  with `finite J` have X: "X \<in> sets (Pi\<^isub>M J M)"
    1.33 +  then obtain E where [simp]: "X = Pi\<^sub>E J E" and E: "\<forall>i\<in>J. E i \<in> sets (M i)" by auto
    1.34 +  with `finite J` have X: "X \<in> sets (Pi\<^sub>M J M)"
    1.35      by simp
    1.36  
    1.37    have "emeasure ?P X = (\<Prod> i\<in>J. emeasure (M i) (E i))"
    1.38 @@ -41,29 +41,29 @@
    1.39    also have "\<dots> = (\<Prod> i\<in>K. emeasure (M i) (if i \<in> J then E i else space (M i)))"
    1.40      using `finite K` `J \<subseteq> K`
    1.41      by (intro setprod_mono_one_left) (auto simp: M.emeasure_space_1)
    1.42 -  also have "\<dots> = emeasure (Pi\<^isub>M K M) (\<Pi>\<^isub>E i\<in>K. if i \<in> J then E i else space (M i))"
    1.43 +  also have "\<dots> = emeasure (Pi\<^sub>M K M) (\<Pi>\<^sub>E i\<in>K. if i \<in> J then E i else space (M i))"
    1.44      using E by (simp add: K.measure_times)
    1.45 -  also have "(\<Pi>\<^isub>E i\<in>K. if i \<in> J then E i else space (M i)) = (\<lambda>f. restrict f J) -` Pi\<^isub>E J E \<inter> (\<Pi>\<^isub>E i\<in>K. space (M i))"
    1.46 +  also have "(\<Pi>\<^sub>E i\<in>K. if i \<in> J then E i else space (M i)) = (\<lambda>f. restrict f J) -` Pi\<^sub>E J E \<inter> (\<Pi>\<^sub>E i\<in>K. space (M i))"
    1.47      using `J \<subseteq> K` sets.sets_into_space E by (force simp: Pi_iff PiE_def split: split_if_asm)
    1.48 -  finally show "emeasure (Pi\<^isub>M J M) X = emeasure ?D X"
    1.49 +  finally show "emeasure (Pi\<^sub>M J M) X = emeasure ?D X"
    1.50      using X `J \<subseteq> K` apply (subst emeasure_distr)
    1.51      by (auto intro!: measurable_restrict_subset simp: space_PiM)
    1.52  qed
    1.53  
    1.54  lemma (in product_prob_space) emeasure_prod_emb[simp]:
    1.55 -  assumes L: "J \<noteq> {}" "J \<subseteq> L" "finite L" and X: "X \<in> sets (Pi\<^isub>M J M)"
    1.56 -  shows "emeasure (Pi\<^isub>M L M) (prod_emb L M J X) = emeasure (Pi\<^isub>M J M) X"
    1.57 +  assumes L: "J \<noteq> {}" "J \<subseteq> L" "finite L" and X: "X \<in> sets (Pi\<^sub>M J M)"
    1.58 +  shows "emeasure (Pi\<^sub>M L M) (prod_emb L M J X) = emeasure (Pi\<^sub>M J M) X"
    1.59    by (subst distr_restrict[OF L])
    1.60       (simp add: prod_emb_def space_PiM emeasure_distr measurable_restrict_subset L X)
    1.61  
    1.62  definition
    1.63    limP :: "'i set \<Rightarrow> ('i \<Rightarrow> 'a measure) \<Rightarrow> ('i set \<Rightarrow> ('i \<Rightarrow> 'a) measure) \<Rightarrow> ('i \<Rightarrow> 'a) measure" where
    1.64 -  "limP I M P = extend_measure (\<Pi>\<^isub>E i\<in>I. space (M i))
    1.65 +  "limP I M P = extend_measure (\<Pi>\<^sub>E i\<in>I. space (M i))
    1.66      {(J, X). (J \<noteq> {} \<or> I = {}) \<and> finite J \<and> J \<subseteq> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}
    1.67 -    (\<lambda>(J, X). prod_emb I M J (\<Pi>\<^isub>E j\<in>J. X j))
    1.68 -    (\<lambda>(J, X). emeasure (P J) (Pi\<^isub>E J X))"
    1.69 +    (\<lambda>(J, X). prod_emb I M J (\<Pi>\<^sub>E j\<in>J. X j))
    1.70 +    (\<lambda>(J, X). emeasure (P J) (Pi\<^sub>E J X))"
    1.71  
    1.72 -abbreviation "lim\<^isub>P \<equiv> limP"
    1.73 +abbreviation "lim\<^sub>P \<equiv> limP"
    1.74  
    1.75  lemma space_limP[simp]: "space (limP I M P) = space (PiM I M)"
    1.76    by (auto simp add: limP_def space_PiM prod_emb_def intro!: space_extend_measure)
    1.77 @@ -71,10 +71,10 @@
    1.78  lemma sets_limP[simp]: "sets (limP I M P) = sets (PiM I M)"
    1.79    by (auto simp add: limP_def sets_PiM prod_algebra_def prod_emb_def intro!: sets_extend_measure)
    1.80  
    1.81 -lemma measurable_limP1[simp]: "measurable (limP I M P) M' = measurable (\<Pi>\<^isub>M i\<in>I. M i) M'"
    1.82 +lemma measurable_limP1[simp]: "measurable (limP I M P) M' = measurable (\<Pi>\<^sub>M i\<in>I. M i) M'"
    1.83    unfolding measurable_def by auto
    1.84  
    1.85 -lemma measurable_limP2[simp]: "measurable M' (limP I M P) = measurable M' (\<Pi>\<^isub>M i\<in>I. M i)"
    1.86 +lemma measurable_limP2[simp]: "measurable M' (limP I M P) = measurable M' (\<Pi>\<^sub>M i\<in>I. M i)"
    1.87    unfolding measurable_def by auto
    1.88  
    1.89  locale projective_family =
    1.90 @@ -90,14 +90,14 @@
    1.91    assumes "finite J"
    1.92    assumes "J \<subseteq> I"
    1.93    assumes A: "\<And>i. i\<in>J \<Longrightarrow> A i \<in> sets (M i)"
    1.94 -  shows "emeasure (limP J M P) (Pi\<^isub>E J A) = emeasure (P J) (Pi\<^isub>E J A)"
    1.95 +  shows "emeasure (limP J M P) (Pi\<^sub>E J A) = emeasure (P J) (Pi\<^sub>E J A)"
    1.96  proof -
    1.97 -  have "Pi\<^isub>E J (restrict A J) \<subseteq> (\<Pi>\<^isub>E i\<in>J. space (M i))"
    1.98 +  have "Pi\<^sub>E J (restrict A J) \<subseteq> (\<Pi>\<^sub>E i\<in>J. space (M i))"
    1.99      using sets.sets_into_space[OF A] by (auto simp: PiE_iff) blast
   1.100 -  hence "emeasure (limP J M P) (Pi\<^isub>E J A) =
   1.101 -    emeasure (limP J M P) (prod_emb J M J (Pi\<^isub>E J A))"
   1.102 +  hence "emeasure (limP J M P) (Pi\<^sub>E J A) =
   1.103 +    emeasure (limP J M P) (prod_emb J M J (Pi\<^sub>E J A))"
   1.104      using assms(1-3) sets.sets_into_space by (auto simp add: prod_emb_id PiE_def Pi_def)
   1.105 -  also have "\<dots> = emeasure (P J) (Pi\<^isub>E J A)"
   1.106 +  also have "\<dots> = emeasure (P J) (Pi\<^sub>E J A)"
   1.107    proof (rule emeasure_extend_measure_Pair[OF limP_def])
   1.108      show "positive (sets (limP J M P)) (P J)" unfolding positive_def by auto
   1.109      show "countably_additive (sets (limP J M P)) (P J)" unfolding countably_additive_def
   1.110 @@ -105,10 +105,10 @@
   1.111      show "(J \<noteq> {} \<or> J = {}) \<and> finite J \<and> J \<subseteq> J \<and> A \<in> (\<Pi> j\<in>J. sets (M j))"
   1.112        using assms by auto
   1.113      fix K and X::"'i \<Rightarrow> 'a set"
   1.114 -    show "prod_emb J M K (Pi\<^isub>E K X) \<in> Pow (\<Pi>\<^isub>E i\<in>J. space (M i))"
   1.115 +    show "prod_emb J M K (Pi\<^sub>E K X) \<in> Pow (\<Pi>\<^sub>E i\<in>J. space (M i))"
   1.116        by (auto simp: prod_emb_def)
   1.117      assume JX: "(K \<noteq> {} \<or> J = {}) \<and> finite K \<and> K \<subseteq> J \<and> X \<in> (\<Pi> j\<in>K. sets (M j))"
   1.118 -    thus "emeasure (P J) (prod_emb J M K (Pi\<^isub>E K X)) = emeasure (P K) (Pi\<^isub>E K X)"
   1.119 +    thus "emeasure (P J) (prod_emb J M K (Pi\<^sub>E K X)) = emeasure (P K) (Pi\<^sub>E K X)"
   1.120        using assms
   1.121        apply (cases "J = {}")
   1.122        apply (simp add: prod_emb_id)
   1.123 @@ -123,16 +123,16 @@
   1.124    assumes "J \<subseteq> I"
   1.125    shows "limP J M P = P J" (is "?P = _")
   1.126  proof (rule measure_eqI_generator_eq)
   1.127 -  let ?J = "{Pi\<^isub>E J E | E. \<forall>i\<in>J. E i \<in> sets (M i)}"
   1.128 -  let ?\<Omega> = "(\<Pi>\<^isub>E k\<in>J. space (M k))"
   1.129 +  let ?J = "{Pi\<^sub>E J E | E. \<forall>i\<in>J. E i \<in> sets (M i)}"
   1.130 +  let ?\<Omega> = "(\<Pi>\<^sub>E k\<in>J. space (M k))"
   1.131    interpret prob_space "P J" using proj_prob_space `finite J` by simp
   1.132 -  show "emeasure ?P (\<Pi>\<^isub>E k\<in>J. space (M k)) \<noteq> \<infinity>" using assms `finite J` by (auto simp: emeasure_limP)
   1.133 +  show "emeasure ?P (\<Pi>\<^sub>E k\<in>J. space (M k)) \<noteq> \<infinity>" using assms `finite J` by (auto simp: emeasure_limP)
   1.134    show "sets (limP J M P) = sigma_sets ?\<Omega> ?J" "sets (P J) = sigma_sets ?\<Omega> ?J"
   1.135      using `finite J` proj_sets by (simp_all add: sets_PiM prod_algebra_eq_finite Pi_iff)
   1.136    fix X assume "X \<in> ?J"
   1.137 -  then obtain E where X: "X = Pi\<^isub>E J E" and E: "\<forall>i\<in>J. E i \<in> sets (M i)" by auto
   1.138 +  then obtain E where X: "X = Pi\<^sub>E J E" and E: "\<forall>i\<in>J. E i \<in> sets (M i)" by auto
   1.139    with `finite J` have "X \<in> sets (limP J M P)" by simp
   1.140 -  have emb_self: "prod_emb J M J (Pi\<^isub>E J E) = Pi\<^isub>E J E"
   1.141 +  have emb_self: "prod_emb J M J (Pi\<^sub>E J E) = Pi\<^sub>E J E"
   1.142      using E sets.sets_into_space
   1.143      by (auto intro!: prod_emb_PiE_same_index)
   1.144    show "emeasure (limP J M P) X = emeasure (P J) X"
   1.145 @@ -150,11 +150,11 @@
   1.146    "emb L K X \<equiv> prod_emb L M K X"
   1.147  
   1.148  lemma prod_emb_injective:
   1.149 -  assumes "J \<subseteq> L" and sets: "X \<in> sets (Pi\<^isub>M J M)" "Y \<in> sets (Pi\<^isub>M J M)"
   1.150 +  assumes "J \<subseteq> L" and sets: "X \<in> sets (Pi\<^sub>M J M)" "Y \<in> sets (Pi\<^sub>M J M)"
   1.151    assumes "emb L J X = emb L J Y"
   1.152    shows "X = Y"
   1.153  proof (rule injective_vimage_restrict)
   1.154 -  show "X \<subseteq> (\<Pi>\<^isub>E i\<in>J. space (M i))" "Y \<subseteq> (\<Pi>\<^isub>E i\<in>J. space (M i))"
   1.155 +  show "X \<subseteq> (\<Pi>\<^sub>E i\<in>J. space (M i))" "Y \<subseteq> (\<Pi>\<^sub>E i\<in>J. space (M i))"
   1.156      using sets[THEN sets.sets_into_space] by (auto simp: space_PiM)
   1.157    have "\<forall>i\<in>L. \<exists>x. x \<in> space (M i)"
   1.158    proof
   1.159 @@ -163,20 +163,20 @@
   1.160      from not_empty show "\<exists>x. x \<in> space (M i)" by (auto simp add: proj_space space_PiM)
   1.161    qed
   1.162    from bchoice[OF this]
   1.163 -  show "(\<Pi>\<^isub>E i\<in>L. space (M i)) \<noteq> {}" by (auto simp: PiE_def)
   1.164 -  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.165 +  show "(\<Pi>\<^sub>E i\<in>L. space (M i)) \<noteq> {}" by (auto simp: PiE_def)
   1.166 +  show "(\<lambda>x. restrict x J) -` X \<inter> (\<Pi>\<^sub>E i\<in>L. space (M i)) = (\<lambda>x. restrict x J) -` Y \<inter> (\<Pi>\<^sub>E i\<in>L. space (M i))"
   1.167      using `prod_emb L M J X = prod_emb L M J Y` by (simp add: prod_emb_def)
   1.168  qed fact
   1.169  
   1.170  definition generator :: "('i \<Rightarrow> 'a) set set" where
   1.171 -  "generator = (\<Union>J\<in>{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emb I J ` sets (Pi\<^isub>M J M))"
   1.172 +  "generator = (\<Union>J\<in>{J. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I}. emb I J ` sets (Pi\<^sub>M J M))"
   1.173  
   1.174  lemma generatorI':
   1.175 -  "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.176 +  "J \<noteq> {} \<Longrightarrow> finite J \<Longrightarrow> J \<subseteq> I \<Longrightarrow> X \<in> sets (Pi\<^sub>M J M) \<Longrightarrow> emb I J X \<in> generator"
   1.177    unfolding generator_def by auto
   1.178  
   1.179  lemma algebra_generator:
   1.180 -  assumes "I \<noteq> {}" shows "algebra (\<Pi>\<^isub>E i\<in>I. space (M i)) generator" (is "algebra ?\<Omega> ?G")
   1.181 +  assumes "I \<noteq> {}" shows "algebra (\<Pi>\<^sub>E i\<in>I. space (M i)) generator" (is "algebra ?\<Omega> ?G")
   1.182    unfolding algebra_def algebra_axioms_def ring_of_sets_iff
   1.183  proof (intro conjI ballI)
   1.184    let ?G = generator
   1.185 @@ -187,13 +187,13 @@
   1.186      by (auto intro!: exI[of _ "{i}"] image_eqI[where x="\<lambda>i. {}"]
   1.187               simp: sigma_sets.Empty generator_def prod_emb_def)
   1.188    from `i \<in> I` show "?\<Omega> \<in> ?G"
   1.189 -    by (auto intro!: exI[of _ "{i}"] image_eqI[where x="Pi\<^isub>E {i} (\<lambda>i. space (M i))"]
   1.190 +    by (auto intro!: exI[of _ "{i}"] image_eqI[where x="Pi\<^sub>E {i} (\<lambda>i. space (M i))"]
   1.191               simp: generator_def prod_emb_def)
   1.192    fix A assume "A \<in> ?G"
   1.193 -  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.194 +  then obtain JA XA where XA: "JA \<noteq> {}" "finite JA" "JA \<subseteq> I" "XA \<in> sets (Pi\<^sub>M JA M)" and A: "A = emb I JA XA"
   1.195      by (auto simp: generator_def)
   1.196    fix B assume "B \<in> ?G"
   1.197 -  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.198 +  then obtain JB XB where XB: "JB \<noteq> {}" "finite JB" "JB \<subseteq> I" "XB \<in> sets (Pi\<^sub>M JB M)" and B: "B = emb I JB XB"
   1.199      by (auto simp: generator_def)
   1.200    let ?RA = "emb (JA \<union> JB) JA XA"
   1.201    let ?RB = "emb (JA \<union> JB) JB XB"
   1.202 @@ -204,7 +204,7 @@
   1.203  qed
   1.204  
   1.205  lemma sets_PiM_generator:
   1.206 -  "sets (PiM I M) = sigma_sets (\<Pi>\<^isub>E i\<in>I. space (M i)) generator"
   1.207 +  "sets (PiM I M) = sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i)) generator"
   1.208  proof cases
   1.209    assume "I = {}" then show ?thesis
   1.210      unfolding generator_def
   1.211 @@ -213,7 +213,7 @@
   1.212    assume "I \<noteq> {}"
   1.213    show ?thesis
   1.214    proof
   1.215 -    show "sets (Pi\<^isub>M I M) \<subseteq> sigma_sets (\<Pi>\<^isub>E i\<in>I. space (M i)) generator"
   1.216 +    show "sets (Pi\<^sub>M I M) \<subseteq> sigma_sets (\<Pi>\<^sub>E i\<in>I. space (M i)) generator"
   1.217        unfolding sets_PiM
   1.218      proof (safe intro!: sigma_sets_subseteq)
   1.219        fix A assume "A \<in> prod_algebra I M" with `I \<noteq> {}` show "A \<in> generator"
   1.220 @@ -223,19 +223,19 @@
   1.221  qed
   1.222  
   1.223  lemma generatorI:
   1.224 -  "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.225 +  "J \<noteq> {} \<Longrightarrow> finite J \<Longrightarrow> J \<subseteq> I \<Longrightarrow> X \<in> sets (Pi\<^sub>M J M) \<Longrightarrow> A = emb I J X \<Longrightarrow> A \<in> generator"
   1.226    unfolding generator_def by auto
   1.227  
   1.228  definition mu_G ("\<mu>G") where
   1.229    "\<mu>G A =
   1.230 -    (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 (limP J M P) X))"
   1.231 +    (THE x. \<forall>J. J \<noteq> {} \<longrightarrow> finite J \<longrightarrow> J \<subseteq> I \<longrightarrow> (\<forall>X\<in>sets (Pi\<^sub>M J M). A = emb I J X \<longrightarrow> x = emeasure (limP J M P) X))"
   1.232  
   1.233  lemma mu_G_spec:
   1.234 -  assumes J: "J \<noteq> {}" "finite J" "J \<subseteq> I" "A = emb I J X" "X \<in> sets (Pi\<^isub>M J M)"
   1.235 +  assumes J: "J \<noteq> {}" "finite J" "J \<subseteq> I" "A = emb I J X" "X \<in> sets (Pi\<^sub>M J M)"
   1.236    shows "\<mu>G A = emeasure (limP J M P) X"
   1.237    unfolding mu_G_def
   1.238  proof (intro the_equality allI impI ballI)
   1.239 -  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.240 +  fix K Y assume K: "K \<noteq> {}" "finite K" "K \<subseteq> I" "A = emb I K Y" "Y \<in> sets (Pi\<^sub>M K M)"
   1.241    have "emeasure (limP K M P) Y = emeasure (limP (K \<union> J) M P) (emb (K \<union> J) K Y)"
   1.242      using K J by simp
   1.243    also have "emb (K \<union> J) K Y = emb (K \<union> J) J X"
   1.244 @@ -246,31 +246,31 @@
   1.245  qed (insert J, force)
   1.246  
   1.247  lemma mu_G_eq:
   1.248 -  "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 (limP J M P) X"
   1.249 +  "J \<noteq> {} \<Longrightarrow> finite J \<Longrightarrow> J \<subseteq> I \<Longrightarrow> X \<in> sets (Pi\<^sub>M J M) \<Longrightarrow> \<mu>G (emb I J X) = emeasure (limP J M P) X"
   1.250    by (intro mu_G_spec) auto
   1.251  
   1.252  lemma generator_Ex:
   1.253    assumes *: "A \<in> generator"
   1.254 -  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 (limP J M P) X"
   1.255 +  shows "\<exists>J X. J \<noteq> {} \<and> finite J \<and> J \<subseteq> I \<and> X \<in> sets (Pi\<^sub>M J M) \<and> A = emb I J X \<and> \<mu>G A = emeasure (limP J M P) X"
   1.256  proof -
   1.257 -  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.258 +  from * obtain J X where J: "J \<noteq> {}" "finite J" "J \<subseteq> I" "A = emb I J X" "X \<in> sets (Pi\<^sub>M J M)"
   1.259      unfolding generator_def by auto
   1.260    with mu_G_spec[OF this] show ?thesis by auto
   1.261  qed
   1.262  
   1.263  lemma generatorE:
   1.264    assumes A: "A \<in> generator"
   1.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 = emeasure (limP J M P) X"
   1.266 +  obtains J X where "J \<noteq> {}" "finite J" "J \<subseteq> I" "X \<in> sets (Pi\<^sub>M J M)" "emb I J X = A" "\<mu>G A = emeasure (limP J M P) X"
   1.267    using generator_Ex[OF A] by atomize_elim auto
   1.268  
   1.269  lemma merge_sets:
   1.270 -  "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.271 +  "J \<inter> K = {} \<Longrightarrow> A \<in> sets (Pi\<^sub>M (J \<union> K) M) \<Longrightarrow> x \<in> space (Pi\<^sub>M J M) \<Longrightarrow> (\<lambda>y. merge J K (x,y)) -` A \<inter> space (Pi\<^sub>M K M) \<in> sets (Pi\<^sub>M K M)"
   1.272    by simp
   1.273  
   1.274  lemma merge_emb:
   1.275 -  assumes "K \<subseteq> I" "J \<subseteq> I" and y: "y \<in> space (Pi\<^isub>M J M)"
   1.276 -  shows "((\<lambda>x. merge J (I - J) (y, x)) -` emb I K X \<inter> space (Pi\<^isub>M I M)) =
   1.277 -    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.278 +  assumes "K \<subseteq> I" "J \<subseteq> I" and y: "y \<in> space (Pi\<^sub>M J M)"
   1.279 +  shows "((\<lambda>x. merge J (I - J) (y, x)) -` emb I K X \<inter> space (Pi\<^sub>M I M)) =
   1.280 +    emb I (K - J) ((\<lambda>x. merge J (K - J) (y, x)) -` emb (J \<union> K) K X \<inter> space (Pi\<^sub>M (K - J) M))"
   1.281  proof -
   1.282    have [simp]: "\<And>x J K L. merge J K (y, restrict x L) = merge J (K \<inter> L) (y, x)"
   1.283      by (auto simp: restrict_def merge_def)
   1.284 @@ -288,7 +288,7 @@
   1.285    assumes "I \<noteq> {}"
   1.286    shows "positive generator \<mu>G"
   1.287  proof -
   1.288 -  interpret G!: algebra "\<Pi>\<^isub>E i\<in>I. space (M i)" generator by (rule algebra_generator) fact
   1.289 +  interpret G!: algebra "\<Pi>\<^sub>E i\<in>I. space (M i)" generator by (rule algebra_generator) fact
   1.290    show ?thesis
   1.291    proof (intro positive_def[THEN iffD2] conjI ballI)
   1.292      from generatorE[OF G.empty_sets] guess J X . note this[simp]
   1.293 @@ -306,7 +306,7 @@
   1.294    assumes "I \<noteq> {}"
   1.295    shows "additive generator \<mu>G"
   1.296  proof -
   1.297 -  interpret G!: algebra "\<Pi>\<^isub>E i\<in>I. space (M i)" generator by (rule algebra_generator) fact
   1.298 +  interpret G!: algebra "\<Pi>\<^sub>E i\<in>I. space (M i)" generator by (rule algebra_generator) fact
   1.299    show ?thesis
   1.300    proof (intro additive_def[THEN iffD2] ballI impI)
   1.301      fix A assume "A \<in> generator" with generatorE guess J X . note J = this
   1.302 @@ -337,12 +337,12 @@
   1.303  proof
   1.304    fix J::"'i set" assume "finite J"
   1.305    interpret f: finite_product_prob_space M J proof qed fact
   1.306 -  show "emeasure (Pi\<^isub>M J M) (space (Pi\<^isub>M J M)) \<noteq> \<infinity>" by simp
   1.307 -  show "\<exists>A. range A \<subseteq> sets (Pi\<^isub>M J M) \<and>
   1.308 -            (\<Union>i. A i) = space (Pi\<^isub>M J M) \<and>
   1.309 -            (\<forall>i. emeasure (Pi\<^isub>M J M) (A i) \<noteq> \<infinity>)" using sigma_finite[OF `finite J`]
   1.310 +  show "emeasure (Pi\<^sub>M J M) (space (Pi\<^sub>M J M)) \<noteq> \<infinity>" by simp
   1.311 +  show "\<exists>A. range A \<subseteq> sets (Pi\<^sub>M J M) \<and>
   1.312 +            (\<Union>i. A i) = space (Pi\<^sub>M J M) \<and>
   1.313 +            (\<forall>i. emeasure (Pi\<^sub>M J M) (A i) \<noteq> \<infinity>)" using sigma_finite[OF `finite J`]
   1.314      by (auto simp add: sigma_finite_measure_def)
   1.315 -  show "emeasure (Pi\<^isub>M J M) (space (Pi\<^isub>M J M)) = 1" by (rule f.emeasure_space_1)
   1.316 +  show "emeasure (Pi\<^sub>M J M) (space (Pi\<^sub>M J M)) = 1" by (rule f.emeasure_space_1)
   1.317  qed simp_all
   1.318  
   1.319  lemma (in product_prob_space) limP_PiM_finite[simp]: