| author | wenzelm | 
| Sat, 01 Apr 2023 19:15:38 +0200 | |
| changeset 77775 | 3cc55085d490 | 
| parent 77140 | 9a60c1759543 | 
| child 78200 | 264f2b69d09c | 
| permissions | -rw-r--r-- | 
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1 | section \<open>Equipollence and Other Relations Connected with Cardinality\<close> | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3 | theory "Equipollence" | 
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 4 | imports FuncSet | 
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 5 | begin | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 7 | subsection\<open>Eqpoll\<close> | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 8 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 9 | definition eqpoll :: "'a set \<Rightarrow> 'b set \<Rightarrow> bool" (infixl "\<approx>" 50) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 10 | where "eqpoll A B \<equiv> \<exists>f. bij_betw f A B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 11 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 12 | definition lepoll :: "'a set \<Rightarrow> 'b set \<Rightarrow> bool" (infixl "\<lesssim>" 50) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 13 | where "lepoll A B \<equiv> \<exists>f. inj_on f A \<and> f ` A \<subseteq> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 14 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 15 | definition lesspoll :: "'a set \<Rightarrow> 'b set \<Rightarrow> bool" (infixl \<open>\<prec>\<close> 50) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 16 | where "A \<prec> B == A \<lesssim> B \<and> ~(A \<approx> B)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 17 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 18 | lemma lepoll_empty_iff_empty [simp]: "A \<lesssim> {} \<longleftrightarrow> A = {}"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 19 | by (auto simp: lepoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 20 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 21 | lemma eqpoll_iff_card_of_ordIso: "A \<approx> B \<longleftrightarrow> ordIso2 (card_of A) (card_of B)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 22 | by (simp add: card_of_ordIso eqpoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 23 | |
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 24 | lemma eqpoll_refl [iff]: "A \<approx> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 25 | by (simp add: card_of_refl eqpoll_iff_card_of_ordIso) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 26 | |
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 27 | lemma eqpoll_finite_iff: "A \<approx> B \<Longrightarrow> finite A \<longleftrightarrow> finite B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 28 | by (meson bij_betw_finite eqpoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 29 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 30 | lemma eqpoll_iff_card: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 31 | assumes "finite A" "finite B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 32 | shows "A \<approx> B \<longleftrightarrow> card A = card B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 33 | using assms by (auto simp: bij_betw_iff_card eqpoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 34 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 35 | lemma lepoll_antisym: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 36 | assumes "A \<lesssim> B" "B \<lesssim> A" shows "A \<approx> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 37 | using assms unfolding eqpoll_def lepoll_def by (metis Schroeder_Bernstein) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 38 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 39 | lemma lepoll_trans [trans]: "\<lbrakk>A \<lesssim> B; B \<lesssim> C\<rbrakk> \<Longrightarrow> A \<lesssim> C" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 40 | apply (clarsimp simp: lepoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 41 | apply (rename_tac f g) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 42 | apply (rule_tac x="g \<circ> f" in exI) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 43 | apply (auto simp: image_subset_iff inj_on_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 44 | done | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 45 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 46 | lemma lepoll_trans1 [trans]: "\<lbrakk>A \<approx> B; B \<lesssim> C\<rbrakk> \<Longrightarrow> A \<lesssim> C" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 47 | by (meson card_of_ordLeq eqpoll_iff_card_of_ordIso lepoll_def lepoll_trans ordIso_iff_ordLeq) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 48 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 49 | lemma lepoll_trans2 [trans]: "\<lbrakk>A \<lesssim> B; B \<approx> C\<rbrakk> \<Longrightarrow> A \<lesssim> C" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 50 | apply (clarsimp simp: eqpoll_def lepoll_def bij_betw_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 51 | apply (rename_tac f g) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 52 | apply (rule_tac x="g \<circ> f" in exI) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 53 | apply (auto simp: image_subset_iff inj_on_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 54 | done | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 55 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 56 | lemma eqpoll_sym: "A \<approx> B \<Longrightarrow> B \<approx> A" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 57 | unfolding eqpoll_def | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 58 | using bij_betw_the_inv_into by auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 59 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 60 | lemma eqpoll_trans [trans]: "\<lbrakk>A \<approx> B; B \<approx> C\<rbrakk> \<Longrightarrow> A \<approx> C" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 61 | unfolding eqpoll_def using bij_betw_trans by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 62 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 63 | lemma eqpoll_imp_lepoll: "A \<approx> B \<Longrightarrow> A \<lesssim> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 64 | unfolding eqpoll_def lepoll_def by (metis bij_betw_def order_refl) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 65 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 66 | lemma subset_imp_lepoll: "A \<subseteq> B \<Longrightarrow> A \<lesssim> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 67 | by (force simp: lepoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 68 | |
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 69 | lemma lepoll_refl [iff]: "A \<lesssim> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 70 | by (simp add: subset_imp_lepoll) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 71 | |
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 72 | lemma lepoll_iff: "A \<lesssim> B \<longleftrightarrow> (\<exists>g. A \<subseteq> g ` B)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 73 | unfolding lepoll_def | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 74 | proof safe | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 75 | fix g assume "A \<subseteq> g ` B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 76 | then show "\<exists>f. inj_on f A \<and> f ` A \<subseteq> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 77 | by (rule_tac x="inv_into B g" in exI) (auto simp: inv_into_into inj_on_inv_into) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 78 | qed (metis image_mono the_inv_into_onto) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 79 | |
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 80 | lemma empty_lepoll [iff]: "{} \<lesssim> A"
 | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 81 | by (simp add: lepoll_iff) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 82 | |
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 83 | lemma subset_image_lepoll: "B \<subseteq> f ` A \<Longrightarrow> B \<lesssim> A" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 84 | by (auto simp: lepoll_iff) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 85 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 86 | lemma image_lepoll: "f ` A \<lesssim> A" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 87 | by (auto simp: lepoll_iff) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 88 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 89 | lemma infinite_le_lepoll: "infinite A \<longleftrightarrow> (UNIV::nat set) \<lesssim> A" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 90 | apply (auto simp: lepoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 91 | apply (simp add: infinite_countable_subset) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 92 | using infinite_iff_countable_subset by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 93 | |
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 94 | lemma lepoll_Pow_self: "A \<lesssim> Pow A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 95 | unfolding lepoll_def inj_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 96 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 97 |     show "inj_on (\<lambda>x. {x}) A"
 | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 98 | by (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 99 | qed auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 100 | |
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 101 | lemma eqpoll_iff_bijections: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 102 | "A \<approx> B \<longleftrightarrow> (\<exists>f g. (\<forall>x \<in> A. f x \<in> B \<and> g(f x) = x) \<and> (\<forall>y \<in> B. g y \<in> A \<and> f(g y) = y))" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 103 | by (auto simp: eqpoll_def bij_betw_iff_bijections) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 104 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 105 | lemma lepoll_restricted_funspace: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 106 |    "{f. f ` A \<subseteq> B \<and> {x. f x \<noteq> k x} \<subseteq> A \<and> finite {x. f x \<noteq> k x}} \<lesssim> Fpow (A \<times> B)"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 107 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 108 | have *: "\<exists>U \<in> Fpow (A \<times> B). f = (\<lambda>x. if \<exists>y. (x, y) \<in> U then SOME y. (x,y) \<in> U else k x)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 109 |     if "f ` A \<subseteq> B" "{x. f x \<noteq> k x} \<subseteq> A" "finite {x. f x \<noteq> k x}" for f
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 110 |     apply (rule_tac x="(\<lambda>x. (x, f x)) ` {x. f x \<noteq> k x}" in bexI)
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 111 | using that by (auto simp: image_def Fpow_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 112 | show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 113 | apply (rule subset_image_lepoll [where f = "\<lambda>U x. if \<exists>y. (x,y) \<in> U then @y. (x,y) \<in> U else k x"]) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 114 | using * by (auto simp: image_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 115 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 116 | |
| 69874 | 117 | lemma singleton_lepoll: "{x} \<lesssim> insert y A"
 | 
| 118 | by (force simp: lepoll_def) | |
| 119 | ||
| 120 | lemma singleton_eqpoll: "{x} \<approx> {y}"
 | |
| 121 | by (blast intro: lepoll_antisym singleton_lepoll) | |
| 122 | ||
| 123 | lemma subset_singleton_iff_lepoll: "(\<exists>x. S \<subseteq> {x}) \<longleftrightarrow> S \<lesssim> {()}"
 | |
| 124 | proof safe | |
| 125 |   show "S \<lesssim> {()}" if "S \<subseteq> {x}" for x
 | |
| 126 | using subset_imp_lepoll [OF that] by (simp add: singleton_eqpoll lepoll_trans2) | |
| 127 |   show "\<exists>x. S \<subseteq> {x}" if "S \<lesssim> {()}"
 | |
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
71857diff
changeset | 128 | by (metis (no_types, opaque_lifting) image_empty image_insert lepoll_iff that) | 
| 69874 | 129 | qed | 
| 130 | ||
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 131 | lemma infinite_insert_lepoll: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 132 | assumes "infinite A" shows "insert a A \<lesssim> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 133 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 134 | obtain f :: "nat \<Rightarrow> 'a" where "inj f" and f: "range f \<subseteq> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 135 | using assms infinite_countable_subset by blast | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 136 | let ?g = "(\<lambda>z. if z=a then f 0 else if z \<in> range f then f (Suc (inv f z)) else z)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 137 | show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 138 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 139 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 140 | show "inj_on ?g (insert a A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 141 | using inj_on_eq_iff [OF \<open>inj f\<close>] | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 142 | by (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 143 | show "?g ` insert a A \<subseteq> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 144 | using f by auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 145 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 146 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 147 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 148 | lemma infinite_insert_eqpoll: "infinite A \<Longrightarrow> insert a A \<approx> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 149 | by (simp add: lepoll_antisym infinite_insert_lepoll subset_imp_lepoll subset_insertI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 150 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 151 | lemma finite_lepoll_infinite: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 152 | assumes "infinite A" "finite B" shows "B \<lesssim> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 153 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 154 | have "B \<lesssim> (UNIV::nat set)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 155 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 156 | using finite_imp_inj_to_nat_seg [OF \<open>finite B\<close>] by blast | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 157 | then show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 158 | using \<open>infinite A\<close> infinite_le_lepoll lepoll_trans by auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 159 | qed | 
| 69874 | 160 | |
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 161 | subsection\<open>The strict relation\<close> | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 162 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 163 | lemma lesspoll_not_refl [iff]: "~ (i \<prec> i)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 164 | by (simp add: lepoll_antisym lesspoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 165 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 166 | lemma lesspoll_imp_lepoll: "A \<prec> B ==> A \<lesssim> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 167 | by (unfold lesspoll_def, blast) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 168 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 169 | lemma lepoll_iff_leqpoll: "A \<lesssim> B \<longleftrightarrow> A \<prec> B | A \<approx> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 170 | using eqpoll_imp_lepoll lesspoll_def by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 171 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 172 | lemma lesspoll_trans [trans]: "\<lbrakk>X \<prec> Y; Y \<prec> Z\<rbrakk> \<Longrightarrow> X \<prec> Z" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 173 | by (meson eqpoll_sym lepoll_antisym lepoll_trans lepoll_trans1 lesspoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 174 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 175 | lemma lesspoll_trans1 [trans]: "\<lbrakk>X \<lesssim> Y; Y \<prec> Z\<rbrakk> \<Longrightarrow> X \<prec> Z" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 176 | by (meson eqpoll_sym lepoll_antisym lepoll_trans lepoll_trans1 lesspoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 177 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 178 | lemma lesspoll_trans2 [trans]: "\<lbrakk>X \<prec> Y; Y \<lesssim> Z\<rbrakk> \<Longrightarrow> X \<prec> Z" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 179 | by (meson eqpoll_imp_lepoll eqpoll_sym lepoll_antisym lepoll_trans lesspoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 180 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 181 | lemma eq_lesspoll_trans [trans]: "\<lbrakk>X \<approx> Y; Y \<prec> Z\<rbrakk> \<Longrightarrow> X \<prec> Z" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 182 | using eqpoll_imp_lepoll lesspoll_trans1 by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 183 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 184 | lemma lesspoll_eq_trans [trans]: "\<lbrakk>X \<prec> Y; Y \<approx> Z\<rbrakk> \<Longrightarrow> X \<prec> Z" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 185 | using eqpoll_imp_lepoll lesspoll_trans2 by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 186 | |
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 187 | lemma lesspoll_Pow_self: "A \<prec> Pow A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 188 | unfolding lesspoll_def bij_betw_def eqpoll_def | 
| 77140 
9a60c1759543
Lots more new material thanks to Manuel Eberl
 paulson <lp15@cam.ac.uk> parents: 
75331diff
changeset | 189 | by (meson lepoll_Pow_self Cantors_theorem) | 
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 190 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 191 | lemma finite_lesspoll_infinite: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 192 | assumes "infinite A" "finite B" shows "B \<prec> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 193 | by (meson assms eqpoll_finite_iff finite_lepoll_infinite lesspoll_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 194 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 195 | subsection\<open>Mapping by an injection\<close> | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 196 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 197 | lemma inj_on_image_eqpoll_self: "inj_on f A \<Longrightarrow> f ` A \<approx> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 198 | by (meson bij_betw_def eqpoll_def eqpoll_sym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 199 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 200 | lemma inj_on_image_lepoll_1 [simp]: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 201 | assumes "inj_on f A" shows "f ` A \<lesssim> B \<longleftrightarrow> A \<lesssim> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 202 | by (meson assms image_lepoll lepoll_def lepoll_trans order_refl) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 203 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 204 | lemma inj_on_image_lepoll_2 [simp]: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 205 | assumes "inj_on f B" shows "A \<lesssim> f ` B \<longleftrightarrow> A \<lesssim> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 206 | by (meson assms eq_iff image_lepoll lepoll_def lepoll_trans) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 207 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 208 | lemma inj_on_image_lesspoll_1 [simp]: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 209 | assumes "inj_on f A" shows "f ` A \<prec> B \<longleftrightarrow> A \<prec> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 210 | by (meson assms image_lepoll le_less lepoll_def lesspoll_trans1) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 211 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 212 | lemma inj_on_image_lesspoll_2 [simp]: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 213 | assumes "inj_on f B" shows "A \<prec> f ` B \<longleftrightarrow> A \<prec> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 214 | by (meson assms eqpoll_sym inj_on_image_eqpoll_self lesspoll_eq_trans) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 215 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 216 | lemma inj_on_image_eqpoll_1 [simp]: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 217 | assumes "inj_on f A" shows "f ` A \<approx> B \<longleftrightarrow> A \<approx> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 218 | by (metis assms eqpoll_trans inj_on_image_eqpoll_self eqpoll_sym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 219 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 220 | lemma inj_on_image_eqpoll_2 [simp]: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 221 | assumes "inj_on f B" shows "A \<approx> f ` B \<longleftrightarrow> A \<approx> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 222 | by (metis assms inj_on_image_eqpoll_1 eqpoll_sym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 223 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 224 | subsection \<open>Inserting elements into sets\<close> | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 225 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 226 | lemma insert_lepoll_insertD: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 227 | assumes "insert u A \<lesssim> insert v B" "u \<notin> A" "v \<notin> B" shows "A \<lesssim> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 228 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 229 | obtain f where inj: "inj_on f (insert u A)" and fim: "f ` (insert u A) \<subseteq> insert v B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 230 | by (meson assms lepoll_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 231 | show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 232 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 233 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 234 | let ?g = "\<lambda>x\<in>A. if f x = v then f u else f x" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 235 | show "inj_on ?g A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 236 | using inj \<open>u \<notin> A\<close> by (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 237 | show "?g ` A \<subseteq> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 238 | using fim \<open>u \<notin> A\<close> image_subset_iff inj inj_on_image_mem_iff by fastforce | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 239 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 240 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 241 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 242 | lemma insert_eqpoll_insertD: "\<lbrakk>insert u A \<approx> insert v B; u \<notin> A; v \<notin> B\<rbrakk> \<Longrightarrow> A \<approx> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 243 | by (meson insert_lepoll_insertD eqpoll_imp_lepoll eqpoll_sym lepoll_antisym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 244 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 245 | lemma insert_lepoll_cong: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 246 | assumes "A \<lesssim> B" "b \<notin> B" shows "insert a A \<lesssim> insert b B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 247 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 248 | obtain f where f: "inj_on f A" "f ` A \<subseteq> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 249 | by (meson assms lepoll_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 250 | let ?f = "\<lambda>u \<in> insert a A. if u=a then b else f u" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 251 | show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 252 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 253 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 254 | show "inj_on ?f (insert a A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 255 | using f \<open>b \<notin> B\<close> by (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 256 | show "?f ` insert a A \<subseteq> insert b B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 257 | using f \<open>b \<notin> B\<close> by auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 258 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 259 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 260 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 261 | lemma insert_eqpoll_cong: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 262 | "\<lbrakk>A \<approx> B; a \<notin> A; b \<notin> B\<rbrakk> \<Longrightarrow> insert a A \<approx> insert b B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 263 | apply (rule lepoll_antisym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 264 | apply (simp add: eqpoll_imp_lepoll insert_lepoll_cong)+ | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 265 | by (meson eqpoll_imp_lepoll eqpoll_sym insert_lepoll_cong) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 266 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 267 | lemma insert_eqpoll_insert_iff: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 268 | "\<lbrakk>a \<notin> A; b \<notin> B\<rbrakk> \<Longrightarrow> insert a A \<approx> insert b B \<longleftrightarrow> A \<approx> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 269 | by (meson insert_eqpoll_insertD insert_eqpoll_cong) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 270 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 271 | lemma insert_lepoll_insert_iff: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 272 | " \<lbrakk>a \<notin> A; b \<notin> B\<rbrakk> \<Longrightarrow> (insert a A \<lesssim> insert b B) \<longleftrightarrow> (A \<lesssim> B)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 273 | by (meson insert_lepoll_insertD insert_lepoll_cong) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 274 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 275 | lemma less_imp_insert_lepoll: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 276 | assumes "A \<prec> B" shows "insert a A \<lesssim> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 277 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 278 | obtain f where "inj_on f A" "f ` A \<subset> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 279 | using assms by (metis bij_betw_def eqpoll_def lepoll_def lesspoll_def psubset_eq) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 280 | then obtain b where b: "b \<in> B" "b \<notin> f ` A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 281 | by auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 282 | show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 283 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 284 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 285 | show "inj_on (f(a:=b)) (insert a A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 286 | using b \<open>inj_on f A\<close> by (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 287 | show "(f(a:=b)) ` insert a A \<subseteq> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 288 | using \<open>f ` A \<subset> B\<close> by (auto simp: b) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 289 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 290 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 291 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 292 | lemma finite_insert_lepoll: "finite A \<Longrightarrow> (insert a A \<lesssim> A) \<longleftrightarrow> (a \<in> A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 293 | proof (induction A rule: finite_induct) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 294 | case (insert x A) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 295 | then show ?case | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 296 | apply (auto simp: insert_absorb) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 297 | by (metis insert_commute insert_iff insert_lepoll_insertD) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 298 | qed auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 299 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 300 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 301 | subsection\<open>Binary sums and unions\<close> | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 302 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 303 | lemma Un_lepoll_mono: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 304 | assumes "A \<lesssim> C" "B \<lesssim> D" "disjnt C D" shows "A \<union> B \<lesssim> C \<union> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 305 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 306 | obtain f g where inj: "inj_on f A" "inj_on g B" and fg: "f ` A \<subseteq> C" "g ` B \<subseteq> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 307 | by (meson assms lepoll_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 308 | have "inj_on (\<lambda>x. if x \<in> A then f x else g x) (A \<union> B)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 309 | using inj \<open>disjnt C D\<close> fg unfolding disjnt_iff | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 310 | by (fastforce intro: inj_onI dest: inj_on_contraD split: if_split_asm) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 311 | with fg show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 312 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 313 | by (rule_tac x="\<lambda>x. if x \<in> A then f x else g x" in exI) auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 314 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 315 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 316 | lemma Un_eqpoll_cong: "\<lbrakk>A \<approx> C; B \<approx> D; disjnt A B; disjnt C D\<rbrakk> \<Longrightarrow> A \<union> B \<approx> C \<union> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 317 | by (meson Un_lepoll_mono eqpoll_imp_lepoll eqpoll_sym lepoll_antisym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 318 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 319 | lemma sum_lepoll_mono: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 320 | assumes "A \<lesssim> C" "B \<lesssim> D" shows "A <+> B \<lesssim> C <+> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 321 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 322 | obtain f g where "inj_on f A" "f ` A \<subseteq> C" "inj_on g B" "g ` B \<subseteq> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 323 | by (meson assms lepoll_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 324 | then show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 325 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 326 | by (rule_tac x="case_sum (Inl \<circ> f) (Inr \<circ> g)" in exI) (force simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 327 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 328 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 329 | lemma sum_eqpoll_cong: "\<lbrakk>A \<approx> C; B \<approx> D\<rbrakk> \<Longrightarrow> A <+> B \<approx> C <+> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 330 | by (meson eqpoll_imp_lepoll eqpoll_sym lepoll_antisym sum_lepoll_mono) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 331 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 332 | subsection\<open>Binary Cartesian products\<close> | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 333 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 334 | lemma times_square_lepoll: "A \<lesssim> A \<times> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 335 | unfolding lepoll_def inj_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 336 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 337 | show "inj_on (\<lambda>x. (x,x)) A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 338 | by (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 339 | qed auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 340 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 341 | lemma times_commute_eqpoll: "A \<times> B \<approx> B \<times> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 342 | unfolding eqpoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 343 | by (force intro: bij_betw_byWitness [where f = "\<lambda>(x,y). (y,x)" and f' = "\<lambda>(x,y). (y,x)"]) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 344 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 345 | lemma times_assoc_eqpoll: "(A \<times> B) \<times> C \<approx> A \<times> (B \<times> C)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 346 | unfolding eqpoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 347 | by (force intro: bij_betw_byWitness [where f = "\<lambda>((x,y),z). (x,(y,z))" and f' = "\<lambda>(x,(y,z)). ((x,y),z)"]) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 348 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 349 | lemma times_singleton_eqpoll: "{a} \<times> A \<approx> A"
 | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 350 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 351 |   have "{a} \<times> A = (\<lambda>x. (a,x)) ` A"
 | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 352 | by auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 353 | also have "\<dots> \<approx> A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 354 | proof (rule inj_on_image_eqpoll_self) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 355 | show "inj_on (Pair a) A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 356 | by (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 357 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 358 | finally show ?thesis . | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 359 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 360 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 361 | lemma times_lepoll_mono: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 362 | assumes "A \<lesssim> C" "B \<lesssim> D" shows "A \<times> B \<lesssim> C \<times> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 363 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 364 | obtain f g where "inj_on f A" "f ` A \<subseteq> C" "inj_on g B" "g ` B \<subseteq> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 365 | by (meson assms lepoll_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 366 | then show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 367 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 368 | by (rule_tac x="\<lambda>(x,y). (f x, g y)" in exI) (auto simp: inj_on_def) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 369 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 370 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 371 | lemma times_eqpoll_cong: "\<lbrakk>A \<approx> C; B \<approx> D\<rbrakk> \<Longrightarrow> A \<times> B \<approx> C \<times> D" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 372 | by (metis eqpoll_imp_lepoll eqpoll_sym lepoll_antisym times_lepoll_mono) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 373 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 374 | lemma | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 375 |   assumes "B \<noteq> {}" shows lepoll_times1: "A \<lesssim> A \<times> B" and lepoll_times2:  "A \<lesssim> B \<times> A"
 | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 376 | using assms lepoll_iff by fastforce+ | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 377 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 378 | lemma times_0_eqpoll: "{} \<times> A \<approx> {}"
 | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 379 | by (simp add: eqpoll_iff_bijections) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 380 | |
| 75331 | 381 | lemma Sigma_inj_lepoll_mono: | 
| 382 | assumes h: "inj_on h A" "h ` A \<subseteq> C" and "\<And>x. x \<in> A \<Longrightarrow> B x \<lesssim> D (h x)" | |
| 383 | shows "Sigma A B \<lesssim> Sigma C D" | |
| 384 | proof - | |
| 385 | have "\<And>x. x \<in> A \<Longrightarrow> \<exists>f. inj_on f (B x) \<and> f ` (B x) \<subseteq> D (h x)" | |
| 386 | by (meson assms lepoll_def) | |
| 387 | then obtain f where "\<And>x. x \<in> A \<Longrightarrow> inj_on (f x) (B x) \<and> f x ` B x \<subseteq> D (h x)" | |
| 388 | by metis | |
| 389 | with h show ?thesis | |
| 390 | unfolding lepoll_def inj_on_def | |
| 391 | by (rule_tac x="\<lambda>(x,y). (h x, f x y)" in exI) force | |
| 392 | qed | |
| 393 | ||
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 394 | lemma Sigma_lepoll_mono: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 395 | assumes "A \<subseteq> C" "\<And>x. x \<in> A \<Longrightarrow> B x \<lesssim> D x" shows "Sigma A B \<lesssim> Sigma C D" | 
| 75331 | 396 | using Sigma_inj_lepoll_mono [of id] assms by auto | 
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 397 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 398 | lemma sum_times_distrib_eqpoll: "(A <+> B) \<times> C \<approx> (A \<times> C) <+> (B \<times> C)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 399 | unfolding eqpoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 400 | proof | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 401 | show "bij_betw (\<lambda>(x,z). case_sum(\<lambda>y. Inl(y,z)) (\<lambda>y. Inr(y,z)) x) ((A <+> B) \<times> C) (A \<times> C <+> B \<times> C)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 402 | by (rule bij_betw_byWitness [where f' = "case_sum (\<lambda>(x,z). (Inl x, z)) (\<lambda>(y,z). (Inr y, z))"]) auto | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 403 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 404 | |
| 75331 | 405 | lemma Sigma_eqpoll_cong: | 
| 406 | assumes h: "bij_betw h A C" and BD: "\<And>x. x \<in> A \<Longrightarrow> B x \<approx> D (h x)" | |
| 407 | shows "Sigma A B \<approx> Sigma C D" | |
| 408 | proof (intro lepoll_antisym) | |
| 409 | show "Sigma A B \<lesssim> Sigma C D" | |
| 410 | by (metis Sigma_inj_lepoll_mono bij_betw_def eqpoll_imp_lepoll subset_refl assms) | |
| 411 | have "inj_on (inv_into A h) C \<and> inv_into A h ` C \<subseteq> A" | |
| 412 | by (metis bij_betw_def bij_betw_inv_into h set_eq_subset) | |
| 413 | then show "Sigma C D \<lesssim> Sigma A B" | |
| 414 | by (smt (verit, best) BD Sigma_inj_lepoll_mono bij_betw_inv_into_right eqpoll_sym h image_subset_iff lepoll_refl lepoll_trans2) | |
| 415 | qed | |
| 416 | ||
| 71096 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 417 | lemma prod_insert_eqpoll: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 418 | assumes "a \<notin> A" shows "insert a A \<times> B \<approx> B <+> A \<times> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 419 | unfolding eqpoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 420 | proof | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 421 | show "bij_betw (\<lambda>(x,y). if x=a then Inl y else Inr (x,y)) (insert a A \<times> B) (B <+> A \<times> B)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 422 | by (rule bij_betw_byWitness [where f' = "case_sum (\<lambda>y. (a,y)) id"]) (auto simp: assms) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 423 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 424 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 425 | subsection\<open>General Unions\<close> | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 426 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 427 | lemma Union_eqpoll_Times: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 428 | assumes B: "\<And>x. x \<in> A \<Longrightarrow> F x \<approx> B" and disj: "pairwise (\<lambda>x y. disjnt (F x) (F y)) A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 429 | shows "(\<Union>x\<in>A. F x) \<approx> A \<times> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 430 | proof (rule lepoll_antisym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 431 | obtain b where b: "\<And>x. x \<in> A \<Longrightarrow> bij_betw (b x) (F x) B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 432 | using B unfolding eqpoll_def by metis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 433 | show "\<Union>(F ` A) \<lesssim> A \<times> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 434 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 435 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 436 | define \<chi> where "\<chi> \<equiv> \<lambda>z. THE x. x \<in> A \<and> z \<in> F x" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 437 | have \<chi>: "\<chi> z = x" if "x \<in> A" "z \<in> F x" for x z | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 438 | unfolding \<chi>_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 439 | apply (rule the_equality) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 440 | apply (simp add: that) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 441 | by (metis disj disjnt_iff pairwiseD that) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 442 | let ?f = "\<lambda>z. (\<chi> z, b (\<chi> z) z)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 443 | show "inj_on ?f (\<Union>(F ` A))" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 444 | unfolding inj_on_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 445 | by clarify (metis \<chi> b bij_betw_inv_into_left) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 446 | show "?f ` \<Union>(F ` A) \<subseteq> A \<times> B" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 447 | using \<chi> b bij_betwE by blast | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 448 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 449 | show "A \<times> B \<lesssim> \<Union>(F ` A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 450 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 451 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 452 | let ?f = "\<lambda>(x,y). inv_into (F x) (b x) y" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 453 | have *: "inv_into (F x) (b x) y \<in> F x" if "x \<in> A" "y \<in> B" for x y | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 454 | by (metis b bij_betw_imp_surj_on inv_into_into that) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 455 | then show "inj_on ?f (A \<times> B)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 456 | unfolding inj_on_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 457 | by clarsimp (metis (mono_tags, lifting) b bij_betw_inv_into_right disj disjnt_iff pairwiseD) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 458 | show "?f ` (A \<times> B) \<subseteq> \<Union> (F ` A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 459 | by clarsimp (metis b bij_betw_imp_surj_on inv_into_into) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 460 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 461 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 462 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 463 | lemma UN_lepoll_UN: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 464 | assumes A: "\<And>x. x \<in> A \<Longrightarrow> B x \<lesssim> C x" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 465 | and disj: "pairwise (\<lambda>x y. disjnt (C x) (C y)) A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 466 | shows "\<Union> (B`A) \<lesssim> \<Union> (C`A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 467 | proof - | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 468 | obtain f where f: "\<And>x. x \<in> A \<Longrightarrow> inj_on (f x) (B x) \<and> f x ` (B x) \<subseteq> (C x)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 469 | using A unfolding lepoll_def by metis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 470 | show ?thesis | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 471 | unfolding lepoll_def | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 472 | proof (intro exI conjI) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 473 | define \<chi> where "\<chi> \<equiv> \<lambda>z. @x. x \<in> A \<and> z \<in> B x" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 474 | have \<chi>: "\<chi> z \<in> A \<and> z \<in> B (\<chi> z)" if "x \<in> A" "z \<in> B x" for x z | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 475 | unfolding \<chi>_def by (metis (mono_tags, lifting) someI_ex that) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 476 | let ?f = "\<lambda>z. (f (\<chi> z) z)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 477 | show "inj_on ?f (\<Union>(B ` A))" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 478 | using disj f unfolding inj_on_def disjnt_iff pairwise_def image_subset_iff | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 479 | by (metis UN_iff \<chi>) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 480 | show "?f ` \<Union> (B ` A) \<subseteq> \<Union> (C ` A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 481 | using \<chi> f unfolding image_subset_iff by blast | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 482 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 483 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 484 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 485 | lemma UN_eqpoll_UN: | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 486 | assumes A: "\<And>x. x \<in> A \<Longrightarrow> B x \<approx> C x" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 487 | and B: "pairwise (\<lambda>x y. disjnt (B x) (B y)) A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 488 | and C: "pairwise (\<lambda>x y. disjnt (C x) (C y)) A" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 489 | shows "(\<Union>x\<in>A. B x) \<approx> (\<Union>x\<in>A. C x)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 490 | proof (rule lepoll_antisym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 491 | show "\<Union> (B ` A) \<lesssim> \<Union> (C ` A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 492 | by (meson A C UN_lepoll_UN eqpoll_imp_lepoll) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 493 | show "\<Union> (C ` A) \<lesssim> \<Union> (B ` A)" | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 494 | by (simp add: A B UN_lepoll_UN eqpoll_imp_lepoll eqpoll_sym) | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 495 | qed | 
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 496 | |
| 
ec7cc76e88e5
New library material from the AFP entry ZFC_in_HOL
 paulson <lp15@cam.ac.uk> parents: 
69874diff
changeset | 497 | subsection\<open>General Cartesian products (Pi)\<close> | 
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 498 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 499 | lemma PiE_sing_eqpoll_self: "({a} \<rightarrow>\<^sub>E B) \<approx> B"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 500 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 501 | have 1: "x = y" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 502 |     if "x \<in> {a} \<rightarrow>\<^sub>E B" "y \<in> {a} \<rightarrow>\<^sub>E B" "x a = y a" for x y
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 503 | by (metis IntD2 PiE_def extensionalityI singletonD that) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 504 |   have 2: "x \<in> (\<lambda>h. h a) ` ({a} \<rightarrow>\<^sub>E B)" if "x \<in> B" for x
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 505 |     using that by (rule_tac x="\<lambda>z\<in>{a}. x" in image_eqI) auto
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 506 | show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 507 | unfolding eqpoll_def bij_betw_def inj_on_def | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 508 | by (force intro: 1 2) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 509 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 510 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 511 | lemma lepoll_funcset_right: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 512 | "B \<lesssim> B' \<Longrightarrow> A \<rightarrow>\<^sub>E B \<lesssim> A \<rightarrow>\<^sub>E B'" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 513 | apply (auto simp: lepoll_def inj_on_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 514 | apply (rule_tac x = "\<lambda>g. \<lambda>z \<in> A. f(g z)" in exI) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 515 | apply (auto simp: fun_eq_iff) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 516 | apply (metis PiE_E) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 517 | by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 518 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 519 | lemma lepoll_funcset_left: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 520 |   assumes "B \<noteq> {}" "A \<lesssim> A'"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 521 | shows "A \<rightarrow>\<^sub>E B \<lesssim> A' \<rightarrow>\<^sub>E B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 522 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 523 | obtain b where "b \<in> B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 524 | using assms by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 525 | obtain f where "inj_on f A" and fim: "f ` A \<subseteq> A'" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 526 | using assms by (auto simp: lepoll_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 527 | then obtain h where h: "\<And>x. x \<in> A \<Longrightarrow> h (f x) = x" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 528 | using the_inv_into_f_f by fastforce | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 529 | let ?F = "\<lambda>g. \<lambda>u \<in> A'. if h u \<in> A then g(h u) else b" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 530 | show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 531 | unfolding lepoll_def inj_on_def | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 532 | proof (intro exI conjI ballI impI ext) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 533 | fix k l x | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 534 | assume k: "k \<in> A \<rightarrow>\<^sub>E B" and l: "l \<in> A \<rightarrow>\<^sub>E B" and "?F k = ?F l" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 535 | then have "?F k (f x) = ?F l (f x)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 536 | by simp | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 537 | then show "k x = l x" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 538 | apply (auto simp: h split: if_split_asm) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 539 | apply (metis PiE_arb h k l) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 540 | apply (metis (full_types) PiE_E h k l) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 541 | using fim k l by fastforce | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 542 | next | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 543 | show "?F ` (A \<rightarrow>\<^sub>E B) \<subseteq> A' \<rightarrow>\<^sub>E B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 544 | using \<open>b \<in> B\<close> by force | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 545 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 546 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 547 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 548 | lemma lepoll_funcset: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 549 |    "\<lbrakk>B \<noteq> {}; A \<lesssim> A'; B \<lesssim> B'\<rbrakk> \<Longrightarrow> A \<rightarrow>\<^sub>E B \<lesssim> A' \<rightarrow>\<^sub>E B'"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 550 | by (rule lepoll_trans [OF lepoll_funcset_right lepoll_funcset_left]) auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 551 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 552 | lemma lepoll_PiE: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 553 | assumes "\<And>i. i \<in> A \<Longrightarrow> B i \<lesssim> C i" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 554 | shows "PiE A B \<lesssim> PiE A C" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 555 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 556 | obtain f where f: "\<And>i. i \<in> A \<Longrightarrow> inj_on (f i) (B i) \<and> (f i) ` B i \<subseteq> C i" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 557 | using assms unfolding lepoll_def by metis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 558 | then show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 559 | unfolding lepoll_def | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 560 | apply (rule_tac x = "\<lambda>g. \<lambda>i \<in> A. f i (g i)" in exI) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 561 | apply (auto simp: inj_on_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 562 | apply (rule PiE_ext, auto) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 563 | apply (metis (full_types) PiE_mem restrict_apply') | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 564 | by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 565 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 566 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 567 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 568 | lemma card_le_PiE_subindex: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 569 |   assumes "A \<subseteq> A'" "Pi\<^sub>E A' B \<noteq> {}"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 570 | shows "PiE A B \<lesssim> PiE A' B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 571 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 572 | have "\<And>x. x \<in> A' \<Longrightarrow> \<exists>y. y \<in> B x" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 573 | using assms by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 574 | then obtain g where g: "\<And>x. x \<in> A' \<Longrightarrow> g x \<in> B x" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 575 | by metis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 576 | let ?F = "\<lambda>f x. if x \<in> A then f x else if x \<in> A' then g x else undefined" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 577 | have "Pi\<^sub>E A B \<subseteq> (\<lambda>f. restrict f A) ` Pi\<^sub>E A' B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 578 | proof | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 579 | show "f \<in> Pi\<^sub>E A B \<Longrightarrow> f \<in> (\<lambda>f. restrict f A) ` Pi\<^sub>E A' B" for f | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 580 | using \<open>A \<subseteq> A'\<close> | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 581 | by (rule_tac x="?F f" in image_eqI) (auto simp: g fun_eq_iff) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 582 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 583 | then have "Pi\<^sub>E A B \<lesssim> (\<lambda>f. \<lambda>i \<in> A. f i) ` Pi\<^sub>E A' B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 584 | by (simp add: subset_imp_lepoll) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 585 | also have "\<dots> \<lesssim> PiE A' B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 586 | by (rule image_lepoll) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 587 | finally show ?thesis . | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 588 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 589 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 590 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 591 | lemma finite_restricted_funspace: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 592 | assumes "finite A" "finite B" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 593 |   shows "finite {f. f ` A \<subseteq> B \<and> {x. f x \<noteq> k x} \<subseteq> A}" (is "finite ?F")
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 594 | proof (rule finite_subset) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 595 | show "finite ((\<lambda>U x. if \<exists>y. (x,y) \<in> U then @y. (x,y) \<in> U else k x) ` Pow(A \<times> B))" (is "finite ?G") | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 596 | using assms by auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 597 | show "?F \<subseteq> ?G" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 598 | proof | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 599 | fix f | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 600 | assume "f \<in> ?F" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 601 | then show "f \<in> ?G" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 602 |       by (rule_tac x="(\<lambda>x. (x,f x)) ` {x. f x \<noteq> k x}" in image_eqI) (auto simp: fun_eq_iff image_def)
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 603 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 604 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 605 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 606 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 607 | proposition finite_PiE_iff: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 608 |    "finite(PiE I S) \<longleftrightarrow> PiE I S = {} \<or> finite {i \<in> I. ~(\<exists>a. S i \<subseteq> {a})} \<and> (\<forall>i \<in> I. finite(S i))"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 609 | (is "?lhs = ?rhs") | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 610 | proof (cases "PiE I S = {}")
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 611 | case False | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 612 |   define J where "J \<equiv> {i \<in> I. \<nexists>a. S i \<subseteq> {a}}"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 613 | show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 614 | proof | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 615 | assume L: ?lhs | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 616 | have "infinite (Pi\<^sub>E I S)" if "infinite J" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 617 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 618 | have "(UNIV::nat set) \<lesssim> (UNIV::(nat\<Rightarrow>bool) set)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 619 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 620 | have "\<forall>N::nat set. inj_on (=) N" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 621 | by (simp add: inj_on_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 622 | then show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 623 | by (meson infinite_iff_countable_subset infinite_le_lepoll top.extremum) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 624 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 625 | also have "\<dots> = (UNIV::nat set) \<rightarrow>\<^sub>E (UNIV::bool set)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 626 | by auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 627 | also have "\<dots> \<lesssim> J \<rightarrow>\<^sub>E (UNIV::bool set)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 628 | apply (rule lepoll_funcset_left) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 629 | using infinite_le_lepoll that by auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 630 | also have "\<dots> \<lesssim> Pi\<^sub>E J S" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 631 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 632 |         have *: "(UNIV::bool set) \<lesssim> S i" if "i \<in> I" and "\<forall>a. \<not> S i \<subseteq> {a}" for i
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 633 | proof - | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 634 |           obtain a b where "{a,b} \<subseteq> S i" "a \<noteq> b"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 635 |             by (metis \<open>\<forall>a. \<not> S i \<subseteq> {a}\<close> all_not_in_conv empty_subsetI insertCI insert_subset set_eq_subset subsetI)
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 636 | then show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 637 | apply (clarsimp simp: lepoll_def inj_on_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 638 | apply (rule_tac x="\<lambda>x. if x then a else b" in exI, auto) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 639 | done | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 640 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 641 | show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 642 | by (auto simp: * J_def intro: lepoll_PiE) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 643 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 644 | also have "\<dots> \<lesssim> Pi\<^sub>E I S" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 645 | using False by (auto simp: J_def intro: card_le_PiE_subindex) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 646 | finally have "(UNIV::nat set) \<lesssim> Pi\<^sub>E I S" . | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 647 | then show ?thesis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 648 | by (simp add: infinite_le_lepoll) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 649 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 650 | moreover have "finite (S i)" if "i \<in> I" for i | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 651 | proof (rule finite_subset) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 652 | obtain f where f: "f \<in> PiE I S" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 653 | using False by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 654 | show "S i \<subseteq> (\<lambda>f. f i) ` Pi\<^sub>E I S" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 655 | proof | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 656 | show "s \<in> (\<lambda>f. f i) ` Pi\<^sub>E I S" if "s \<in> S i" for s | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 657 | using that f \<open>i \<in> I\<close> | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 658 | by (rule_tac x="\<lambda>j. if j = i then s else f j" in image_eqI) auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 659 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 660 | next | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 661 | show "finite ((\<lambda>x. x i) ` Pi\<^sub>E I S)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 662 | using L by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 663 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 664 | ultimately show ?rhs | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 665 | using L | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 666 | by (auto simp: J_def False) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 667 | next | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 668 | assume R: ?rhs | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 669 |     have "\<forall>i \<in> I - J. \<exists>a. S i = {a}"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 670 | using False J_def by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 671 |     then obtain a where a: "\<forall>i \<in> I - J. S i = {a i}"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 672 | by metis | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 673 |     let ?F = "{f. f ` J \<subseteq> (\<Union>i \<in> J. S i) \<and> {i. f i \<noteq> (if i \<in> I then a i else undefined)} \<subseteq> J}"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 674 | have *: "finite (Pi\<^sub>E I S)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 675 | if "finite J" and "\<forall>i\<in>I. finite (S i)" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 676 | proof (rule finite_subset) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 677 | show "Pi\<^sub>E I S \<subseteq> ?F" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 678 | apply safe | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 679 | using J_def apply blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 680 | by (metis DiffI PiE_E a singletonD) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 681 | show "finite ?F" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 682 | proof (rule finite_restricted_funspace [OF \<open>finite J\<close>]) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 683 | show "finite (\<Union> (S ` J))" | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 684 | using that J_def by blast | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 685 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 686 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 687 | show ?lhs | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 688 | using R by (auto simp: * J_def) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 689 | qed | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 690 | qed auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 691 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 692 | |
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 693 | corollary finite_funcset_iff: | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 694 |   "finite(I \<rightarrow>\<^sub>E S) \<longleftrightarrow> (\<exists>a. S \<subseteq> {a}) \<or> I = {} \<or> finite I \<and> finite S"
 | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 695 | apply (auto simp: finite_PiE_iff PiE_eq_empty_iff dest: not_finite_existsD) | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 696 | using finite.simps by auto | 
| 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 697 | |
| 71226 | 698 | lemma lists_lepoll_mono: | 
| 699 | assumes "A \<lesssim> B" shows "lists A \<lesssim> lists B" | |
| 700 | proof - | |
| 701 | obtain f where f: "inj_on f A" "f ` A \<subseteq> B" | |
| 702 | by (meson assms lepoll_def) | |
| 703 | moreover have "inj_on (map f) (lists A)" | |
| 704 | using f unfolding inj_on_def | |
| 705 | by clarsimp (metis list.inj_map_strong) | |
| 706 | ultimately show ?thesis | |
| 707 | unfolding lepoll_def by force | |
| 708 | qed | |
| 709 | ||
| 710 | lemma lepoll_lists: "A \<lesssim> lists A" | |
| 711 | unfolding lepoll_def inj_on_def by(rule_tac x="\<lambda>x. [x]" in exI) auto | |
| 712 | ||
| 69735 
8230dca028eb
the theory of Equipollence, and moving Fpow from Cardinals into Main
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 713 | end |