equal
deleted
inserted
replaced
1949 lemma nn_integral_count_space_indicator: |
1949 lemma nn_integral_count_space_indicator: |
1950 assumes "NO_MATCH (X::'a set) (UNIV::'a set)" |
1950 assumes "NO_MATCH (X::'a set) (UNIV::'a set)" |
1951 shows "(\<integral>\<^sup>+x. f x \<partial>count_space X) = (\<integral>\<^sup>+x. f x * indicator X x \<partial>count_space UNIV)" |
1951 shows "(\<integral>\<^sup>+x. f x \<partial>count_space X) = (\<integral>\<^sup>+x. f x * indicator X x \<partial>count_space UNIV)" |
1952 by (simp add: nn_integral_restrict_space[symmetric] restrict_count_space) |
1952 by (simp add: nn_integral_restrict_space[symmetric] restrict_count_space) |
1953 |
1953 |
|
1954 lemma nn_integral_count_space_eq: |
|
1955 "(\<And>x. x \<in> A - B \<Longrightarrow> f x = 0) \<Longrightarrow> (\<And>x. x \<in> B - A \<Longrightarrow> f x = 0) \<Longrightarrow> |
|
1956 (\<integral>\<^sup>+x. f x \<partial>count_space A) = (\<integral>\<^sup>+x. f x \<partial>count_space B)" |
|
1957 by (auto simp: nn_integral_count_space_indicator intro!: nn_integral_cong split: split_indicator) |
|
1958 |
1954 lemma nn_integral_ge_point: |
1959 lemma nn_integral_ge_point: |
1955 assumes "x \<in> A" |
1960 assumes "x \<in> A" |
1956 shows "p x \<le> \<integral>\<^sup>+ x. p x \<partial>count_space A" |
1961 shows "p x \<le> \<integral>\<^sup>+ x. p x \<partial>count_space A" |
1957 proof - |
1962 proof - |
1958 from assms have "p x \<le> \<integral>\<^sup>+ x. p x \<partial>count_space {x}" |
1963 from assms have "p x \<le> \<integral>\<^sup>+ x. p x \<partial>count_space {x}" |
2192 using f g ac by (auto intro!: density_cong measurable_If) |
2197 using f g ac by (auto intro!: density_cong measurable_If) |
2193 then show ?thesis |
2198 then show ?thesis |
2194 using f g by (subst density_density_eq) auto |
2199 using f g by (subst density_density_eq) auto |
2195 qed |
2200 qed |
2196 |
2201 |
|
2202 lemma density_1: "density M (\<lambda>_. 1) = M" |
|
2203 by (intro measure_eqI) (auto simp: emeasure_density) |
|
2204 |
|
2205 lemma emeasure_density_add: |
|
2206 assumes X: "X \<in> sets M" |
|
2207 assumes Mf[measurable]: "f \<in> borel_measurable M" |
|
2208 assumes Mg[measurable]: "g \<in> borel_measurable M" |
|
2209 assumes nonnegf: "\<And>x. x \<in> space M \<Longrightarrow> f x \<ge> 0" |
|
2210 assumes nonnegg: "\<And>x. x \<in> space M \<Longrightarrow> g x \<ge> 0" |
|
2211 shows "emeasure (density M f) X + emeasure (density M g) X = |
|
2212 emeasure (density M (\<lambda>x. f x + g x)) X" |
|
2213 using assms |
|
2214 apply (subst (1 2 3) emeasure_density, simp_all) [] |
|
2215 apply (subst nn_integral_add[symmetric], simp_all) [] |
|
2216 apply (intro nn_integral_cong, simp split: split_indicator) |
|
2217 done |
|
2218 |
2197 subsubsection {* Point measure *} |
2219 subsubsection {* Point measure *} |
2198 |
2220 |
2199 definition point_measure :: "'a set \<Rightarrow> ('a \<Rightarrow> ereal) \<Rightarrow> 'a measure" where |
2221 definition point_measure :: "'a set \<Rightarrow> ('a \<Rightarrow> ereal) \<Rightarrow> 'a measure" where |
2200 "point_measure A f = density (count_space A) f" |
2222 "point_measure A f = density (count_space A) f" |
2201 |
2223 |
2349 by (cases "emeasure M A") (auto split: split_indicator simp: one_ereal_def) |
2371 by (cases "emeasure M A") (auto split: split_indicator simp: one_ereal_def) |
2350 ultimately show ?thesis |
2372 ultimately show ?thesis |
2351 unfolding uniform_measure_def by (simp add: AE_density) |
2373 unfolding uniform_measure_def by (simp add: AE_density) |
2352 qed |
2374 qed |
2353 |
2375 |
|
2376 subsubsection {* Null measure *} |
|
2377 |
|
2378 lemma null_measure_eq_density: "null_measure M = density M (\<lambda>_. 0)" |
|
2379 by (intro measure_eqI) (simp_all add: emeasure_density) |
|
2380 |
|
2381 lemma nn_integral_null_measure[simp]: "(\<integral>\<^sup>+x. f x \<partial>null_measure M) = 0" |
|
2382 by (auto simp add: nn_integral_def simple_integral_def SUP_constant bot_ereal_def le_fun_def |
|
2383 intro!: exI[of _ "\<lambda>x. 0"]) |
|
2384 |
|
2385 lemma density_null_measure[simp]: "density (null_measure M) f = null_measure M" |
|
2386 proof (intro measure_eqI) |
|
2387 fix A show "emeasure (density (null_measure M) f) A = emeasure (null_measure M) A" |
|
2388 by (simp add: density_def) (simp only: null_measure_def[symmetric] emeasure_null_measure) |
|
2389 qed simp |
|
2390 |
2354 subsubsection {* Uniform count measure *} |
2391 subsubsection {* Uniform count measure *} |
2355 |
2392 |
2356 definition "uniform_count_measure A = point_measure A (\<lambda>x. 1 / card A)" |
2393 definition "uniform_count_measure A = point_measure A (\<lambda>x. 1 / card A)" |
2357 |
2394 |
2358 lemma |
2395 lemma |