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