1353 using assms \<open>R x y\<close> by (auto simp: quotient_def dest: equivp_symp equivp_transp) |
1353 using assms \<open>R x y\<close> by (auto simp: quotient_def dest: equivp_symp equivp_transp) |
1354 with eq show "measure p {x. R x y} = measure q {y. R x y}" |
1354 with eq show "measure p {x. R x y} = measure q {y. R x y}" |
1355 by auto |
1355 by auto |
1356 qed |
1356 qed |
1357 |
1357 |
1358 bnf pmf: "'a pmf" map: map_pmf sets: set_pmf bd : "natLeq" rel: rel_pmf |
1358 bnf pmf: "'a pmf" map: map_pmf sets: set_pmf bd : "card_suc natLeq" rel: rel_pmf |
1359 proof - |
1359 proof - |
1360 show "map_pmf id = id" by (rule map_pmf_id) |
1360 show "map_pmf id = id" by (rule map_pmf_id) |
1361 show "\<And>f g. map_pmf (f \<circ> g) = map_pmf f \<circ> map_pmf g" by (rule map_pmf_compose) |
1361 show "\<And>f g. map_pmf (f \<circ> g) = map_pmf f \<circ> map_pmf g" by (rule map_pmf_compose) |
1362 show "\<And>f g::'a \<Rightarrow> 'b. \<And>p. (\<And>x. x \<in> set_pmf p \<Longrightarrow> f x = g x) \<Longrightarrow> map_pmf f p = map_pmf g p" |
1362 show "\<And>f g::'a \<Rightarrow> 'b. \<And>p. (\<And>x. x \<in> set_pmf p \<Longrightarrow> f x = g x) \<Longrightarrow> map_pmf f p = map_pmf g p" |
1363 by (intro map_pmf_cong refl) |
1363 by (intro map_pmf_cong refl) |
1364 |
1364 |
1365 show "\<And>f::'a \<Rightarrow> 'b. set_pmf \<circ> map_pmf f = (`) f \<circ> set_pmf" |
1365 show "\<And>f::'a \<Rightarrow> 'b. set_pmf \<circ> map_pmf f = (`) f \<circ> set_pmf" |
1366 by (rule pmf_set_map) |
1366 by (rule pmf_set_map) |
1367 |
1367 |
1368 show "(card_of (set_pmf p), natLeq) \<in> ordLeq" for p :: "'s pmf" |
1368 show "card_order (card_suc natLeq)" using natLeq_card_order by (rule card_order_card_suc) |
|
1369 show "BNF_Cardinal_Arithmetic.cinfinite (card_suc natLeq)" |
|
1370 using natLeq_Cinfinite natLeq_card_order Cinfinite_card_suc by blast |
|
1371 show "regularCard (card_suc natLeq)" using natLeq_card_order natLeq_Cinfinite |
|
1372 by (rule regular_card_suc) |
|
1373 |
|
1374 show "(card_of (set_pmf p), card_suc natLeq) \<in> ordLess" for p :: "'s pmf" |
1369 proof - |
1375 proof - |
1370 have "(card_of (set_pmf p), card_of (UNIV :: nat set)) \<in> ordLeq" |
1376 have "(card_of (set_pmf p), card_of (UNIV :: nat set)) \<in> ordLeq" |
1371 by (rule card_of_ordLeqI[where f="to_nat_on (set_pmf p)"]) |
1377 by (rule card_of_ordLeqI[where f="to_nat_on (set_pmf p)"]) |
1372 (auto intro: countable_set_pmf) |
1378 (auto intro: countable_set_pmf) |
1373 also have "(card_of (UNIV :: nat set), natLeq) \<in> ordLeq" |
1379 also have "(card_of (UNIV :: nat set), natLeq) \<in> ordLeq" |
1374 by (metis Field_natLeq card_of_least natLeq_Well_order) |
1380 by (metis Field_natLeq card_of_least natLeq_Well_order) |
1375 finally show ?thesis . |
1381 finally show ?thesis using card_suc_greater natLeq_card_order ordLeq_ordLess_trans by blast |
1376 qed |
1382 qed |
1377 |
1383 |
1378 show "\<And>R. rel_pmf R = (\<lambda>x y. \<exists>z. set_pmf z \<subseteq> {(x, y). R x y} \<and> |
1384 show "\<And>R. rel_pmf R = (\<lambda>x y. \<exists>z. set_pmf z \<subseteq> {(x, y). R x y} \<and> |
1379 map_pmf fst z = x \<and> map_pmf snd z = y)" |
1385 map_pmf fst z = x \<and> map_pmf snd z = y)" |
1380 by (auto simp add: fun_eq_iff rel_pmf.simps) |
1386 by (auto simp add: fun_eq_iff rel_pmf.simps) |
1411 qed (simp add: pr_def map_bind_pmf split_beta map_pmf_def[symmetric] p map_pmf_comp) |
1417 qed (simp add: pr_def map_bind_pmf split_beta map_pmf_def[symmetric] p map_pmf_comp) |
1412 } |
1418 } |
1413 then show ?thesis |
1419 then show ?thesis |
1414 by(auto simp add: le_fun_def) |
1420 by(auto simp add: le_fun_def) |
1415 qed |
1421 qed |
1416 qed (fact natLeq_card_order natLeq_cinfinite)+ |
1422 qed |
1417 |
1423 |
1418 lemma map_pmf_idI: "(\<And>x. x \<in> set_pmf p \<Longrightarrow> f x = x) \<Longrightarrow> map_pmf f p = p" |
1424 lemma map_pmf_idI: "(\<And>x. x \<in> set_pmf p \<Longrightarrow> f x = x) \<Longrightarrow> map_pmf f p = p" |
1419 by(simp cong: pmf.map_cong) |
1425 by(simp cong: pmf.map_cong) |
1420 |
1426 |
1421 lemma rel_pmf_conj[simp]: |
1427 lemma rel_pmf_conj[simp]: |