move conditional expectation to its own theory file
authorhoelzl
Mon Jun 27 09:42:46 2011 +0200 (2011-06-27)
changeset 435560d78c8d31d0d
parent 43555 93c1fc6ac527
child 43557 844b4a178dff
child 43566 a818d5a34cca
child 43582 ddca453102ab
move conditional expectation to its own theory file
src/HOL/IsaMakefile
src/HOL/Probability/Conditional_Probability.thy
src/HOL/Probability/Information.thy
src/HOL/Probability/Measure.thy
src/HOL/Probability/Probability.thy
src/HOL/Probability/Probability_Measure.thy
src/HOL/Probability/Radon_Nikodym.thy
     1.1 --- a/src/HOL/IsaMakefile	Sun Jun 26 19:10:03 2011 +0200
     1.2 +++ b/src/HOL/IsaMakefile	Mon Jun 27 09:42:46 2011 +0200
     1.3 @@ -1203,6 +1203,7 @@
     1.4  $(OUT)/HOL-Probability: $(OUT)/HOL-Multivariate_Analysis		\
     1.5    Probability/Binary_Product_Measure.thy Probability/Borel_Space.thy	\
     1.6    Probability/Caratheodory.thy Probability/Complete_Measure.thy		\
     1.7 +  Probability/Conditional_Probability.thy				\
     1.8    Probability/ex/Dining_Cryptographers.thy				\
     1.9    Probability/ex/Koepf_Duermuth_Countermeasure.thy			\
    1.10    Probability/Finite_Product_Measure.thy				\
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/HOL/Probability/Conditional_Probability.thy	Mon Jun 27 09:42:46 2011 +0200
     2.3 @@ -0,0 +1,161 @@
     2.4 +(*  Title:      HOL/Probability/Conditional_Probability.thy
     2.5 +    Author:     Johannes Hölzl, TU München
     2.6 +*)
     2.7 +
     2.8 +header {*Conditional probability*}
     2.9 +
    2.10 +theory Conditional_Probability
    2.11 +imports Probability_Measure Radon_Nikodym
    2.12 +begin
    2.13 +
    2.14 +section "Conditional Expectation and Probability"
    2.15 +
    2.16 +definition (in prob_space)
    2.17 +  "conditional_expectation N X = (SOME Y. Y\<in>borel_measurable N \<and> (\<forall>x. 0 \<le> Y x)
    2.18 +    \<and> (\<forall>C\<in>sets N. (\<integral>\<^isup>+x. Y x * indicator C x\<partial>M) = (\<integral>\<^isup>+x. X x * indicator C x\<partial>M)))"
    2.19 +
    2.20 +lemma (in prob_space) conditional_expectation_exists:
    2.21 +  fixes X :: "'a \<Rightarrow> extreal" and N :: "('a, 'b) measure_space_scheme"
    2.22 +  assumes borel: "X \<in> borel_measurable M" "AE x. 0 \<le> X x"
    2.23 +  and N: "sigma_algebra N" "sets N \<subseteq> sets M" "space N = space M" "\<And>A. measure N A = \<mu> A"
    2.24 +  shows "\<exists>Y\<in>borel_measurable N. (\<forall>x. 0 \<le> Y x) \<and> (\<forall>C\<in>sets N.
    2.25 +      (\<integral>\<^isup>+x. Y x * indicator C x \<partial>M) = (\<integral>\<^isup>+x. X x * indicator C x \<partial>M))"
    2.26 +proof -
    2.27 +  note N(4)[simp]
    2.28 +  interpret P: prob_space N
    2.29 +    using prob_space_subalgebra[OF N] .
    2.30 +
    2.31 +  let "?f A" = "\<lambda>x. X x * indicator A x"
    2.32 +  let "?Q A" = "integral\<^isup>P M (?f A)"
    2.33 +
    2.34 +  from measure_space_density[OF borel]
    2.35 +  have Q: "measure_space (N\<lparr> measure := ?Q \<rparr>)"
    2.36 +    apply (rule measure_space.measure_space_subalgebra[of "M\<lparr> measure := ?Q \<rparr>"])
    2.37 +    using N by (auto intro!: P.sigma_algebra_cong)
    2.38 +  then interpret Q: measure_space "N\<lparr> measure := ?Q \<rparr>" .
    2.39 +
    2.40 +  have "P.absolutely_continuous ?Q"
    2.41 +    unfolding P.absolutely_continuous_def
    2.42 +  proof safe
    2.43 +    fix A assume "A \<in> sets N" "P.\<mu> A = 0"
    2.44 +    then have f_borel: "?f A \<in> borel_measurable M" "AE x. x \<notin> A"
    2.45 +      using borel N by (auto intro!: borel_measurable_indicator AE_not_in)
    2.46 +    then show "?Q A = 0"
    2.47 +      by (auto simp add: positive_integral_0_iff_AE)
    2.48 +  qed
    2.49 +  from P.Radon_Nikodym[OF Q this]
    2.50 +  obtain Y where Y: "Y \<in> borel_measurable N" "\<And>x. 0 \<le> Y x"
    2.51 +    "\<And>A. A \<in> sets N \<Longrightarrow> ?Q A =(\<integral>\<^isup>+x. Y x * indicator A x \<partial>N)"
    2.52 +    by blast
    2.53 +  with N(2) show ?thesis
    2.54 +    by (auto intro!: bexI[OF _ Y(1)] simp: positive_integral_subalgebra[OF _ _ N(2,3,4,1)])
    2.55 +qed
    2.56 +
    2.57 +lemma (in prob_space)
    2.58 +  fixes X :: "'a \<Rightarrow> extreal" and N :: "('a, 'b) measure_space_scheme"
    2.59 +  assumes borel: "X \<in> borel_measurable M" "AE x. 0 \<le> X x"
    2.60 +  and N: "sigma_algebra N" "sets N \<subseteq> sets M" "space N = space M" "\<And>A. measure N A = \<mu> A"
    2.61 +  shows borel_measurable_conditional_expectation:
    2.62 +    "conditional_expectation N X \<in> borel_measurable N"
    2.63 +  and conditional_expectation: "\<And>C. C \<in> sets N \<Longrightarrow>
    2.64 +      (\<integral>\<^isup>+x. conditional_expectation N X x * indicator C x \<partial>M) =
    2.65 +      (\<integral>\<^isup>+x. X x * indicator C x \<partial>M)"
    2.66 +   (is "\<And>C. C \<in> sets N \<Longrightarrow> ?eq C")
    2.67 +proof -
    2.68 +  note CE = conditional_expectation_exists[OF assms, unfolded Bex_def]
    2.69 +  then show "conditional_expectation N X \<in> borel_measurable N"
    2.70 +    unfolding conditional_expectation_def by (rule someI2_ex) blast
    2.71 +
    2.72 +  from CE show "\<And>C. C \<in> sets N \<Longrightarrow> ?eq C"
    2.73 +    unfolding conditional_expectation_def by (rule someI2_ex) blast
    2.74 +qed
    2.75 +
    2.76 +lemma (in sigma_algebra) factorize_measurable_function_pos:
    2.77 +  fixes Z :: "'a \<Rightarrow> extreal" and Y :: "'a \<Rightarrow> 'c"
    2.78 +  assumes "sigma_algebra M'" and "Y \<in> measurable M M'" "Z \<in> borel_measurable M"
    2.79 +  assumes Z: "Z \<in> borel_measurable (sigma_algebra.vimage_algebra M' (space M) Y)"
    2.80 +  shows "\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. max 0 (Z x) = g (Y x)"
    2.81 +proof -
    2.82 +  interpret M': sigma_algebra M' by fact
    2.83 +  have Y: "Y \<in> space M \<rightarrow> space M'" using assms unfolding measurable_def by auto
    2.84 +  from M'.sigma_algebra_vimage[OF this]
    2.85 +  interpret va: sigma_algebra "M'.vimage_algebra (space M) Y" .
    2.86 +
    2.87 +  from va.borel_measurable_implies_simple_function_sequence'[OF Z] guess f . note f = this
    2.88 +
    2.89 +  have "\<forall>i. \<exists>g. simple_function M' g \<and> (\<forall>x\<in>space M. f i x = g (Y x))"
    2.90 +  proof
    2.91 +    fix i
    2.92 +    from f(1)[of i] have "finite (f i`space M)" and B_ex:
    2.93 +      "\<forall>z\<in>(f i)`space M. \<exists>B. B \<in> sets M' \<and> (f i) -` {z} \<inter> space M = Y -` B \<inter> space M"
    2.94 +      unfolding simple_function_def by auto
    2.95 +    from B_ex[THEN bchoice] guess B .. note B = this
    2.96 +
    2.97 +    let ?g = "\<lambda>x. \<Sum>z\<in>f i`space M. z * indicator (B z) x"
    2.98 +
    2.99 +    show "\<exists>g. simple_function M' g \<and> (\<forall>x\<in>space M. f i x = g (Y x))"
   2.100 +    proof (intro exI[of _ ?g] conjI ballI)
   2.101 +      show "simple_function M' ?g" using B by auto
   2.102 +
   2.103 +      fix x assume "x \<in> space M"
   2.104 +      then have "\<And>z. z \<in> f i`space M \<Longrightarrow> indicator (B z) (Y x) = (indicator (f i -` {z} \<inter> space M) x::extreal)"
   2.105 +        unfolding indicator_def using B by auto
   2.106 +      then show "f i x = ?g (Y x)" using `x \<in> space M` f(1)[of i]
   2.107 +        by (subst va.simple_function_indicator_representation) auto
   2.108 +    qed
   2.109 +  qed
   2.110 +  from choice[OF this] guess g .. note g = this
   2.111 +
   2.112 +  show ?thesis
   2.113 +  proof (intro ballI bexI)
   2.114 +    show "(\<lambda>x. SUP i. g i x) \<in> borel_measurable M'"
   2.115 +      using g by (auto intro: M'.borel_measurable_simple_function)
   2.116 +    fix x assume "x \<in> space M"
   2.117 +    have "max 0 (Z x) = (SUP i. f i x)" using f by simp
   2.118 +    also have "\<dots> = (SUP i. g i (Y x))"
   2.119 +      using g `x \<in> space M` by simp
   2.120 +    finally show "max 0 (Z x) = (SUP i. g i (Y x))" .
   2.121 +  qed
   2.122 +qed
   2.123 +
   2.124 +lemma (in sigma_algebra) factorize_measurable_function:
   2.125 +  fixes Z :: "'a \<Rightarrow> extreal" and Y :: "'a \<Rightarrow> 'c"
   2.126 +  assumes "sigma_algebra M'" and "Y \<in> measurable M M'" "Z \<in> borel_measurable M"
   2.127 +  shows "Z \<in> borel_measurable (sigma_algebra.vimage_algebra M' (space M) Y)
   2.128 +    \<longleftrightarrow> (\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. Z x = g (Y x))"
   2.129 +proof safe
   2.130 +  interpret M': sigma_algebra M' by fact
   2.131 +  have Y: "Y \<in> space M \<rightarrow> space M'" using assms unfolding measurable_def by auto
   2.132 +  from M'.sigma_algebra_vimage[OF this]
   2.133 +  interpret va: sigma_algebra "M'.vimage_algebra (space M) Y" .
   2.134 +
   2.135 +  { fix g :: "'c \<Rightarrow> extreal" assume "g \<in> borel_measurable M'"
   2.136 +    with M'.measurable_vimage_algebra[OF Y]
   2.137 +    have "g \<circ> Y \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   2.138 +      by (rule measurable_comp)
   2.139 +    moreover assume "\<forall>x\<in>space M. Z x = g (Y x)"
   2.140 +    then have "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y) \<longleftrightarrow>
   2.141 +       g \<circ> Y \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   2.142 +       by (auto intro!: measurable_cong)
   2.143 +    ultimately show "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   2.144 +      by simp }
   2.145 +
   2.146 +  assume Z: "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   2.147 +  with assms have "(\<lambda>x. - Z x) \<in> borel_measurable M"
   2.148 +    "(\<lambda>x. - Z x) \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   2.149 +    by auto
   2.150 +  from factorize_measurable_function_pos[OF assms(1,2) this] guess n .. note n = this
   2.151 +  from factorize_measurable_function_pos[OF assms Z] guess p .. note p = this
   2.152 +  let "?g x" = "p x - n x"
   2.153 +  show "\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. Z x = g (Y x)"
   2.154 +  proof (intro bexI ballI)
   2.155 +    show "?g \<in> borel_measurable M'" using p n by auto
   2.156 +    fix x assume "x \<in> space M"
   2.157 +    then have "p (Y x) = max 0 (Z x)" "n (Y x) = max 0 (- Z x)"
   2.158 +      using p n by auto
   2.159 +    then show "Z x = ?g (Y x)"
   2.160 +      by (auto split: split_max)
   2.161 +  qed
   2.162 +qed
   2.163 +
   2.164 +end
   2.165 \ No newline at end of file
     3.1 --- a/src/HOL/Probability/Information.thy	Sun Jun 26 19:10:03 2011 +0200
     3.2 +++ b/src/HOL/Probability/Information.thy	Mon Jun 27 09:42:46 2011 +0200
     3.3 @@ -8,6 +8,7 @@
     3.4  theory Information
     3.5  imports
     3.6    Independent_Family
     3.7 +  Radon_Nikodym
     3.8    "~~/src/HOL/Library/Convex"
     3.9  begin
    3.10  
     4.1 --- a/src/HOL/Probability/Measure.thy	Sun Jun 26 19:10:03 2011 +0200
     4.2 +++ b/src/HOL/Probability/Measure.thy	Mon Jun 27 09:42:46 2011 +0200
     4.3 @@ -1205,6 +1205,10 @@
     4.4  lemma (in finite_measure) positive_measure'[simp, intro]: "0 \<le> \<mu>' A"
     4.5    unfolding \<mu>'_def by (auto simp: real_of_extreal_pos)
     4.6  
     4.7 +lemma (in finite_measure) real_measure:
     4.8 +  assumes A: "A \<in> sets M" shows "\<exists>r. 0 \<le> r \<and> \<mu> A = extreal r"
     4.9 +  using finite_measure[OF A] positive_measure[OF A] by (cases "\<mu> A") auto
    4.10 +
    4.11  lemma (in finite_measure) bounded_measure: "\<mu>' A \<le> \<mu>' (space M)"
    4.12  proof cases
    4.13    assume "A \<in> sets M"
     5.1 --- a/src/HOL/Probability/Probability.thy	Sun Jun 26 19:10:03 2011 +0200
     5.2 +++ b/src/HOL/Probability/Probability.thy	Mon Jun 27 09:42:46 2011 +0200
     5.3 @@ -4,6 +4,7 @@
     5.4    Probability_Measure
     5.5    Infinite_Product_Measure
     5.6    Independent_Family
     5.7 +  Conditional_Probability
     5.8    Information
     5.9    "ex/Dining_Cryptographers"
    5.10    "ex/Koepf_Duermuth_Countermeasure"
     6.1 --- a/src/HOL/Probability/Probability_Measure.thy	Sun Jun 26 19:10:03 2011 +0200
     6.2 +++ b/src/HOL/Probability/Probability_Measure.thy	Mon Jun 27 09:42:46 2011 +0200
     6.3 @@ -6,7 +6,7 @@
     6.4  header {*Probability measure*}
     6.5  
     6.6  theory Probability_Measure
     6.7 -imports Lebesgue_Integration Radon_Nikodym Finite_Product_Measure Lebesgue_Measure
     6.8 +imports Lebesgue_Measure
     6.9  begin
    6.10  
    6.11  locale prob_space = measure_space +
    6.12 @@ -1107,159 +1107,6 @@
    6.13      by (simp add: distribution_def prob_space vimage_Times comp_def measure_space_1)
    6.14  qed
    6.15  
    6.16 -section "Conditional Expectation and Probability"
    6.17 -
    6.18 -lemma (in prob_space) conditional_expectation_exists:
    6.19 -  fixes X :: "'a \<Rightarrow> extreal" and N :: "('a, 'b) measure_space_scheme"
    6.20 -  assumes borel: "X \<in> borel_measurable M" "AE x. 0 \<le> X x"
    6.21 -  and N: "sigma_algebra N" "sets N \<subseteq> sets M" "space N = space M" "\<And>A. measure N A = \<mu> A"
    6.22 -  shows "\<exists>Y\<in>borel_measurable N. (\<forall>x. 0 \<le> Y x) \<and> (\<forall>C\<in>sets N.
    6.23 -      (\<integral>\<^isup>+x. Y x * indicator C x \<partial>M) = (\<integral>\<^isup>+x. X x * indicator C x \<partial>M))"
    6.24 -proof -
    6.25 -  note N(4)[simp]
    6.26 -  interpret P: prob_space N
    6.27 -    using prob_space_subalgebra[OF N] .
    6.28 -
    6.29 -  let "?f A" = "\<lambda>x. X x * indicator A x"
    6.30 -  let "?Q A" = "integral\<^isup>P M (?f A)"
    6.31 -
    6.32 -  from measure_space_density[OF borel]
    6.33 -  have Q: "measure_space (N\<lparr> measure := ?Q \<rparr>)"
    6.34 -    apply (rule measure_space.measure_space_subalgebra[of "M\<lparr> measure := ?Q \<rparr>"])
    6.35 -    using N by (auto intro!: P.sigma_algebra_cong)
    6.36 -  then interpret Q: measure_space "N\<lparr> measure := ?Q \<rparr>" .
    6.37 -
    6.38 -  have "P.absolutely_continuous ?Q"
    6.39 -    unfolding P.absolutely_continuous_def
    6.40 -  proof safe
    6.41 -    fix A assume "A \<in> sets N" "P.\<mu> A = 0"
    6.42 -    then have f_borel: "?f A \<in> borel_measurable M" "AE x. x \<notin> A"
    6.43 -      using borel N by (auto intro!: borel_measurable_indicator AE_not_in)
    6.44 -    then show "?Q A = 0"
    6.45 -      by (auto simp add: positive_integral_0_iff_AE)
    6.46 -  qed
    6.47 -  from P.Radon_Nikodym[OF Q this]
    6.48 -  obtain Y where Y: "Y \<in> borel_measurable N" "\<And>x. 0 \<le> Y x"
    6.49 -    "\<And>A. A \<in> sets N \<Longrightarrow> ?Q A =(\<integral>\<^isup>+x. Y x * indicator A x \<partial>N)"
    6.50 -    by blast
    6.51 -  with N(2) show ?thesis
    6.52 -    by (auto intro!: bexI[OF _ Y(1)] simp: positive_integral_subalgebra[OF _ _ N(2,3,4,1)])
    6.53 -qed
    6.54 -
    6.55 -definition (in prob_space)
    6.56 -  "conditional_expectation N X = (SOME Y. Y\<in>borel_measurable N \<and> (\<forall>x. 0 \<le> Y x)
    6.57 -    \<and> (\<forall>C\<in>sets N. (\<integral>\<^isup>+x. Y x * indicator C x\<partial>M) = (\<integral>\<^isup>+x. X x * indicator C x\<partial>M)))"
    6.58 -
    6.59 -abbreviation (in prob_space)
    6.60 -  "conditional_prob N A \<equiv> conditional_expectation N (indicator A)"
    6.61 -
    6.62 -lemma (in prob_space)
    6.63 -  fixes X :: "'a \<Rightarrow> extreal" and N :: "('a, 'b) measure_space_scheme"
    6.64 -  assumes borel: "X \<in> borel_measurable M" "AE x. 0 \<le> X x"
    6.65 -  and N: "sigma_algebra N" "sets N \<subseteq> sets M" "space N = space M" "\<And>A. measure N A = \<mu> A"
    6.66 -  shows borel_measurable_conditional_expectation:
    6.67 -    "conditional_expectation N X \<in> borel_measurable N"
    6.68 -  and conditional_expectation: "\<And>C. C \<in> sets N \<Longrightarrow>
    6.69 -      (\<integral>\<^isup>+x. conditional_expectation N X x * indicator C x \<partial>M) =
    6.70 -      (\<integral>\<^isup>+x. X x * indicator C x \<partial>M)"
    6.71 -   (is "\<And>C. C \<in> sets N \<Longrightarrow> ?eq C")
    6.72 -proof -
    6.73 -  note CE = conditional_expectation_exists[OF assms, unfolded Bex_def]
    6.74 -  then show "conditional_expectation N X \<in> borel_measurable N"
    6.75 -    unfolding conditional_expectation_def by (rule someI2_ex) blast
    6.76 -
    6.77 -  from CE show "\<And>C. C \<in> sets N \<Longrightarrow> ?eq C"
    6.78 -    unfolding conditional_expectation_def by (rule someI2_ex) blast
    6.79 -qed
    6.80 -
    6.81 -lemma (in sigma_algebra) factorize_measurable_function_pos:
    6.82 -  fixes Z :: "'a \<Rightarrow> extreal" and Y :: "'a \<Rightarrow> 'c"
    6.83 -  assumes "sigma_algebra M'" and "Y \<in> measurable M M'" "Z \<in> borel_measurable M"
    6.84 -  assumes Z: "Z \<in> borel_measurable (sigma_algebra.vimage_algebra M' (space M) Y)"
    6.85 -  shows "\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. max 0 (Z x) = g (Y x)"
    6.86 -proof -
    6.87 -  interpret M': sigma_algebra M' by fact
    6.88 -  have Y: "Y \<in> space M \<rightarrow> space M'" using assms unfolding measurable_def by auto
    6.89 -  from M'.sigma_algebra_vimage[OF this]
    6.90 -  interpret va: sigma_algebra "M'.vimage_algebra (space M) Y" .
    6.91 -
    6.92 -  from va.borel_measurable_implies_simple_function_sequence'[OF Z] guess f . note f = this
    6.93 -
    6.94 -  have "\<forall>i. \<exists>g. simple_function M' g \<and> (\<forall>x\<in>space M. f i x = g (Y x))"
    6.95 -  proof
    6.96 -    fix i
    6.97 -    from f(1)[of i] have "finite (f i`space M)" and B_ex:
    6.98 -      "\<forall>z\<in>(f i)`space M. \<exists>B. B \<in> sets M' \<and> (f i) -` {z} \<inter> space M = Y -` B \<inter> space M"
    6.99 -      unfolding simple_function_def by auto
   6.100 -    from B_ex[THEN bchoice] guess B .. note B = this
   6.101 -
   6.102 -    let ?g = "\<lambda>x. \<Sum>z\<in>f i`space M. z * indicator (B z) x"
   6.103 -
   6.104 -    show "\<exists>g. simple_function M' g \<and> (\<forall>x\<in>space M. f i x = g (Y x))"
   6.105 -    proof (intro exI[of _ ?g] conjI ballI)
   6.106 -      show "simple_function M' ?g" using B by auto
   6.107 -
   6.108 -      fix x assume "x \<in> space M"
   6.109 -      then have "\<And>z. z \<in> f i`space M \<Longrightarrow> indicator (B z) (Y x) = (indicator (f i -` {z} \<inter> space M) x::extreal)"
   6.110 -        unfolding indicator_def using B by auto
   6.111 -      then show "f i x = ?g (Y x)" using `x \<in> space M` f(1)[of i]
   6.112 -        by (subst va.simple_function_indicator_representation) auto
   6.113 -    qed
   6.114 -  qed
   6.115 -  from choice[OF this] guess g .. note g = this
   6.116 -
   6.117 -  show ?thesis
   6.118 -  proof (intro ballI bexI)
   6.119 -    show "(\<lambda>x. SUP i. g i x) \<in> borel_measurable M'"
   6.120 -      using g by (auto intro: M'.borel_measurable_simple_function)
   6.121 -    fix x assume "x \<in> space M"
   6.122 -    have "max 0 (Z x) = (SUP i. f i x)" using f by simp
   6.123 -    also have "\<dots> = (SUP i. g i (Y x))"
   6.124 -      using g `x \<in> space M` by simp
   6.125 -    finally show "max 0 (Z x) = (SUP i. g i (Y x))" .
   6.126 -  qed
   6.127 -qed
   6.128 -
   6.129 -lemma (in sigma_algebra) factorize_measurable_function:
   6.130 -  fixes Z :: "'a \<Rightarrow> extreal" and Y :: "'a \<Rightarrow> 'c"
   6.131 -  assumes "sigma_algebra M'" and "Y \<in> measurable M M'" "Z \<in> borel_measurable M"
   6.132 -  shows "Z \<in> borel_measurable (sigma_algebra.vimage_algebra M' (space M) Y)
   6.133 -    \<longleftrightarrow> (\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. Z x = g (Y x))"
   6.134 -proof safe
   6.135 -  interpret M': sigma_algebra M' by fact
   6.136 -  have Y: "Y \<in> space M \<rightarrow> space M'" using assms unfolding measurable_def by auto
   6.137 -  from M'.sigma_algebra_vimage[OF this]
   6.138 -  interpret va: sigma_algebra "M'.vimage_algebra (space M) Y" .
   6.139 -
   6.140 -  { fix g :: "'c \<Rightarrow> extreal" assume "g \<in> borel_measurable M'"
   6.141 -    with M'.measurable_vimage_algebra[OF Y]
   6.142 -    have "g \<circ> Y \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   6.143 -      by (rule measurable_comp)
   6.144 -    moreover assume "\<forall>x\<in>space M. Z x = g (Y x)"
   6.145 -    then have "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y) \<longleftrightarrow>
   6.146 -       g \<circ> Y \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   6.147 -       by (auto intro!: measurable_cong)
   6.148 -    ultimately show "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   6.149 -      by simp }
   6.150 -
   6.151 -  assume Z: "Z \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   6.152 -  with assms have "(\<lambda>x. - Z x) \<in> borel_measurable M"
   6.153 -    "(\<lambda>x. - Z x) \<in> borel_measurable (M'.vimage_algebra (space M) Y)"
   6.154 -    by auto
   6.155 -  from factorize_measurable_function_pos[OF assms(1,2) this] guess n .. note n = this
   6.156 -  from factorize_measurable_function_pos[OF assms Z] guess p .. note p = this
   6.157 -  let "?g x" = "p x - n x"
   6.158 -  show "\<exists>g\<in>borel_measurable M'. \<forall>x\<in>space M. Z x = g (Y x)"
   6.159 -  proof (intro bexI ballI)
   6.160 -    show "?g \<in> borel_measurable M'" using p n by auto
   6.161 -    fix x assume "x \<in> space M"
   6.162 -    then have "p (Y x) = max 0 (Z x)" "n (Y x) = max 0 (- Z x)"
   6.163 -      using p n by auto
   6.164 -    then show "Z x = ?g (Y x)"
   6.165 -      by (auto split: split_max)
   6.166 -  qed
   6.167 -qed
   6.168 -
   6.169  subsection "Borel Measure on {0 .. 1}"
   6.170  
   6.171  definition pborel :: "real measure_space" where
     7.1 --- a/src/HOL/Probability/Radon_Nikodym.thy	Sun Jun 26 19:10:03 2011 +0200
     7.2 +++ b/src/HOL/Probability/Radon_Nikodym.thy	Mon Jun 27 09:42:46 2011 +0200
     7.3 @@ -314,10 +314,6 @@
     7.4    qed
     7.5  qed
     7.6  
     7.7 -lemma (in finite_measure) real_measure:
     7.8 -  assumes A: "A \<in> sets M" shows "\<exists>r. 0 \<le> r \<and> \<mu> A = extreal r"
     7.9 -  using finite_measure[OF A] positive_measure[OF A] by (cases "\<mu> A") auto
    7.10 -
    7.11  lemma (in finite_measure) Radon_Nikodym_finite_measure:
    7.12    assumes "finite_measure (M\<lparr> measure := \<nu>\<rparr>)" (is "finite_measure ?M'")
    7.13    assumes "absolutely_continuous \<nu>"