# HG changeset patch # User paulson # Date 1648161821 0 # Node ID c3f1bf2824bcd4cf494b795ed52fc09cae6d09d1 # Parent bcb7d5f1f535975fae115c77c23dad6e4293f295 Some new library lemmas diff -r bcb7d5f1f535 -r c3f1bf2824bc src/HOL/Library/Equipollence.thy --- a/src/HOL/Library/Equipollence.thy Thu Mar 24 22:21:24 2022 +0000 +++ b/src/HOL/Library/Equipollence.thy Thu Mar 24 22:43:41 2022 +0000 @@ -378,17 +378,22 @@ lemma times_0_eqpoll: "{} \ A \ {}" by (simp add: eqpoll_iff_bijections) +lemma Sigma_inj_lepoll_mono: + assumes h: "inj_on h A" "h ` A \ C" and "\x. x \ A \ B x \ D (h x)" + shows "Sigma A B \ Sigma C D" +proof - + have "\x. x \ A \ \f. inj_on f (B x) \ f ` (B x) \ D (h x)" + by (meson assms lepoll_def) + then obtain f where "\x. x \ A \ inj_on (f x) (B x) \ f x ` B x \ D (h x)" + by metis + with h show ?thesis + unfolding lepoll_def inj_on_def + by (rule_tac x="\(x,y). (h x, f x y)" in exI) force +qed + lemma Sigma_lepoll_mono: assumes "A \ C" "\x. x \ A \ B x \ D x" shows "Sigma A B \ Sigma C D" -proof - - have "\x. x \ A \ \f. inj_on f (B x) \ f ` (B x) \ D x" - by (meson assms lepoll_def) - then obtain f where "\x. x \ A \ inj_on (f x) (B x) \ f x ` B x \ D x" - by metis - with \A \ C\ show ?thesis - unfolding lepoll_def inj_on_def - by (rule_tac x="\(x,y). (x, f x y)" in exI) force -qed + using Sigma_inj_lepoll_mono [of id] assms by auto lemma sum_times_distrib_eqpoll: "(A <+> B) \ C \ (A \ C) <+> (B \ C)" unfolding eqpoll_def @@ -397,6 +402,18 @@ by (rule bij_betw_byWitness [where f' = "case_sum (\(x,z). (Inl x, z)) (\(y,z). (Inr y, z))"]) auto qed +lemma Sigma_eqpoll_cong: + assumes h: "bij_betw h A C" and BD: "\x. x \ A \ B x \ D (h x)" + shows "Sigma A B \ Sigma C D" +proof (intro lepoll_antisym) + show "Sigma A B \ Sigma C D" + by (metis Sigma_inj_lepoll_mono bij_betw_def eqpoll_imp_lepoll subset_refl assms) + have "inj_on (inv_into A h) C \ inv_into A h ` C \ A" + by (metis bij_betw_def bij_betw_inv_into h set_eq_subset) + then show "Sigma C D \ Sigma A B" + by (smt (verit, best) BD Sigma_inj_lepoll_mono bij_betw_inv_into_right eqpoll_sym h image_subset_iff lepoll_refl lepoll_trans2) +qed + lemma prod_insert_eqpoll: assumes "a \ A" shows "insert a A \ B \ B <+> A \ B" unfolding eqpoll_def