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