src/HOL/Probability/Information.thy
changeset 50244 de72bbe42190
parent 50003 8c213922ed49
child 50419 3177d0374701
equal deleted inserted replaced
50243:0d97ef1d6de9 50244:de72bbe42190
   181   next
   181   next
   182     show "emeasure M {x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} \<noteq> 0"
   182     show "emeasure M {x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} \<noteq> 0"
   183     proof
   183     proof
   184       assume eq_0: "emeasure M {x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} = 0"
   184       assume eq_0: "emeasure M {x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} = 0"
   185       then have disj: "AE x in M. D x = 1 \<or> D x = 0"
   185       then have disj: "AE x in M. D x = 1 \<or> D x = 0"
   186         using D(1) by (auto intro!: AE_I[OF subset_refl] sets_Collect)
   186         using D(1) by (auto intro!: AE_I[OF subset_refl] sets.sets_Collect)
   187 
   187 
   188       have "emeasure M {x\<in>space M. D x = 1} = (\<integral>\<^isup>+ x. indicator {x\<in>space M. D x = 1} x \<partial>M)"
   188       have "emeasure M {x\<in>space M. D x = 1} = (\<integral>\<^isup>+ x. indicator {x\<in>space M. D x = 1} x \<partial>M)"
   189         using D(1) by auto
   189         using D(1) by auto
   190       also have "\<dots> = (\<integral>\<^isup>+ x. ereal (D x) \<partial>M)"
   190       also have "\<dots> = (\<integral>\<^isup>+ x. ereal (D x) \<partial>M)"
   191         using disj by (auto intro!: positive_integral_cong_AE simp: indicator_def one_ereal_def)
   191         using disj by (auto intro!: positive_integral_cong_AE simp: indicator_def one_ereal_def)
   196       also have "\<dots> = density M D A"
   196       also have "\<dots> = density M D A"
   197         using `A \<in> sets M` D by (simp add: emeasure_density)
   197         using `A \<in> sets M` D by (simp add: emeasure_density)
   198       finally show False using `A \<in> sets M` `emeasure (density M D) A \<noteq> emeasure M A` by simp
   198       finally show False using `A \<in> sets M` `emeasure (density M D) A \<noteq> emeasure M A` by simp
   199     qed
   199     qed
   200     show "{x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} \<in> sets M"
   200     show "{x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} \<in> sets M"
   201       using D(1) by (auto intro: sets_Collect_conj)
   201       using D(1) by (auto intro: sets.sets_Collect_conj)
   202 
   202 
   203     show "AE t in M. t \<in> {x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} \<longrightarrow>
   203     show "AE t in M. t \<in> {x\<in>space M. D x \<noteq> 1 \<and> D x \<noteq> 0} \<longrightarrow>
   204       D t - indicator ?D_set t \<noteq> D t * (ln b * log b (D t))"
   204       D t - indicator ?D_set t \<noteq> D t * (ln b * log b (D t))"
   205       using D(2)
   205       using D(2)
   206     proof (eventually_elim, safe)
   206     proof (eventually_elim, safe)
   381   shows "absolutely_continuous S (distr (S \<Otimes>\<^isub>M T) S fst)"
   381   shows "absolutely_continuous S (distr (S \<Otimes>\<^isub>M T) S fst)"
   382 proof -
   382 proof -
   383   interpret sigma_finite_measure T by fact
   383   interpret sigma_finite_measure T by fact
   384   { fix A assume "A \<in> sets S" "emeasure S A = 0"
   384   { fix A assume "A \<in> sets S" "emeasure S A = 0"
   385     moreover then have "fst -` A \<inter> space (S \<Otimes>\<^isub>M T) = A \<times> space T"
   385     moreover then have "fst -` A \<inter> space (S \<Otimes>\<^isub>M T) = A \<times> space T"
   386       by (auto simp: space_pair_measure dest!: sets_into_space)
   386       by (auto simp: space_pair_measure dest!: sets.sets_into_space)
   387     ultimately have "emeasure (S \<Otimes>\<^isub>M T) (fst -` A \<inter> space (S \<Otimes>\<^isub>M T)) = 0"
   387     ultimately have "emeasure (S \<Otimes>\<^isub>M T) (fst -` A \<inter> space (S \<Otimes>\<^isub>M T)) = 0"
   388       by (simp add: emeasure_pair_measure_Times) }
   388       by (simp add: emeasure_pair_measure_Times) }
   389   then show ?thesis
   389   then show ?thesis
   390     unfolding absolutely_continuous_def
   390     unfolding absolutely_continuous_def
   391     apply (auto simp: null_sets_distr_iff)
   391     apply (auto simp: null_sets_distr_iff)
   398   shows "absolutely_continuous T (distr (S \<Otimes>\<^isub>M T) T snd)"
   398   shows "absolutely_continuous T (distr (S \<Otimes>\<^isub>M T) T snd)"
   399 proof -
   399 proof -
   400   interpret sigma_finite_measure T by fact
   400   interpret sigma_finite_measure T by fact
   401   { fix A assume "A \<in> sets T" "emeasure T A = 0"
   401   { fix A assume "A \<in> sets T" "emeasure T A = 0"
   402     moreover then have "snd -` A \<inter> space (S \<Otimes>\<^isub>M T) = space S \<times> A"
   402     moreover then have "snd -` A \<inter> space (S \<Otimes>\<^isub>M T) = space S \<times> A"
   403       by (auto simp: space_pair_measure dest!: sets_into_space)
   403       by (auto simp: space_pair_measure dest!: sets.sets_into_space)
   404     ultimately have "emeasure (S \<Otimes>\<^isub>M T) (snd -` A \<inter> space (S \<Otimes>\<^isub>M T)) = 0"
   404     ultimately have "emeasure (S \<Otimes>\<^isub>M T) (snd -` A \<inter> space (S \<Otimes>\<^isub>M T)) = 0"
   405       by (simp add: emeasure_pair_measure_Times) }
   405       by (simp add: emeasure_pair_measure_Times) }
   406   then show ?thesis
   406   then show ?thesis
   407     unfolding absolutely_continuous_def
   407     unfolding absolutely_continuous_def
   408     apply (auto simp: null_sets_distr_iff)
   408     apply (auto simp: null_sets_distr_iff)
  1569   moreover
  1569   moreover
  1570   have "AE x in density (S \<Otimes>\<^isub>M T) (\<lambda>x. ereal (Pxy x)). Py (snd x) = real (RN_deriv T (distr M T Y) (snd x))"
  1570   have "AE x in density (S \<Otimes>\<^isub>M T) (\<lambda>x. ereal (Pxy x)). Py (snd x) = real (RN_deriv T (distr M T Y) (snd x))"
  1571     unfolding AE_density[OF distributed_borel_measurable, OF Pxy]
  1571     unfolding AE_density[OF distributed_borel_measurable, OF Pxy]
  1572     unfolding distributed_distr_eq_density[OF Py]
  1572     unfolding distributed_distr_eq_density[OF Py]
  1573     apply (rule ST.AE_pair_measure)
  1573     apply (rule ST.AE_pair_measure)
  1574     apply (auto intro!: sets_Collect borel_measurable_eq measurable_compose[OF _ distributed_real_measurable[OF Py]]
  1574     apply (auto intro!: sets.sets_Collect borel_measurable_eq measurable_compose[OF _ distributed_real_measurable[OF Py]]
  1575                         distributed_real_measurable[OF Pxy] distributed_real_AE[OF Py]
  1575                         distributed_real_measurable[OF Pxy] distributed_real_AE[OF Py]
  1576                         borel_measurable_real_of_ereal measurable_compose[OF _ borel_measurable_RN_deriv_density])
  1576                         borel_measurable_real_of_ereal measurable_compose[OF _ borel_measurable_RN_deriv_density])
  1577     using distributed_RN_deriv[OF Py]
  1577     using distributed_RN_deriv[OF Py]
  1578     apply auto
  1578     apply auto
  1579     done    
  1579     done