diff -r 933eb9e6a1cc -r 77b453bd616f src/HOL/Probability/Giry_Monad.thy --- a/src/HOL/Probability/Giry_Monad.thy Tue Nov 03 11:20:21 2015 +0100 +++ b/src/HOL/Probability/Giry_Monad.thy Tue Nov 10 14:18:41 2015 +0000 @@ -337,7 +337,7 @@ shows "(\M. integral\<^sup>L M f) \ borel_measurable (subprob_algebra N)" proof - note [measurable] = nn_integral_measurable_subprob_algebra - have "?thesis \ (\M. real (\\<^sup>+ x. f x \M) - real (\\<^sup>+ x. - f x \M)) \ borel_measurable (subprob_algebra N)" + have "?thesis \ (\M. real_of_ereal (\\<^sup>+ x. f x \M) - real_of_ereal (\\<^sup>+ x. - f x \M)) \ borel_measurable (subprob_algebra N)" proof(rule measurable_cong) fix M assume "M \ space (subprob_algebra N)" @@ -352,7 +352,7 @@ finally have "(\\<^sup>+ x. ereal \f x\ \M) \ \" by(auto simp add: max_def) then have "integrable M f" using f_measurable by(auto intro: integrableI_bounded) - thus "(\ x. f x \M) = real (\\<^sup>+ x. f x \M) - real (\\<^sup>+ x. - f x \M)" + thus "(\ x. f x \M) = real_of_ereal (\\<^sup>+ x. f x \M) - real_of_ereal (\\<^sup>+ x. - f x \M)" by(simp add: real_lebesgue_integral_def) qed also have "\" by measurable @@ -933,9 +933,9 @@ using f_measurable by(auto intro!: bounded1 dest: f_bounded) have "AE M' in M. (\\<^sup>+ x. f x \M') \ \" using M_bounded by(rule AE_mp[OF _ AE_I2])(auto dest: f_pos1) - hence [simp]: "(\\<^sup>+ M'. ereal (real (\\<^sup>+ x. f x \M')) \M) = (\\<^sup>+ M'. \\<^sup>+ x. f x \M' \M)" + hence [simp]: "(\\<^sup>+ M'. ereal (real_of_ereal (\\<^sup>+ x. f x \M')) \M) = (\\<^sup>+ M'. \\<^sup>+ x. f x \M' \M)" by(rule nn_integral_cong_AE[OF AE_mp])(simp add: ereal_real nn_integral_nonneg) - from f_pos have [simp]: "integrable M (\M'. real (\\<^sup>+ x. f x \M'))" + from f_pos have [simp]: "integrable M (\M'. real_of_ereal (\\<^sup>+ x. f x \M'))" by(simp add: int_f real_integrable_def nn_integral_nonneg real_of_ereal[symmetric] nn_integral_0_iff_AE[THEN iffD2] del: real_of_ereal) have f_neg1: @@ -944,9 +944,9 @@ using f_measurable by(auto intro!: bounded1 dest: f_bounded) have "AE M' in M. (\\<^sup>+ x. - f x \M') \ \" using M_bounded by(rule AE_mp[OF _ AE_I2])(auto dest: f_neg1) - hence [simp]: "(\\<^sup>+ M'. ereal (real (\\<^sup>+ x. - f x \M')) \M) = (\\<^sup>+ M'. \\<^sup>+ x. - f x \M' \M)" + hence [simp]: "(\\<^sup>+ M'. ereal (real_of_ereal (\\<^sup>+ x. - f x \M')) \M) = (\\<^sup>+ M'. \\<^sup>+ x. - f x \M' \M)" by(rule nn_integral_cong_AE[OF AE_mp])(simp add: ereal_real nn_integral_nonneg) - from f_neg have [simp]: "integrable M (\M'. real (\\<^sup>+ x. - f x \M'))" + from f_neg have [simp]: "integrable M (\M'. real_of_ereal (\\<^sup>+ x. - f x \M'))" by(simp add: int_mf real_integrable_def nn_integral_nonneg real_of_ereal[symmetric] nn_integral_0_iff_AE[THEN iffD2] del: real_of_ereal) from \?integrable\ @@ -958,15 +958,15 @@ ((\\<^sup>+ M'. \\<^sup>+ x. f x \M' \M) - (\\<^sup>+ M'. - \\<^sup>+ x. f x \M' \M)) - ((\\<^sup>+ M'. \\<^sup>+ x. - f x \M' \M) - (\\<^sup>+ M'. - \\<^sup>+ x. - f x \M' \M))" by(subst (7 11) nn_integral_0_iff_AE[THEN iffD2])(simp_all add: nn_integral_nonneg) - also have "(\\<^sup>+ M'. \\<^sup>+ x. f x \M' \M) - (\\<^sup>+ M'. - \\<^sup>+ x. f x \M' \M) = \ M'. real (\\<^sup>+ x. f x \M') \M" + also have "(\\<^sup>+ M'. \\<^sup>+ x. f x \M' \M) - (\\<^sup>+ M'. - \\<^sup>+ x. f x \M' \M) = \ M'. real_of_ereal (\\<^sup>+ x. f x \M') \M" using f_pos by(simp add: real_lebesgue_integral_def)(simp add: ereal_minus(1)[symmetric] ereal_real int_f nn_integral_nonneg nn_integral_0_iff_AE[THEN iffD2] real_of_ereal_pos zero_ereal_def[symmetric]) - also have "(\\<^sup>+ M'. \\<^sup>+ x. - f x \M' \M) - (\\<^sup>+ M'. - \\<^sup>+ x. - f x \M' \M) = \ M'. real (\\<^sup>+ x. - f x \M') \M" + also have "(\\<^sup>+ M'. \\<^sup>+ x. - f x \M' \M) - (\\<^sup>+ M'. - \\<^sup>+ x. - f x \M' \M) = \ M'. real_of_ereal (\\<^sup>+ x. - f x \M') \M" using f_neg by(simp add: real_lebesgue_integral_def)(simp add: ereal_minus(1)[symmetric] ereal_real int_mf nn_integral_nonneg nn_integral_0_iff_AE[THEN iffD2] real_of_ereal_pos zero_ereal_def[symmetric]) also note ereal_minus(1) - also have "(\ M'. real (\\<^sup>+ x. f x \M') \M) - (\ M'. real (\\<^sup>+ x. - f x \M') \M) = - \M'. real (\\<^sup>+ x. f x \M') - real (\\<^sup>+ x. - f x \M') \M" + also have "(\ M'. real_of_ereal (\\<^sup>+ x. f x \M') \M) - (\ M'. real_of_ereal (\\<^sup>+ x. - f x \M') \M) = + \M'. real_of_ereal (\\<^sup>+ x. f x \M') - real_of_ereal (\\<^sup>+ x. - f x \M') \M" by simp also have "\ = \M'. \ x. f x \M' \M" using _ _ M_bounded proof(rule integral_cong_AE[OF _ _ AE_mp[OF _ AE_I2], rule_format]) @@ -982,7 +982,7 @@ hence [simp]: "space M' = space N" by(rule sets_eq_imp_space_eq) have "integrable M' f" by(rule integrable_const_bound[where B=B])(auto simp add: f_bounded) - then show "real (\\<^sup>+ x. f x \M') - real (\\<^sup>+ x. - f x \M') = \ x. f x \M'" + then show "real_of_ereal (\\<^sup>+ x. f x \M') - real_of_ereal (\\<^sup>+ x. - f x \M') = \ x. f x \M'" by(simp add: real_lebesgue_integral_def) qed simp_all finally show ?integral by simp