hoelzl@42067 ` 1` ```(* Title: HOL/Probability/Radon_Nikodym.thy ``` hoelzl@42067 ` 2` ``` Author: Johannes Hölzl, TU München ``` hoelzl@42067 ` 3` ```*) ``` hoelzl@42067 ` 4` hoelzl@42067 ` 5` ```header {*Radon-Nikod{\'y}m derivative*} ``` hoelzl@42067 ` 6` hoelzl@38656 ` 7` ```theory Radon_Nikodym ``` hoelzl@38656 ` 8` ```imports Lebesgue_Integration ``` hoelzl@38656 ` 9` ```begin ``` hoelzl@38656 ` 10` hoelzl@47694 ` 11` ```definition "diff_measure M N = ``` hoelzl@47694 ` 12` ``` measure_of (space M) (sets M) (\A. emeasure M A - emeasure N A)" ``` hoelzl@47694 ` 13` hoelzl@47694 ` 14` ```lemma ``` hoelzl@47694 ` 15` ``` shows space_diff_measure[simp]: "space (diff_measure M N) = space M" ``` hoelzl@47694 ` 16` ``` and sets_diff_measure[simp]: "sets (diff_measure M N) = sets M" ``` hoelzl@47694 ` 17` ``` by (auto simp: diff_measure_def) ``` hoelzl@47694 ` 18` hoelzl@47694 ` 19` ```lemma emeasure_diff_measure: ``` hoelzl@47694 ` 20` ``` assumes fin: "finite_measure M" "finite_measure N" and sets_eq: "sets M = sets N" ``` hoelzl@47694 ` 21` ``` assumes pos: "\A. A \ sets M \ emeasure N A \ emeasure M A" and A: "A \ sets M" ``` hoelzl@47694 ` 22` ``` shows "emeasure (diff_measure M N) A = emeasure M A - emeasure N A" (is "_ = ?\ A") ``` hoelzl@47694 ` 23` ``` unfolding diff_measure_def ``` hoelzl@47694 ` 24` ```proof (rule emeasure_measure_of_sigma) ``` hoelzl@47694 ` 25` ``` show "sigma_algebra (space M) (sets M)" .. ``` hoelzl@47694 ` 26` ``` show "positive (sets M) ?\" ``` hoelzl@47694 ` 27` ``` using pos by (simp add: positive_def ereal_diff_positive) ``` hoelzl@47694 ` 28` ``` show "countably_additive (sets M) ?\" ``` hoelzl@47694 ` 29` ``` proof (rule countably_additiveI) ``` hoelzl@47694 ` 30` ``` fix A :: "nat \ _" assume A: "range A \ sets M" and "disjoint_family A" ``` hoelzl@47694 ` 31` ``` then have suminf: ``` hoelzl@47694 ` 32` ``` "(\i. emeasure M (A i)) = emeasure M (\i. A i)" ``` hoelzl@47694 ` 33` ``` "(\i. emeasure N (A i)) = emeasure N (\i. A i)" ``` hoelzl@47694 ` 34` ``` by (simp_all add: suminf_emeasure sets_eq) ``` hoelzl@47694 ` 35` ``` with A have "(\i. emeasure M (A i) - emeasure N (A i)) = ``` hoelzl@47694 ` 36` ``` (\i. emeasure M (A i)) - (\i. emeasure N (A i))" ``` hoelzl@47694 ` 37` ``` using fin ``` hoelzl@47694 ` 38` ``` by (intro suminf_ereal_minus pos emeasure_nonneg) ``` hoelzl@47694 ` 39` ``` (auto simp: sets_eq finite_measure.emeasure_eq_measure suminf_emeasure) ``` hoelzl@47694 ` 40` ``` then show "(\i. emeasure M (A i) - emeasure N (A i)) = ``` hoelzl@47694 ` 41` ``` emeasure M (\i. A i) - emeasure N (\i. A i) " ``` hoelzl@47694 ` 42` ``` by (simp add: suminf) ``` hoelzl@47694 ` 43` ``` qed ``` hoelzl@47694 ` 44` ```qed fact ``` hoelzl@47694 ` 45` hoelzl@38656 ` 46` ```lemma (in sigma_finite_measure) Ex_finite_integrable_function: ``` hoelzl@41981 ` 47` ``` shows "\h\borel_measurable M. integral\<^isup>P M h \ \ \ (\x\space M. 0 < h x \ h x < \) \ (\x. 0 \ h x)" ``` hoelzl@38656 ` 48` ```proof - ``` hoelzl@38656 ` 49` ``` obtain A :: "nat \ 'a set" where ``` hoelzl@38656 ` 50` ``` range: "range A \ sets M" and ``` hoelzl@38656 ` 51` ``` space: "(\i. A i) = space M" and ``` hoelzl@47694 ` 52` ``` measure: "\i. emeasure M (A i) \ \" and ``` hoelzl@38656 ` 53` ``` disjoint: "disjoint_family A" ``` hoelzl@47694 ` 54` ``` using sigma_finite_disjoint by auto ``` hoelzl@47694 ` 55` ``` let ?B = "\i. 2^Suc i * emeasure M (A i)" ``` hoelzl@38656 ` 56` ``` have "\i. \x. 0 < x \ x < inverse (?B i)" ``` hoelzl@38656 ` 57` ``` proof ``` hoelzl@47694 ` 58` ``` fix i show "\x. 0 < x \ x < inverse (?B i)" ``` hoelzl@47694 ` 59` ``` using measure[of i] emeasure_nonneg[of M "A i"] ``` hoelzl@47694 ` 60` ``` by (auto intro!: ereal_dense simp: ereal_0_gt_inverse ereal_zero_le_0_iff) ``` hoelzl@38656 ` 61` ``` qed ``` hoelzl@38656 ` 62` ``` from choice[OF this] obtain n where n: "\i. 0 < n i" ``` hoelzl@47694 ` 63` ``` "\i. n i < inverse (2^Suc i * emeasure M (A i))" by auto ``` hoelzl@41981 ` 64` ``` { fix i have "0 \ n i" using n(1)[of i] by auto } note pos = this ``` wenzelm@46731 ` 65` ``` let ?h = "\x. \i. n i * indicator (A i) x" ``` hoelzl@38656 ` 66` ``` show ?thesis ``` hoelzl@38656 ` 67` ``` proof (safe intro!: bexI[of _ ?h] del: notI) ``` hoelzl@39092 ` 68` ``` have "\i. A i \ sets M" ``` nipkow@44890 ` 69` ``` using range by fastforce+ ``` hoelzl@47694 ` 70` ``` then have "integral\<^isup>P M ?h = (\i. n i * emeasure M (A i))" using pos ``` hoelzl@41981 ` 71` ``` by (simp add: positive_integral_suminf positive_integral_cmult_indicator) ``` hoelzl@41981 ` 72` ``` also have "\ \ (\i. (1 / 2)^Suc i)" ``` hoelzl@41981 ` 73` ``` proof (rule suminf_le_pos) ``` hoelzl@41981 ` 74` ``` fix N ``` hoelzl@47694 ` 75` ``` have "n N * emeasure M (A N) \ inverse (2^Suc N * emeasure M (A N)) * emeasure M (A N)" ``` hoelzl@47694 ` 76` ``` using n[of N] ``` hoelzl@43920 ` 77` ``` by (intro ereal_mult_right_mono) auto ``` hoelzl@41981 ` 78` ``` also have "\ \ (1 / 2) ^ Suc N" ``` hoelzl@38656 ` 79` ``` using measure[of N] n[of N] ``` hoelzl@47694 ` 80` ``` by (cases rule: ereal2_cases[of "n N" "emeasure M (A N)"]) ``` hoelzl@43920 ` 81` ``` (simp_all add: inverse_eq_divide power_divide one_ereal_def ereal_power_divide) ``` hoelzl@47694 ` 82` ``` finally show "n N * emeasure M (A N) \ (1 / 2) ^ Suc N" . ``` hoelzl@47694 ` 83` ``` show "0 \ n N * emeasure M (A N)" using n[of N] `A N \ sets M` by (simp add: emeasure_nonneg) ``` hoelzl@38656 ` 84` ``` qed ``` hoelzl@43920 ` 85` ``` finally show "integral\<^isup>P M ?h \ \" unfolding suminf_half_series_ereal by auto ``` hoelzl@38656 ` 86` ``` next ``` hoelzl@41981 ` 87` ``` { fix x assume "x \ space M" ``` hoelzl@41981 ` 88` ``` then obtain i where "x \ A i" using space[symmetric] by auto ``` hoelzl@41981 ` 89` ``` with disjoint n have "?h x = n i" ``` hoelzl@41981 ` 90` ``` by (auto intro!: suminf_cmult_indicator intro: less_imp_le) ``` hoelzl@41981 ` 91` ``` then show "0 < ?h x" and "?h x < \" using n[of i] by auto } ``` hoelzl@41981 ` 92` ``` note pos = this ``` hoelzl@41981 ` 93` ``` fix x show "0 \ ?h x" ``` hoelzl@41981 ` 94` ``` proof cases ``` hoelzl@41981 ` 95` ``` assume "x \ space M" then show "0 \ ?h x" using pos by (auto intro: less_imp_le) ``` hoelzl@41981 ` 96` ``` next ``` hoelzl@41981 ` 97` ``` assume "x \ space M" then have "\i. x \ A i" using space by auto ``` hoelzl@41981 ` 98` ``` then show "0 \ ?h x" by auto ``` hoelzl@41981 ` 99` ``` qed ``` hoelzl@38656 ` 100` ``` next ``` hoelzl@41981 ` 101` ``` show "?h \ borel_measurable M" using range n ``` hoelzl@43920 ` 102` ``` by (auto intro!: borel_measurable_psuminf borel_measurable_ereal_times ereal_0_le_mult intro: less_imp_le) ``` hoelzl@38656 ` 103` ``` qed ``` hoelzl@38656 ` 104` ```qed ``` hoelzl@38656 ` 105` hoelzl@40871 ` 106` ```subsection "Absolutely continuous" ``` hoelzl@40871 ` 107` hoelzl@47694 ` 108` ```definition absolutely_continuous :: "'a measure \ 'a measure \ bool" where ``` hoelzl@47694 ` 109` ``` "absolutely_continuous M N \ null_sets M \ null_sets N" ``` hoelzl@47694 ` 110` hoelzl@47694 ` 111` ```lemma absolutely_continuousI_count_space: "absolutely_continuous (count_space A) M" ``` hoelzl@47694 ` 112` ``` unfolding absolutely_continuous_def by (auto simp: null_sets_count_space) ``` hoelzl@38656 ` 113` hoelzl@47694 ` 114` ```lemma absolutely_continuousI_density: ``` hoelzl@47694 ` 115` ``` "f \ borel_measurable M \ absolutely_continuous M (density M f)" ``` hoelzl@47694 ` 116` ``` by (force simp add: absolutely_continuous_def null_sets_density_iff dest: AE_not_in) ``` hoelzl@47694 ` 117` hoelzl@47694 ` 118` ```lemma absolutely_continuousI_point_measure_finite: ``` hoelzl@47694 ` 119` ``` "(\x. \ x \ A ; f x \ 0 \ \ g x \ 0) \ absolutely_continuous (point_measure A f) (point_measure A g)" ``` hoelzl@47694 ` 120` ``` unfolding absolutely_continuous_def by (force simp: null_sets_point_measure_iff) ``` hoelzl@47694 ` 121` hoelzl@47694 ` 122` ```lemma absolutely_continuous_AE: ``` hoelzl@47694 ` 123` ``` assumes sets_eq: "sets M' = sets M" ``` hoelzl@47694 ` 124` ``` and "absolutely_continuous M M'" "AE x in M. P x" ``` hoelzl@41981 ` 125` ``` shows "AE x in M'. P x" ``` hoelzl@40859 ` 126` ```proof - ``` hoelzl@47694 ` 127` ``` from `AE x in M. P x` obtain N where N: "N \ null_sets M" "{x\space M. \ P x} \ N" ``` hoelzl@47694 ` 128` ``` unfolding eventually_ae_filter by auto ``` hoelzl@41981 ` 129` ``` show "AE x in M'. P x" ``` hoelzl@47694 ` 130` ``` proof (rule AE_I') ``` hoelzl@47694 ` 131` ``` show "{x\space M'. \ P x} \ N" using sets_eq_imp_space_eq[OF sets_eq] N(2) by simp ``` hoelzl@47694 ` 132` ``` from `absolutely_continuous M M'` show "N \ null_sets M'" ``` hoelzl@47694 ` 133` ``` using N unfolding absolutely_continuous_def sets_eq null_sets_def by auto ``` hoelzl@40859 ` 134` ``` qed ``` hoelzl@40859 ` 135` ```qed ``` hoelzl@40859 ` 136` hoelzl@40871 ` 137` ```subsection "Existence of the Radon-Nikodym derivative" ``` hoelzl@40871 ` 138` hoelzl@38656 ` 139` ```lemma (in finite_measure) Radon_Nikodym_aux_epsilon: ``` hoelzl@38656 ` 140` ``` fixes e :: real assumes "0 < e" ``` hoelzl@47694 ` 141` ``` assumes "finite_measure N" and sets_eq: "sets N = sets M" ``` hoelzl@47694 ` 142` ``` shows "\A\sets M. measure M (space M) - measure N (space M) \ measure M A - measure N A \ ``` hoelzl@47694 ` 143` ``` (\B\sets M. B \ A \ - e < measure M B - measure N B)" ``` hoelzl@38656 ` 144` ```proof - ``` hoelzl@47694 ` 145` ``` interpret M': finite_measure N by fact ``` hoelzl@47694 ` 146` ``` let ?d = "\A. measure M A - measure N A" ``` wenzelm@46731 ` 147` ``` let ?A = "\A. if (\B\sets M. B \ space M - A \ -e < ?d B) ``` hoelzl@38656 ` 148` ``` then {} ``` hoelzl@38656 ` 149` ``` else (SOME B. B \ sets M \ B \ space M - A \ ?d B \ -e)" ``` hoelzl@38656 ` 150` ``` def A \ "\n. ((\B. B \ ?A B) ^^ n) {}" ``` hoelzl@38656 ` 151` ``` have A_simps[simp]: ``` hoelzl@38656 ` 152` ``` "A 0 = {}" ``` hoelzl@38656 ` 153` ``` "\n. A (Suc n) = (A n \ ?A (A n))" unfolding A_def by simp_all ``` hoelzl@38656 ` 154` ``` { fix A assume "A \ sets M" ``` hoelzl@38656 ` 155` ``` have "?A A \ sets M" ``` hoelzl@38656 ` 156` ``` by (auto intro!: someI2[of _ _ "\A. A \ sets M"] simp: not_less) } ``` hoelzl@38656 ` 157` ``` note A'_in_sets = this ``` hoelzl@38656 ` 158` ``` { fix n have "A n \ sets M" ``` hoelzl@38656 ` 159` ``` proof (induct n) ``` hoelzl@38656 ` 160` ``` case (Suc n) thus "A (Suc n) \ sets M" ``` hoelzl@38656 ` 161` ``` using A'_in_sets[of "A n"] by (auto split: split_if_asm) ``` hoelzl@38656 ` 162` ``` qed (simp add: A_def) } ``` hoelzl@38656 ` 163` ``` note A_in_sets = this ``` hoelzl@38656 ` 164` ``` hence "range A \ sets M" by auto ``` hoelzl@38656 ` 165` ``` { fix n B ``` hoelzl@38656 ` 166` ``` assume Ex: "\B. B \ sets M \ B \ space M - A n \ ?d B \ -e" ``` hoelzl@38656 ` 167` ``` hence False: "\ (\B\sets M. B \ space M - A n \ -e < ?d B)" by (auto simp: not_less) ``` hoelzl@38656 ` 168` ``` have "?d (A (Suc n)) \ ?d (A n) - e" unfolding A_simps if_not_P[OF False] ``` hoelzl@38656 ` 169` ``` proof (rule someI2_ex[OF Ex]) ``` hoelzl@38656 ` 170` ``` fix B assume "B \ sets M \ B \ space M - A n \ ?d B \ - e" ``` hoelzl@38656 ` 171` ``` hence "A n \ B = {}" "B \ sets M" and dB: "?d B \ -e" by auto ``` hoelzl@38656 ` 172` ``` hence "?d (A n \ B) = ?d (A n) + ?d B" ``` hoelzl@47694 ` 173` ``` using `A n \ sets M` finite_measure_Union M'.finite_measure_Union by (simp add: sets_eq) ``` hoelzl@38656 ` 174` ``` also have "\ \ ?d (A n) - e" using dB by simp ``` hoelzl@38656 ` 175` ``` finally show "?d (A n \ B) \ ?d (A n) - e" . ``` hoelzl@38656 ` 176` ``` qed } ``` hoelzl@38656 ` 177` ``` note dA_epsilon = this ``` hoelzl@38656 ` 178` ``` { fix n have "?d (A (Suc n)) \ ?d (A n)" ``` hoelzl@38656 ` 179` ``` proof (cases "\B. B\sets M \ B \ space M - A n \ ?d B \ - e") ``` hoelzl@38656 ` 180` ``` case True from dA_epsilon[OF this] show ?thesis using `0 < e` by simp ``` hoelzl@38656 ` 181` ``` next ``` hoelzl@38656 ` 182` ``` case False ``` hoelzl@38656 ` 183` ``` hence "\B\sets M. B \ space M - A n \ -e < ?d B" by (auto simp: not_le) ``` hoelzl@38656 ` 184` ``` thus ?thesis by simp ``` hoelzl@38656 ` 185` ``` qed } ``` hoelzl@38656 ` 186` ``` note dA_mono = this ``` hoelzl@38656 ` 187` ``` show ?thesis ``` hoelzl@38656 ` 188` ``` proof (cases "\n. \B\sets M. B \ space M - A n \ -e < ?d B") ``` hoelzl@38656 ` 189` ``` case True then obtain n where B: "\B. \ B \ sets M; B \ space M - A n\ \ -e < ?d B" by blast ``` hoelzl@38656 ` 190` ``` show ?thesis ``` hoelzl@38656 ` 191` ``` proof (safe intro!: bexI[of _ "space M - A n"]) ``` hoelzl@38656 ` 192` ``` fix B assume "B \ sets M" "B \ space M - A n" ``` hoelzl@38656 ` 193` ``` from B[OF this] show "-e < ?d B" . ``` hoelzl@38656 ` 194` ``` next ``` hoelzl@38656 ` 195` ``` show "space M - A n \ sets M" by (rule compl_sets) fact ``` hoelzl@38656 ` 196` ``` next ``` hoelzl@38656 ` 197` ``` show "?d (space M) \ ?d (space M - A n)" ``` hoelzl@38656 ` 198` ``` proof (induct n) ``` hoelzl@38656 ` 199` ``` fix n assume "?d (space M) \ ?d (space M - A n)" ``` hoelzl@38656 ` 200` ``` also have "\ \ ?d (space M - A (Suc n))" ``` hoelzl@47694 ` 201` ``` using A_in_sets sets_into_space dA_mono[of n] finite_measure_compl M'.finite_measure_compl ``` hoelzl@47694 ` 202` ``` by (simp del: A_simps add: sets_eq sets_eq_imp_space_eq[OF sets_eq]) ``` hoelzl@38656 ` 203` ``` finally show "?d (space M) \ ?d (space M - A (Suc n))" . ``` hoelzl@38656 ` 204` ``` qed simp ``` hoelzl@38656 ` 205` ``` qed ``` hoelzl@38656 ` 206` ``` next ``` hoelzl@38656 ` 207` ``` case False hence B: "\n. \B. B\sets M \ B \ space M - A n \ ?d B \ - e" ``` hoelzl@38656 ` 208` ``` by (auto simp add: not_less) ``` hoelzl@38656 ` 209` ``` { fix n have "?d (A n) \ - real n * e" ``` hoelzl@38656 ` 210` ``` proof (induct n) ``` hoelzl@38656 ` 211` ``` case (Suc n) with dA_epsilon[of n, OF B] show ?case by (simp del: A_simps add: real_of_nat_Suc field_simps) ``` hoelzl@41981 ` 212` ``` next ``` hoelzl@47694 ` 213` ``` case 0 with measure_empty show ?case by (simp add: zero_ereal_def) ``` hoelzl@41981 ` 214` ``` qed } note dA_less = this ``` hoelzl@38656 ` 215` ``` have decseq: "decseq (\n. ?d (A n))" unfolding decseq_eq_incseq ``` hoelzl@38656 ` 216` ``` proof (rule incseq_SucI) ``` hoelzl@38656 ` 217` ``` fix n show "- ?d (A n) \ - ?d (A (Suc n))" using dA_mono[of n] by auto ``` hoelzl@38656 ` 218` ``` qed ``` hoelzl@41981 ` 219` ``` have A: "incseq A" by (auto intro!: incseq_SucI) ``` hoelzl@47694 ` 220` ``` from finite_Lim_measure_incseq[OF _ A] `range A \ sets M` ``` hoelzl@47694 ` 221` ``` M'.finite_Lim_measure_incseq[OF _ A] ``` hoelzl@38656 ` 222` ``` have convergent: "(\i. ?d (A i)) ----> ?d (\i. A i)" ``` hoelzl@47694 ` 223` ``` by (auto intro!: tendsto_diff simp: sets_eq) ``` hoelzl@38656 ` 224` ``` obtain n :: nat where "- ?d (\i. A i) / e < real n" using reals_Archimedean2 by auto ``` hoelzl@38656 ` 225` ``` moreover from order_trans[OF decseq_le[OF decseq convergent] dA_less] ``` hoelzl@38656 ` 226` ``` have "real n \ - ?d (\i. A i) / e" using `0A\sets M. measure M (space M) - measure N (space M) \ ``` hoelzl@47694 ` 234` ``` measure M A - measure N A \ ``` hoelzl@47694 ` 235` ``` (\B\sets M. B \ A \ 0 \ measure M B - measure N B)" ``` hoelzl@41981 ` 236` ```proof - ``` hoelzl@47694 ` 237` ``` interpret N: finite_measure N by fact ``` hoelzl@47694 ` 238` ``` let ?d = "\A. measure M A - measure N A" ``` wenzelm@46731 ` 239` ``` let ?P = "\A B n. A \ sets M \ A \ B \ ?d B \ ?d A \ (\C\sets M. C \ A \ - 1 / real (Suc n) < ?d C)" ``` wenzelm@46731 ` 240` ``` let ?r = "\S. restricted_space S" ``` hoelzl@41981 ` 241` ``` { fix S n assume S: "S \ sets M" ``` hoelzl@47694 ` 242` ``` then have "finite_measure (density M (indicator S))" "0 < 1 / real (Suc n)" ``` hoelzl@47694 ` 243` ``` "finite_measure (density N (indicator S))" "sets (density N (indicator S)) = sets (density M (indicator S))" ``` hoelzl@47694 ` 244` ``` by (auto simp: finite_measure_restricted N.finite_measure_restricted sets_eq) ``` hoelzl@41981 ` 245` ``` from finite_measure.Radon_Nikodym_aux_epsilon[OF this] guess X .. note X = this ``` hoelzl@47694 ` 246` ``` with S have "?P (S \ X) S n" ``` hoelzl@47694 ` 247` ``` by (simp add: measure_restricted sets_eq Int) (metis inf_absorb2) ``` hoelzl@47694 ` 248` ``` hence "\A. ?P A S n" .. } ``` hoelzl@38656 ` 249` ``` note Ex_P = this ``` hoelzl@38656 ` 250` ``` def A \ "nat_rec (space M) (\n A. SOME B. ?P B A n)" ``` hoelzl@38656 ` 251` ``` have A_Suc: "\n. A (Suc n) = (SOME B. ?P B (A n) n)" by (simp add: A_def) ``` hoelzl@38656 ` 252` ``` have A_0[simp]: "A 0 = space M" unfolding A_def by simp ``` hoelzl@38656 ` 253` ``` { fix i have "A i \ sets M" unfolding A_def ``` hoelzl@38656 ` 254` ``` proof (induct i) ``` hoelzl@38656 ` 255` ``` case (Suc i) ``` hoelzl@38656 ` 256` ``` from Ex_P[OF this, of i] show ?case unfolding nat_rec_Suc ``` hoelzl@38656 ` 257` ``` by (rule someI2_ex) simp ``` hoelzl@38656 ` 258` ``` qed simp } ``` hoelzl@38656 ` 259` ``` note A_in_sets = this ``` hoelzl@38656 ` 260` ``` { fix n have "?P (A (Suc n)) (A n) n" ``` hoelzl@38656 ` 261` ``` using Ex_P[OF A_in_sets] unfolding A_Suc ``` hoelzl@38656 ` 262` ``` by (rule someI2_ex) simp } ``` hoelzl@38656 ` 263` ``` note P_A = this ``` hoelzl@38656 ` 264` ``` have "range A \ sets M" using A_in_sets by auto ``` hoelzl@38656 ` 265` ``` have A_mono: "\i. A (Suc i) \ A i" using P_A by simp ``` hoelzl@38656 ` 266` ``` have mono_dA: "mono (\i. ?d (A i))" using P_A by (simp add: mono_iff_le_Suc) ``` hoelzl@38656 ` 267` ``` have epsilon: "\C i. \ C \ sets M; C \ A (Suc i) \ \ - 1 / real (Suc i) < ?d C" ``` hoelzl@38656 ` 268` ``` using P_A by auto ``` hoelzl@38656 ` 269` ``` show ?thesis ``` hoelzl@38656 ` 270` ``` proof (safe intro!: bexI[of _ "\i. A i"]) ``` hoelzl@38656 ` 271` ``` show "(\i. A i) \ sets M" using A_in_sets by auto ``` hoelzl@41981 ` 272` ``` have A: "decseq A" using A_mono by (auto intro!: decseq_SucI) ``` hoelzl@47694 ` 273` ``` from `range A \ sets M` ``` hoelzl@47694 ` 274` ``` finite_Lim_measure_decseq[OF _ A] N.finite_Lim_measure_decseq[OF _ A] ``` hoelzl@47694 ` 275` ``` have "(\i. ?d (A i)) ----> ?d (\i. A i)" by (auto intro!: tendsto_diff simp: sets_eq) ``` hoelzl@38656 ` 276` ``` thus "?d (space M) \ ?d (\i. A i)" using mono_dA[THEN monoD, of 0 _] ``` hoelzl@47694 ` 277` ``` by (rule_tac LIMSEQ_le_const) auto ``` hoelzl@38656 ` 278` ``` next ``` hoelzl@38656 ` 279` ``` fix B assume B: "B \ sets M" "B \ (\i. A i)" ``` hoelzl@38656 ` 280` ``` show "0 \ ?d B" ``` hoelzl@38656 ` 281` ``` proof (rule ccontr) ``` hoelzl@38656 ` 282` ``` assume "\ 0 \ ?d B" ``` hoelzl@38656 ` 283` ``` hence "0 < - ?d B" by auto ``` hoelzl@38656 ` 284` ``` from ex_inverse_of_nat_Suc_less[OF this] ``` hoelzl@38656 ` 285` ``` obtain n where *: "?d B < - 1 / real (Suc n)" ``` hoelzl@38656 ` 286` ``` by (auto simp: real_eq_of_nat inverse_eq_divide field_simps) ``` hoelzl@38656 ` 287` ``` have "B \ A (Suc n)" using B by (auto simp del: nat_rec_Suc) ``` hoelzl@38656 ` 288` ``` from epsilon[OF B(1) this] * ``` hoelzl@38656 ` 289` ``` show False by auto ``` hoelzl@38656 ` 290` ``` qed ``` hoelzl@38656 ` 291` ``` qed ``` hoelzl@38656 ` 292` ```qed ``` hoelzl@38656 ` 293` hoelzl@38656 ` 294` ```lemma (in finite_measure) Radon_Nikodym_finite_measure: ``` hoelzl@47694 ` 295` ``` assumes "finite_measure N" and sets_eq: "sets N = sets M" ``` hoelzl@47694 ` 296` ``` assumes "absolutely_continuous M N" ``` hoelzl@47694 ` 297` ``` shows "\f \ borel_measurable M. (\x. 0 \ f x) \ density M f = N" ``` hoelzl@38656 ` 298` ```proof - ``` hoelzl@47694 ` 299` ``` interpret N: finite_measure N by fact ``` hoelzl@47694 ` 300` ``` def G \ "{g \ borel_measurable M. (\x. 0 \ g x) \ (\A\sets M. (\\<^isup>+x. g x * indicator A x \M) \ N A)}" ``` hoelzl@38656 ` 301` ``` have "(\x. 0) \ G" unfolding G_def by auto ``` hoelzl@38656 ` 302` ``` hence "G \ {}" by auto ``` hoelzl@38656 ` 303` ``` { fix f g assume f: "f \ G" and g: "g \ G" ``` hoelzl@38656 ` 304` ``` have "(\x. max (g x) (f x)) \ G" (is "?max \ G") unfolding G_def ``` hoelzl@38656 ` 305` ``` proof safe ``` hoelzl@38656 ` 306` ``` show "?max \ borel_measurable M" using f g unfolding G_def by auto ``` hoelzl@38656 ` 307` ``` let ?A = "{x \ space M. f x \ g x}" ``` hoelzl@38656 ` 308` ``` have "?A \ sets M" using f g unfolding G_def by auto ``` hoelzl@38656 ` 309` ``` fix A assume "A \ sets M" ``` hoelzl@38656 ` 310` ``` hence sets: "?A \ A \ sets M" "(space M - ?A) \ A \ sets M" using `?A \ sets M` by auto ``` hoelzl@47694 ` 311` ``` hence sets': "?A \ A \ sets N" "(space M - ?A) \ A \ sets N" by (auto simp: sets_eq) ``` hoelzl@38656 ` 312` ``` have union: "((?A \ A) \ ((space M - ?A) \ A)) = A" ``` hoelzl@38656 ` 313` ``` using sets_into_space[OF `A \ sets M`] by auto ``` hoelzl@38656 ` 314` ``` have "\x. x \ space M \ max (g x) (f x) * indicator A x = ``` hoelzl@38656 ` 315` ``` g x * indicator (?A \ A) x + f x * indicator ((space M - ?A) \ A) x" ``` hoelzl@38656 ` 316` ``` by (auto simp: indicator_def max_def) ``` hoelzl@41689 ` 317` ``` hence "(\\<^isup>+x. max (g x) (f x) * indicator A x \M) = ``` hoelzl@41689 ` 318` ``` (\\<^isup>+x. g x * indicator (?A \ A) x \M) + ``` hoelzl@41689 ` 319` ``` (\\<^isup>+x. f x * indicator ((space M - ?A) \ A) x \M)" ``` hoelzl@38656 ` 320` ``` using f g sets unfolding G_def ``` wenzelm@46731 ` 321` ``` by (auto cong: positive_integral_cong intro!: positive_integral_add) ``` hoelzl@47694 ` 322` ``` also have "\ \ N (?A \ A) + N ((space M - ?A) \ A)" ``` hoelzl@38656 ` 323` ``` using f g sets unfolding G_def by (auto intro!: add_mono) ``` hoelzl@47694 ` 324` ``` also have "\ = N A" ``` hoelzl@47694 ` 325` ``` using plus_emeasure[OF sets'] union by auto ``` hoelzl@47694 ` 326` ``` finally show "(\\<^isup>+x. max (g x) (f x) * indicator A x \M) \ N A" . ``` hoelzl@41981 ` 327` ``` next ``` hoelzl@41981 ` 328` ``` fix x show "0 \ max (g x) (f x)" using f g by (auto simp: G_def split: split_max) ``` hoelzl@38656 ` 329` ``` qed } ``` hoelzl@38656 ` 330` ``` note max_in_G = this ``` hoelzl@41981 ` 331` ``` { fix f assume "incseq f" and f: "\i. f i \ G" ``` hoelzl@41981 ` 332` ``` have "(\x. SUP i. f i x) \ G" unfolding G_def ``` hoelzl@38656 ` 333` ``` proof safe ``` hoelzl@41981 ` 334` ``` show "(\x. SUP i. f i x) \ borel_measurable M" ``` hoelzl@41981 ` 335` ``` using f by (auto simp: G_def) ``` hoelzl@41981 ` 336` ``` { fix x show "0 \ (SUP i. f i x)" ``` hoelzl@44928 ` 337` ``` using f by (auto simp: G_def intro: SUP_upper2) } ``` hoelzl@41981 ` 338` ``` next ``` hoelzl@38656 ` 339` ``` fix A assume "A \ sets M" ``` hoelzl@41981 ` 340` ``` have "(\\<^isup>+x. (SUP i. f i x) * indicator A x \M) = ``` hoelzl@41981 ` 341` ``` (\\<^isup>+x. (SUP i. f i x * indicator A x) \M)" ``` hoelzl@41981 ` 342` ``` by (intro positive_integral_cong) (simp split: split_indicator) ``` hoelzl@41981 ` 343` ``` also have "\ = (SUP i. (\\<^isup>+x. f i x * indicator A x \M))" ``` hoelzl@41981 ` 344` ``` using `incseq f` f `A \ sets M` ``` hoelzl@41981 ` 345` ``` by (intro positive_integral_monotone_convergence_SUP) ``` hoelzl@41981 ` 346` ``` (auto simp: G_def incseq_Suc_iff le_fun_def split: split_indicator) ``` hoelzl@47694 ` 347` ``` finally show "(\\<^isup>+x. (SUP i. f i x) * indicator A x \M) \ N A" ``` hoelzl@44928 ` 348` ``` using f `A \ sets M` by (auto intro!: SUP_least simp: G_def) ``` hoelzl@38656 ` 349` ``` qed } ``` hoelzl@38656 ` 350` ``` note SUP_in_G = this ``` hoelzl@41689 ` 351` ``` let ?y = "SUP g : G. integral\<^isup>P M g" ``` hoelzl@47694 ` 352` ``` have y_le: "?y \ N (space M)" unfolding G_def ``` hoelzl@44928 ` 353` ``` proof (safe intro!: SUP_least) ``` hoelzl@47694 ` 354` ``` fix g assume "\A\sets M. (\\<^isup>+x. g x * indicator A x \M) \ N A" ``` hoelzl@47694 ` 355` ``` from this[THEN bspec, OF top] show "integral\<^isup>P M g \ N (space M)" ``` hoelzl@38656 ` 356` ``` by (simp cong: positive_integral_cong) ``` hoelzl@38656 ` 357` ``` qed ``` hoelzl@41981 ` 358` ``` from SUPR_countable_SUPR[OF `G \ {}`, of "integral\<^isup>P M"] guess ys .. note ys = this ``` hoelzl@41981 ` 359` ``` then have "\n. \g. g\G \ integral\<^isup>P M g = ys n" ``` hoelzl@38656 ` 360` ``` proof safe ``` hoelzl@41689 ` 361` ``` fix n assume "range ys \ integral\<^isup>P M ` G" ``` hoelzl@41689 ` 362` ``` hence "ys n \ integral\<^isup>P M ` G" by auto ``` hoelzl@41689 ` 363` ``` thus "\g. g\G \ integral\<^isup>P M g = ys n" by auto ``` hoelzl@38656 ` 364` ``` qed ``` hoelzl@41689 ` 365` ``` from choice[OF this] obtain gs where "\i. gs i \ G" "\n. integral\<^isup>P M (gs n) = ys n" by auto ``` hoelzl@41689 ` 366` ``` hence y_eq: "?y = (SUP i. integral\<^isup>P M (gs i))" using ys by auto ``` wenzelm@46731 ` 367` ``` let ?g = "\i x. Max ((\n. gs n x) ` {..i})" ``` hoelzl@41981 ` 368` ``` def f \ "\x. SUP i. ?g i x" ``` wenzelm@46731 ` 369` ``` let ?F = "\A x. f x * indicator A x" ``` hoelzl@41981 ` 370` ``` have gs_not_empty: "\i x. (\n. gs n x) ` {..i} \ {}" by auto ``` hoelzl@38656 ` 371` ``` { fix i have "?g i \ G" ``` hoelzl@38656 ` 372` ``` proof (induct i) ``` hoelzl@38656 ` 373` ``` case 0 thus ?case by simp fact ``` hoelzl@38656 ` 374` ``` next ``` hoelzl@38656 ` 375` ``` case (Suc i) ``` hoelzl@38656 ` 376` ``` with Suc gs_not_empty `gs (Suc i) \ G` show ?case ``` hoelzl@38656 ` 377` ``` by (auto simp add: atMost_Suc intro!: max_in_G) ``` hoelzl@38656 ` 378` ``` qed } ``` hoelzl@38656 ` 379` ``` note g_in_G = this ``` hoelzl@41981 ` 380` ``` have "incseq ?g" using gs_not_empty ``` hoelzl@41981 ` 381` ``` by (auto intro!: incseq_SucI le_funI simp add: atMost_Suc) ``` hoelzl@41981 ` 382` ``` from SUP_in_G[OF this g_in_G] have "f \ G" unfolding f_def . ``` hoelzl@41981 ` 383` ``` then have [simp, intro]: "f \ borel_measurable M" unfolding G_def by auto ``` hoelzl@41981 ` 384` ``` have "integral\<^isup>P M f = (SUP i. integral\<^isup>P M (?g i))" unfolding f_def ``` hoelzl@41981 ` 385` ``` using g_in_G `incseq ?g` ``` hoelzl@41981 ` 386` ``` by (auto intro!: positive_integral_monotone_convergence_SUP simp: G_def) ``` hoelzl@38656 ` 387` ``` also have "\ = ?y" ``` hoelzl@38656 ` 388` ``` proof (rule antisym) ``` hoelzl@41689 ` 389` ``` show "(SUP i. integral\<^isup>P M (?g i)) \ ?y" ``` hoelzl@47694 ` 390` ``` using g_in_G by (auto intro: Sup_mono simp: SUP_def) ``` hoelzl@41689 ` 391` ``` show "?y \ (SUP i. integral\<^isup>P M (?g i))" unfolding y_eq ``` hoelzl@38656 ` 392` ``` by (auto intro!: SUP_mono positive_integral_mono Max_ge) ``` hoelzl@38656 ` 393` ``` qed ``` hoelzl@41689 ` 394` ``` finally have int_f_eq_y: "integral\<^isup>P M f = ?y" . ``` hoelzl@41981 ` 395` ``` have "\x. 0 \ f x" ``` hoelzl@41981 ` 396` ``` unfolding f_def using `\i. gs i \ G` ``` hoelzl@44928 ` 397` ``` by (auto intro!: SUP_upper2 Max_ge_iff[THEN iffD2] simp: G_def) ``` hoelzl@47694 ` 398` ``` let ?t = "\A. N A - (\\<^isup>+x. ?F A x \M)" ``` hoelzl@47694 ` 399` ``` let ?M = "diff_measure N (density M f)" ``` hoelzl@47694 ` 400` ``` have f_le_N: "\A. A \ sets M \ (\\<^isup>+x. ?F A x \M) \ N A" ``` hoelzl@41981 ` 401` ``` using `f \ G` unfolding G_def by auto ``` hoelzl@47694 ` 402` ``` have emeasure_M: "\A. A \ sets M \ emeasure ?M A = ?t A" ``` hoelzl@47694 ` 403` ``` proof (subst emeasure_diff_measure) ``` hoelzl@47694 ` 404` ``` from f_le_N[of "space M"] show "finite_measure N" "finite_measure (density M f)" ``` hoelzl@47694 ` 405` ``` by (auto intro!: finite_measureI simp: emeasure_density cong: positive_integral_cong) ``` hoelzl@47694 ` 406` ``` next ``` hoelzl@47694 ` 407` ``` fix B assume "B \ sets N" with f_le_N[of B] show "emeasure (density M f) B \ emeasure N B" ``` hoelzl@47694 ` 408` ``` by (auto simp: sets_eq emeasure_density cong: positive_integral_cong) ``` hoelzl@47694 ` 409` ``` qed (auto simp: sets_eq emeasure_density) ``` hoelzl@47694 ` 410` ``` from emeasure_M[of "space M"] N.finite_emeasure_space positive_integral_positive[of M "?F (space M)"] ``` hoelzl@47694 ` 411` ``` interpret M': finite_measure ?M ``` hoelzl@47694 ` 412` ``` by (auto intro!: finite_measureI simp: sets_eq_imp_space_eq[OF sets_eq] N.emeasure_eq_measure ereal_minus_eq_PInfty_iff) ``` hoelzl@47694 ` 413` hoelzl@47694 ` 414` ``` have ac: "absolutely_continuous M ?M" unfolding absolutely_continuous_def ``` hoelzl@45777 ` 415` ``` proof ``` hoelzl@47694 ` 416` ``` fix A assume A: "A \ null_sets M" ``` hoelzl@47694 ` 417` ``` with `absolutely_continuous M N` have "A \ null_sets N" ``` hoelzl@47694 ` 418` ``` unfolding absolutely_continuous_def by auto ``` hoelzl@47694 ` 419` ``` moreover with A have "(\\<^isup>+ x. ?F A x \M) \ N A" using `f \ G` by (auto simp: G_def) ``` hoelzl@47694 ` 420` ``` ultimately have "N A - (\\<^isup>+ x. ?F A x \M) = 0" ``` hoelzl@47694 ` 421` ``` using positive_integral_positive[of M] by (auto intro!: antisym) ``` hoelzl@47694 ` 422` ``` then show "A \ null_sets ?M" ``` hoelzl@47694 ` 423` ``` using A by (simp add: emeasure_M null_sets_def sets_eq) ``` hoelzl@38656 ` 424` ``` qed ``` hoelzl@47694 ` 425` ``` have upper_bound: "\A\sets M. ?M A \ 0" ``` hoelzl@38656 ` 426` ``` proof (rule ccontr) ``` hoelzl@38656 ` 427` ``` assume "\ ?thesis" ``` hoelzl@47694 ` 428` ``` then obtain A where A: "A \ sets M" and pos: "0 < ?M A" ``` hoelzl@38656 ` 429` ``` by (auto simp: not_le) ``` hoelzl@38656 ` 430` ``` note pos ``` hoelzl@47694 ` 431` ``` also have "?M A \ ?M (space M)" ``` hoelzl@47694 ` 432` ``` using emeasure_space[of ?M A] by (simp add: sets_eq[THEN sets_eq_imp_space_eq]) ``` hoelzl@47694 ` 433` ``` finally have pos_t: "0 < ?M (space M)" by simp ``` hoelzl@38656 ` 434` ``` moreover ``` hoelzl@47694 ` 435` ``` then have "emeasure M (space M) \ 0" ``` hoelzl@47694 ` 436` ``` using ac unfolding absolutely_continuous_def by (auto simp: null_sets_def) ``` hoelzl@47694 ` 437` ``` then have pos_M: "0 < emeasure M (space M)" ``` hoelzl@47694 ` 438` ``` using emeasure_nonneg[of M "space M"] by (simp add: le_less) ``` hoelzl@38656 ` 439` ``` moreover ``` hoelzl@47694 ` 440` ``` have "(\\<^isup>+x. f x * indicator (space M) x \M) \ N (space M)" ``` hoelzl@38656 ` 441` ``` using `f \ G` unfolding G_def by auto ``` hoelzl@41981 ` 442` ``` hence "(\\<^isup>+x. f x * indicator (space M) x \M) \ \" ``` hoelzl@47694 ` 443` ``` using M'.finite_emeasure_space by auto ``` hoelzl@38656 ` 444` ``` moreover ``` hoelzl@47694 ` 445` ``` def b \ "?M (space M) / emeasure M (space M) / 2" ``` hoelzl@41981 ` 446` ``` ultimately have b: "b \ 0 \ 0 \ b \ b \ \" ``` hoelzl@47694 ` 447` ``` by (auto simp: ereal_divide_eq) ``` hoelzl@41981 ` 448` ``` then have b: "b \ 0" "0 \ b" "0 < b" "b \ \" by auto ``` hoelzl@47694 ` 449` ``` let ?Mb = "density M (\_. b)" ``` hoelzl@47694 ` 450` ``` have Mb: "finite_measure ?Mb" "sets ?Mb = sets ?M" ``` hoelzl@47694 ` 451` ``` using b by (auto simp: emeasure_density_const sets_eq intro!: finite_measureI) ``` hoelzl@47694 ` 452` ``` from M'.Radon_Nikodym_aux[OF this] guess A0 .. ``` hoelzl@47694 ` 453` ``` then have "A0 \ sets M" ``` hoelzl@47694 ` 454` ``` and space_less_A0: "measure ?M (space M) - real b * measure M (space M) \ measure ?M A0 - real b * measure M A0" ``` hoelzl@47694 ` 455` ``` and *: "\B. B \ sets M \ B \ A0 \ 0 \ measure ?M B - real b * measure M B" ``` hoelzl@47694 ` 456` ``` using b by (simp_all add: measure_density_const sets_eq_imp_space_eq[OF sets_eq] sets_eq) ``` hoelzl@41981 ` 457` ``` { fix B assume B: "B \ sets M" "B \ A0" ``` hoelzl@47694 ` 458` ``` with *[OF this] have "b * emeasure M B \ ?M B" ``` hoelzl@47694 ` 459` ``` using b unfolding M'.emeasure_eq_measure emeasure_eq_measure by (cases b) auto } ``` hoelzl@38656 ` 460` ``` note bM_le_t = this ``` wenzelm@46731 ` 461` ``` let ?f0 = "\x. f x + b * indicator A0 x" ``` hoelzl@38656 ` 462` ``` { fix A assume A: "A \ sets M" ``` hoelzl@38656 ` 463` ``` hence "A \ A0 \ sets M" using `A0 \ sets M` by auto ``` hoelzl@41689 ` 464` ``` have "(\\<^isup>+x. ?f0 x * indicator A x \M) = ``` hoelzl@41689 ` 465` ``` (\\<^isup>+x. f x * indicator A x + b * indicator (A \ A0) x \M)" ``` hoelzl@41981 ` 466` ``` by (auto intro!: positive_integral_cong split: split_indicator) ``` hoelzl@41689 ` 467` ``` hence "(\\<^isup>+x. ?f0 x * indicator A x \M) = ``` hoelzl@47694 ` 468` ``` (\\<^isup>+x. f x * indicator A x \M) + b * emeasure M (A \ A0)" ``` hoelzl@41981 ` 469` ``` using `A0 \ sets M` `A \ A0 \ sets M` A b `f \ G` ``` hoelzl@41981 ` 470` ``` by (simp add: G_def positive_integral_add positive_integral_cmult_indicator) } ``` hoelzl@38656 ` 471` ``` note f0_eq = this ``` hoelzl@38656 ` 472` ``` { fix A assume A: "A \ sets M" ``` hoelzl@38656 ` 473` ``` hence "A \ A0 \ sets M" using `A0 \ sets M` by auto ``` hoelzl@47694 ` 474` ``` have f_le_v: "(\\<^isup>+x. ?F A x \M) \ N A" using `f \ G` A unfolding G_def by auto ``` hoelzl@38656 ` 475` ``` note f0_eq[OF A] ``` hoelzl@47694 ` 476` ``` also have "(\\<^isup>+x. ?F A x \M) + b * emeasure M (A \ A0) \ (\\<^isup>+x. ?F A x \M) + ?M (A \ A0)" ``` hoelzl@38656 ` 477` ``` using bM_le_t[OF `A \ A0 \ sets M`] `A \ sets M` `A0 \ sets M` ``` hoelzl@38656 ` 478` ``` by (auto intro!: add_left_mono) ``` hoelzl@47694 ` 479` ``` also have "\ \ (\\<^isup>+x. f x * indicator A x \M) + ?M A" ``` hoelzl@47694 ` 480` ``` using emeasure_mono[of "A \ A0" A ?M] `A \ sets M` `A0 \ sets M` ``` hoelzl@47694 ` 481` ``` by (auto intro!: add_left_mono simp: sets_eq) ``` hoelzl@47694 ` 482` ``` also have "\ \ N A" ``` hoelzl@47694 ` 483` ``` unfolding emeasure_M[OF `A \ sets M`] ``` hoelzl@47694 ` 484` ``` using f_le_v N.emeasure_eq_measure[of A] positive_integral_positive[of M "?F A"] ``` hoelzl@47694 ` 485` ``` by (cases "\\<^isup>+x. ?F A x \M", cases "N A") auto ``` hoelzl@47694 ` 486` ``` finally have "(\\<^isup>+x. ?f0 x * indicator A x \M) \ N A" . } ``` hoelzl@41981 ` 487` ``` hence "?f0 \ G" using `A0 \ sets M` b `f \ G` unfolding G_def ``` wenzelm@46731 ` 488` ``` by (auto intro!: ereal_add_nonneg_nonneg) ``` hoelzl@41981 ` 489` ``` have int_f_finite: "integral\<^isup>P M f \ \" ``` hoelzl@47694 ` 490` ``` by (metis N.emeasure_finite ereal_infty_less_eq2(1) int_f_eq_y y_le) ``` hoelzl@47694 ` 491` ``` have "0 < ?M (space M) - emeasure ?Mb (space M)" ``` hoelzl@47694 ` 492` ``` using pos_t ``` hoelzl@47694 ` 493` ``` by (simp add: b emeasure_density_const) ``` hoelzl@47694 ` 494` ``` (simp add: M'.emeasure_eq_measure emeasure_eq_measure pos_M b_def) ``` hoelzl@47694 ` 495` ``` also have "\ \ ?M A0 - b * emeasure M A0" ``` hoelzl@47694 ` 496` ``` using space_less_A0 `A0 \ sets M` b ``` hoelzl@47694 ` 497` ``` by (cases b) (auto simp add: b emeasure_density_const sets_eq M'.emeasure_eq_measure emeasure_eq_measure) ``` hoelzl@47694 ` 498` ``` finally have 1: "b * emeasure M A0 < ?M A0" ``` hoelzl@47694 ` 499` ``` by (metis M'.emeasure_real `A0 \ sets M` bM_le_t diff_self ereal_less(1) ereal_minus(1) ``` hoelzl@47694 ` 500` ``` less_eq_ereal_def mult_zero_left not_square_less_zero subset_refl zero_ereal_def) ``` hoelzl@47694 ` 501` ``` with b have "0 < ?M A0" ``` hoelzl@47694 ` 502` ``` by (metis M'.emeasure_real MInfty_neq_PInfty(1) emeasure_real ereal_less_eq(5) ereal_zero_times ``` hoelzl@47694 ` 503` ``` ereal_mult_eq_MInfty ereal_mult_eq_PInfty ereal_zero_less_0_iff less_eq_ereal_def) ``` hoelzl@47694 ` 504` ``` then have "emeasure M A0 \ 0" using ac `A0 \ sets M` ``` hoelzl@47694 ` 505` ``` by (auto simp: absolutely_continuous_def null_sets_def) ``` hoelzl@47694 ` 506` ``` then have "0 < emeasure M A0" using emeasure_nonneg[of M A0] by auto ``` hoelzl@47694 ` 507` ``` hence "0 < b * emeasure M A0" using b by (auto simp: ereal_zero_less_0_iff) ``` hoelzl@47694 ` 508` ``` with int_f_finite have "?y + 0 < integral\<^isup>P M f + b * emeasure M A0" unfolding int_f_eq_y ``` hoelzl@41981 ` 509` ``` using `f \ G` ``` hoelzl@44928 ` 510` ``` by (intro ereal_add_strict_mono) (auto intro!: SUP_upper2 positive_integral_positive) ``` hoelzl@41689 ` 511` ``` also have "\ = integral\<^isup>P M ?f0" using f0_eq[OF top] `A0 \ sets M` sets_into_space ``` hoelzl@38656 ` 512` ``` by (simp cong: positive_integral_cong) ``` hoelzl@41689 ` 513` ``` finally have "?y < integral\<^isup>P M ?f0" by simp ``` hoelzl@44928 ` 514` ``` moreover from `?f0 \ G` have "integral\<^isup>P M ?f0 \ ?y" by (auto intro!: SUP_upper) ``` hoelzl@38656 ` 515` ``` ultimately show False by auto ``` hoelzl@38656 ` 516` ``` qed ``` hoelzl@47694 ` 517` ``` let ?f = "\x. max 0 (f x)" ``` hoelzl@38656 ` 518` ``` show ?thesis ``` hoelzl@47694 ` 519` ``` proof (intro bexI[of _ ?f] measure_eqI conjI) ``` hoelzl@47694 ` 520` ``` show "sets (density M ?f) = sets N" ``` hoelzl@47694 ` 521` ``` by (simp add: sets_eq) ``` hoelzl@47694 ` 522` ``` fix A assume A: "A\sets (density M ?f)" ``` hoelzl@47694 ` 523` ``` then show "emeasure (density M ?f) A = emeasure N A" ``` hoelzl@47694 ` 524` ``` using `f \ G` A upper_bound[THEN bspec, of A] N.emeasure_eq_measure[of A] ``` hoelzl@47694 ` 525` ``` by (cases "integral\<^isup>P M (?F A)") ``` hoelzl@47694 ` 526` ``` (auto intro!: antisym simp add: emeasure_density G_def emeasure_M density_max_0[symmetric]) ``` hoelzl@47694 ` 527` ``` qed auto ``` hoelzl@38656 ` 528` ```qed ``` hoelzl@38656 ` 529` hoelzl@40859 ` 530` ```lemma (in finite_measure) split_space_into_finite_sets_and_rest: ``` hoelzl@47694 ` 531` ``` assumes ac: "absolutely_continuous M N" and sets_eq: "sets N = sets M" ``` hoelzl@41981 ` 532` ``` shows "\A0\sets M. \B::nat\'a set. disjoint_family B \ range B \ sets M \ A0 = space M - (\i. B i) \ ``` hoelzl@47694 ` 533` ``` (\A\sets M. A \ A0 \ (emeasure M A = 0 \ N A = 0) \ (emeasure M A > 0 \ N A = \)) \ ``` hoelzl@47694 ` 534` ``` (\i. N (B i) \ \)" ``` hoelzl@38656 ` 535` ```proof - ``` hoelzl@47694 ` 536` ``` let ?Q = "{Q\sets M. N Q \ \}" ``` hoelzl@47694 ` 537` ``` let ?a = "SUP Q:?Q. emeasure M Q" ``` hoelzl@47694 ` 538` ``` have "{} \ ?Q" by auto ``` hoelzl@38656 ` 539` ``` then have Q_not_empty: "?Q \ {}" by blast ``` hoelzl@47694 ` 540` ``` have "?a \ emeasure M (space M)" using sets_into_space ``` hoelzl@47694 ` 541` ``` by (auto intro!: SUP_least emeasure_mono) ``` hoelzl@47694 ` 542` ``` then have "?a \ \" using finite_emeasure_space ``` hoelzl@38656 ` 543` ``` by auto ``` hoelzl@47694 ` 544` ``` from SUPR_countable_SUPR[OF Q_not_empty, of "emeasure M"] ``` hoelzl@47694 ` 545` ``` obtain Q'' where "range Q'' \ emeasure M ` ?Q" and a: "?a = (SUP i::nat. Q'' i)" ``` hoelzl@38656 ` 546` ``` by auto ``` hoelzl@47694 ` 547` ``` then have "\i. \Q'. Q'' i = emeasure M Q' \ Q' \ ?Q" by auto ``` hoelzl@47694 ` 548` ``` from choice[OF this] obtain Q' where Q': "\i. Q'' i = emeasure M (Q' i)" "\i. Q' i \ ?Q" ``` hoelzl@38656 ` 549` ``` by auto ``` hoelzl@47694 ` 550` ``` then have a_Lim: "?a = (SUP i::nat. emeasure M (Q' i))" using a by simp ``` wenzelm@46731 ` 551` ``` let ?O = "\n. \i\n. Q' i" ``` hoelzl@47694 ` 552` ``` have Union: "(SUP i. emeasure M (?O i)) = emeasure M (\i. ?O i)" ``` hoelzl@47694 ` 553` ``` proof (rule SUP_emeasure_incseq[of ?O]) ``` hoelzl@47694 ` 554` ``` show "range ?O \ sets M" using Q' by auto ``` nipkow@44890 ` 555` ``` show "incseq ?O" by (fastforce intro!: incseq_SucI) ``` hoelzl@38656 ` 556` ``` qed ``` hoelzl@38656 ` 557` ``` have Q'_sets: "\i. Q' i \ sets M" using Q' by auto ``` hoelzl@47694 ` 558` ``` have O_sets: "\i. ?O i \ sets M" using Q' by auto ``` hoelzl@38656 ` 559` ``` then have O_in_G: "\i. ?O i \ ?Q" ``` hoelzl@38656 ` 560` ``` proof (safe del: notI) ``` hoelzl@47694 ` 561` ``` fix i have "Q' ` {..i} \ sets M" using Q' by auto ``` hoelzl@47694 ` 562` ``` then have "N (?O i) \ (\i\i. N (Q' i))" ``` hoelzl@47694 ` 563` ``` by (simp add: sets_eq emeasure_subadditive_finite) ``` hoelzl@41981 ` 564` ``` also have "\ < \" using Q' by (simp add: setsum_Pinfty) ``` hoelzl@47694 ` 565` ``` finally show "N (?O i) \ \" by simp ``` hoelzl@38656 ` 566` ``` qed auto ``` nipkow@44890 ` 567` ``` have O_mono: "\n. ?O n \ ?O (Suc n)" by fastforce ``` hoelzl@47694 ` 568` ``` have a_eq: "?a = emeasure M (\i. ?O i)" unfolding Union[symmetric] ``` hoelzl@38656 ` 569` ``` proof (rule antisym) ``` hoelzl@47694 ` 570` ``` show "?a \ (SUP i. emeasure M (?O i))" unfolding a_Lim ``` hoelzl@47694 ` 571` ``` using Q' by (auto intro!: SUP_mono emeasure_mono) ``` hoelzl@47694 ` 572` ``` show "(SUP i. emeasure M (?O i)) \ ?a" unfolding SUP_def ``` hoelzl@38656 ` 573` ``` proof (safe intro!: Sup_mono, unfold bex_simps) ``` hoelzl@38656 ` 574` ``` fix i ``` hoelzl@38656 ` 575` ``` have *: "(\Q' ` {..i}) = ?O i" by auto ``` hoelzl@47694 ` 576` ``` then show "\x. (x \ sets M \ N x \ \) \ ``` hoelzl@47694 ` 577` ``` emeasure M (\Q' ` {..i}) \ emeasure M x" ``` hoelzl@38656 ` 578` ``` using O_in_G[of i] by (auto intro!: exI[of _ "?O i"]) ``` hoelzl@38656 ` 579` ``` qed ``` hoelzl@38656 ` 580` ``` qed ``` wenzelm@46731 ` 581` ``` let ?O_0 = "(\i. ?O i)" ``` hoelzl@38656 ` 582` ``` have "?O_0 \ sets M" using Q' by auto ``` hoelzl@40859 ` 583` ``` def Q \ "\i. case i of 0 \ Q' 0 | Suc n \ ?O (Suc n) - ?O n" ``` hoelzl@38656 ` 584` ``` { fix i have "Q i \ sets M" unfolding Q_def using Q'[of 0] by (cases i) (auto intro: O_sets) } ``` hoelzl@38656 ` 585` ``` note Q_sets = this ``` hoelzl@40859 ` 586` ``` show ?thesis ``` hoelzl@40859 ` 587` ``` proof (intro bexI exI conjI ballI impI allI) ``` hoelzl@40859 ` 588` ``` show "disjoint_family Q" ``` nipkow@44890 ` 589` ``` by (fastforce simp: disjoint_family_on_def Q_def ``` hoelzl@40859 ` 590` ``` split: nat.split_asm) ``` hoelzl@40859 ` 591` ``` show "range Q \ sets M" ``` hoelzl@40859 ` 592` ``` using Q_sets by auto ``` hoelzl@40859 ` 593` ``` { fix A assume A: "A \ sets M" "A \ space M - ?O_0" ``` hoelzl@47694 ` 594` ``` show "emeasure M A = 0 \ N A = 0 \ 0 < emeasure M A \ N A = \" ``` hoelzl@40859 ` 595` ``` proof (rule disjCI, simp) ``` hoelzl@47694 ` 596` ``` assume *: "0 < emeasure M A \ N A \ \" ``` hoelzl@47694 ` 597` ``` show "emeasure M A = 0 \ N A = 0" ``` hoelzl@40859 ` 598` ``` proof cases ``` hoelzl@47694 ` 599` ``` assume "emeasure M A = 0" moreover with ac A have "N A = 0" ``` hoelzl@40859 ` 600` ``` unfolding absolutely_continuous_def by auto ``` hoelzl@40859 ` 601` ``` ultimately show ?thesis by simp ``` hoelzl@40859 ` 602` ``` next ``` hoelzl@47694 ` 603` ``` assume "emeasure M A \ 0" with * have "N A \ \" using emeasure_nonneg[of M A] by auto ``` hoelzl@47694 ` 604` ``` with A have "emeasure M ?O_0 + emeasure M A = emeasure M (?O_0 \ A)" ``` hoelzl@47694 ` 605` ``` using Q' by (auto intro!: plus_emeasure countable_UN) ``` hoelzl@47694 ` 606` ``` also have "\ = (SUP i. emeasure M (?O i \ A))" ``` hoelzl@47694 ` 607` ``` proof (rule SUP_emeasure_incseq[of "\i. ?O i \ A", symmetric, simplified]) ``` hoelzl@40859 ` 608` ``` show "range (\i. ?O i \ A) \ sets M" ``` hoelzl@47694 ` 609` ``` using `N A \ \` O_sets A by auto ``` nipkow@44890 ` 610` ``` qed (fastforce intro!: incseq_SucI) ``` hoelzl@40859 ` 611` ``` also have "\ \ ?a" ``` hoelzl@44928 ` 612` ``` proof (safe intro!: SUP_least) ``` hoelzl@40859 ` 613` ``` fix i have "?O i \ A \ ?Q" ``` hoelzl@40859 ` 614` ``` proof (safe del: notI) ``` hoelzl@40859 ` 615` ``` show "?O i \ A \ sets M" using O_sets A by auto ``` hoelzl@47694 ` 616` ``` from O_in_G[of i] have "N (?O i \ A) \ N (?O i) + N A" ``` hoelzl@47694 ` 617` ``` using emeasure_subadditive[of "?O i" N A] A O_sets by (auto simp: sets_eq) ``` hoelzl@47694 ` 618` ``` with O_in_G[of i] show "N (?O i \ A) \ \" ``` hoelzl@47694 ` 619` ``` using `N A \ \` by auto ``` hoelzl@40859 ` 620` ``` qed ``` hoelzl@47694 ` 621` ``` then show "emeasure M (?O i \ A) \ ?a" by (rule SUP_upper) ``` hoelzl@40859 ` 622` ``` qed ``` hoelzl@47694 ` 623` ``` finally have "emeasure M A = 0" ``` hoelzl@47694 ` 624` ``` unfolding a_eq using measure_nonneg[of M A] by (simp add: emeasure_eq_measure) ``` hoelzl@47694 ` 625` ``` with `emeasure M A \ 0` show ?thesis by auto ``` hoelzl@40859 ` 626` ``` qed ``` hoelzl@40859 ` 627` ``` qed } ``` hoelzl@47694 ` 628` ``` { fix i show "N (Q i) \ \" ``` hoelzl@40859 ` 629` ``` proof (cases i) ``` hoelzl@40859 ` 630` ``` case 0 then show ?thesis ``` hoelzl@40859 ` 631` ``` unfolding Q_def using Q'[of 0] by simp ``` hoelzl@40859 ` 632` ``` next ``` hoelzl@40859 ` 633` ``` case (Suc n) ``` hoelzl@47694 ` 634` ``` with `?O n \ ?Q` `?O (Suc n) \ ?Q` ``` hoelzl@47694 ` 635` ``` emeasure_Diff[OF _ _ _ O_mono, of N n] emeasure_nonneg[of N "(\ x\n. Q' x)"] ``` hoelzl@47694 ` 636` ``` show ?thesis ``` hoelzl@47694 ` 637` ``` by (auto simp: sets_eq ereal_minus_eq_PInfty_iff Q_def) ``` hoelzl@40859 ` 638` ``` qed } ``` hoelzl@40859 ` 639` ``` show "space M - ?O_0 \ sets M" using Q'_sets by auto ``` hoelzl@40859 ` 640` ``` { fix j have "(\i\j. ?O i) = (\i\j. Q i)" ``` hoelzl@40859 ` 641` ``` proof (induct j) ``` hoelzl@40859 ` 642` ``` case 0 then show ?case by (simp add: Q_def) ``` hoelzl@40859 ` 643` ``` next ``` hoelzl@40859 ` 644` ``` case (Suc j) ``` nipkow@44890 ` 645` ``` have eq: "\j. (\i\j. ?O i) = (\i\j. Q' i)" by fastforce ``` hoelzl@40859 ` 646` ``` have "{..j} \ {..Suc j} = {..Suc j}" by auto ``` hoelzl@40859 ` 647` ``` then have "(\i\Suc j. Q' i) = (\i\j. Q' i) \ Q (Suc j)" ``` hoelzl@40859 ` 648` ``` by (simp add: UN_Un[symmetric] Q_def del: UN_Un) ``` hoelzl@40859 ` 649` ``` then show ?case using Suc by (auto simp add: eq atMost_Suc) ``` hoelzl@40859 ` 650` ``` qed } ``` hoelzl@40859 ` 651` ``` then have "(\j. (\i\j. ?O i)) = (\j. (\i\j. Q i))" by simp ``` nipkow@44890 ` 652` ``` then show "space M - ?O_0 = space M - (\i. Q i)" by fastforce ``` hoelzl@40859 ` 653` ``` qed ``` hoelzl@40859 ` 654` ```qed ``` hoelzl@40859 ` 655` hoelzl@40859 ` 656` ```lemma (in finite_measure) Radon_Nikodym_finite_measure_infinite: ``` hoelzl@47694 ` 657` ``` assumes "absolutely_continuous M N" and sets_eq: "sets N = sets M" ``` hoelzl@47694 ` 658` ``` shows "\f\borel_measurable M. (\x. 0 \ f x) \ density M f = N" ``` hoelzl@40859 ` 659` ```proof - ``` hoelzl@40859 ` 660` ``` from split_space_into_finite_sets_and_rest[OF assms] ``` hoelzl@40859 ` 661` ``` obtain Q0 and Q :: "nat \ 'a set" ``` hoelzl@40859 ` 662` ``` where Q: "disjoint_family Q" "range Q \ sets M" ``` hoelzl@40859 ` 663` ``` and Q0: "Q0 \ sets M" "Q0 = space M - (\i. Q i)" ``` hoelzl@47694 ` 664` ``` and in_Q0: "\A. A \ sets M \ A \ Q0 \ emeasure M A = 0 \ N A = 0 \ 0 < emeasure M A \ N A = \" ``` hoelzl@47694 ` 665` ``` and Q_fin: "\i. N (Q i) \ \" by force ``` hoelzl@40859 ` 666` ``` from Q have Q_sets: "\i. Q i \ sets M" by auto ``` hoelzl@47694 ` 667` ``` let ?N = "\i. density N (indicator (Q i))" and ?M = "\i. density M (indicator (Q i))" ``` hoelzl@47694 ` 668` ``` have "\i. \f\borel_measurable (?M i). (\x. 0 \ f x) \ density (?M i) f = ?N i" ``` hoelzl@47694 ` 669` ``` proof (intro allI finite_measure.Radon_Nikodym_finite_measure) ``` hoelzl@38656 ` 670` ``` fix i ``` hoelzl@47694 ` 671` ``` from Q show "finite_measure (?M i)" ``` hoelzl@47694 ` 672` ``` by (auto intro!: finite_measureI cong: positive_integral_cong ``` hoelzl@47694 ` 673` ``` simp add: emeasure_density subset_eq sets_eq) ``` hoelzl@47694 ` 674` ``` from Q have "emeasure (?N i) (space N) = emeasure N (Q i)" ``` hoelzl@47694 ` 675` ``` by (simp add: sets_eq[symmetric] emeasure_density subset_eq cong: positive_integral_cong) ``` hoelzl@47694 ` 676` ``` with Q_fin show "finite_measure (?N i)" ``` hoelzl@47694 ` 677` ``` by (auto intro!: finite_measureI) ``` hoelzl@47694 ` 678` ``` show "sets (?N i) = sets (?M i)" by (simp add: sets_eq) ``` hoelzl@47694 ` 679` ``` show "absolutely_continuous (?M i) (?N i)" ``` hoelzl@47694 ` 680` ``` using `absolutely_continuous M N` `Q i \ sets M` ``` hoelzl@47694 ` 681` ``` by (auto simp: absolutely_continuous_def null_sets_density_iff sets_eq ``` hoelzl@47694 ` 682` ``` intro!: absolutely_continuous_AE[OF sets_eq]) ``` hoelzl@38656 ` 683` ``` qed ``` hoelzl@47694 ` 684` ``` from choice[OF this[unfolded Bex_def]] ``` hoelzl@47694 ` 685` ``` obtain f where borel: "\i. f i \ borel_measurable M" "\i x. 0 \ f i x" ``` hoelzl@47694 ` 686` ``` and f_density: "\i. density (?M i) (f i) = ?N i" ``` hoelzl@38656 ` 687` ``` by auto ``` hoelzl@47694 ` 688` ``` { fix A i assume A: "A \ sets M" ``` hoelzl@47694 ` 689` ``` with Q borel have "(\\<^isup>+x. f i x * indicator (Q i \ A) x \M) = emeasure (density (?M i) (f i)) A" ``` hoelzl@47694 ` 690` ``` by (auto simp add: emeasure_density positive_integral_density subset_eq ``` hoelzl@47694 ` 691` ``` intro!: positive_integral_cong split: split_indicator) ``` hoelzl@47694 ` 692` ``` also have "\ = emeasure N (Q i \ A)" ``` hoelzl@47694 ` 693` ``` using A Q by (simp add: f_density emeasure_restricted subset_eq sets_eq) ``` hoelzl@47694 ` 694` ``` finally have "emeasure N (Q i \ A) = (\\<^isup>+x. f i x * indicator (Q i \ A) x \M)" .. } ``` hoelzl@47694 ` 695` ``` note integral_eq = this ``` wenzelm@46731 ` 696` ``` let ?f = "\x. (\i. f i x * indicator (Q i) x) + \ * indicator Q0 x" ``` hoelzl@38656 ` 697` ``` show ?thesis ``` hoelzl@38656 ` 698` ``` proof (safe intro!: bexI[of _ ?f]) ``` hoelzl@41981 ` 699` ``` show "?f \ borel_measurable M" using Q0 borel Q_sets ``` hoelzl@41981 ` 700` ``` by (auto intro!: measurable_If) ``` hoelzl@41981 ` 701` ``` show "\x. 0 \ ?f x" using borel by (auto intro!: suminf_0_le simp: indicator_def) ``` hoelzl@47694 ` 702` ``` show "density M ?f = N" ``` hoelzl@47694 ` 703` ``` proof (rule measure_eqI) ``` hoelzl@47694 ` 704` ``` fix A assume "A \ sets (density M ?f)" ``` hoelzl@47694 ` 705` ``` then have "A \ sets M" by simp ``` hoelzl@47694 ` 706` ``` have Qi: "\i. Q i \ sets M" using Q by auto ``` hoelzl@47694 ` 707` ``` have [intro,simp]: "\i. (\x. f i x * indicator (Q i \ A) x) \ borel_measurable M" ``` hoelzl@47694 ` 708` ``` "\i. AE x in M. 0 \ f i x * indicator (Q i \ A) x" ``` hoelzl@47694 ` 709` ``` using borel Qi Q0(1) `A \ sets M` by (auto intro!: borel_measurable_ereal_times) ``` hoelzl@47694 ` 710` ``` have "(\\<^isup>+x. ?f x * indicator A x \M) = (\\<^isup>+x. (\i. f i x * indicator (Q i \ A) x) + \ * indicator (Q0 \ A) x \M)" ``` hoelzl@47694 ` 711` ``` using borel by (intro positive_integral_cong) (auto simp: indicator_def) ``` hoelzl@47694 ` 712` ``` also have "\ = (\\<^isup>+x. (\i. f i x * indicator (Q i \ A) x) \M) + \ * emeasure M (Q0 \ A)" ``` hoelzl@47694 ` 713` ``` using borel Qi Q0(1) `A \ sets M` ``` hoelzl@47694 ` 714` ``` by (subst positive_integral_add) (auto simp del: ereal_infty_mult ``` hoelzl@47694 ` 715` ``` simp add: positive_integral_cmult_indicator Int intro!: suminf_0_le) ``` hoelzl@47694 ` 716` ``` also have "\ = (\i. N (Q i \ A)) + \ * emeasure M (Q0 \ A)" ``` hoelzl@47694 ` 717` ``` by (subst integral_eq[OF `A \ sets M`], subst positive_integral_suminf) auto ``` hoelzl@47694 ` 718` ``` finally have "(\\<^isup>+x. ?f x * indicator A x \M) = (\i. N (Q i \ A)) + \ * emeasure M (Q0 \ A)" . ``` hoelzl@47694 ` 719` ``` moreover have "(\i. N (Q i \ A)) = N ((\i. Q i) \ A)" ``` hoelzl@47694 ` 720` ``` using Q Q_sets `A \ sets M` ``` hoelzl@47694 ` 721` ``` by (subst suminf_emeasure) (auto simp: disjoint_family_on_def sets_eq) ``` hoelzl@47694 ` 722` ``` moreover have "\ * emeasure M (Q0 \ A) = N (Q0 \ A)" ``` hoelzl@47694 ` 723` ``` proof - ``` hoelzl@47694 ` 724` ``` have "Q0 \ A \ sets M" using Q0(1) `A \ sets M` by blast ``` hoelzl@47694 ` 725` ``` from in_Q0[OF this] show ?thesis by auto ``` hoelzl@47694 ` 726` ``` qed ``` hoelzl@47694 ` 727` ``` moreover have "Q0 \ A \ sets M" "((\i. Q i) \ A) \ sets M" ``` hoelzl@47694 ` 728` ``` using Q_sets `A \ sets M` Q0(1) by auto ``` hoelzl@47694 ` 729` ``` moreover have "((\i. Q i) \ A) \ (Q0 \ A) = A" "((\i. Q i) \ A) \ (Q0 \ A) = {}" ``` hoelzl@47694 ` 730` ``` using `A \ sets M` sets_into_space Q0 by auto ``` hoelzl@47694 ` 731` ``` ultimately have "N A = (\\<^isup>+x. ?f x * indicator A x \M)" ``` hoelzl@47694 ` 732` ``` using plus_emeasure[of "(\i. Q i) \ A" N "Q0 \ A"] by (simp add: sets_eq) ``` hoelzl@47694 ` 733` ``` with `A \ sets M` borel Q Q0(1) show "emeasure (density M ?f) A = N A" ``` hoelzl@47694 ` 734` ``` by (subst emeasure_density) ``` hoelzl@47694 ` 735` ``` (auto intro!: borel_measurable_ereal_add borel_measurable_psuminf measurable_If ``` hoelzl@47694 ` 736` ``` simp: subset_eq) ``` hoelzl@47694 ` 737` ``` qed (simp add: sets_eq) ``` hoelzl@38656 ` 738` ``` qed ``` hoelzl@38656 ` 739` ```qed ``` hoelzl@38656 ` 740` hoelzl@38656 ` 741` ```lemma (in sigma_finite_measure) Radon_Nikodym: ``` hoelzl@47694 ` 742` ``` assumes ac: "absolutely_continuous M N" assumes sets_eq: "sets N = sets M" ``` hoelzl@47694 ` 743` ``` shows "\f \ borel_measurable M. (\x. 0 \ f x) \ density M f = N" ``` hoelzl@38656 ` 744` ```proof - ``` hoelzl@38656 ` 745` ``` from Ex_finite_integrable_function ``` hoelzl@41981 ` 746` ``` obtain h where finite: "integral\<^isup>P M h \ \" and ``` hoelzl@38656 ` 747` ``` borel: "h \ borel_measurable M" and ``` hoelzl@41981 ` 748` ``` nn: "\x. 0 \ h x" and ``` hoelzl@38656 ` 749` ``` pos: "\x. x \ space M \ 0 < h x" and ``` hoelzl@41981 ` 750` ``` "\x. x \ space M \ h x < \" by auto ``` wenzelm@46731 ` 751` ``` let ?T = "\A. (\\<^isup>+x. h x * indicator A x \M)" ``` hoelzl@47694 ` 752` ``` let ?MT = "density M h" ``` hoelzl@47694 ` 753` ``` from borel finite nn interpret T: finite_measure ?MT ``` hoelzl@47694 ` 754` ``` by (auto intro!: finite_measureI cong: positive_integral_cong simp: emeasure_density) ``` hoelzl@47694 ` 755` ``` have "absolutely_continuous ?MT N" "sets N = sets ?MT" ``` hoelzl@47694 ` 756` ``` proof (unfold absolutely_continuous_def, safe) ``` hoelzl@47694 ` 757` ``` fix A assume "A \ null_sets ?MT" ``` hoelzl@47694 ` 758` ``` with borel have "A \ sets M" "AE x in M. x \ A \ h x \ 0" ``` hoelzl@47694 ` 759` ``` by (auto simp add: null_sets_density_iff) ``` hoelzl@47694 ` 760` ``` with pos sets_into_space have "AE x in M. x \ A" ``` hoelzl@47694 ` 761` ``` by (elim eventually_elim1) (auto simp: not_le[symmetric]) ``` hoelzl@47694 ` 762` ``` then have "A \ null_sets M" ``` hoelzl@47694 ` 763` ``` using `A \ sets M` by (simp add: AE_iff_null_sets) ``` hoelzl@47694 ` 764` ``` with ac show "A \ null_sets N" ``` hoelzl@47694 ` 765` ``` by (auto simp: absolutely_continuous_def) ``` hoelzl@47694 ` 766` ``` qed (auto simp add: sets_eq) ``` hoelzl@47694 ` 767` ``` from T.Radon_Nikodym_finite_measure_infinite[OF this] ``` hoelzl@47694 ` 768` ``` obtain f where f_borel: "f \ borel_measurable M" "\x. 0 \ f x" "density ?MT f = N" by auto ``` hoelzl@47694 ` 769` ``` with nn borel show ?thesis ``` hoelzl@47694 ` 770` ``` by (auto intro!: bexI[of _ "\x. h x * f x"] simp: density_density_eq) ``` hoelzl@38656 ` 771` ```qed ``` hoelzl@38656 ` 772` hoelzl@40859 ` 773` ```section "Uniqueness of densities" ``` hoelzl@40859 ` 774` hoelzl@47694 ` 775` ```lemma finite_density_unique: ``` hoelzl@40859 ` 776` ``` assumes borel: "f \ borel_measurable M" "g \ borel_measurable M" ``` hoelzl@47694 ` 777` ``` assumes pos: "AE x in M. 0 \ f x" "AE x in M. 0 \ g x" ``` hoelzl@41981 ` 778` ``` and fin: "integral\<^isup>P M f \ \" ``` hoelzl@41689 ` 779` ``` shows "(\A\sets M. (\\<^isup>+x. f x * indicator A x \M) = (\\<^isup>+x. g x * indicator A x \M)) ``` hoelzl@47694 ` 780` ``` \ (AE x in M. f x = g x)" ``` hoelzl@40859 ` 781` ``` (is "(\A\sets M. ?P f A = ?P g A) \ _") ``` hoelzl@40859 ` 782` ```proof (intro iffI ballI) ``` hoelzl@47694 ` 783` ``` fix A assume eq: "AE x in M. f x = g x" ``` hoelzl@41705 ` 784` ``` then show "?P f A = ?P g A" ``` hoelzl@41705 ` 785` ``` by (auto intro: positive_integral_cong_AE) ``` hoelzl@40859 ` 786` ```next ``` hoelzl@40859 ` 787` ``` assume eq: "\A\sets M. ?P f A = ?P g A" ``` hoelzl@40859 ` 788` ``` from this[THEN bspec, OF top] fin ``` hoelzl@41981 ` 789` ``` have g_fin: "integral\<^isup>P M g \ \" by (simp cong: positive_integral_cong) ``` hoelzl@40859 ` 790` ``` { fix f g assume borel: "f \ borel_measurable M" "g \ borel_measurable M" ``` hoelzl@47694 ` 791` ``` and pos: "AE x in M. 0 \ f x" "AE x in M. 0 \ g x" ``` hoelzl@41981 ` 792` ``` and g_fin: "integral\<^isup>P M g \ \" and eq: "\A\sets M. ?P f A = ?P g A" ``` hoelzl@40859 ` 793` ``` let ?N = "{x\space M. g x < f x}" ``` hoelzl@40859 ` 794` ``` have N: "?N \ sets M" using borel by simp ``` hoelzl@41981 ` 795` ``` have "?P g ?N \ integral\<^isup>P M g" using pos ``` hoelzl@41981 ` 796` ``` by (intro positive_integral_mono_AE) (auto split: split_indicator) ``` hoelzl@41981 ` 797` ``` then have Pg_fin: "?P g ?N \ \" using g_fin by auto ``` hoelzl@41689 ` 798` ``` have "?P (\x. (f x - g x)) ?N = (\\<^isup>+x. f x * indicator ?N x - g x * indicator ?N x \M)" ``` hoelzl@40859 ` 799` ``` by (auto intro!: positive_integral_cong simp: indicator_def) ``` hoelzl@40859 ` 800` ``` also have "\ = ?P f ?N - ?P g ?N" ``` hoelzl@40859 ` 801` ``` proof (rule positive_integral_diff) ``` hoelzl@40859 ` 802` ``` show "(\x. f x * indicator ?N x) \ borel_measurable M" "(\x. g x * indicator ?N x) \ borel_measurable M" ``` hoelzl@40859 ` 803` ``` using borel N by auto ``` hoelzl@47694 ` 804` ``` show "AE x in M. g x * indicator ?N x \ f x * indicator ?N x" ``` hoelzl@47694 ` 805` ``` "AE x in M. 0 \ g x * indicator ?N x" ``` hoelzl@41981 ` 806` ``` using pos by (auto split: split_indicator) ``` hoelzl@41981 ` 807` ``` qed fact ``` hoelzl@40859 ` 808` ``` also have "\ = 0" ``` hoelzl@47694 ` 809` ``` unfolding eq[THEN bspec, OF N] using positive_integral_positive[of M] Pg_fin by auto ``` hoelzl@47694 ` 810` ``` finally have "AE x in M. f x \ g x" ``` hoelzl@41981 ` 811` ``` using pos borel positive_integral_PInf_AE[OF borel(2) g_fin] ``` hoelzl@41981 ` 812` ``` by (subst (asm) positive_integral_0_iff_AE) ``` hoelzl@43920 ` 813` ``` (auto split: split_indicator simp: not_less ereal_minus_le_iff) } ``` hoelzl@41981 ` 814` ``` from this[OF borel pos g_fin eq] this[OF borel(2,1) pos(2,1) fin] eq ``` hoelzl@47694 ` 815` ``` show "AE x in M. f x = g x" by auto ``` hoelzl@40859 ` 816` ```qed ``` hoelzl@40859 ` 817` hoelzl@40859 ` 818` ```lemma (in finite_measure) density_unique_finite_measure: ``` hoelzl@40859 ` 819` ``` assumes borel: "f \ borel_measurable M" "f' \ borel_measurable M" ``` hoelzl@47694 ` 820` ``` assumes pos: "AE x in M. 0 \ f x" "AE x in M. 0 \ f' x" ``` hoelzl@41689 ` 821` ``` assumes f: "\A. A \ sets M \ (\\<^isup>+x. f x * indicator A x \M) = (\\<^isup>+x. f' x * indicator A x \M)" ``` hoelzl@40859 ` 822` ``` (is "\A. A \ sets M \ ?P f A = ?P f' A") ``` hoelzl@47694 ` 823` ``` shows "AE x in M. f x = f' x" ``` hoelzl@40859 ` 824` ```proof - ``` hoelzl@47694 ` 825` ``` let ?D = "\f. density M f" ``` hoelzl@47694 ` 826` ``` let ?N = "\A. ?P f A" and ?N' = "\A. ?P f' A" ``` wenzelm@46731 ` 827` ``` let ?f = "\A x. f x * indicator A x" and ?f' = "\A x. f' x * indicator A x" ``` hoelzl@47694 ` 828` hoelzl@47694 ` 829` ``` have ac: "absolutely_continuous M (density M f)" "sets (density M f) = sets M" ``` hoelzl@47694 ` 830` ``` using borel by (auto intro!: absolutely_continuousI_density) ``` hoelzl@47694 ` 831` ``` from split_space_into_finite_sets_and_rest[OF this] ``` hoelzl@40859 ` 832` ``` obtain Q0 and Q :: "nat \ 'a set" ``` hoelzl@40859 ` 833` ``` where Q: "disjoint_family Q" "range Q \ sets M" ``` hoelzl@40859 ` 834` ``` and Q0: "Q0 \ sets M" "Q0 = space M - (\i. Q i)" ``` hoelzl@47694 ` 835` ``` and in_Q0: "\A. A \ sets M \ A \ Q0 \ emeasure M A = 0 \ ?D f A = 0 \ 0 < emeasure M A \ ?D f A = \" ``` hoelzl@47694 ` 836` ``` and Q_fin: "\i. ?D f (Q i) \ \" by force ``` hoelzl@47694 ` 837` ``` with borel pos have in_Q0: "\A. A \ sets M \ A \ Q0 \ emeasure M A = 0 \ ?N A = 0 \ 0 < emeasure M A \ ?N A = \" ``` hoelzl@47694 ` 838` ``` and Q_fin: "\i. ?N (Q i) \ \" by (auto simp: emeasure_density subset_eq) ``` hoelzl@47694 ` 839` hoelzl@40859 ` 840` ``` from Q have Q_sets: "\i. Q i \ sets M" by auto ``` hoelzl@47694 ` 841` ``` let ?D = "{x\space M. f x \ f' x}" ``` hoelzl@47694 ` 842` ``` have "?D \ sets M" using borel by auto ``` hoelzl@43920 ` 843` ``` have *: "\i x A. \y::ereal. y * indicator (Q i) x * indicator A x = y * indicator (Q i \ A) x" ``` hoelzl@40859 ` 844` ``` unfolding indicator_def by auto ``` hoelzl@47694 ` 845` ``` have "\i. AE x in M. ?f (Q i) x = ?f' (Q i) x" using borel Q_fin Q pos ``` hoelzl@40859 ` 846` ``` by (intro finite_density_unique[THEN iffD1] allI) ``` hoelzl@43920 ` 847` ``` (auto intro!: borel_measurable_ereal_times f Int simp: *) ``` hoelzl@47694 ` 848` ``` moreover have "AE x in M. ?f Q0 x = ?f' Q0 x" ``` hoelzl@40859 ` 849` ``` proof (rule AE_I') ``` hoelzl@43920 ` 850` ``` { fix f :: "'a \ ereal" assume borel: "f \ borel_measurable M" ``` hoelzl@47694 ` 851` ``` and eq: "\A. A \ sets M \ ?N A = (\\<^isup>+x. f x * indicator A x \M)" ``` wenzelm@46731 ` 852` ``` let ?A = "\i. Q0 \ {x \ space M. f x < (i::nat)}" ``` hoelzl@47694 ` 853` ``` have "(\i. ?A i) \ null_sets M" ``` hoelzl@40859 ` 854` ``` proof (rule null_sets_UN) ``` hoelzl@43923 ` 855` ``` fix i ::nat have "?A i \ sets M" ``` hoelzl@40859 ` 856` ``` using borel Q0(1) by auto ``` hoelzl@47694 ` 857` ``` have "?N (?A i) \ (\\<^isup>+x. (i::ereal) * indicator (?A i) x \M)" ``` hoelzl@40859 ` 858` ``` unfolding eq[OF `?A i \ sets M`] ``` hoelzl@40859 ` 859` ``` by (auto intro!: positive_integral_mono simp: indicator_def) ``` hoelzl@47694 ` 860` ``` also have "\ = i * emeasure M (?A i)" ``` hoelzl@40859 ` 861` ``` using `?A i \ sets M` by (auto intro!: positive_integral_cmult_indicator) ``` hoelzl@47694 ` 862` ``` also have "\ < \" using emeasure_real[of "?A i"] by simp ``` hoelzl@47694 ` 863` ``` finally have "?N (?A i) \ \" by simp ``` hoelzl@47694 ` 864` ``` then show "?A i \ null_sets M" using in_Q0[OF `?A i \ sets M`] `?A i \ sets M` by auto ``` hoelzl@40859 ` 865` ``` qed ``` hoelzl@41981 ` 866` ``` also have "(\i. ?A i) = Q0 \ {x\space M. f x \ \}" ``` hoelzl@41981 ` 867` ``` by (auto simp: less_PInf_Ex_of_nat real_eq_of_nat) ``` hoelzl@47694 ` 868` ``` finally have "Q0 \ {x\space M. f x \ \} \ null_sets M" by simp } ``` hoelzl@40859 ` 869` ``` from this[OF borel(1) refl] this[OF borel(2) f] ``` hoelzl@47694 ` 870` ``` have "Q0 \ {x\space M. f x \ \} \ null_sets M" "Q0 \ {x\space M. f' x \ \} \ null_sets M" by simp_all ``` hoelzl@47694 ` 871` ``` then show "(Q0 \ {x\space M. f x \ \}) \ (Q0 \ {x\space M. f' x \ \}) \ null_sets M" by (rule null_sets.Un) ``` hoelzl@40859 ` 872` ``` show "{x \ space M. ?f Q0 x \ ?f' Q0 x} \ ``` hoelzl@41981 ` 873` ``` (Q0 \ {x\space M. f x \ \}) \ (Q0 \ {x\space M. f' x \ \})" by (auto simp: indicator_def) ``` hoelzl@40859 ` 874` ``` qed ``` hoelzl@47694 ` 875` ``` moreover have "AE x in M. (?f Q0 x = ?f' Q0 x) \ (\i. ?f (Q i) x = ?f' (Q i) x) \ ``` hoelzl@40859 ` 876` ``` ?f (space M) x = ?f' (space M) x" ``` hoelzl@40859 ` 877` ``` by (auto simp: indicator_def Q0) ``` hoelzl@47694 ` 878` ``` ultimately have "AE x in M. ?f (space M) x = ?f' (space M) x" ``` hoelzl@47694 ` 879` ``` unfolding AE_all_countable[symmetric] ``` hoelzl@47694 ` 880` ``` by eventually_elim (auto intro!: AE_I2 split: split_if_asm simp: indicator_def) ``` hoelzl@47694 ` 881` ``` then show "AE x in M. f x = f' x" by auto ``` hoelzl@40859 ` 882` ```qed ``` hoelzl@40859 ` 883` hoelzl@40859 ` 884` ```lemma (in sigma_finite_measure) density_unique: ``` hoelzl@47694 ` 885` ``` assumes f: "f \ borel_measurable M" "AE x in M. 0 \ f x" ``` hoelzl@47694 ` 886` ``` assumes f': "f' \ borel_measurable M" "AE x in M. 0 \ f' x" ``` hoelzl@47694 ` 887` ``` assumes density_eq: "density M f = density M f'" ``` hoelzl@47694 ` 888` ``` shows "AE x in M. f x = f' x" ``` hoelzl@40859 ` 889` ```proof - ``` hoelzl@40859 ` 890` ``` obtain h where h_borel: "h \ borel_measurable M" ``` hoelzl@41981 ` 891` ``` and fin: "integral\<^isup>P M h \ \" and pos: "\x. x \ space M \ 0 < h x \ h x < \" "\x. 0 \ h x" ``` hoelzl@40859 ` 892` ``` using Ex_finite_integrable_function by auto ``` hoelzl@47694 ` 893` ``` then have h_nn: "AE x in M. 0 \ h x" by auto ``` hoelzl@47694 ` 894` ``` let ?H = "density M h" ``` hoelzl@47694 ` 895` ``` interpret h: finite_measure ?H ``` hoelzl@47694 ` 896` ``` using fin h_borel pos ``` hoelzl@47694 ` 897` ``` by (intro finite_measureI) (simp cong: positive_integral_cong emeasure_density add: fin) ``` hoelzl@47694 ` 898` ``` let ?fM = "density M f" ``` hoelzl@47694 ` 899` ``` let ?f'M = "density M f'" ``` hoelzl@40859 ` 900` ``` { fix A assume "A \ sets M" ``` hoelzl@41981 ` 901` ``` then have "{x \ space M. h x * indicator A x \ 0} = A" ``` hoelzl@41981 ` 902` ``` using pos(1) sets_into_space by (force simp: indicator_def) ``` hoelzl@47694 ` 903` ``` then have "(\\<^isup>+x. h x * indicator A x \M) = 0 \ A \ null_sets M" ``` hoelzl@41981 ` 904` ``` using h_borel `A \ sets M` h_nn by (subst positive_integral_0_iff) auto } ``` hoelzl@40859 ` 905` ``` note h_null_sets = this ``` hoelzl@40859 ` 906` ``` { fix A assume "A \ sets M" ``` hoelzl@41981 ` 907` ``` have "(\\<^isup>+x. f x * (h x * indicator A x) \M) = (\\<^isup>+x. h x * indicator A x \?fM)" ``` hoelzl@41981 ` 908` ``` using `A \ sets M` h_borel h_nn f f' ``` hoelzl@47694 ` 909` ``` by (intro positive_integral_density[symmetric]) auto ``` hoelzl@41689 ` 910` ``` also have "\ = (\\<^isup>+x. h x * indicator A x \?f'M)" ``` hoelzl@47694 ` 911` ``` by (simp_all add: density_eq) ``` hoelzl@41981 ` 912` ``` also have "\ = (\\<^isup>+x. f' x * (h x * indicator A x) \M)" ``` hoelzl@41981 ` 913` ``` using `A \ sets M` h_borel h_nn f f' ``` hoelzl@47694 ` 914` ``` by (intro positive_integral_density) auto ``` hoelzl@41981 ` 915` ``` finally have "(\\<^isup>+x. h x * (f x * indicator A x) \M) = (\\<^isup>+x. h x * (f' x * indicator A x) \M)" ``` hoelzl@41981 ` 916` ``` by (simp add: ac_simps) ``` hoelzl@41981 ` 917` ``` then have "(\\<^isup>+x. (f x * indicator A x) \?H) = (\\<^isup>+x. (f' x * indicator A x) \?H)" ``` hoelzl@41981 ` 918` ``` using `A \ sets M` h_borel h_nn f f' ``` hoelzl@47694 ` 919` ``` by (subst (asm) (1 2) positive_integral_density[symmetric]) auto } ``` hoelzl@41981 ` 920` ``` then have "AE x in ?H. f x = f' x" using h_borel h_nn f f' ``` hoelzl@47694 ` 921` ``` by (intro h.density_unique_finite_measure absolutely_continuous_AE[of M]) ``` hoelzl@47694 ` 922` ``` (auto simp add: AE_density) ``` hoelzl@47694 ` 923` ``` then show "AE x in M. f x = f' x" ``` hoelzl@47694 ` 924` ``` unfolding eventually_ae_filter using h_borel pos ``` hoelzl@47694 ` 925` ``` by (auto simp add: h_null_sets null_sets_density_iff not_less[symmetric] ``` hoelzl@47694 ` 926` ``` AE_iff_null_sets[symmetric]) ``` hoelzl@47694 ` 927` ``` blast ``` hoelzl@40859 ` 928` ```qed ``` hoelzl@40859 ` 929` hoelzl@47694 ` 930` ```lemma (in sigma_finite_measure) density_unique_iff: ``` hoelzl@47694 ` 931` ``` assumes f: "f \ borel_measurable M" and "AE x in M. 0 \ f x" ``` hoelzl@47694 ` 932` ``` assumes f': "f' \ borel_measurable M" and "AE x in M. 0 \ f' x" ``` hoelzl@47694 ` 933` ``` shows "density M f = density M f' \ (AE x in M. f x = f' x)" ``` hoelzl@47694 ` 934` ``` using density_unique[OF assms] density_cong[OF f f'] by auto ``` hoelzl@47694 ` 935` hoelzl@40859 ` 936` ```lemma (in sigma_finite_measure) sigma_finite_iff_density_finite: ``` hoelzl@47694 ` 937` ``` assumes f: "f \ borel_measurable M" "AE x in M. 0 \ f x" ``` hoelzl@47694 ` 938` ``` shows "sigma_finite_measure (density M f) \ (AE x in M. f x \ \)" ``` hoelzl@47694 ` 939` ``` (is "sigma_finite_measure ?N \ _") ``` hoelzl@40859 ` 940` ```proof ``` hoelzl@41689 ` 941` ``` assume "sigma_finite_measure ?N" ``` hoelzl@47694 ` 942` ``` then interpret N: sigma_finite_measure ?N . ``` hoelzl@47694 ` 943` ``` from N.Ex_finite_integrable_function obtain h where ``` hoelzl@41981 ` 944` ``` h: "h \ borel_measurable M" "integral\<^isup>P ?N h \ \" and ``` hoelzl@41981 ` 945` ``` h_nn: "\x. 0 \ h x" and ``` hoelzl@41981 ` 946` ``` fin: "\x\space M. 0 < h x \ h x < \" by auto ``` hoelzl@47694 ` 947` ``` have "AE x in M. f x * h x \ \" ``` hoelzl@40859 ` 948` ``` proof (rule AE_I') ``` hoelzl@41981 ` 949` ``` have "integral\<^isup>P ?N h = (\\<^isup>+x. f x * h x \M)" using f h h_nn ``` hoelzl@47694 ` 950` ``` by (auto intro!: positive_integral_density) ``` hoelzl@41981 ` 951` ``` then have "(\\<^isup>+x. f x * h x \M) \ \" ``` hoelzl@40859 ` 952` ``` using h(2) by simp ``` hoelzl@47694 ` 953` ``` then show "(\x. f x * h x) -` {\} \ space M \ null_sets M" ``` hoelzl@41981 ` 954` ``` using f h(1) by (auto intro!: positive_integral_PInf borel_measurable_vimage) ``` hoelzl@40859 ` 955` ``` qed auto ``` hoelzl@47694 ` 956` ``` then show "AE x in M. f x \ \" ``` hoelzl@41705 ` 957` ``` using fin by (auto elim!: AE_Ball_mp) ``` hoelzl@40859 ` 958` ```next ``` hoelzl@47694 ` 959` ``` assume AE: "AE x in M. f x \ \" ``` hoelzl@40859 ` 960` ``` from sigma_finite guess Q .. note Q = this ``` hoelzl@43923 ` 961` ``` def A \ "\i. f -` (case i of 0 \ {\} | Suc n \ {.. ereal(of_nat (Suc n))}) \ space M" ``` hoelzl@40859 ` 962` ``` { fix i j have "A i \ Q j \ sets M" ``` hoelzl@40859 ` 963` ``` unfolding A_def using f Q ``` hoelzl@40859 ` 964` ``` apply (rule_tac Int) ``` hoelzl@41981 ` 965` ``` by (cases i) (auto intro: measurable_sets[OF f(1)]) } ``` hoelzl@40859 ` 966` ``` note A_in_sets = this ``` wenzelm@46731 ` 967` ``` let ?A = "\n. case prod_decode n of (i,j) \ A i \ Q j" ``` hoelzl@41689 ` 968` ``` show "sigma_finite_measure ?N" ``` hoelzl@40859 ` 969` ``` proof (default, intro exI conjI subsetI allI) ``` hoelzl@40859 ` 970` ``` fix x assume "x \ range ?A" ``` hoelzl@40859 ` 971` ``` then obtain n where n: "x = ?A n" by auto ``` hoelzl@41689 ` 972` ``` then show "x \ sets ?N" using A_in_sets by (cases "prod_decode n") auto ``` hoelzl@40859 ` 973` ``` next ``` hoelzl@40859 ` 974` ``` have "(\i. ?A i) = (\i j. A i \ Q j)" ``` hoelzl@40859 ` 975` ``` proof safe ``` hoelzl@40859 ` 976` ``` fix x i j assume "x \ A i" "x \ Q j" ``` hoelzl@40859 ` 977` ``` then show "x \ (\i. case prod_decode i of (i, j) \ A i \ Q j)" ``` hoelzl@40859 ` 978` ``` by (intro UN_I[of "prod_encode (i,j)"]) auto ``` hoelzl@40859 ` 979` ``` qed auto ``` hoelzl@40859 ` 980` ``` also have "\ = (\i. A i) \ space M" using Q by auto ``` hoelzl@40859 ` 981` ``` also have "(\i. A i) = space M" ``` hoelzl@40859 ` 982` ``` proof safe ``` hoelzl@40859 ` 983` ``` fix x assume x: "x \ space M" ``` hoelzl@40859 ` 984` ``` show "x \ (\i. A i)" ``` hoelzl@40859 ` 985` ``` proof (cases "f x") ``` hoelzl@41981 ` 986` ``` case PInf with x show ?thesis unfolding A_def by (auto intro: exI[of _ 0]) ``` hoelzl@40859 ` 987` ``` next ``` hoelzl@41981 ` 988` ``` case (real r) ``` hoelzl@43923 ` 989` ``` with less_PInf_Ex_of_nat[of "f x"] obtain n :: nat where "f x < n" by (auto simp: real_eq_of_nat) ``` hoelzl@45769 ` 990` ``` then show ?thesis using x real unfolding A_def by (auto intro!: exI[of _ "Suc n"] simp: real_eq_of_nat) ``` hoelzl@41981 ` 991` ``` next ``` hoelzl@41981 ` 992` ``` case MInf with x show ?thesis ``` hoelzl@41981 ` 993` ``` unfolding A_def by (auto intro!: exI[of _ "Suc 0"]) ``` hoelzl@40859 ` 994` ``` qed ``` hoelzl@40859 ` 995` ``` qed (auto simp: A_def) ``` hoelzl@41689 ` 996` ``` finally show "(\i. ?A i) = space ?N" by simp ``` hoelzl@40859 ` 997` ``` next ``` hoelzl@40859 ` 998` ``` fix n obtain i j where ``` hoelzl@40859 ` 999` ``` [simp]: "prod_decode n = (i, j)" by (cases "prod_decode n") auto ``` hoelzl@41981 ` 1000` ``` have "(\\<^isup>+x. f x * indicator (A i \ Q j) x \M) \ \" ``` hoelzl@40859 ` 1001` ``` proof (cases i) ``` hoelzl@40859 ` 1002` ``` case 0 ``` hoelzl@47694 ` 1003` ``` have "AE x in M. f x * indicator (A i \ Q j) x = 0" ``` hoelzl@41705 ` 1004` ``` using AE by (auto simp: A_def `i = 0`) ``` hoelzl@41705 ` 1005` ``` from positive_integral_cong_AE[OF this] show ?thesis by simp ``` hoelzl@40859 ` 1006` ``` next ``` hoelzl@40859 ` 1007` ``` case (Suc n) ``` hoelzl@41689 ` 1008` ``` then have "(\\<^isup>+x. f x * indicator (A i \ Q j) x \M) \ ``` hoelzl@43923 ` 1009` ``` (\\<^isup>+x. (Suc n :: ereal) * indicator (Q j) x \M)" ``` hoelzl@45769 ` 1010` ``` by (auto intro!: positive_integral_mono simp: indicator_def A_def real_eq_of_nat) ``` hoelzl@47694 ` 1011` ``` also have "\ = Suc n * emeasure M (Q j)" ``` hoelzl@40859 ` 1012` ``` using Q by (auto intro!: positive_integral_cmult_indicator) ``` hoelzl@41981 ` 1013` ``` also have "\ < \" ``` hoelzl@41981 ` 1014` ``` using Q by (auto simp: real_eq_of_nat[symmetric]) ``` hoelzl@40859 ` 1015` ``` finally show ?thesis by simp ``` hoelzl@40859 ` 1016` ``` qed ``` hoelzl@47694 ` 1017` ``` then show "emeasure ?N (?A n) \ \" ``` hoelzl@47694 ` 1018` ``` using A_in_sets Q f by (auto simp: emeasure_density) ``` hoelzl@40859 ` 1019` ``` qed ``` hoelzl@40859 ` 1020` ```qed ``` hoelzl@40859 ` 1021` hoelzl@40871 ` 1022` ```section "Radon-Nikodym derivative" ``` hoelzl@38656 ` 1023` hoelzl@41689 ` 1024` ```definition ``` hoelzl@47694 ` 1025` ``` "RN_deriv M N \ SOME f. f \ borel_measurable M \ (\x. 0 \ f x) \ density M f = N" ``` hoelzl@38656 ` 1026` hoelzl@47694 ` 1027` ```lemma ``` hoelzl@47694 ` 1028` ``` assumes f: "f \ borel_measurable M" "AE x in M. 0 \ f x" ``` hoelzl@47694 ` 1029` ``` shows borel_measurable_RN_deriv_density: "RN_deriv M (density M f) \ borel_measurable M" (is ?borel) ``` hoelzl@47694 ` 1030` ``` and density_RN_deriv_density: "density M (RN_deriv M (density M f)) = density M f" (is ?density) ``` hoelzl@47694 ` 1031` ``` and RN_deriv_density_nonneg: "0 \ RN_deriv M (density M f) x" (is ?pos) ``` hoelzl@40859 ` 1032` ```proof - ``` hoelzl@47694 ` 1033` ``` let ?f = "\x. max 0 (f x)" ``` hoelzl@47694 ` 1034` ``` let ?P = "\g. g \ borel_measurable M \ (\x. 0 \ g x) \ density M g = density M f" ``` hoelzl@47694 ` 1035` ``` from f have "?P ?f" using f by (auto intro!: density_cong simp: split: split_max) ``` hoelzl@47694 ` 1036` ``` then have "?P (RN_deriv M (density M f))" ``` hoelzl@47694 ` 1037` ``` unfolding RN_deriv_def by (rule someI[where P="?P"]) ``` hoelzl@47694 ` 1038` ``` then show ?borel ?density ?pos by auto ``` hoelzl@40859 ` 1039` ```qed ``` hoelzl@40859 ` 1040` hoelzl@38656 ` 1041` ```lemma (in sigma_finite_measure) RN_deriv: ``` hoelzl@47694 ` 1042` ``` assumes "absolutely_continuous M N" "sets N = sets M" ``` hoelzl@47694 ` 1043` ``` shows borel_measurable_RN_deriv: "RN_deriv M N \ borel_measurable M" (is ?borel) ``` hoelzl@47694 ` 1044` ``` and density_RN_deriv: "density M (RN_deriv M N) = N" (is ?density) ``` hoelzl@47694 ` 1045` ``` and RN_deriv_nonneg: "0 \ RN_deriv M N x" (is ?pos) ``` hoelzl@38656 ` 1046` ```proof - ``` hoelzl@38656 ` 1047` ``` note Ex = Radon_Nikodym[OF assms, unfolded Bex_def] ``` hoelzl@47694 ` 1048` ``` from Ex show ?borel unfolding RN_deriv_def by (rule someI2_ex) simp ``` hoelzl@47694 ` 1049` ``` from Ex show ?density unfolding RN_deriv_def by (rule someI2_ex) simp ``` hoelzl@47694 ` 1050` ``` from Ex show ?pos unfolding RN_deriv_def by (rule someI2_ex) simp ``` hoelzl@38656 ` 1051` ```qed ``` hoelzl@38656 ` 1052` hoelzl@40859 ` 1053` ```lemma (in sigma_finite_measure) RN_deriv_positive_integral: ``` hoelzl@47694 ` 1054` ``` assumes N: "absolutely_continuous M N" "sets N = sets M" ``` hoelzl@40859 ` 1055` ``` and f: "f \ borel_measurable M" ``` hoelzl@47694 ` 1056` ``` shows "integral\<^isup>P N f = (\\<^isup>+x. RN_deriv M N x * f x \M)" ``` hoelzl@40859 ` 1057` ```proof - ``` hoelzl@47694 ` 1058` ``` have "integral\<^isup>P N f = integral\<^isup>P (density M (RN_deriv M N)) f" ``` hoelzl@47694 ` 1059` ``` using N by (simp add: density_RN_deriv) ``` hoelzl@47694 ` 1060` ``` also have "\ = (\\<^isup>+x. RN_deriv M N x * f x \M)" ``` hoelzl@47694 ` 1061` ``` using RN_deriv(1,3)[OF N] f by (simp add: positive_integral_density) ``` hoelzl@47694 ` 1062` ``` finally show ?thesis by simp ``` hoelzl@40859 ` 1063` ```qed ``` hoelzl@40859 ` 1064` hoelzl@47694 ` 1065` ```lemma null_setsD_AE: "N \ null_sets M \ AE x in M. x \ N" ``` hoelzl@47694 ` 1066` ``` using AE_iff_null_sets[of N M] by auto ``` hoelzl@47694 ` 1067` hoelzl@47694 ` 1068` ```lemma (in sigma_finite_measure) RN_deriv_unique: ``` hoelzl@47694 ` 1069` ``` assumes f: "f \ borel_measurable M" "AE x in M. 0 \ f x" ``` hoelzl@47694 ` 1070` ``` and eq: "density M f = N" ``` hoelzl@47694 ` 1071` ``` shows "AE x in M. f x = RN_deriv M N x" ``` hoelzl@47694 ` 1072` ```proof (rule density_unique) ``` hoelzl@47694 ` 1073` ``` have ac: "absolutely_continuous M N" ``` hoelzl@47694 ` 1074` ``` using f(1) unfolding eq[symmetric] by (rule absolutely_continuousI_density) ``` hoelzl@47694 ` 1075` ``` have eq2: "sets N = sets M" ``` hoelzl@47694 ` 1076` ``` unfolding eq[symmetric] by simp ``` hoelzl@47694 ` 1077` ``` show "RN_deriv M N \ borel_measurable M" "AE x in M. 0 \ RN_deriv M N x" ``` hoelzl@47694 ` 1078` ``` "density M f = density M (RN_deriv M N)" ``` hoelzl@47694 ` 1079` ``` using RN_deriv[OF ac eq2] eq by auto ``` hoelzl@47694 ` 1080` ```qed fact+ ``` hoelzl@47694 ` 1081` hoelzl@47694 ` 1082` ```lemma (in sigma_finite_measure) RN_deriv_distr: ``` hoelzl@47694 ` 1083` ``` fixes T :: "'a \ 'b" ``` hoelzl@47694 ` 1084` ``` assumes T: "T \ measurable M M'" and T': "T' \ measurable M' M" ``` hoelzl@47694 ` 1085` ``` and inv: "\x\space M. T' (T x) = x" ``` hoelzl@47694 ` 1086` ``` and ac: "absolutely_continuous (distr M M' T) (distr N M' T)" ``` hoelzl@47694 ` 1087` ``` and N: "sets N = sets M" ``` hoelzl@47694 ` 1088` ``` shows "AE x in M. RN_deriv (distr M M' T) (distr N M' T) (T x) = RN_deriv M N x" ``` hoelzl@41832 ` 1089` ```proof (rule RN_deriv_unique) ``` hoelzl@47694 ` 1090` ``` have [simp]: "sets N = sets M" by fact ``` hoelzl@47694 ` 1091` ``` note sets_eq_imp_space_eq[OF N, simp] ``` hoelzl@47694 ` 1092` ``` have measurable_N[simp]: "\M'. measurable N M' = measurable M M'" by (auto simp: measurable_def) ``` hoelzl@47694 ` 1093` ``` { fix A assume "A \ sets M" ``` hoelzl@47694 ` 1094` ``` with inv T T' sets_into_space[OF this] ``` hoelzl@47694 ` 1095` ``` have "T -` T' -` A \ T -` space M' \ space M = A" ``` hoelzl@47694 ` 1096` ``` by (auto simp: measurable_def) } ``` hoelzl@47694 ` 1097` ``` note eq = this[simp] ``` hoelzl@47694 ` 1098` ``` { fix A assume "A \ sets M" ``` hoelzl@47694 ` 1099` ``` with inv T T' sets_into_space[OF this] ``` hoelzl@47694 ` 1100` ``` have "(T' \ T) -` A \ space M = A" ``` hoelzl@47694 ` 1101` ``` by (auto simp: measurable_def) } ``` hoelzl@47694 ` 1102` ``` note eq2 = this[simp] ``` hoelzl@47694 ` 1103` ``` let ?M' = "distr M M' T" and ?N' = "distr N M' T" ``` hoelzl@47694 ` 1104` ``` interpret M': sigma_finite_measure ?M' ``` hoelzl@41832 ` 1105` ``` proof ``` hoelzl@41832 ` 1106` ``` from sigma_finite guess F .. note F = this ``` hoelzl@47694 ` 1107` ``` show "\A::nat \ 'b set. range A \ sets ?M' \ (\i. A i) = space ?M' \ (\i. emeasure ?M' (A i) \ \)" ``` hoelzl@41832 ` 1108` ``` proof (intro exI conjI allI) ``` hoelzl@47694 ` 1109` ``` show *: "range (\i. T' -` F i \ space ?M') \ sets ?M'" ``` hoelzl@47694 ` 1110` ``` using F T' by (auto simp: measurable_def) ``` hoelzl@47694 ` 1111` ``` show "(\i. T' -` F i \ space ?M') = space ?M'" ``` hoelzl@47694 ` 1112` ``` using F T' by (force simp: measurable_def) ``` hoelzl@41832 ` 1113` ``` fix i ``` hoelzl@41832 ` 1114` ``` have "T' -` F i \ space M' \ sets M'" using * by auto ``` hoelzl@41832 ` 1115` ``` moreover ``` hoelzl@41832 ` 1116` ``` have Fi: "F i \ sets M" using F by auto ``` hoelzl@47694 ` 1117` ``` ultimately show "emeasure ?M' (T' -` F i \ space ?M') \ \" ``` hoelzl@47694 ` 1118` ``` using F T T' by (simp add: emeasure_distr) ``` hoelzl@41832 ` 1119` ``` qed ``` hoelzl@41832 ` 1120` ``` qed ``` hoelzl@47694 ` 1121` ``` have "(RN_deriv ?M' ?N') \ T \ borel_measurable M" ``` hoelzl@47694 ` 1122` ``` using T ac by (intro measurable_comp[where b="?M'"] M'.borel_measurable_RN_deriv) simp_all ``` hoelzl@47694 ` 1123` ``` then show "(\x. RN_deriv ?M' ?N' (T x)) \ borel_measurable M" ``` hoelzl@41832 ` 1124` ``` by (simp add: comp_def) ``` hoelzl@47694 ` 1125` ``` show "AE x in M. 0 \ RN_deriv ?M' ?N' (T x)" using M'.RN_deriv_nonneg[OF ac] by auto ``` hoelzl@47694 ` 1126` hoelzl@47694 ` 1127` ``` have "N = distr N M (T' \ T)" ``` hoelzl@47694 ` 1128` ``` by (subst measure_of_of_measure[of N, symmetric]) ``` hoelzl@47694 ` 1129` ``` (auto simp add: distr_def sigma_sets_eq intro!: measure_of_eq space_closed) ``` hoelzl@47694 ` 1130` ``` also have "\ = distr (distr N M' T) M T'" ``` hoelzl@47694 ` 1131` ``` using T T' by (simp add: distr_distr) ``` hoelzl@47694 ` 1132` ``` also have "\ = distr (density (distr M M' T) (RN_deriv (distr M M' T) (distr N M' T))) M T'" ``` hoelzl@47694 ` 1133` ``` using ac by (simp add: M'.density_RN_deriv) ``` hoelzl@47694 ` 1134` ``` also have "\ = density M (RN_deriv (distr M M' T) (distr N M' T) \ T)" ``` hoelzl@47694 ` 1135` ``` using M'.borel_measurable_RN_deriv[OF ac] by (simp add: distr_density_distr[OF T T', OF inv]) ``` hoelzl@47694 ` 1136` ``` finally show "density M (\x. RN_deriv (distr M M' T) (distr N M' T) (T x)) = N" ``` hoelzl@47694 ` 1137` ``` by (simp add: comp_def) ``` hoelzl@41832 ` 1138` ```qed ``` hoelzl@41832 ` 1139` hoelzl@40859 ` 1140` ```lemma (in sigma_finite_measure) RN_deriv_finite: ``` hoelzl@47694 ` 1141` ``` assumes N: "sigma_finite_measure N" and ac: "absolutely_continuous M N" "sets N = sets M" ``` hoelzl@47694 ` 1142` ``` shows "AE x in M. RN_deriv M N x \ \" ``` hoelzl@40859 ` 1143` ```proof - ``` hoelzl@47694 ` 1144` ``` interpret N: sigma_finite_measure N by fact ``` hoelzl@47694 ` 1145` ``` from N show ?thesis ``` hoelzl@47694 ` 1146` ``` using sigma_finite_iff_density_finite[OF RN_deriv(1)[OF ac]] RN_deriv(2,3)[OF ac] by simp ``` hoelzl@40859 ` 1147` ```qed ``` hoelzl@40859 ` 1148` hoelzl@40859 ` 1149` ```lemma (in sigma_finite_measure) ``` hoelzl@47694 ` 1150` ``` assumes N: "sigma_finite_measure N" and ac: "absolutely_continuous M N" "sets N = sets M" ``` hoelzl@40859 ` 1151` ``` and f: "f \ borel_measurable M" ``` hoelzl@47694 ` 1152` ``` shows RN_deriv_integrable: "integrable N f \ ``` hoelzl@47694 ` 1153` ``` integrable M (\x. real (RN_deriv M N x) * f x)" (is ?integrable) ``` hoelzl@47694 ` 1154` ``` and RN_deriv_integral: "integral\<^isup>L N f = ``` hoelzl@47694 ` 1155` ``` (\x. real (RN_deriv M N x) * f x \M)" (is ?integral) ``` hoelzl@40859 ` 1156` ```proof - ``` hoelzl@47694 ` 1157` ``` note ac(2)[simp] and sets_eq_imp_space_eq[OF ac(2), simp] ``` hoelzl@47694 ` 1158` ``` interpret N: sigma_finite_measure N by fact ``` hoelzl@43920 ` 1159` ``` have minus_cong: "\A B A' B'::ereal. A = A' \ B = B' \ real A - real B = real A' - real B'" by simp ``` hoelzl@40859 ` 1160` ``` have f': "(\x. - f x) \ borel_measurable M" using f by auto ``` hoelzl@47694 ` 1161` ``` have Nf: "f \ borel_measurable N" using f by (simp add: measurable_def) ``` hoelzl@41689 ` 1162` ``` { fix f :: "'a \ real" ``` hoelzl@47694 ` 1163` ``` { fix x assume *: "RN_deriv M N x \ \" ``` hoelzl@47694 ` 1164` ``` have "ereal (real (RN_deriv M N x)) * ereal (f x) = ereal (real (RN_deriv M N x) * f x)" ``` hoelzl@40859 ` 1165` ``` by (simp add: mult_le_0_iff) ``` hoelzl@47694 ` 1166` ``` then have "RN_deriv M N x * ereal (f x) = ereal (real (RN_deriv M N x) * f x)" ``` hoelzl@47694 ` 1167` ``` using RN_deriv(3)[OF ac] * by (auto simp add: ereal_real split: split_if_asm) } ``` hoelzl@47694 ` 1168` ``` then have "(\\<^isup>+x. ereal (real (RN_deriv M N x) * f x) \M) = (\\<^isup>+x. RN_deriv M N x * ereal (f x) \M)" ``` hoelzl@47694 ` 1169` ``` "(\\<^isup>+x. ereal (- (real (RN_deriv M N x) * f x)) \M) = (\\<^isup>+x. RN_deriv M N x * ereal (- f x) \M)" ``` hoelzl@47694 ` 1170` ``` using RN_deriv_finite[OF N ac] unfolding ereal_mult_minus_right uminus_ereal.simps(1)[symmetric] ``` hoelzl@41981 ` 1171` ``` by (auto intro!: positive_integral_cong_AE) } ``` hoelzl@41981 ` 1172` ``` note * = this ``` hoelzl@40859 ` 1173` ``` show ?integral ?integrable ``` hoelzl@41981 ` 1174` ``` unfolding lebesgue_integral_def integrable_def * ``` hoelzl@47694 ` 1175` ``` using Nf f RN_deriv(1)[OF ac] ``` hoelzl@47694 ` 1176` ``` by (auto simp: RN_deriv_positive_integral[OF ac]) ``` hoelzl@40859 ` 1177` ```qed ``` hoelzl@40859 ` 1178` hoelzl@43340 ` 1179` ```lemma (in sigma_finite_measure) real_RN_deriv: ``` hoelzl@47694 ` 1180` ``` assumes "finite_measure N" ``` hoelzl@47694 ` 1181` ``` assumes ac: "absolutely_continuous M N" "sets N = sets M" ``` hoelzl@43340 ` 1182` ``` obtains D where "D \ borel_measurable M" ``` hoelzl@47694 ` 1183` ``` and "AE x in M. RN_deriv M N x = ereal (D x)" ``` hoelzl@47694 ` 1184` ``` and "AE x in N. 0 < D x" ``` hoelzl@43340 ` 1185` ``` and "\x. 0 \ D x" ``` hoelzl@43340 ` 1186` ```proof ``` hoelzl@47694 ` 1187` ``` interpret N: finite_measure N by fact ``` hoelzl@47694 ` 1188` ``` ``` hoelzl@47694 ` 1189` ``` note RN = RN_deriv[OF ac] ``` hoelzl@43340 ` 1190` hoelzl@47694 ` 1191` ``` let ?RN = "\t. {x \ space M. RN_deriv M N x = t}" ``` hoelzl@43340 ` 1192` hoelzl@47694 ` 1193` ``` show "(\x. real (RN_deriv M N x)) \ borel_measurable M" ``` hoelzl@43340 ` 1194` ``` using RN by auto ``` hoelzl@43340 ` 1195` hoelzl@47694 ` 1196` ``` have "N (?RN \) = (\\<^isup>+ x. RN_deriv M N x * indicator (?RN \) x \M)" ``` hoelzl@47694 ` 1197` ``` using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) ``` hoelzl@43340 ` 1198` ``` also have "\ = (\\<^isup>+ x. \ * indicator (?RN \) x \M)" ``` hoelzl@43340 ` 1199` ``` by (intro positive_integral_cong) (auto simp: indicator_def) ``` hoelzl@47694 ` 1200` ``` also have "\ = \ * emeasure M (?RN \)" ``` hoelzl@43340 ` 1201` ``` using RN by (intro positive_integral_cmult_indicator) auto ``` hoelzl@47694 ` 1202` ``` finally have eq: "N (?RN \) = \ * emeasure M (?RN \)" . ``` hoelzl@43340 ` 1203` ``` moreover ``` hoelzl@47694 ` 1204` ``` have "emeasure M (?RN \) = 0" ``` hoelzl@43340 ` 1205` ``` proof (rule ccontr) ``` hoelzl@47694 ` 1206` ``` assume "emeasure M {x \ space M. RN_deriv M N x = \} \ 0" ``` hoelzl@47694 ` 1207` ``` moreover from RN have "0 \ emeasure M {x \ space M. RN_deriv M N x = \}" by auto ``` hoelzl@47694 ` 1208` ``` ultimately have "0 < emeasure M {x \ space M. RN_deriv M N x = \}" by auto ``` hoelzl@47694 ` 1209` ``` with eq have "N (?RN \) = \" by simp ``` hoelzl@47694 ` 1210` ``` with N.emeasure_finite[of "?RN \"] RN show False by auto ``` hoelzl@43340 ` 1211` ``` qed ``` hoelzl@47694 ` 1212` ``` ultimately have "AE x in M. RN_deriv M N x < \" ``` hoelzl@43340 ` 1213` ``` using RN by (intro AE_iff_measurable[THEN iffD2]) auto ``` hoelzl@47694 ` 1214` ``` then show "AE x in M. RN_deriv M N x = ereal (real (RN_deriv M N x))" ``` hoelzl@43920 ` 1215` ``` using RN(3) by (auto simp: ereal_real) ``` hoelzl@47694 ` 1216` ``` then have eq: "AE x in N. RN_deriv M N x = ereal (real (RN_deriv M N x))" ``` hoelzl@47694 ` 1217` ``` using ac absolutely_continuous_AE by auto ``` hoelzl@43340 ` 1218` hoelzl@47694 ` 1219` ``` show "\x. 0 \ real (RN_deriv M N x)" ``` hoelzl@43920 ` 1220` ``` using RN by (auto intro: real_of_ereal_pos) ``` hoelzl@43340 ` 1221` hoelzl@47694 ` 1222` ``` have "N (?RN 0) = (\\<^isup>+ x. RN_deriv M N x * indicator (?RN 0) x \M)" ``` hoelzl@47694 ` 1223` ``` using RN(1,3) by (subst RN(2)[symmetric]) (auto simp: emeasure_density) ``` hoelzl@43340 ` 1224` ``` also have "\ = (\\<^isup>+ x. 0 \M)" ``` hoelzl@43340 ` 1225` ``` by (intro positive_integral_cong) (auto simp: indicator_def) ``` hoelzl@47694 ` 1226` ``` finally have "AE x in N. RN_deriv M N x \ 0" ``` hoelzl@47694 ` 1227` ``` using RN by (subst AE_iff_measurable[OF _ refl]) (auto simp: ac cong: sets_eq_imp_space_eq) ``` hoelzl@47694 ` 1228` ``` with RN(3) eq show "AE x in N. 0 < real (RN_deriv M N x)" ``` hoelzl@43920 ` 1229` ``` by (auto simp: zero_less_real_of_ereal le_less) ``` hoelzl@43340 ` 1230` ```qed ``` hoelzl@43340 ` 1231` hoelzl@38656 ` 1232` ```lemma (in sigma_finite_measure) RN_deriv_singleton: ``` hoelzl@47694 ` 1233` ``` assumes ac: "absolutely_continuous M N" "sets N = sets M" ``` hoelzl@47694 ` 1234` ``` and x: "{x} \ sets M" ``` hoelzl@47694 ` 1235` ``` shows "N {x} = RN_deriv M N x * emeasure M {x}" ``` hoelzl@38656 ` 1236` ```proof - ``` hoelzl@47694 ` 1237` ``` note deriv = RN_deriv[OF ac] ``` hoelzl@47694 ` 1238` ``` from deriv(1,3) `{x} \ sets M` ``` hoelzl@47694 ` 1239` ``` have "density M (RN_deriv M N) {x} = (\\<^isup>+w. RN_deriv M N x * indicator {x} w \M)" ``` hoelzl@47694 ` 1240` ``` by (auto simp: indicator_def emeasure_density intro!: positive_integral_cong) ``` hoelzl@47694 ` 1241` ``` with x deriv show ?thesis ``` hoelzl@47694 ` 1242` ``` by (auto simp: positive_integral_cmult_indicator) ``` hoelzl@38656 ` 1243` ```qed ``` hoelzl@38656 ` 1244` hoelzl@38656 ` 1245` ```end ```