65 let ?h = "\<lambda>x. \<Sum>i. n i * indicator (A i) x" |
65 let ?h = "\<lambda>x. \<Sum>i. n i * indicator (A i) x" |
66 show ?thesis |
66 show ?thesis |
67 proof (safe intro!: bexI[of _ ?h] del: notI) |
67 proof (safe intro!: bexI[of _ ?h] del: notI) |
68 have "\<And>i. A i \<in> sets M" |
68 have "\<And>i. A i \<in> sets M" |
69 using range by fastforce+ |
69 using range by fastforce+ |
70 then have "integral\<^isup>P M ?h = (\<Sum>i. n i * emeasure M (A i))" using pos |
70 then have "integral\<^sup>P M ?h = (\<Sum>i. n i * emeasure M (A i))" using pos |
71 by (simp add: positive_integral_suminf positive_integral_cmult_indicator) |
71 by (simp add: positive_integral_suminf positive_integral_cmult_indicator) |
72 also have "\<dots> \<le> (\<Sum>i. (1 / 2)^Suc i)" |
72 also have "\<dots> \<le> (\<Sum>i. (1 / 2)^Suc i)" |
73 proof (rule suminf_le_pos) |
73 proof (rule suminf_le_pos) |
74 fix N |
74 fix N |
75 have "n N * emeasure M (A N) \<le> inverse (2^Suc N * emeasure M (A N)) * emeasure M (A N)" |
75 have "n N * emeasure M (A N) \<le> inverse (2^Suc N * emeasure M (A N)) * emeasure M (A N)" |
80 by (cases rule: ereal2_cases[of "n N" "emeasure M (A N)"]) |
80 by (cases rule: ereal2_cases[of "n N" "emeasure M (A N)"]) |
81 (simp_all add: inverse_eq_divide power_divide one_ereal_def ereal_power_divide) |
81 (simp_all add: inverse_eq_divide power_divide one_ereal_def ereal_power_divide) |
82 finally show "n N * emeasure M (A N) \<le> (1 / 2) ^ Suc N" . |
82 finally show "n N * emeasure M (A N) \<le> (1 / 2) ^ Suc N" . |
83 show "0 \<le> n N * emeasure M (A N)" using n[of N] `A N \<in> sets M` by (simp add: emeasure_nonneg) |
83 show "0 \<le> n N * emeasure M (A N)" using n[of N] `A N \<in> sets M` by (simp add: emeasure_nonneg) |
84 qed |
84 qed |
85 finally show "integral\<^isup>P M ?h \<noteq> \<infinity>" unfolding suminf_half_series_ereal by auto |
85 finally show "integral\<^sup>P M ?h \<noteq> \<infinity>" unfolding suminf_half_series_ereal by auto |
86 next |
86 next |
87 { fix x assume "x \<in> space M" |
87 { fix x assume "x \<in> space M" |
88 then obtain i where "x \<in> A i" using space[symmetric] by auto |
88 then obtain i where "x \<in> A i" using space[symmetric] by auto |
89 with disjoint n have "?h x = n i" |
89 with disjoint n have "?h x = n i" |
90 by (auto intro!: suminf_cmult_indicator intro: less_imp_le) |
90 by (auto intro!: suminf_cmult_indicator intro: less_imp_le) |
292 assumes "finite_measure N" and sets_eq: "sets N = sets M" |
292 assumes "finite_measure N" and sets_eq: "sets N = sets M" |
293 assumes "absolutely_continuous M N" |
293 assumes "absolutely_continuous M N" |
294 shows "\<exists>f \<in> borel_measurable M. (\<forall>x. 0 \<le> f x) \<and> density M f = N" |
294 shows "\<exists>f \<in> borel_measurable M. (\<forall>x. 0 \<le> f x) \<and> density M f = N" |
295 proof - |
295 proof - |
296 interpret N: finite_measure N by fact |
296 interpret N: finite_measure N by fact |
297 def G \<equiv> "{g \<in> borel_measurable M. (\<forall>x. 0 \<le> g x) \<and> (\<forall>A\<in>sets M. (\<integral>\<^isup>+x. g x * indicator A x \<partial>M) \<le> N A)}" |
297 def G \<equiv> "{g \<in> borel_measurable M. (\<forall>x. 0 \<le> g x) \<and> (\<forall>A\<in>sets M. (\<integral>\<^sup>+x. g x * indicator A x \<partial>M) \<le> N A)}" |
298 { fix f have "f \<in> G \<Longrightarrow> f \<in> borel_measurable M" by (auto simp: G_def) } |
298 { fix f have "f \<in> G \<Longrightarrow> f \<in> borel_measurable M" by (auto simp: G_def) } |
299 note this[measurable_dest] |
299 note this[measurable_dest] |
300 have "(\<lambda>x. 0) \<in> G" unfolding G_def by auto |
300 have "(\<lambda>x. 0) \<in> G" unfolding G_def by auto |
301 hence "G \<noteq> {}" by auto |
301 hence "G \<noteq> {}" by auto |
302 { fix f g assume f: "f \<in> G" and g: "g \<in> G" |
302 { fix f g assume f: "f \<in> G" and g: "g \<in> G" |
311 have union: "((?A \<inter> A) \<union> ((space M - ?A) \<inter> A)) = A" |
311 have union: "((?A \<inter> A) \<union> ((space M - ?A) \<inter> A)) = A" |
312 using sets.sets_into_space[OF `A \<in> sets M`] by auto |
312 using sets.sets_into_space[OF `A \<in> sets M`] by auto |
313 have "\<And>x. x \<in> space M \<Longrightarrow> max (g x) (f x) * indicator A x = |
313 have "\<And>x. x \<in> space M \<Longrightarrow> max (g x) (f x) * indicator A x = |
314 g x * indicator (?A \<inter> A) x + f x * indicator ((space M - ?A) \<inter> A) x" |
314 g x * indicator (?A \<inter> A) x + f x * indicator ((space M - ?A) \<inter> A) x" |
315 by (auto simp: indicator_def max_def) |
315 by (auto simp: indicator_def max_def) |
316 hence "(\<integral>\<^isup>+x. max (g x) (f x) * indicator A x \<partial>M) = |
316 hence "(\<integral>\<^sup>+x. max (g x) (f x) * indicator A x \<partial>M) = |
317 (\<integral>\<^isup>+x. g x * indicator (?A \<inter> A) x \<partial>M) + |
317 (\<integral>\<^sup>+x. g x * indicator (?A \<inter> A) x \<partial>M) + |
318 (\<integral>\<^isup>+x. f x * indicator ((space M - ?A) \<inter> A) x \<partial>M)" |
318 (\<integral>\<^sup>+x. f x * indicator ((space M - ?A) \<inter> A) x \<partial>M)" |
319 using f g sets unfolding G_def |
319 using f g sets unfolding G_def |
320 by (auto cong: positive_integral_cong intro!: positive_integral_add) |
320 by (auto cong: positive_integral_cong intro!: positive_integral_add) |
321 also have "\<dots> \<le> N (?A \<inter> A) + N ((space M - ?A) \<inter> A)" |
321 also have "\<dots> \<le> N (?A \<inter> A) + N ((space M - ?A) \<inter> A)" |
322 using f g sets unfolding G_def by (auto intro!: add_mono) |
322 using f g sets unfolding G_def by (auto intro!: add_mono) |
323 also have "\<dots> = N A" |
323 also have "\<dots> = N A" |
324 using plus_emeasure[OF sets'] union by auto |
324 using plus_emeasure[OF sets'] union by auto |
325 finally show "(\<integral>\<^isup>+x. max (g x) (f x) * indicator A x \<partial>M) \<le> N A" . |
325 finally show "(\<integral>\<^sup>+x. max (g x) (f x) * indicator A x \<partial>M) \<le> N A" . |
326 next |
326 next |
327 fix x show "0 \<le> max (g x) (f x)" using f g by (auto simp: G_def split: split_max) |
327 fix x show "0 \<le> max (g x) (f x)" using f g by (auto simp: G_def split: split_max) |
328 qed } |
328 qed } |
329 note max_in_G = this |
329 note max_in_G = this |
330 { fix f assume "incseq f" and f: "\<And>i. f i \<in> G" |
330 { fix f assume "incseq f" and f: "\<And>i. f i \<in> G" |
334 show "(\<lambda>x. SUP i. f i x) \<in> borel_measurable M" by measurable |
334 show "(\<lambda>x. SUP i. f i x) \<in> borel_measurable M" by measurable |
335 { fix x show "0 \<le> (SUP i. f i x)" |
335 { fix x show "0 \<le> (SUP i. f i x)" |
336 using f by (auto simp: G_def intro: SUP_upper2) } |
336 using f by (auto simp: G_def intro: SUP_upper2) } |
337 next |
337 next |
338 fix A assume "A \<in> sets M" |
338 fix A assume "A \<in> sets M" |
339 have "(\<integral>\<^isup>+x. (SUP i. f i x) * indicator A x \<partial>M) = |
339 have "(\<integral>\<^sup>+x. (SUP i. f i x) * indicator A x \<partial>M) = |
340 (\<integral>\<^isup>+x. (SUP i. f i x * indicator A x) \<partial>M)" |
340 (\<integral>\<^sup>+x. (SUP i. f i x * indicator A x) \<partial>M)" |
341 by (intro positive_integral_cong) (simp split: split_indicator) |
341 by (intro positive_integral_cong) (simp split: split_indicator) |
342 also have "\<dots> = (SUP i. (\<integral>\<^isup>+x. f i x * indicator A x \<partial>M))" |
342 also have "\<dots> = (SUP i. (\<integral>\<^sup>+x. f i x * indicator A x \<partial>M))" |
343 using `incseq f` f `A \<in> sets M` |
343 using `incseq f` f `A \<in> sets M` |
344 by (intro positive_integral_monotone_convergence_SUP) |
344 by (intro positive_integral_monotone_convergence_SUP) |
345 (auto simp: G_def incseq_Suc_iff le_fun_def split: split_indicator) |
345 (auto simp: G_def incseq_Suc_iff le_fun_def split: split_indicator) |
346 finally show "(\<integral>\<^isup>+x. (SUP i. f i x) * indicator A x \<partial>M) \<le> N A" |
346 finally show "(\<integral>\<^sup>+x. (SUP i. f i x) * indicator A x \<partial>M) \<le> N A" |
347 using f `A \<in> sets M` by (auto intro!: SUP_least simp: G_def) |
347 using f `A \<in> sets M` by (auto intro!: SUP_least simp: G_def) |
348 qed } |
348 qed } |
349 note SUP_in_G = this |
349 note SUP_in_G = this |
350 let ?y = "SUP g : G. integral\<^isup>P M g" |
350 let ?y = "SUP g : G. integral\<^sup>P M g" |
351 have y_le: "?y \<le> N (space M)" unfolding G_def |
351 have y_le: "?y \<le> N (space M)" unfolding G_def |
352 proof (safe intro!: SUP_least) |
352 proof (safe intro!: SUP_least) |
353 fix g assume "\<forall>A\<in>sets M. (\<integral>\<^isup>+x. g x * indicator A x \<partial>M) \<le> N A" |
353 fix g assume "\<forall>A\<in>sets M. (\<integral>\<^sup>+x. g x * indicator A x \<partial>M) \<le> N A" |
354 from this[THEN bspec, OF sets.top] show "integral\<^isup>P M g \<le> N (space M)" |
354 from this[THEN bspec, OF sets.top] show "integral\<^sup>P M g \<le> N (space M)" |
355 by (simp cong: positive_integral_cong) |
355 by (simp cong: positive_integral_cong) |
356 qed |
356 qed |
357 from SUPR_countable_SUPR[OF `G \<noteq> {}`, of "integral\<^isup>P M"] guess ys .. note ys = this |
357 from SUPR_countable_SUPR[OF `G \<noteq> {}`, of "integral\<^sup>P M"] guess ys .. note ys = this |
358 then have "\<forall>n. \<exists>g. g\<in>G \<and> integral\<^isup>P M g = ys n" |
358 then have "\<forall>n. \<exists>g. g\<in>G \<and> integral\<^sup>P M g = ys n" |
359 proof safe |
359 proof safe |
360 fix n assume "range ys \<subseteq> integral\<^isup>P M ` G" |
360 fix n assume "range ys \<subseteq> integral\<^sup>P M ` G" |
361 hence "ys n \<in> integral\<^isup>P M ` G" by auto |
361 hence "ys n \<in> integral\<^sup>P M ` G" by auto |
362 thus "\<exists>g. g\<in>G \<and> integral\<^isup>P M g = ys n" by auto |
362 thus "\<exists>g. g\<in>G \<and> integral\<^sup>P M g = ys n" by auto |
363 qed |
363 qed |
364 from choice[OF this] obtain gs where "\<And>i. gs i \<in> G" "\<And>n. integral\<^isup>P M (gs n) = ys n" by auto |
364 from choice[OF this] obtain gs where "\<And>i. gs i \<in> G" "\<And>n. integral\<^sup>P M (gs n) = ys n" by auto |
365 hence y_eq: "?y = (SUP i. integral\<^isup>P M (gs i))" using ys by auto |
365 hence y_eq: "?y = (SUP i. integral\<^sup>P M (gs i))" using ys by auto |
366 let ?g = "\<lambda>i x. Max ((\<lambda>n. gs n x) ` {..i})" |
366 let ?g = "\<lambda>i x. Max ((\<lambda>n. gs n x) ` {..i})" |
367 def f \<equiv> "\<lambda>x. SUP i. ?g i x" |
367 def f \<equiv> "\<lambda>x. SUP i. ?g i x" |
368 let ?F = "\<lambda>A x. f x * indicator A x" |
368 let ?F = "\<lambda>A x. f x * indicator A x" |
369 have gs_not_empty: "\<And>i x. (\<lambda>n. gs n x) ` {..i} \<noteq> {}" by auto |
369 have gs_not_empty: "\<And>i x. (\<lambda>n. gs n x) ` {..i} \<noteq> {}" by auto |
370 { fix i have "?g i \<in> G" |
370 { fix i have "?g i \<in> G" |
378 note g_in_G = this |
378 note g_in_G = this |
379 have "incseq ?g" using gs_not_empty |
379 have "incseq ?g" using gs_not_empty |
380 by (auto intro!: incseq_SucI le_funI simp add: atMost_Suc) |
380 by (auto intro!: incseq_SucI le_funI simp add: atMost_Suc) |
381 from SUP_in_G[OF this g_in_G] have [measurable]: "f \<in> G" unfolding f_def . |
381 from SUP_in_G[OF this g_in_G] have [measurable]: "f \<in> G" unfolding f_def . |
382 then have [simp, intro]: "f \<in> borel_measurable M" unfolding G_def by auto |
382 then have [simp, intro]: "f \<in> borel_measurable M" unfolding G_def by auto |
383 have "integral\<^isup>P M f = (SUP i. integral\<^isup>P M (?g i))" unfolding f_def |
383 have "integral\<^sup>P M f = (SUP i. integral\<^sup>P M (?g i))" unfolding f_def |
384 using g_in_G `incseq ?g` |
384 using g_in_G `incseq ?g` |
385 by (auto intro!: positive_integral_monotone_convergence_SUP simp: G_def) |
385 by (auto intro!: positive_integral_monotone_convergence_SUP simp: G_def) |
386 also have "\<dots> = ?y" |
386 also have "\<dots> = ?y" |
387 proof (rule antisym) |
387 proof (rule antisym) |
388 show "(SUP i. integral\<^isup>P M (?g i)) \<le> ?y" |
388 show "(SUP i. integral\<^sup>P M (?g i)) \<le> ?y" |
389 using g_in_G by (auto intro: Sup_mono simp: SUP_def) |
389 using g_in_G by (auto intro: Sup_mono simp: SUP_def) |
390 show "?y \<le> (SUP i. integral\<^isup>P M (?g i))" unfolding y_eq |
390 show "?y \<le> (SUP i. integral\<^sup>P M (?g i))" unfolding y_eq |
391 by (auto intro!: SUP_mono positive_integral_mono Max_ge) |
391 by (auto intro!: SUP_mono positive_integral_mono Max_ge) |
392 qed |
392 qed |
393 finally have int_f_eq_y: "integral\<^isup>P M f = ?y" . |
393 finally have int_f_eq_y: "integral\<^sup>P M f = ?y" . |
394 have "\<And>x. 0 \<le> f x" |
394 have "\<And>x. 0 \<le> f x" |
395 unfolding f_def using `\<And>i. gs i \<in> G` |
395 unfolding f_def using `\<And>i. gs i \<in> G` |
396 by (auto intro!: SUP_upper2 Max_ge_iff[THEN iffD2] simp: G_def) |
396 by (auto intro!: SUP_upper2 Max_ge_iff[THEN iffD2] simp: G_def) |
397 let ?t = "\<lambda>A. N A - (\<integral>\<^isup>+x. ?F A x \<partial>M)" |
397 let ?t = "\<lambda>A. N A - (\<integral>\<^sup>+x. ?F A x \<partial>M)" |
398 let ?M = "diff_measure N (density M f)" |
398 let ?M = "diff_measure N (density M f)" |
399 have f_le_N: "\<And>A. A \<in> sets M \<Longrightarrow> (\<integral>\<^isup>+x. ?F A x \<partial>M) \<le> N A" |
399 have f_le_N: "\<And>A. A \<in> sets M \<Longrightarrow> (\<integral>\<^sup>+x. ?F A x \<partial>M) \<le> N A" |
400 using `f \<in> G` unfolding G_def by auto |
400 using `f \<in> G` unfolding G_def by auto |
401 have emeasure_M: "\<And>A. A \<in> sets M \<Longrightarrow> emeasure ?M A = ?t A" |
401 have emeasure_M: "\<And>A. A \<in> sets M \<Longrightarrow> emeasure ?M A = ?t A" |
402 proof (subst emeasure_diff_measure) |
402 proof (subst emeasure_diff_measure) |
403 from f_le_N[of "space M"] show "finite_measure N" "finite_measure (density M f)" |
403 from f_le_N[of "space M"] show "finite_measure N" "finite_measure (density M f)" |
404 by (auto intro!: finite_measureI simp: emeasure_density cong: positive_integral_cong) |
404 by (auto intro!: finite_measureI simp: emeasure_density cong: positive_integral_cong) |
413 have ac: "absolutely_continuous M ?M" unfolding absolutely_continuous_def |
413 have ac: "absolutely_continuous M ?M" unfolding absolutely_continuous_def |
414 proof |
414 proof |
415 fix A assume A: "A \<in> null_sets M" |
415 fix A assume A: "A \<in> null_sets M" |
416 with `absolutely_continuous M N` have "A \<in> null_sets N" |
416 with `absolutely_continuous M N` have "A \<in> null_sets N" |
417 unfolding absolutely_continuous_def by auto |
417 unfolding absolutely_continuous_def by auto |
418 moreover with A have "(\<integral>\<^isup>+ x. ?F A x \<partial>M) \<le> N A" using `f \<in> G` by (auto simp: G_def) |
418 moreover with A have "(\<integral>\<^sup>+ x. ?F A x \<partial>M) \<le> N A" using `f \<in> G` by (auto simp: G_def) |
419 ultimately have "N A - (\<integral>\<^isup>+ x. ?F A x \<partial>M) = 0" |
419 ultimately have "N A - (\<integral>\<^sup>+ x. ?F A x \<partial>M) = 0" |
420 using positive_integral_positive[of M] by (auto intro!: antisym) |
420 using positive_integral_positive[of M] by (auto intro!: antisym) |
421 then show "A \<in> null_sets ?M" |
421 then show "A \<in> null_sets ?M" |
422 using A by (simp add: emeasure_M null_sets_def sets_eq) |
422 using A by (simp add: emeasure_M null_sets_def sets_eq) |
423 qed |
423 qed |
424 have upper_bound: "\<forall>A\<in>sets M. ?M A \<le> 0" |
424 have upper_bound: "\<forall>A\<in>sets M. ?M A \<le> 0" |
434 then have "emeasure M (space M) \<noteq> 0" |
434 then have "emeasure M (space M) \<noteq> 0" |
435 using ac unfolding absolutely_continuous_def by (auto simp: null_sets_def) |
435 using ac unfolding absolutely_continuous_def by (auto simp: null_sets_def) |
436 then have pos_M: "0 < emeasure M (space M)" |
436 then have pos_M: "0 < emeasure M (space M)" |
437 using emeasure_nonneg[of M "space M"] by (simp add: le_less) |
437 using emeasure_nonneg[of M "space M"] by (simp add: le_less) |
438 moreover |
438 moreover |
439 have "(\<integral>\<^isup>+x. f x * indicator (space M) x \<partial>M) \<le> N (space M)" |
439 have "(\<integral>\<^sup>+x. f x * indicator (space M) x \<partial>M) \<le> N (space M)" |
440 using `f \<in> G` unfolding G_def by auto |
440 using `f \<in> G` unfolding G_def by auto |
441 hence "(\<integral>\<^isup>+x. f x * indicator (space M) x \<partial>M) \<noteq> \<infinity>" |
441 hence "(\<integral>\<^sup>+x. f x * indicator (space M) x \<partial>M) \<noteq> \<infinity>" |
442 using M'.finite_emeasure_space by auto |
442 using M'.finite_emeasure_space by auto |
443 moreover |
443 moreover |
444 def b \<equiv> "?M (space M) / emeasure M (space M) / 2" |
444 def b \<equiv> "?M (space M) / emeasure M (space M) / 2" |
445 ultimately have b: "b \<noteq> 0 \<and> 0 \<le> b \<and> b \<noteq> \<infinity>" |
445 ultimately have b: "b \<noteq> 0 \<and> 0 \<le> b \<and> b \<noteq> \<infinity>" |
446 by (auto simp: ereal_divide_eq) |
446 by (auto simp: ereal_divide_eq) |
458 using b unfolding M'.emeasure_eq_measure emeasure_eq_measure by (cases b) auto } |
458 using b unfolding M'.emeasure_eq_measure emeasure_eq_measure by (cases b) auto } |
459 note bM_le_t = this |
459 note bM_le_t = this |
460 let ?f0 = "\<lambda>x. f x + b * indicator A0 x" |
460 let ?f0 = "\<lambda>x. f x + b * indicator A0 x" |
461 { fix A assume A: "A \<in> sets M" |
461 { fix A assume A: "A \<in> sets M" |
462 hence "A \<inter> A0 \<in> sets M" using `A0 \<in> sets M` by auto |
462 hence "A \<inter> A0 \<in> sets M" using `A0 \<in> sets M` by auto |
463 have "(\<integral>\<^isup>+x. ?f0 x * indicator A x \<partial>M) = |
463 have "(\<integral>\<^sup>+x. ?f0 x * indicator A x \<partial>M) = |
464 (\<integral>\<^isup>+x. f x * indicator A x + b * indicator (A \<inter> A0) x \<partial>M)" |
464 (\<integral>\<^sup>+x. f x * indicator A x + b * indicator (A \<inter> A0) x \<partial>M)" |
465 by (auto intro!: positive_integral_cong split: split_indicator) |
465 by (auto intro!: positive_integral_cong split: split_indicator) |
466 hence "(\<integral>\<^isup>+x. ?f0 x * indicator A x \<partial>M) = |
466 hence "(\<integral>\<^sup>+x. ?f0 x * indicator A x \<partial>M) = |
467 (\<integral>\<^isup>+x. f x * indicator A x \<partial>M) + b * emeasure M (A \<inter> A0)" |
467 (\<integral>\<^sup>+x. f x * indicator A x \<partial>M) + b * emeasure M (A \<inter> A0)" |
468 using `A0 \<in> sets M` `A \<inter> A0 \<in> sets M` A b `f \<in> G` |
468 using `A0 \<in> sets M` `A \<inter> A0 \<in> sets M` A b `f \<in> G` |
469 by (simp add: positive_integral_add positive_integral_cmult_indicator G_def) } |
469 by (simp add: positive_integral_add positive_integral_cmult_indicator G_def) } |
470 note f0_eq = this |
470 note f0_eq = this |
471 { fix A assume A: "A \<in> sets M" |
471 { fix A assume A: "A \<in> sets M" |
472 hence "A \<inter> A0 \<in> sets M" using `A0 \<in> sets M` by auto |
472 hence "A \<inter> A0 \<in> sets M" using `A0 \<in> sets M` by auto |
473 have f_le_v: "(\<integral>\<^isup>+x. ?F A x \<partial>M) \<le> N A" using `f \<in> G` A unfolding G_def by auto |
473 have f_le_v: "(\<integral>\<^sup>+x. ?F A x \<partial>M) \<le> N A" using `f \<in> G` A unfolding G_def by auto |
474 note f0_eq[OF A] |
474 note f0_eq[OF A] |
475 also have "(\<integral>\<^isup>+x. ?F A x \<partial>M) + b * emeasure M (A \<inter> A0) \<le> (\<integral>\<^isup>+x. ?F A x \<partial>M) + ?M (A \<inter> A0)" |
475 also have "(\<integral>\<^sup>+x. ?F A x \<partial>M) + b * emeasure M (A \<inter> A0) \<le> (\<integral>\<^sup>+x. ?F A x \<partial>M) + ?M (A \<inter> A0)" |
476 using bM_le_t[OF `A \<inter> A0 \<in> sets M`] `A \<in> sets M` `A0 \<in> sets M` |
476 using bM_le_t[OF `A \<inter> A0 \<in> sets M`] `A \<in> sets M` `A0 \<in> sets M` |
477 by (auto intro!: add_left_mono) |
477 by (auto intro!: add_left_mono) |
478 also have "\<dots> \<le> (\<integral>\<^isup>+x. f x * indicator A x \<partial>M) + ?M A" |
478 also have "\<dots> \<le> (\<integral>\<^sup>+x. f x * indicator A x \<partial>M) + ?M A" |
479 using emeasure_mono[of "A \<inter> A0" A ?M] `A \<in> sets M` `A0 \<in> sets M` |
479 using emeasure_mono[of "A \<inter> A0" A ?M] `A \<in> sets M` `A0 \<in> sets M` |
480 by (auto intro!: add_left_mono simp: sets_eq) |
480 by (auto intro!: add_left_mono simp: sets_eq) |
481 also have "\<dots> \<le> N A" |
481 also have "\<dots> \<le> N A" |
482 unfolding emeasure_M[OF `A \<in> sets M`] |
482 unfolding emeasure_M[OF `A \<in> sets M`] |
483 using f_le_v N.emeasure_eq_measure[of A] positive_integral_positive[of M "?F A"] |
483 using f_le_v N.emeasure_eq_measure[of A] positive_integral_positive[of M "?F A"] |
484 by (cases "\<integral>\<^isup>+x. ?F A x \<partial>M", cases "N A") auto |
484 by (cases "\<integral>\<^sup>+x. ?F A x \<partial>M", cases "N A") auto |
485 finally have "(\<integral>\<^isup>+x. ?f0 x * indicator A x \<partial>M) \<le> N A" . } |
485 finally have "(\<integral>\<^sup>+x. ?f0 x * indicator A x \<partial>M) \<le> N A" . } |
486 hence "?f0 \<in> G" using `A0 \<in> sets M` b `f \<in> G` |
486 hence "?f0 \<in> G" using `A0 \<in> sets M` b `f \<in> G` |
487 by (auto intro!: ereal_add_nonneg_nonneg simp: G_def) |
487 by (auto intro!: ereal_add_nonneg_nonneg simp: G_def) |
488 have int_f_finite: "integral\<^isup>P M f \<noteq> \<infinity>" |
488 have int_f_finite: "integral\<^sup>P M f \<noteq> \<infinity>" |
489 by (metis N.emeasure_finite ereal_infty_less_eq2(1) int_f_eq_y y_le) |
489 by (metis N.emeasure_finite ereal_infty_less_eq2(1) int_f_eq_y y_le) |
490 have "0 < ?M (space M) - emeasure ?Mb (space M)" |
490 have "0 < ?M (space M) - emeasure ?Mb (space M)" |
491 using pos_t |
491 using pos_t |
492 by (simp add: b emeasure_density_const) |
492 by (simp add: b emeasure_density_const) |
493 (simp add: M'.emeasure_eq_measure emeasure_eq_measure pos_M b_def) |
493 (simp add: M'.emeasure_eq_measure emeasure_eq_measure pos_M b_def) |
502 ereal_mult_eq_MInfty ereal_mult_eq_PInfty ereal_zero_less_0_iff less_eq_ereal_def) |
502 ereal_mult_eq_MInfty ereal_mult_eq_PInfty ereal_zero_less_0_iff less_eq_ereal_def) |
503 then have "emeasure M A0 \<noteq> 0" using ac `A0 \<in> sets M` |
503 then have "emeasure M A0 \<noteq> 0" using ac `A0 \<in> sets M` |
504 by (auto simp: absolutely_continuous_def null_sets_def) |
504 by (auto simp: absolutely_continuous_def null_sets_def) |
505 then have "0 < emeasure M A0" using emeasure_nonneg[of M A0] by auto |
505 then have "0 < emeasure M A0" using emeasure_nonneg[of M A0] by auto |
506 hence "0 < b * emeasure M A0" using b by (auto simp: ereal_zero_less_0_iff) |
506 hence "0 < b * emeasure M A0" using b by (auto simp: ereal_zero_less_0_iff) |
507 with int_f_finite have "?y + 0 < integral\<^isup>P M f + b * emeasure M A0" unfolding int_f_eq_y |
507 with int_f_finite have "?y + 0 < integral\<^sup>P M f + b * emeasure M A0" unfolding int_f_eq_y |
508 using `f \<in> G` |
508 using `f \<in> G` |
509 by (intro ereal_add_strict_mono) (auto intro!: SUP_upper2 positive_integral_positive) |
509 by (intro ereal_add_strict_mono) (auto intro!: SUP_upper2 positive_integral_positive) |
510 also have "\<dots> = integral\<^isup>P M ?f0" using f0_eq[OF sets.top] `A0 \<in> sets M` sets.sets_into_space |
510 also have "\<dots> = integral\<^sup>P M ?f0" using f0_eq[OF sets.top] `A0 \<in> sets M` sets.sets_into_space |
511 by (simp cong: positive_integral_cong) |
511 by (simp cong: positive_integral_cong) |
512 finally have "?y < integral\<^isup>P M ?f0" by simp |
512 finally have "?y < integral\<^sup>P M ?f0" by simp |
513 moreover from `?f0 \<in> G` have "integral\<^isup>P M ?f0 \<le> ?y" by (auto intro!: SUP_upper) |
513 moreover from `?f0 \<in> G` have "integral\<^sup>P M ?f0 \<le> ?y" by (auto intro!: SUP_upper) |
514 ultimately show False by auto |
514 ultimately show False by auto |
515 qed |
515 qed |
516 let ?f = "\<lambda>x. max 0 (f x)" |
516 let ?f = "\<lambda>x. max 0 (f x)" |
517 show ?thesis |
517 show ?thesis |
518 proof (intro bexI[of _ ?f] measure_eqI conjI) |
518 proof (intro bexI[of _ ?f] measure_eqI conjI) |
519 show "sets (density M ?f) = sets N" |
519 show "sets (density M ?f) = sets N" |
520 by (simp add: sets_eq) |
520 by (simp add: sets_eq) |
521 fix A assume A: "A\<in>sets (density M ?f)" |
521 fix A assume A: "A\<in>sets (density M ?f)" |
522 then show "emeasure (density M ?f) A = emeasure N A" |
522 then show "emeasure (density M ?f) A = emeasure N A" |
523 using `f \<in> G` A upper_bound[THEN bspec, of A] N.emeasure_eq_measure[of A] |
523 using `f \<in> G` A upper_bound[THEN bspec, of A] N.emeasure_eq_measure[of A] |
524 by (cases "integral\<^isup>P M (?F A)") |
524 by (cases "integral\<^sup>P M (?F A)") |
525 (auto intro!: antisym simp add: emeasure_density G_def emeasure_M density_max_0[symmetric]) |
525 (auto intro!: antisym simp add: emeasure_density G_def emeasure_M density_max_0[symmetric]) |
526 qed auto |
526 qed auto |
527 qed |
527 qed |
528 |
528 |
529 lemma (in finite_measure) split_space_into_finite_sets_and_rest: |
529 lemma (in finite_measure) split_space_into_finite_sets_and_rest: |
684 from choice[OF this[unfolded Bex_def]] |
684 from choice[OF this[unfolded Bex_def]] |
685 obtain f where borel: "\<And>i. f i \<in> borel_measurable M" "\<And>i x. 0 \<le> f i x" |
685 obtain f where borel: "\<And>i. f i \<in> borel_measurable M" "\<And>i x. 0 \<le> f i x" |
686 and f_density: "\<And>i. density (?M i) (f i) = ?N i" |
686 and f_density: "\<And>i. density (?M i) (f i) = ?N i" |
687 by auto |
687 by auto |
688 { fix A i assume A: "A \<in> sets M" |
688 { fix A i assume A: "A \<in> sets M" |
689 with Q borel have "(\<integral>\<^isup>+x. f i x * indicator (Q i \<inter> A) x \<partial>M) = emeasure (density (?M i) (f i)) A" |
689 with Q borel have "(\<integral>\<^sup>+x. f i x * indicator (Q i \<inter> A) x \<partial>M) = emeasure (density (?M i) (f i)) A" |
690 by (auto simp add: emeasure_density positive_integral_density subset_eq |
690 by (auto simp add: emeasure_density positive_integral_density subset_eq |
691 intro!: positive_integral_cong split: split_indicator) |
691 intro!: positive_integral_cong split: split_indicator) |
692 also have "\<dots> = emeasure N (Q i \<inter> A)" |
692 also have "\<dots> = emeasure N (Q i \<inter> A)" |
693 using A Q by (simp add: f_density emeasure_restricted subset_eq sets_eq) |
693 using A Q by (simp add: f_density emeasure_restricted subset_eq sets_eq) |
694 finally have "emeasure N (Q i \<inter> A) = (\<integral>\<^isup>+x. f i x * indicator (Q i \<inter> A) x \<partial>M)" .. } |
694 finally have "emeasure N (Q i \<inter> A) = (\<integral>\<^sup>+x. f i x * indicator (Q i \<inter> A) x \<partial>M)" .. } |
695 note integral_eq = this |
695 note integral_eq = this |
696 let ?f = "\<lambda>x. (\<Sum>i. f i x * indicator (Q i) x) + \<infinity> * indicator Q0 x" |
696 let ?f = "\<lambda>x. (\<Sum>i. f i x * indicator (Q i) x) + \<infinity> * indicator Q0 x" |
697 show ?thesis |
697 show ?thesis |
698 proof (safe intro!: bexI[of _ ?f]) |
698 proof (safe intro!: bexI[of _ ?f]) |
699 show "?f \<in> borel_measurable M" using Q0 borel Q_sets |
699 show "?f \<in> borel_measurable M" using Q0 borel Q_sets |
705 then have "A \<in> sets M" by simp |
705 then have "A \<in> sets M" by simp |
706 have Qi: "\<And>i. Q i \<in> sets M" using Q by auto |
706 have Qi: "\<And>i. Q i \<in> sets M" using Q by auto |
707 have [intro,simp]: "\<And>i. (\<lambda>x. f i x * indicator (Q i \<inter> A) x) \<in> borel_measurable M" |
707 have [intro,simp]: "\<And>i. (\<lambda>x. f i x * indicator (Q i \<inter> A) x) \<in> borel_measurable M" |
708 "\<And>i. AE x in M. 0 \<le> f i x * indicator (Q i \<inter> A) x" |
708 "\<And>i. AE x in M. 0 \<le> f i x * indicator (Q i \<inter> A) x" |
709 using borel Qi Q0(1) `A \<in> sets M` by (auto intro!: borel_measurable_ereal_times) |
709 using borel Qi Q0(1) `A \<in> sets M` by (auto intro!: borel_measurable_ereal_times) |
710 have "(\<integral>\<^isup>+x. ?f x * indicator A x \<partial>M) = (\<integral>\<^isup>+x. (\<Sum>i. f i x * indicator (Q i \<inter> A) x) + \<infinity> * indicator (Q0 \<inter> A) x \<partial>M)" |
710 have "(\<integral>\<^sup>+x. ?f x * indicator A x \<partial>M) = (\<integral>\<^sup>+x. (\<Sum>i. f i x * indicator (Q i \<inter> A) x) + \<infinity> * indicator (Q0 \<inter> A) x \<partial>M)" |
711 using borel by (intro positive_integral_cong) (auto simp: indicator_def) |
711 using borel by (intro positive_integral_cong) (auto simp: indicator_def) |
712 also have "\<dots> = (\<integral>\<^isup>+x. (\<Sum>i. f i x * indicator (Q i \<inter> A) x) \<partial>M) + \<infinity> * emeasure M (Q0 \<inter> A)" |
712 also have "\<dots> = (\<integral>\<^sup>+x. (\<Sum>i. f i x * indicator (Q i \<inter> A) x) \<partial>M) + \<infinity> * emeasure M (Q0 \<inter> A)" |
713 using borel Qi Q0(1) `A \<in> sets M` |
713 using borel Qi Q0(1) `A \<in> sets M` |
714 by (subst positive_integral_add) (auto simp del: ereal_infty_mult |
714 by (subst positive_integral_add) (auto simp del: ereal_infty_mult |
715 simp add: positive_integral_cmult_indicator sets.Int intro!: suminf_0_le) |
715 simp add: positive_integral_cmult_indicator sets.Int intro!: suminf_0_le) |
716 also have "\<dots> = (\<Sum>i. N (Q i \<inter> A)) + \<infinity> * emeasure M (Q0 \<inter> A)" |
716 also have "\<dots> = (\<Sum>i. N (Q i \<inter> A)) + \<infinity> * emeasure M (Q0 \<inter> A)" |
717 by (subst integral_eq[OF `A \<in> sets M`], subst positive_integral_suminf) auto |
717 by (subst integral_eq[OF `A \<in> sets M`], subst positive_integral_suminf) auto |
718 finally have "(\<integral>\<^isup>+x. ?f x * indicator A x \<partial>M) = (\<Sum>i. N (Q i \<inter> A)) + \<infinity> * emeasure M (Q0 \<inter> A)" . |
718 finally have "(\<integral>\<^sup>+x. ?f x * indicator A x \<partial>M) = (\<Sum>i. N (Q i \<inter> A)) + \<infinity> * emeasure M (Q0 \<inter> A)" . |
719 moreover have "(\<Sum>i. N (Q i \<inter> A)) = N ((\<Union>i. Q i) \<inter> A)" |
719 moreover have "(\<Sum>i. N (Q i \<inter> A)) = N ((\<Union>i. Q i) \<inter> A)" |
720 using Q Q_sets `A \<in> sets M` |
720 using Q Q_sets `A \<in> sets M` |
721 by (subst suminf_emeasure) (auto simp: disjoint_family_on_def sets_eq) |
721 by (subst suminf_emeasure) (auto simp: disjoint_family_on_def sets_eq) |
722 moreover have "\<infinity> * emeasure M (Q0 \<inter> A) = N (Q0 \<inter> A)" |
722 moreover have "\<infinity> * emeasure M (Q0 \<inter> A) = N (Q0 \<inter> A)" |
723 proof - |
723 proof - |
726 qed |
726 qed |
727 moreover have "Q0 \<inter> A \<in> sets M" "((\<Union>i. Q i) \<inter> A) \<in> sets M" |
727 moreover have "Q0 \<inter> A \<in> sets M" "((\<Union>i. Q i) \<inter> A) \<in> sets M" |
728 using Q_sets `A \<in> sets M` Q0(1) by auto |
728 using Q_sets `A \<in> sets M` Q0(1) by auto |
729 moreover have "((\<Union>i. Q i) \<inter> A) \<union> (Q0 \<inter> A) = A" "((\<Union>i. Q i) \<inter> A) \<inter> (Q0 \<inter> A) = {}" |
729 moreover have "((\<Union>i. Q i) \<inter> A) \<union> (Q0 \<inter> A) = A" "((\<Union>i. Q i) \<inter> A) \<inter> (Q0 \<inter> A) = {}" |
730 using `A \<in> sets M` sets.sets_into_space Q0 by auto |
730 using `A \<in> sets M` sets.sets_into_space Q0 by auto |
731 ultimately have "N A = (\<integral>\<^isup>+x. ?f x * indicator A x \<partial>M)" |
731 ultimately have "N A = (\<integral>\<^sup>+x. ?f x * indicator A x \<partial>M)" |
732 using plus_emeasure[of "(\<Union>i. Q i) \<inter> A" N "Q0 \<inter> A"] by (simp add: sets_eq) |
732 using plus_emeasure[of "(\<Union>i. Q i) \<inter> A" N "Q0 \<inter> A"] by (simp add: sets_eq) |
733 with `A \<in> sets M` borel Q Q0(1) show "emeasure (density M ?f) A = N A" |
733 with `A \<in> sets M` borel Q Q0(1) show "emeasure (density M ?f) A = N A" |
734 by (auto simp: subset_eq emeasure_density) |
734 by (auto simp: subset_eq emeasure_density) |
735 qed (simp add: sets_eq) |
735 qed (simp add: sets_eq) |
736 qed |
736 qed |
739 lemma (in sigma_finite_measure) Radon_Nikodym: |
739 lemma (in sigma_finite_measure) Radon_Nikodym: |
740 assumes ac: "absolutely_continuous M N" assumes sets_eq: "sets N = sets M" |
740 assumes ac: "absolutely_continuous M N" assumes sets_eq: "sets N = sets M" |
741 shows "\<exists>f \<in> borel_measurable M. (\<forall>x. 0 \<le> f x) \<and> density M f = N" |
741 shows "\<exists>f \<in> borel_measurable M. (\<forall>x. 0 \<le> f x) \<and> density M f = N" |
742 proof - |
742 proof - |
743 from Ex_finite_integrable_function |
743 from Ex_finite_integrable_function |
744 obtain h where finite: "integral\<^isup>P M h \<noteq> \<infinity>" and |
744 obtain h where finite: "integral\<^sup>P M h \<noteq> \<infinity>" and |
745 borel: "h \<in> borel_measurable M" and |
745 borel: "h \<in> borel_measurable M" and |
746 nn: "\<And>x. 0 \<le> h x" and |
746 nn: "\<And>x. 0 \<le> h x" and |
747 pos: "\<And>x. x \<in> space M \<Longrightarrow> 0 < h x" and |
747 pos: "\<And>x. x \<in> space M \<Longrightarrow> 0 < h x" and |
748 "\<And>x. x \<in> space M \<Longrightarrow> h x < \<infinity>" by auto |
748 "\<And>x. x \<in> space M \<Longrightarrow> h x < \<infinity>" by auto |
749 let ?T = "\<lambda>A. (\<integral>\<^isup>+x. h x * indicator A x \<partial>M)" |
749 let ?T = "\<lambda>A. (\<integral>\<^sup>+x. h x * indicator A x \<partial>M)" |
750 let ?MT = "density M h" |
750 let ?MT = "density M h" |
751 from borel finite nn interpret T: finite_measure ?MT |
751 from borel finite nn interpret T: finite_measure ?MT |
752 by (auto intro!: finite_measureI cong: positive_integral_cong simp: emeasure_density) |
752 by (auto intro!: finite_measureI cong: positive_integral_cong simp: emeasure_density) |
753 have "absolutely_continuous ?MT N" "sets N = sets ?MT" |
753 have "absolutely_continuous ?MT N" "sets N = sets ?MT" |
754 proof (unfold absolutely_continuous_def, safe) |
754 proof (unfold absolutely_continuous_def, safe) |
771 section "Uniqueness of densities" |
771 section "Uniqueness of densities" |
772 |
772 |
773 lemma finite_density_unique: |
773 lemma finite_density_unique: |
774 assumes borel: "f \<in> borel_measurable M" "g \<in> borel_measurable M" |
774 assumes borel: "f \<in> borel_measurable M" "g \<in> borel_measurable M" |
775 assumes pos: "AE x in M. 0 \<le> f x" "AE x in M. 0 \<le> g x" |
775 assumes pos: "AE x in M. 0 \<le> f x" "AE x in M. 0 \<le> g x" |
776 and fin: "integral\<^isup>P M f \<noteq> \<infinity>" |
776 and fin: "integral\<^sup>P M f \<noteq> \<infinity>" |
777 shows "density M f = density M g \<longleftrightarrow> (AE x in M. f x = g x)" |
777 shows "density M f = density M g \<longleftrightarrow> (AE x in M. f x = g x)" |
778 proof (intro iffI ballI) |
778 proof (intro iffI ballI) |
779 fix A assume eq: "AE x in M. f x = g x" |
779 fix A assume eq: "AE x in M. f x = g x" |
780 with borel show "density M f = density M g" |
780 with borel show "density M f = density M g" |
781 by (auto intro: density_cong) |
781 by (auto intro: density_cong) |
782 next |
782 next |
783 let ?P = "\<lambda>f A. \<integral>\<^isup>+ x. f x * indicator A x \<partial>M" |
783 let ?P = "\<lambda>f A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M" |
784 assume "density M f = density M g" |
784 assume "density M f = density M g" |
785 with borel have eq: "\<forall>A\<in>sets M. ?P f A = ?P g A" |
785 with borel have eq: "\<forall>A\<in>sets M. ?P f A = ?P g A" |
786 by (simp add: emeasure_density[symmetric]) |
786 by (simp add: emeasure_density[symmetric]) |
787 from this[THEN bspec, OF sets.top] fin |
787 from this[THEN bspec, OF sets.top] fin |
788 have g_fin: "integral\<^isup>P M g \<noteq> \<infinity>" by (simp cong: positive_integral_cong) |
788 have g_fin: "integral\<^sup>P M g \<noteq> \<infinity>" by (simp cong: positive_integral_cong) |
789 { fix f g assume borel: "f \<in> borel_measurable M" "g \<in> borel_measurable M" |
789 { fix f g assume borel: "f \<in> borel_measurable M" "g \<in> borel_measurable M" |
790 and pos: "AE x in M. 0 \<le> f x" "AE x in M. 0 \<le> g x" |
790 and pos: "AE x in M. 0 \<le> f x" "AE x in M. 0 \<le> g x" |
791 and g_fin: "integral\<^isup>P M g \<noteq> \<infinity>" and eq: "\<forall>A\<in>sets M. ?P f A = ?P g A" |
791 and g_fin: "integral\<^sup>P M g \<noteq> \<infinity>" and eq: "\<forall>A\<in>sets M. ?P f A = ?P g A" |
792 let ?N = "{x\<in>space M. g x < f x}" |
792 let ?N = "{x\<in>space M. g x < f x}" |
793 have N: "?N \<in> sets M" using borel by simp |
793 have N: "?N \<in> sets M" using borel by simp |
794 have "?P g ?N \<le> integral\<^isup>P M g" using pos |
794 have "?P g ?N \<le> integral\<^sup>P M g" using pos |
795 by (intro positive_integral_mono_AE) (auto split: split_indicator) |
795 by (intro positive_integral_mono_AE) (auto split: split_indicator) |
796 then have Pg_fin: "?P g ?N \<noteq> \<infinity>" using g_fin by auto |
796 then have Pg_fin: "?P g ?N \<noteq> \<infinity>" using g_fin by auto |
797 have "?P (\<lambda>x. (f x - g x)) ?N = (\<integral>\<^isup>+x. f x * indicator ?N x - g x * indicator ?N x \<partial>M)" |
797 have "?P (\<lambda>x. (f x - g x)) ?N = (\<integral>\<^sup>+x. f x * indicator ?N x - g x * indicator ?N x \<partial>M)" |
798 by (auto intro!: positive_integral_cong simp: indicator_def) |
798 by (auto intro!: positive_integral_cong simp: indicator_def) |
799 also have "\<dots> = ?P f ?N - ?P g ?N" |
799 also have "\<dots> = ?P f ?N - ?P g ?N" |
800 proof (rule positive_integral_diff) |
800 proof (rule positive_integral_diff) |
801 show "(\<lambda>x. f x * indicator ?N x) \<in> borel_measurable M" "(\<lambda>x. g x * indicator ?N x) \<in> borel_measurable M" |
801 show "(\<lambda>x. f x * indicator ?N x) \<in> borel_measurable M" "(\<lambda>x. g x * indicator ?N x) \<in> borel_measurable M" |
802 using borel N by auto |
802 using borel N by auto |
815 qed |
815 qed |
816 |
816 |
817 lemma (in finite_measure) density_unique_finite_measure: |
817 lemma (in finite_measure) density_unique_finite_measure: |
818 assumes borel: "f \<in> borel_measurable M" "f' \<in> borel_measurable M" |
818 assumes borel: "f \<in> borel_measurable M" "f' \<in> borel_measurable M" |
819 assumes pos: "AE x in M. 0 \<le> f x" "AE x in M. 0 \<le> f' x" |
819 assumes pos: "AE x in M. 0 \<le> f x" "AE x in M. 0 \<le> f' x" |
820 assumes f: "\<And>A. A \<in> sets M \<Longrightarrow> (\<integral>\<^isup>+x. f x * indicator A x \<partial>M) = (\<integral>\<^isup>+x. f' x * indicator A x \<partial>M)" |
820 assumes f: "\<And>A. A \<in> sets M \<Longrightarrow> (\<integral>\<^sup>+x. f x * indicator A x \<partial>M) = (\<integral>\<^sup>+x. f' x * indicator A x \<partial>M)" |
821 (is "\<And>A. A \<in> sets M \<Longrightarrow> ?P f A = ?P f' A") |
821 (is "\<And>A. A \<in> sets M \<Longrightarrow> ?P f A = ?P f' A") |
822 shows "AE x in M. f x = f' x" |
822 shows "AE x in M. f x = f' x" |
823 proof - |
823 proof - |
824 let ?D = "\<lambda>f. density M f" |
824 let ?D = "\<lambda>f. density M f" |
825 let ?N = "\<lambda>A. ?P f A" and ?N' = "\<lambda>A. ?P f' A" |
825 let ?N = "\<lambda>A. ?P f A" and ?N' = "\<lambda>A. ?P f' A" |
845 by (intro finite_density_unique[THEN iffD1] allI) |
845 by (intro finite_density_unique[THEN iffD1] allI) |
846 (auto intro!: f measure_eqI simp: emeasure_density * subset_eq) |
846 (auto intro!: f measure_eqI simp: emeasure_density * subset_eq) |
847 moreover have "AE x in M. ?f Q0 x = ?f' Q0 x" |
847 moreover have "AE x in M. ?f Q0 x = ?f' Q0 x" |
848 proof (rule AE_I') |
848 proof (rule AE_I') |
849 { fix f :: "'a \<Rightarrow> ereal" assume borel: "f \<in> borel_measurable M" |
849 { fix f :: "'a \<Rightarrow> ereal" assume borel: "f \<in> borel_measurable M" |
850 and eq: "\<And>A. A \<in> sets M \<Longrightarrow> ?N A = (\<integral>\<^isup>+x. f x * indicator A x \<partial>M)" |
850 and eq: "\<And>A. A \<in> sets M \<Longrightarrow> ?N A = (\<integral>\<^sup>+x. f x * indicator A x \<partial>M)" |
851 let ?A = "\<lambda>i. Q0 \<inter> {x \<in> space M. f x < (i::nat)}" |
851 let ?A = "\<lambda>i. Q0 \<inter> {x \<in> space M. f x < (i::nat)}" |
852 have "(\<Union>i. ?A i) \<in> null_sets M" |
852 have "(\<Union>i. ?A i) \<in> null_sets M" |
853 proof (rule null_sets_UN) |
853 proof (rule null_sets_UN) |
854 fix i ::nat have "?A i \<in> sets M" |
854 fix i ::nat have "?A i \<in> sets M" |
855 using borel Q0(1) by auto |
855 using borel Q0(1) by auto |
856 have "?N (?A i) \<le> (\<integral>\<^isup>+x. (i::ereal) * indicator (?A i) x \<partial>M)" |
856 have "?N (?A i) \<le> (\<integral>\<^sup>+x. (i::ereal) * indicator (?A i) x \<partial>M)" |
857 unfolding eq[OF `?A i \<in> sets M`] |
857 unfolding eq[OF `?A i \<in> sets M`] |
858 by (auto intro!: positive_integral_mono simp: indicator_def) |
858 by (auto intro!: positive_integral_mono simp: indicator_def) |
859 also have "\<dots> = i * emeasure M (?A i)" |
859 also have "\<dots> = i * emeasure M (?A i)" |
860 using `?A i \<in> sets M` by (auto intro!: positive_integral_cmult_indicator) |
860 using `?A i \<in> sets M` by (auto intro!: positive_integral_cmult_indicator) |
861 also have "\<dots> < \<infinity>" using emeasure_real[of "?A i"] by simp |
861 also have "\<dots> < \<infinity>" using emeasure_real[of "?A i"] by simp |
885 assumes f': "f' \<in> borel_measurable M" "AE x in M. 0 \<le> f' x" |
885 assumes f': "f' \<in> borel_measurable M" "AE x in M. 0 \<le> f' x" |
886 assumes density_eq: "density M f = density M f'" |
886 assumes density_eq: "density M f = density M f'" |
887 shows "AE x in M. f x = f' x" |
887 shows "AE x in M. f x = f' x" |
888 proof - |
888 proof - |
889 obtain h where h_borel: "h \<in> borel_measurable M" |
889 obtain h where h_borel: "h \<in> borel_measurable M" |
890 and fin: "integral\<^isup>P M h \<noteq> \<infinity>" and pos: "\<And>x. x \<in> space M \<Longrightarrow> 0 < h x \<and> h x < \<infinity>" "\<And>x. 0 \<le> h x" |
890 and fin: "integral\<^sup>P M h \<noteq> \<infinity>" and pos: "\<And>x. x \<in> space M \<Longrightarrow> 0 < h x \<and> h x < \<infinity>" "\<And>x. 0 \<le> h x" |
891 using Ex_finite_integrable_function by auto |
891 using Ex_finite_integrable_function by auto |
892 then have h_nn: "AE x in M. 0 \<le> h x" by auto |
892 then have h_nn: "AE x in M. 0 \<le> h x" by auto |
893 let ?H = "density M h" |
893 let ?H = "density M h" |
894 interpret h: finite_measure ?H |
894 interpret h: finite_measure ?H |
895 using fin h_borel pos |
895 using fin h_borel pos |
897 let ?fM = "density M f" |
897 let ?fM = "density M f" |
898 let ?f'M = "density M f'" |
898 let ?f'M = "density M f'" |
899 { fix A assume "A \<in> sets M" |
899 { fix A assume "A \<in> sets M" |
900 then have "{x \<in> space M. h x * indicator A x \<noteq> 0} = A" |
900 then have "{x \<in> space M. h x * indicator A x \<noteq> 0} = A" |
901 using pos(1) sets.sets_into_space by (force simp: indicator_def) |
901 using pos(1) sets.sets_into_space by (force simp: indicator_def) |
902 then have "(\<integral>\<^isup>+x. h x * indicator A x \<partial>M) = 0 \<longleftrightarrow> A \<in> null_sets M" |
902 then have "(\<integral>\<^sup>+x. h x * indicator A x \<partial>M) = 0 \<longleftrightarrow> A \<in> null_sets M" |
903 using h_borel `A \<in> sets M` h_nn by (subst positive_integral_0_iff) auto } |
903 using h_borel `A \<in> sets M` h_nn by (subst positive_integral_0_iff) auto } |
904 note h_null_sets = this |
904 note h_null_sets = this |
905 { fix A assume "A \<in> sets M" |
905 { fix A assume "A \<in> sets M" |
906 have "(\<integral>\<^isup>+x. f x * (h x * indicator A x) \<partial>M) = (\<integral>\<^isup>+x. h x * indicator A x \<partial>?fM)" |
906 have "(\<integral>\<^sup>+x. f x * (h x * indicator A x) \<partial>M) = (\<integral>\<^sup>+x. h x * indicator A x \<partial>?fM)" |
907 using `A \<in> sets M` h_borel h_nn f f' |
907 using `A \<in> sets M` h_borel h_nn f f' |
908 by (intro positive_integral_density[symmetric]) auto |
908 by (intro positive_integral_density[symmetric]) auto |
909 also have "\<dots> = (\<integral>\<^isup>+x. h x * indicator A x \<partial>?f'M)" |
909 also have "\<dots> = (\<integral>\<^sup>+x. h x * indicator A x \<partial>?f'M)" |
910 by (simp_all add: density_eq) |
910 by (simp_all add: density_eq) |
911 also have "\<dots> = (\<integral>\<^isup>+x. f' x * (h x * indicator A x) \<partial>M)" |
911 also have "\<dots> = (\<integral>\<^sup>+x. f' x * (h x * indicator A x) \<partial>M)" |
912 using `A \<in> sets M` h_borel h_nn f f' |
912 using `A \<in> sets M` h_borel h_nn f f' |
913 by (intro positive_integral_density) auto |
913 by (intro positive_integral_density) auto |
914 finally have "(\<integral>\<^isup>+x. h x * (f x * indicator A x) \<partial>M) = (\<integral>\<^isup>+x. h x * (f' x * indicator A x) \<partial>M)" |
914 finally have "(\<integral>\<^sup>+x. h x * (f x * indicator A x) \<partial>M) = (\<integral>\<^sup>+x. h x * (f' x * indicator A x) \<partial>M)" |
915 by (simp add: ac_simps) |
915 by (simp add: ac_simps) |
916 then have "(\<integral>\<^isup>+x. (f x * indicator A x) \<partial>?H) = (\<integral>\<^isup>+x. (f' x * indicator A x) \<partial>?H)" |
916 then have "(\<integral>\<^sup>+x. (f x * indicator A x) \<partial>?H) = (\<integral>\<^sup>+x. (f' x * indicator A x) \<partial>?H)" |
917 using `A \<in> sets M` h_borel h_nn f f' |
917 using `A \<in> sets M` h_borel h_nn f f' |
918 by (subst (asm) (1 2) positive_integral_density[symmetric]) auto } |
918 by (subst (asm) (1 2) positive_integral_density[symmetric]) auto } |
919 then have "AE x in ?H. f x = f' x" using h_borel h_nn f f' |
919 then have "AE x in ?H. f x = f' x" using h_borel h_nn f f' |
920 by (intro h.density_unique_finite_measure absolutely_continuous_AE[of M]) |
920 by (intro h.density_unique_finite_measure absolutely_continuous_AE[of M]) |
921 (auto simp add: AE_density) |
921 (auto simp add: AE_density) |
948 unfolding AE_all_countable |
948 unfolding AE_all_countable |
949 proof |
949 proof |
950 fix i |
950 fix i |
951 have "density (density M f) (indicator (A i)) = density (density M g) (indicator (A i))" |
951 have "density (density M f) (indicator (A i)) = density (density M g) (indicator (A i))" |
952 unfolding eq .. |
952 unfolding eq .. |
953 moreover have "(\<integral>\<^isup>+x. f x * indicator (A i) x \<partial>M) \<noteq> \<infinity>" |
953 moreover have "(\<integral>\<^sup>+x. f x * indicator (A i) x \<partial>M) \<noteq> \<infinity>" |
954 using cover(1) cover(3)[of i] borel by (auto simp: emeasure_density subset_eq) |
954 using cover(1) cover(3)[of i] borel by (auto simp: emeasure_density subset_eq) |
955 ultimately have "AE x in M. f x * indicator (A i) x = g x * indicator (A i) x" |
955 ultimately have "AE x in M. f x * indicator (A i) x = g x * indicator (A i) x" |
956 using borel pos cover(1) pos |
956 using borel pos cover(1) pos |
957 by (intro finite_density_unique[THEN iffD1]) |
957 by (intro finite_density_unique[THEN iffD1]) |
958 (auto simp: density_density_eq subset_eq) |
958 (auto simp: density_density_eq subset_eq) |
972 (is "sigma_finite_measure ?N \<longleftrightarrow> _") |
972 (is "sigma_finite_measure ?N \<longleftrightarrow> _") |
973 proof |
973 proof |
974 assume "sigma_finite_measure ?N" |
974 assume "sigma_finite_measure ?N" |
975 then interpret N: sigma_finite_measure ?N . |
975 then interpret N: sigma_finite_measure ?N . |
976 from N.Ex_finite_integrable_function obtain h where |
976 from N.Ex_finite_integrable_function obtain h where |
977 h: "h \<in> borel_measurable M" "integral\<^isup>P ?N h \<noteq> \<infinity>" and |
977 h: "h \<in> borel_measurable M" "integral\<^sup>P ?N h \<noteq> \<infinity>" and |
978 h_nn: "\<And>x. 0 \<le> h x" and |
978 h_nn: "\<And>x. 0 \<le> h x" and |
979 fin: "\<forall>x\<in>space M. 0 < h x \<and> h x < \<infinity>" by auto |
979 fin: "\<forall>x\<in>space M. 0 < h x \<and> h x < \<infinity>" by auto |
980 have "AE x in M. f x * h x \<noteq> \<infinity>" |
980 have "AE x in M. f x * h x \<noteq> \<infinity>" |
981 proof (rule AE_I') |
981 proof (rule AE_I') |
982 have "integral\<^isup>P ?N h = (\<integral>\<^isup>+x. f x * h x \<partial>M)" using f h h_nn |
982 have "integral\<^sup>P ?N h = (\<integral>\<^sup>+x. f x * h x \<partial>M)" using f h h_nn |
983 by (auto intro!: positive_integral_density) |
983 by (auto intro!: positive_integral_density) |
984 then have "(\<integral>\<^isup>+x. f x * h x \<partial>M) \<noteq> \<infinity>" |
984 then have "(\<integral>\<^sup>+x. f x * h x \<partial>M) \<noteq> \<infinity>" |
985 using h(2) by simp |
985 using h(2) by simp |
986 then show "(\<lambda>x. f x * h x) -` {\<infinity>} \<inter> space M \<in> null_sets M" |
986 then show "(\<lambda>x. f x * h x) -` {\<infinity>} \<inter> space M \<in> null_sets M" |
987 using f h(1) by (auto intro!: positive_integral_PInf borel_measurable_vimage) |
987 using f h(1) by (auto intro!: positive_integral_PInf borel_measurable_vimage) |
988 qed auto |
988 qed auto |
989 then show "AE x in M. f x \<noteq> \<infinity>" |
989 then show "AE x in M. f x \<noteq> \<infinity>" |
1028 qed (auto simp: A_def) |
1028 qed (auto simp: A_def) |
1029 finally show "(\<Union>i. ?A i) = space ?N" by simp |
1029 finally show "(\<Union>i. ?A i) = space ?N" by simp |
1030 next |
1030 next |
1031 fix n obtain i j where |
1031 fix n obtain i j where |
1032 [simp]: "prod_decode n = (i, j)" by (cases "prod_decode n") auto |
1032 [simp]: "prod_decode n = (i, j)" by (cases "prod_decode n") auto |
1033 have "(\<integral>\<^isup>+x. f x * indicator (A i \<inter> Q j) x \<partial>M) \<noteq> \<infinity>" |
1033 have "(\<integral>\<^sup>+x. f x * indicator (A i \<inter> Q j) x \<partial>M) \<noteq> \<infinity>" |
1034 proof (cases i) |
1034 proof (cases i) |
1035 case 0 |
1035 case 0 |
1036 have "AE x in M. f x * indicator (A i \<inter> Q j) x = 0" |
1036 have "AE x in M. f x * indicator (A i \<inter> Q j) x = 0" |
1037 using AE by (auto simp: A_def `i = 0`) |
1037 using AE by (auto simp: A_def `i = 0`) |
1038 from positive_integral_cong_AE[OF this] show ?thesis by simp |
1038 from positive_integral_cong_AE[OF this] show ?thesis by simp |
1039 next |
1039 next |
1040 case (Suc n) |
1040 case (Suc n) |
1041 then have "(\<integral>\<^isup>+x. f x * indicator (A i \<inter> Q j) x \<partial>M) \<le> |
1041 then have "(\<integral>\<^sup>+x. f x * indicator (A i \<inter> Q j) x \<partial>M) \<le> |
1042 (\<integral>\<^isup>+x. (Suc n :: ereal) * indicator (Q j) x \<partial>M)" |
1042 (\<integral>\<^sup>+x. (Suc n :: ereal) * indicator (Q j) x \<partial>M)" |
1043 by (auto intro!: positive_integral_mono simp: indicator_def A_def real_eq_of_nat) |
1043 by (auto intro!: positive_integral_mono simp: indicator_def A_def real_eq_of_nat) |
1044 also have "\<dots> = Suc n * emeasure M (Q j)" |
1044 also have "\<dots> = Suc n * emeasure M (Q j)" |
1045 using Q by (auto intro!: positive_integral_cmult_indicator) |
1045 using Q by (auto intro!: positive_integral_cmult_indicator) |
1046 also have "\<dots> < \<infinity>" |
1046 also have "\<dots> < \<infinity>" |
1047 using Q by (auto simp: real_eq_of_nat[symmetric]) |
1047 using Q by (auto simp: real_eq_of_nat[symmetric]) |
1091 qed |
1091 qed |
1092 |
1092 |
1093 lemma (in sigma_finite_measure) RN_deriv_positive_integral: |
1093 lemma (in sigma_finite_measure) RN_deriv_positive_integral: |
1094 assumes N: "absolutely_continuous M N" "sets N = sets M" |
1094 assumes N: "absolutely_continuous M N" "sets N = sets M" |
1095 and f: "f \<in> borel_measurable M" |
1095 and f: "f \<in> borel_measurable M" |
1096 shows "integral\<^isup>P N f = (\<integral>\<^isup>+x. RN_deriv M N x * f x \<partial>M)" |
1096 shows "integral\<^sup>P N f = (\<integral>\<^sup>+x. RN_deriv M N x * f x \<partial>M)" |
1097 proof - |
1097 proof - |
1098 have "integral\<^isup>P N f = integral\<^isup>P (density M (RN_deriv M N)) f" |
1098 have "integral\<^sup>P N f = integral\<^sup>P (density M (RN_deriv M N)) f" |
1099 using N by (simp add: density_RN_deriv) |
1099 using N by (simp add: density_RN_deriv) |
1100 also have "\<dots> = (\<integral>\<^isup>+x. RN_deriv M N x * f x \<partial>M)" |
1100 also have "\<dots> = (\<integral>\<^sup>+x. RN_deriv M N x * f x \<partial>M)" |
1101 using RN_deriv(1,3)[OF N] f by (simp add: positive_integral_density) |
1101 using RN_deriv(1,3)[OF N] f by (simp add: positive_integral_density) |
1102 finally show ?thesis by simp |
1102 finally show ?thesis by simp |
1103 qed |
1103 qed |
1104 |
1104 |
1105 lemma null_setsD_AE: "N \<in> null_sets M \<Longrightarrow> AE x in M. x \<notin> N" |
1105 lemma null_setsD_AE: "N \<in> null_sets M \<Longrightarrow> AE x in M. x \<notin> N" |
1191 lemma (in sigma_finite_measure) |
1191 lemma (in sigma_finite_measure) |
1192 assumes N: "sigma_finite_measure N" and ac: "absolutely_continuous M N" "sets N = sets M" |
1192 assumes N: "sigma_finite_measure N" and ac: "absolutely_continuous M N" "sets N = sets M" |
1193 and f: "f \<in> borel_measurable M" |
1193 and f: "f \<in> borel_measurable M" |
1194 shows RN_deriv_integrable: "integrable N f \<longleftrightarrow> |
1194 shows RN_deriv_integrable: "integrable N f \<longleftrightarrow> |
1195 integrable M (\<lambda>x. real (RN_deriv M N x) * f x)" (is ?integrable) |
1195 integrable M (\<lambda>x. real (RN_deriv M N x) * f x)" (is ?integrable) |
1196 and RN_deriv_integral: "integral\<^isup>L N f = |
1196 and RN_deriv_integral: "integral\<^sup>L N f = |
1197 (\<integral>x. real (RN_deriv M N x) * f x \<partial>M)" (is ?integral) |
1197 (\<integral>x. real (RN_deriv M N x) * f x \<partial>M)" (is ?integral) |
1198 proof - |
1198 proof - |
1199 note ac(2)[simp] and sets_eq_imp_space_eq[OF ac(2), simp] |
1199 note ac(2)[simp] and sets_eq_imp_space_eq[OF ac(2), simp] |
1200 interpret N: sigma_finite_measure N by fact |
1200 interpret N: sigma_finite_measure N by fact |
1201 have minus_cong: "\<And>A B A' B'::ereal. A = A' \<Longrightarrow> B = B' \<Longrightarrow> real A - real B = real A' - real B'" by simp |
1201 have minus_cong: "\<And>A B A' B'::ereal. A = A' \<Longrightarrow> B = B' \<Longrightarrow> real A - real B = real A' - real B'" by simp |
1205 { fix x assume *: "RN_deriv M N x \<noteq> \<infinity>" |
1205 { fix x assume *: "RN_deriv M N x \<noteq> \<infinity>" |
1206 have "ereal (real (RN_deriv M N x)) * ereal (f x) = ereal (real (RN_deriv M N x) * f x)" |
1206 have "ereal (real (RN_deriv M N x)) * ereal (f x) = ereal (real (RN_deriv M N x) * f x)" |
1207 by (simp add: mult_le_0_iff) |
1207 by (simp add: mult_le_0_iff) |
1208 then have "RN_deriv M N x * ereal (f x) = ereal (real (RN_deriv M N x) * f x)" |
1208 then have "RN_deriv M N x * ereal (f x) = ereal (real (RN_deriv M N x) * f x)" |
1209 using RN_deriv(3)[OF ac] * by (auto simp add: ereal_real split: split_if_asm) } |
1209 using RN_deriv(3)[OF ac] * by (auto simp add: ereal_real split: split_if_asm) } |
1210 then have "(\<integral>\<^isup>+x. ereal (real (RN_deriv M N x) * f x) \<partial>M) = (\<integral>\<^isup>+x. RN_deriv M N x * ereal (f x) \<partial>M)" |
1210 then have "(\<integral>\<^sup>+x. ereal (real (RN_deriv M N x) * f x) \<partial>M) = (\<integral>\<^sup>+x. RN_deriv M N x * ereal (f x) \<partial>M)" |
1211 "(\<integral>\<^isup>+x. ereal (- (real (RN_deriv M N x) * f x)) \<partial>M) = (\<integral>\<^isup>+x. RN_deriv M N x * ereal (- f x) \<partial>M)" |
1211 "(\<integral>\<^sup>+x. ereal (- (real (RN_deriv M N x) * f x)) \<partial>M) = (\<integral>\<^sup>+x. RN_deriv M N x * ereal (- f x) \<partial>M)" |
1212 using RN_deriv_finite[OF N ac] unfolding ereal_mult_minus_right uminus_ereal.simps(1)[symmetric] |
1212 using RN_deriv_finite[OF N ac] unfolding ereal_mult_minus_right uminus_ereal.simps(1)[symmetric] |
1213 by (auto intro!: positive_integral_cong_AE) } |
1213 by (auto intro!: positive_integral_cong_AE) } |
1214 note * = this |
1214 note * = this |
1215 show ?integral ?integrable |
1215 show ?integral ?integrable |
1216 unfolding lebesgue_integral_def integrable_def * |
1216 unfolding lebesgue_integral_def integrable_def * |
1233 let ?RN = "\<lambda>t. {x \<in> space M. RN_deriv M N x = t}" |
1233 let ?RN = "\<lambda>t. {x \<in> space M. RN_deriv M N x = t}" |
1234 |
1234 |
1235 show "(\<lambda>x. real (RN_deriv M N x)) \<in> borel_measurable M" |
1235 show "(\<lambda>x. real (RN_deriv M N x)) \<in> borel_measurable M" |
1236 using RN by auto |
1236 using RN by auto |
1237 |
1237 |
1238 have "N (?RN \<infinity>) = (\<integral>\<^isup>+ x. RN_deriv M N x * indicator (?RN \<infinity>) x \<partial>M)" |
1238 have "N (?RN \<infinity>) = (\<integral>\<^sup>+ x. RN_deriv M N x * indicator (?RN \<infinity>) x \<partial>M)" |
1239 using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) |
1239 using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) |
1240 also have "\<dots> = (\<integral>\<^isup>+ x. \<infinity> * indicator (?RN \<infinity>) x \<partial>M)" |
1240 also have "\<dots> = (\<integral>\<^sup>+ x. \<infinity> * indicator (?RN \<infinity>) x \<partial>M)" |
1241 by (intro positive_integral_cong) (auto simp: indicator_def) |
1241 by (intro positive_integral_cong) (auto simp: indicator_def) |
1242 also have "\<dots> = \<infinity> * emeasure M (?RN \<infinity>)" |
1242 also have "\<dots> = \<infinity> * emeasure M (?RN \<infinity>)" |
1243 using RN by (intro positive_integral_cmult_indicator) auto |
1243 using RN by (intro positive_integral_cmult_indicator) auto |
1244 finally have eq: "N (?RN \<infinity>) = \<infinity> * emeasure M (?RN \<infinity>)" . |
1244 finally have eq: "N (?RN \<infinity>) = \<infinity> * emeasure M (?RN \<infinity>)" . |
1245 moreover |
1245 moreover |
1259 using ac absolutely_continuous_AE by auto |
1259 using ac absolutely_continuous_AE by auto |
1260 |
1260 |
1261 show "\<And>x. 0 \<le> real (RN_deriv M N x)" |
1261 show "\<And>x. 0 \<le> real (RN_deriv M N x)" |
1262 using RN by (auto intro: real_of_ereal_pos) |
1262 using RN by (auto intro: real_of_ereal_pos) |
1263 |
1263 |
1264 have "N (?RN 0) = (\<integral>\<^isup>+ x. RN_deriv M N x * indicator (?RN 0) x \<partial>M)" |
1264 have "N (?RN 0) = (\<integral>\<^sup>+ x. RN_deriv M N x * indicator (?RN 0) x \<partial>M)" |
1265 using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) |
1265 using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) |
1266 also have "\<dots> = (\<integral>\<^isup>+ x. 0 \<partial>M)" |
1266 also have "\<dots> = (\<integral>\<^sup>+ x. 0 \<partial>M)" |
1267 by (intro positive_integral_cong) (auto simp: indicator_def) |
1267 by (intro positive_integral_cong) (auto simp: indicator_def) |
1268 finally have "AE x in N. RN_deriv M N x \<noteq> 0" |
1268 finally have "AE x in N. RN_deriv M N x \<noteq> 0" |
1269 using RN by (subst AE_iff_measurable[OF _ refl]) (auto simp: ac cong: sets_eq_imp_space_eq) |
1269 using RN by (subst AE_iff_measurable[OF _ refl]) (auto simp: ac cong: sets_eq_imp_space_eq) |
1270 with RN(3) eq show "AE x in N. 0 < real (RN_deriv M N x)" |
1270 with RN(3) eq show "AE x in N. 0 < real (RN_deriv M N x)" |
1271 by (auto simp: zero_less_real_of_ereal le_less) |
1271 by (auto simp: zero_less_real_of_ereal le_less) |
1276 and x: "{x} \<in> sets M" |
1276 and x: "{x} \<in> sets M" |
1277 shows "N {x} = RN_deriv M N x * emeasure M {x}" |
1277 shows "N {x} = RN_deriv M N x * emeasure M {x}" |
1278 proof - |
1278 proof - |
1279 note deriv = RN_deriv[OF ac] |
1279 note deriv = RN_deriv[OF ac] |
1280 from deriv(1,3) `{x} \<in> sets M` |
1280 from deriv(1,3) `{x} \<in> sets M` |
1281 have "density M (RN_deriv M N) {x} = (\<integral>\<^isup>+w. RN_deriv M N x * indicator {x} w \<partial>M)" |
1281 have "density M (RN_deriv M N) {x} = (\<integral>\<^sup>+w. RN_deriv M N x * indicator {x} w \<partial>M)" |
1282 by (auto simp: indicator_def emeasure_density intro!: positive_integral_cong) |
1282 by (auto simp: indicator_def emeasure_density intro!: positive_integral_cong) |
1283 with x deriv show ?thesis |
1283 with x deriv show ?thesis |
1284 by (auto simp: positive_integral_cmult_indicator) |
1284 by (auto simp: positive_integral_cmult_indicator) |
1285 qed |
1285 qed |
1286 |
1286 |