526 |
526 |
527 lemma integral_map_pmf[simp]: |
527 lemma integral_map_pmf[simp]: |
528 fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}" |
528 fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}" |
529 shows "integral\<^sup>L (map_pmf g p) f = integral\<^sup>L p (\<lambda>x. f (g x))" |
529 shows "integral\<^sup>L (map_pmf g p) f = integral\<^sup>L p (\<lambda>x. f (g x))" |
530 by (simp add: integral_distr map_pmf_rep_eq) |
530 by (simp add: integral_distr map_pmf_rep_eq) |
|
531 |
|
532 lemma pmf_abs_summable [intro]: "pmf p abs_summable_on A" |
|
533 by (rule abs_summable_on_subset[OF _ subset_UNIV]) |
|
534 (auto simp: abs_summable_on_def integrable_iff_bounded nn_integral_pmf) |
|
535 |
|
536 lemma measure_pmf_conv_infsetsum: "measure (measure_pmf p) A = infsetsum (pmf p) A" |
|
537 unfolding infsetsum_def by (simp add: integral_eq_nn_integral nn_integral_pmf measure_def) |
|
538 |
|
539 lemma infsetsum_pmf_eq_1: |
|
540 assumes "set_pmf p \<subseteq> A" |
|
541 shows "infsetsum (pmf p) A = 1" |
|
542 proof - |
|
543 have "infsetsum (pmf p) A = lebesgue_integral (count_space UNIV) (pmf p)" |
|
544 using assms unfolding infsetsum_altdef |
|
545 by (intro Bochner_Integration.integral_cong) (auto simp: indicator_def set_pmf_eq) |
|
546 also have "\<dots> = 1" |
|
547 by (subst integral_eq_nn_integral) (auto simp: nn_integral_pmf) |
|
548 finally show ?thesis . |
|
549 qed |
531 |
550 |
532 lemma map_return_pmf [simp]: "map_pmf f (return_pmf x) = return_pmf (f x)" |
551 lemma map_return_pmf [simp]: "map_pmf f (return_pmf x) = return_pmf (f x)" |
533 by transfer (simp add: distr_return) |
552 by transfer (simp add: distr_return) |
534 |
553 |
535 lemma map_pmf_const[simp]: "map_pmf (\<lambda>_. c) M = return_pmf c" |
554 lemma map_pmf_const[simp]: "map_pmf (\<lambda>_. c) M = return_pmf c" |
2077 |
2096 |
2078 lemma measure_Int_set_pmf: |
2097 lemma measure_Int_set_pmf: |
2079 "measure (measure_pmf p) (A \<inter> set_pmf p) = measure (measure_pmf p) A" |
2098 "measure (measure_pmf p) (A \<inter> set_pmf p) = measure (measure_pmf p) A" |
2080 using emeasure_Int_set_pmf[of p A] by (simp add: Sigma_Algebra.measure_def) |
2099 using emeasure_Int_set_pmf[of p A] by (simp add: Sigma_Algebra.measure_def) |
2081 |
2100 |
|
2101 lemma measure_prob_cong_0: |
|
2102 assumes "\<And>x. x \<in> A - B \<Longrightarrow> pmf p x = 0" |
|
2103 assumes "\<And>x. x \<in> B - A \<Longrightarrow> pmf p x = 0" |
|
2104 shows "measure (measure_pmf p) A = measure (measure_pmf p) B" |
|
2105 proof - |
|
2106 have "measure_pmf.prob p A = measure_pmf.prob p (A \<inter> set_pmf p)" |
|
2107 by (simp add: measure_Int_set_pmf) |
|
2108 also have "A \<inter> set_pmf p = B \<inter> set_pmf p" |
|
2109 using assms by (auto simp: set_pmf_eq) |
|
2110 also have "measure_pmf.prob p \<dots> = measure_pmf.prob p B" |
|
2111 by (simp add: measure_Int_set_pmf) |
|
2112 finally show ?thesis . |
|
2113 qed |
|
2114 |
2082 lemma emeasure_pmf_of_list: |
2115 lemma emeasure_pmf_of_list: |
2083 assumes "pmf_of_list_wf xs" |
2116 assumes "pmf_of_list_wf xs" |
2084 shows "emeasure (pmf_of_list xs) A = ennreal (sum_list (map snd (filter (\<lambda>x. fst x \<in> A) xs)))" |
2117 shows "emeasure (pmf_of_list xs) A = ennreal (sum_list (map snd (filter (\<lambda>x. fst x \<in> A) xs)))" |
2085 proof - |
2118 proof - |
2086 have "emeasure (pmf_of_list xs) A = nn_integral (measure_pmf (pmf_of_list xs)) (indicator A)" |
2119 have "emeasure (pmf_of_list xs) A = nn_integral (measure_pmf (pmf_of_list xs)) (indicator A)" |