396 then show ?thesis |
396 then show ?thesis |
397 unfolding absolutely_continuous_def |
397 unfolding absolutely_continuous_def |
398 apply (auto simp: null_sets_distr_iff) |
398 apply (auto simp: null_sets_distr_iff) |
399 apply (auto simp: null_sets_def intro!: measurable_sets) |
399 apply (auto simp: null_sets_def intro!: measurable_sets) |
400 done |
400 done |
401 qed |
|
402 |
|
403 lemma distributed_integrable: |
|
404 "distributed M N X f \<Longrightarrow> g \<in> borel_measurable N \<Longrightarrow> |
|
405 integrable N (\<lambda>x. f x * g x) \<longleftrightarrow> integrable M (\<lambda>x. g (X x))" |
|
406 by (auto simp: distributed_real_AE |
|
407 distributed_distr_eq_density[symmetric] integrable_real_density[symmetric] integrable_distr_eq) |
|
408 |
|
409 lemma distributed_transform_integrable: |
|
410 assumes Px: "distributed M N X Px" |
|
411 assumes "distributed M P Y Py" |
|
412 assumes Y: "Y = (\<lambda>x. T (X x))" and T: "T \<in> measurable N P" and f: "f \<in> borel_measurable P" |
|
413 shows "integrable P (\<lambda>x. Py x * f x) \<longleftrightarrow> integrable N (\<lambda>x. Px x * f (T x))" |
|
414 proof - |
|
415 have "integrable P (\<lambda>x. Py x * f x) \<longleftrightarrow> integrable M (\<lambda>x. f (Y x))" |
|
416 by (rule distributed_integrable) fact+ |
|
417 also have "\<dots> \<longleftrightarrow> integrable M (\<lambda>x. f (T (X x)))" |
|
418 using Y by simp |
|
419 also have "\<dots> \<longleftrightarrow> integrable N (\<lambda>x. Px x * f (T x))" |
|
420 using measurable_comp[OF T f] Px by (intro distributed_integrable[symmetric]) (auto simp: comp_def) |
|
421 finally show ?thesis . |
|
422 qed |
401 qed |
423 |
402 |
424 lemma integrable_cong_AE_imp: |
403 lemma integrable_cong_AE_imp: |
425 "integrable M g \<Longrightarrow> f \<in> borel_measurable M \<Longrightarrow> (AE x in M. g x = f x) \<Longrightarrow> integrable M f" |
404 "integrable M g \<Longrightarrow> f \<in> borel_measurable M \<Longrightarrow> (AE x in M. g x = f x) \<Longrightarrow> integrable M f" |
426 using integrable_cong_AE[of f M g] by (auto simp: eq_commute) |
405 using integrable_cong_AE[of f M g] by (auto simp: eq_commute) |
933 by (intro integral_cong) (auto split: split_indicator simp: log_divide_eq) |
912 by (intro integral_cong) (auto split: split_indicator simp: log_divide_eq) |
934 show "- (\<integral> x. indicator A x / measure MX A * log b (indicator A x / measure MX A) \<partial>MX) = |
913 show "- (\<integral> x. indicator A x / measure MX A * log b (indicator A x / measure MX A) \<partial>MX) = |
935 log b (measure MX A)" |
914 log b (measure MX A)" |
936 unfolding eq using uniform_distributed_params[OF X] |
915 unfolding eq using uniform_distributed_params[OF X] |
937 by (subst integral_mult_right) (auto simp: measure_def) |
916 by (subst integral_mult_right) (auto simp: measure_def) |
|
917 qed |
|
918 |
|
919 lemma (in information_space) entropy_exponential: |
|
920 assumes D: "distributed M lborel X (exponential_density l)" |
|
921 shows "entropy b lborel X = log b (exp 1 / l)" |
|
922 proof - |
|
923 have l[simp, arith]: "0 < l" by (rule exponential_distributed_params[OF D]) |
|
924 |
|
925 have [simp]: "integrable lborel (exponential_density l)" |
|
926 using distributed_integrable[OF D, of "\<lambda>_. 1"] by simp |
|
927 |
|
928 have [simp]: "integral\<^sup>L lborel (exponential_density l) = 1" |
|
929 using distributed_integral[OF D, of "\<lambda>_. 1"] by (simp add: prob_space) |
|
930 |
|
931 have [simp]: "integrable lborel (\<lambda>x. exponential_density l x * x)" |
|
932 using erlang_ith_moment_integrable[OF l D, of 1] distributed_integrable[OF D, of "\<lambda>x. x"] by simp |
|
933 |
|
934 have [simp]: "integral\<^sup>L lborel (\<lambda>x. exponential_density l x * x) = 1 / l" |
|
935 using erlang_ith_moment[OF l D, of 1] distributed_integral[OF D, of "\<lambda>x. x"] by simp |
|
936 |
|
937 have "entropy b lborel X = - (\<integral> x. exponential_density l x * log b (exponential_density l x) \<partial>lborel)" |
|
938 using D by (rule entropy_distr) |
|
939 also have "(\<integral> x. exponential_density l x * log b (exponential_density l x) \<partial>lborel) = |
|
940 (\<integral> x. (ln l * exponential_density l x - l * (exponential_density l x * x)) / ln b \<partial>lborel)" |
|
941 by (intro integral_cong) (auto simp: log_def ln_mult exponential_density_def field_simps) |
|
942 also have "\<dots> = (ln l - 1) / ln b" |
|
943 by simp |
|
944 finally show ?thesis |
|
945 by (simp add: log_def divide_simps ln_div) |
938 qed |
946 qed |
939 |
947 |
940 lemma (in information_space) entropy_simple_distributed: |
948 lemma (in information_space) entropy_simple_distributed: |
941 "simple_distributed M X f \<Longrightarrow> \<H>(X) = - (\<Sum>x\<in>X`space M. f x * log b (f x))" |
949 "simple_distributed M X f \<Longrightarrow> \<H>(X) = - (\<Sum>x\<in>X`space M. f x * log b (f x))" |
942 by (subst entropy_distr[OF simple_distributed]) |
950 by (subst entropy_distr[OF simple_distributed]) |