src/HOL/Probability/Probability_Mass_Function.thy
changeset 58730 b3fd0628f849
parent 58606 9c66f7c541fb
child 59000 6eb0725503fc
equal deleted inserted replaced
58729:e8ecc79aee43 58730:b3fd0628f849
   232 qed
   232 qed
   233 
   233 
   234 end
   234 end
   235 
   235 
   236 lemma embed_pmf_transfer:
   236 lemma embed_pmf_transfer:
   237   "rel_fun (eq_onp (\<lambda>f::'a \<Rightarrow> real. (\<forall>x. 0 \<le> f x) \<and> (\<integral>\<^sup>+x. ereal (f x) \<partial>count_space UNIV) = 1)) pmf_as_measure.cr_pmf (\<lambda>f. density (count_space UNIV) (ereal \<circ> f)) embed_pmf"
   237   "rel_fun (eq_onp (\<lambda>f. (\<forall>x. 0 \<le> f x) \<and> (\<integral>\<^sup>+x. ereal (f x) \<partial>count_space UNIV) = 1)) pmf_as_measure.cr_pmf (\<lambda>f. density (count_space UNIV) (ereal \<circ> f)) embed_pmf"
   238   by (auto simp: rel_fun_def eq_onp_def embed_pmf.transfer)
   238   by (auto simp: rel_fun_def eq_onp_def embed_pmf.transfer)
   239 
   239 
   240 lemma td_pmf_embed_pmf:
   240 lemma td_pmf_embed_pmf:
   241   "type_definition pmf embed_pmf {f::'a \<Rightarrow> real. (\<forall>x. 0 \<le> f x) \<and> (\<integral>\<^sup>+x. ereal (f x) \<partial>count_space UNIV) = 1}"
   241   "type_definition pmf embed_pmf {f::'a \<Rightarrow> real. (\<forall>x. 0 \<le> f x) \<and> (\<integral>\<^sup>+x. ereal (f x) \<partial>count_space UNIV) = 1}"
   242   unfolding type_definition_def
   242   unfolding type_definition_def
   260 
   260 
   261 locale pmf_as_function
   261 locale pmf_as_function
   262 begin
   262 begin
   263 
   263 
   264 setup_lifting td_pmf_embed_pmf
   264 setup_lifting td_pmf_embed_pmf
       
   265 
       
   266 lemma set_pmf_transfer[transfer_rule]: 
       
   267   assumes "bi_total A"
       
   268   shows "rel_fun (pcr_pmf A) (rel_set A) (\<lambda>f. {x. f x \<noteq> 0}) set_pmf"  
       
   269   using `bi_total A`
       
   270   by (auto simp: pcr_pmf_def cr_pmf_def rel_fun_def rel_set_def bi_total_def Bex_def set_pmf_iff)
       
   271      metis+
   265 
   272 
   266 end 
   273 end 
   267 
   274 
   268 (*
   275 (*
   269 
   276