lemma schroeder_bernstein: "\f \ inj(X,Y); g \ inj(Y,X)\ \ \h. h \ bij(X,Y)" apply (insert decomposition [of f X Y g]) apply (simp add: inj_is_fun) apply (blast intro!: restrict_bij bij_disjoint_Un intro: bij_converse_bij) (* The instantiation of exI to @{term"restrict(f,XA) \<union> converse(restrict(g,YB))"}
is forced by the context\<And>*) done
lemma eqpoll_0_iff: "A \ 0 \ A=0" by (blast intro: eqpoll_0_is_0 eqpoll_refl)
lemma eqpoll_disjoint_Un: "\A \ B; C \ D; A \ C = 0; B \ D = 0\ \<Longrightarrow> A \<union> C \<approx> B \<union> D" unfolding eqpoll_def apply (blast intro: bij_disjoint_Un) done
subsection\<open>lesspoll: contributions by Krzysztof Grabczewski\<close>
lemma lesspoll_not_refl: "\ (i \ i)" by (simp add: lesspoll_def)
lemma lesspoll_irrefl [elim!]: "i \ i \ P" by (simp add: lesspoll_def)
lemma lesspoll_imp_lepoll: "A \ B \ A \ B" by (unfold lesspoll_def, blast)
lemma lepoll_iff_leqpoll: "A \ B \ A \ B | A \ B" unfolding lesspoll_def apply (blast intro!: eqpollI elim!: eqpollE) done
lemma inj_not_surj_succ: assumes fi: "f \ inj(A, succ(m))" and fns: "f \ surj(A, succ(m))" shows"\f. f \ inj(A,m)" proof - from fi [THEN inj_is_fun] fns obtain y where y: "y \ succ(m)" "\x. x\A \ f ` x \ y" by (auto simp add: surj_def) show ?thesis proof show"(\z\A. if f`z = m then y else f`z) \ inj(A, m)" using y fi by (simp add: inj_def)
(auto intro!: if_type [THEN lam_type] intro: Pi_type dest: apply_funtype) qed qed
lemma LeastI: assumes P: "P(i)"and i: "Ord(i)"shows"P(\ x. P(x))" proof -
{ from i have"P(i) \ P(\ x. P(x))" proof (induct i rule: trans_induct) case (step i) show ?case proof (cases "P(\ a. P(a))") case True thus ?thesis . next case False hence"\x. x \ i \ \P(x)" using step by blast hence"(\ a. P(a)) = i" using step by (blast intro: Least_equality ltD) thus ?thesis using step.prems by simp qed qed
} thus ?thesis using P . qed
text\<open>The proof is almost identical to the one above!\<close> lemma Least_le: assumes P: "P(i)"and i: "Ord(i)"shows"(\ x. P(x)) \ i" proof -
{ from i have"P(i) \ (\ x. P(x)) \ i" proof (induct i rule: trans_induct) case (step i) show ?case proof (cases "(\ a. P(a)) \ i") case True thus ?thesis . next case False hence"\x. x \ i \ \ (\ a. P(a)) \ i" using step by blast hence"(\ a. P(a)) = i" using step by (blast elim: ltE intro: ltI Least_equality lt_trans1) thus ?thesis using step by simp qed qed
} thus ?thesis using P . qed
(*\<mu> really is the smallest*) lemma less_LeastE: "\P(i); i < (\ x. P(x))\ \ Q" apply (rule Least_le [THEN [2] lt_trans2, THEN lt_irrefl], assumption+) apply (simp add: lt_Ord) done
(*Easier to apply than LeastI: conclusion has only one occurrence of P*) lemma LeastI2: "\P(i); Ord(i); \j. P(j) \ Q(j)\ \ Q(\ j. P(j))" by (blast intro: LeastI )
(*If there is no such P then \<mu> is vacuously 0*) lemma Least_0: "\\ (\i. Ord(i) \ P(i))\ \ (\ x. P(x)) = 0" unfolding Least_def apply (rule the_0, blast) done
lemma Ord_Least [intro,simp,TC]: "Ord(\ x. P(x))" proof (cases "\i. Ord(i) \ P(i)") case True thenobtain i where"P(i)""Ord(i)"by auto hence" (\ x. P(x)) \ i" by (rule Least_le) thus ?thesis by (elim ltE) next case False hence"(\ x. P(x)) = 0" by (rule Least_0) thus ?thesis by auto qed
subsection\<open>Basic Properties of Cardinals\<close>
(*Not needed for simplification, but helpful below*) lemma Least_cong: "(\y. P(y) \ Q(y)) \ (\ x. P(x)) = (\ x. Q(x))" by simp
(*Need AC to get @{term"X \<lesssim> Y \<Longrightarrow> |X| \<le> |Y|"}; see well_ord_lepoll_imp_cardinal_le
Converse also requires AC, but see well_ord_cardinal_eqE*) lemma cardinal_cong: "X \ Y \ |X| = |Y|" unfolding eqpoll_def cardinal_def apply (rule Least_cong) apply (blast intro: comp_bij bij_converse_bij) done
(*Under AC, the premise becomes trivial; one consequence is ||A|| = |A|*) lemma well_ord_cardinal_eqpoll: assumes r: "well_ord(A,r)"shows"|A| \ A" proof (unfold cardinal_def) show"(\ i. i \ A) \ A" by (best intro: LeastI Ord_ordertype ordermap_bij bij_converse_bij bij_imp_eqpoll r) qed
(*Infinite unions of cardinals? See Devlin, Lemma 6.7, page 98*)
lemma Card_cardinal [iff]: "Card(|A|)" proof (unfold cardinal_def) show"Card(\ i. i \ A)" proof (cases "\i. Ord (i) \ i \ A") case False thus ?thesis \<comment> \<open>degenerate case\<close> by (simp add: Least_0 Card_0) next case True \<comment> \<open>real case: \<^term>\<open>A\<close> is isomorphic to some ordinal\<close> thenobtain i where i: "Ord(i)""i \ A" by blast show ?thesis proof (rule CardI [OF Ord_Least], rule notI) fix j assume j: "j < (\ i. i \ A)" assume"j \ (\ i. i \ A)" alsohave"... \ A" using i by (auto intro: LeastI) finallyhave"j \ A" . thus False by (rule less_LeastE [OF _ j]) qed qed qed
(*Kunen's Lemma 10.5*) lemma cardinal_eq_lemma: assumes i:"|i| \ j" and j: "j \ i" shows "|j| = |i|" proof (rule eqpollI [THEN cardinal_cong]) show"j \ i" by (rule le_imp_lepoll [OF j]) next have Oi: "Ord(i)"using j by (rule le_Ord2) hence"i \ |i|" by (blast intro: Ord_cardinal_eqpoll eqpoll_sym) alsohave"... \ j" by (blast intro: le_imp_lepoll i) finallyshow"i \ j" . qed
lemma cardinal_mono: assumes ij: "i \ j" shows "|i| \ |j|" using Ord_cardinal [of i] Ord_cardinal [of j] proof (cases rule: Ord_linear_le) case le thus ?thesis . next case ge have i: "Ord(i)"using ij by (simp add: lt_Ord) have ci: "|i| \ j" by (blast intro: Ord_cardinal_le ij le_trans i) have"|i| = ||i||" by (auto simp add: Ord_cardinal_idem i) alsohave"... = |j|" by (rule cardinal_eq_lemma [OF ge ci]) finallyhave"|i| = |j|" . thus ?thesis by simp qed
text\<open>Since we have \<^term>\<open>|succ(nat)| \<le> |nat|\<close>, the converse of \<open>cardinal_mono\<close> fails!\<close> lemma cardinal_lt_imp_lt: "\|i| < |j|; Ord(i); Ord(j)\ \ i < j" apply (rule Ord_linear2 [of i j], assumption+) apply (erule lt_trans2 [THEN lt_irrefl]) apply (erule cardinal_mono) done
lemma Card_lt_imp_lt: "\|i| < K; Ord(i); Card(K)\ \ i < K" by (simp (no_asm_simp) add: cardinal_lt_imp_lt Card_is_Ord Card_cardinal_eq)
lemma Card_lt_iff: "\Ord(i); Card(K)\ \ (|i| < K) \ (i < K)" by (blast intro: Card_lt_imp_lt Ord_cardinal_le [THEN lt_trans1])
(*Can use AC or finiteness to discharge first premise*) lemma well_ord_lepoll_imp_cardinal_le: assumes wB: "well_ord(B,r)"and AB: "A \ B" shows"|A| \ |B|" using Ord_cardinal [of A] Ord_cardinal [of B] proof (cases rule: Ord_linear_le) case le thus ?thesis . next case ge from lepoll_well_ord [OF AB wB] obtain s where s: "well_ord(A, s)"by blast have"B \ |B|" by (blast intro: wB eqpoll_sym well_ord_cardinal_eqpoll) alsohave"... \ |A|" by (rule le_imp_lepoll [OF ge]) alsohave"... \ A" by (rule well_ord_cardinal_eqpoll [OF s]) finallyhave"B \ A" . hence"A \ B" by (blast intro: eqpollI AB) hence"|A| = |B|"by (rule cardinal_cong) thus ?thesis by simp qed
(*Lemma suggested by Mike Fourman*) lemma succ_lepoll_succD: "succ(m) \ succ(n) \ m \ n" unfolding succ_def apply (erule cons_lepoll_consD) apply (rule mem_not_refl)+ done
lemma nat_lepoll_imp_le: "m \ nat \ n \ nat \ m \ n \ m \ n" proof (induct m arbitrary: n rule: nat_induct) case 0 thus ?caseby (blast intro!: nat_0_le) next case (succ m) show ?caseusing\<open>n \<in> nat\<close> proof (cases rule: natE) case 0 thus ?thesis using succ by (simp add: lepoll_def inj_def) next case (succ n') thus ?thesis using succ.hyps \ succ(m) \ n\ by (blast intro!: succ_leI dest!: succ_lepoll_succD) qed qed
lemma nat_eqpoll_iff: "\m \ nat; n \ nat\ \ m \ n \ m = n" apply (rule iffI) apply (blast intro: nat_lepoll_imp_le le_anti_sym elim!: eqpollE) apply (simp add: eqpoll_refl) done
(*The object of all this work: every natural number is a (finite) cardinal*) lemma nat_into_Card: assumes n: "n \ nat" shows "Card(n)" proof (unfold Card_def cardinal_def, rule sym) have"Ord(n)"using n by auto moreover
{ fix i assume"i < n""i \ n" hence False using n by (auto simp add: lt_nat_in_nat [THEN nat_eqpoll_iff])
} ultimatelyshow"(\ i. i \ n) = n" by (auto intro!: Least_equality) qed
lemmas cardinal_0 = nat_0I [THEN nat_into_Card, THEN Card_cardinal_eq, iff] lemmas cardinal_1 = nat_1I [THEN nat_into_Card, THEN Card_cardinal_eq, iff]
(*Part of Kunen's Lemma 10.6*) lemma succ_lepoll_natE: "\succ(n) \ n; n \ nat\ \ P" by (rule nat_lepoll_imp_le [THEN lt_irrefl], auto)
lemma nat_lepoll_imp_ex_eqpoll_n: "\n \ nat; nat \ X\ \ \Y. Y \ X \ n \ Y" unfolding lepoll_def eqpoll_def apply (fast del: subsetI subsetCE
intro!: subset_SIs
dest!: Ord_nat [THEN [2] OrdmemD, THEN [2] restrict_inj]
elim!: restrict_bij
inj_is_fun [THEN fun_is_rel, THEN image_subset]) done
(** \<lesssim>, \<prec> and natural numbers **)
lemma lepoll_succ: "i \ succ(i)" by (blast intro: subset_imp_lepoll)
lemma lepoll_imp_lesspoll_succ: assumes A: "A \ m" and m: "m \ nat" shows"A \ succ(m)" proof -
{ assume"A \ succ(m)" hence"succ(m) \ A" by (rule eqpoll_sym) alsohave"... \ m" by (rule A) finallyhave"succ(m) \ m" . hence False by (rule succ_lepoll_natE) (rule m) } moreoverhave"A \ succ(m)" by (blast intro: lepoll_trans A lepoll_succ) ultimatelyshow ?thesis by (auto simp add: lesspoll_def) qed
subsection\<open>The first infinite cardinal: Omega, or nat\<close>
(*This implies Kunen's Lemma 10.6*) lemma lt_not_lepoll: assumes n: "n"n \ nat" shows "\ i \ n" proof -
{ assume i: "i \ n" have"succ(n) \ i" using n by (elim ltE, blast intro: Ord_succ_subsetI [THEN subset_imp_lepoll]) alsohave"... \ n" by (rule i) finallyhave"succ(n) \ n" . hence False by (rule succ_lepoll_natE) (rule n) } thus ?thesis by auto qed
text\<open>A slightly weaker version of \<open>nat_eqpoll_iff\<close>\<close> lemma Ord_nat_eqpoll_iff: assumes i: "Ord(i)"and n: "n \ nat" shows "i \ n \ i=n" using i nat_into_Ord [OF n] proof (cases rule: Ord_linear_lt) case lt hence"i \ nat" by (rule lt_nat_in_nat) (rule n) thus ?thesis by (simp add: nat_eqpoll_iff n) next case eq thus ?thesis by (simp add: eqpoll_refl) next case gt hence"\ i \ n" using n by (rule lt_not_lepoll) hence"\ i \ n" using n by (blast intro: eqpoll_imp_lepoll) moreoverhave"i \ n" using \n by auto ultimatelyshow ?thesis by blast qed
lemma Card_nat: "Card(nat)" proof -
{ fix i assume i: "i < nat""i \ nat" hence"\ nat \ i" by (simp add: lt_def lt_not_lepoll) hence False using i by (simp add: eqpoll_iff)
} hence"(\ i. i \ nat) = nat" by (blast intro: Least_equality eqpoll_refl) thus ?thesis by (auto simp add: Card_def cardinal_def) qed
(*Allows showing that |i| is a limit cardinal*) lemma nat_le_cardinal: "nat \ i \ nat \ |i|" apply (rule Card_nat [THEN Card_cardinal_eq, THEN subst]) apply (erule cardinal_mono) done
lemma n_lesspoll_nat: "n \ nat \ n \ nat" by (blast intro: Ord_nat Card_nat ltI lt_Card_imp_lesspoll)
subsection\<open>Towards Cardinal Arithmetic\<close> (** Congruence laws for successor, cardinal addition and multiplication **)
(*Congruence law for cons under equipollence*) lemma cons_lepoll_cong: "\A \ B; b \ B\ \ cons(a,A) \ cons(b,B)" apply (unfold lepoll_def, safe) apply (rule_tac x = "\y\cons (a,A) . if y=a then b else f`y" in exI) apply (rule_tac d = "\z. if z \ B then converse (f) `z else a" in lam_injective) apply (safe elim!: consE') apply simp_all apply (blast intro: inj_is_fun [THEN apply_type])+ done
lemma cons_eqpoll_cong: "\A \ B; a \ A; b \ B\ \ cons(a,A) \ cons(b,B)" by (simp add: eqpoll_iff cons_lepoll_cong)
lemma cons_lepoll_cons_iff: "\a \ A; b \ B\ \ cons(a,A) \ cons(b,B) \ A \ B" by (blast intro: cons_lepoll_cong cons_lepoll_consD)
lemma cons_eqpoll_cons_iff: "\a \ A; b \ B\ \ cons(a,A) \ cons(b,B) \ A \ B" by (blast intro: cons_eqpoll_cong cons_eqpoll_consD)
lemma not_0_is_lepoll_1: "A \ 0 \ 1 \ A" apply (erule not_emptyE) apply (rule_tac a = "cons (x, A-{x}) "in subst) apply (rule_tac [2] a = "cons(0,0)"and P= "\y. y \ cons (x, A-{x})" in subst) prefer 3 apply (blast intro: cons_lepoll_cong subset_imp_lepoll, auto) done
(*Congruence law for succ under equipollence*) lemma succ_eqpoll_cong: "A \ B \ succ(A) \ succ(B)" unfolding succ_def apply (simp add: cons_eqpoll_cong mem_not_refl) done
(*Congruence law for + under equipollence*) lemma sum_eqpoll_cong: "\A \ C; B \ D\ \ A+B \ C+D" unfolding eqpoll_def apply (blast intro!: sum_bij) done
(*Congruence law for * under equipollence*) lemma prod_eqpoll_cong: "\A \ C; B \ D\ \ A*B \ C*D" unfolding eqpoll_def apply (blast intro!: prod_bij) done
lemma inj_disjoint_eqpoll: "\f \ inj(A,B); A \ B = 0\ \ A \ (B - range(f)) \ B" unfolding eqpoll_def apply (rule exI) apply (rule_tac c = "\x. if x \ A then f`x else x" and d = "\y. if y \ range (f) then converse (f) `y else y" in lam_bijective) apply (blast intro!: if_type inj_is_fun [THEN apply_type]) apply (simp (no_asm_simp) add: inj_converse_fun [THEN apply_funtype]) apply (safe elim!: UnE') apply (simp_all add: inj_is_fun [THEN apply_rangeI]) apply (blast intro: inj_converse_fun [THEN apply_type])+ done
subsection\<open>Lemmas by Krzysztof Grabczewski\<close>
(*New proofs using cons_lepoll_cons. Could generalise from succ to cons.*)
text\<open>If \<^term>\<open>A\<close> has at most \<^term>\<open>n+1\<close> elements and \<^term>\<open>a \<in> A\<close> then\<^term>\<open>A-{a}\<close> has at most \<^term>\<open>n\<close>.\<close> lemma Diff_sing_lepoll: "\a \ A; A \ succ(n)\ \ A - {a} \ n" unfolding succ_def apply (rule cons_lepoll_consD) apply (rule_tac [3] mem_not_refl) apply (erule cons_Diff [THEN ssubst], safe) done
text\<open>If \<^term>\<open>A\<close> has at least \<^term>\<open>n+1\<close> elements then \<^term>\<open>A-{a}\<close> has at least \<^term>\<open>n\<close>.\<close> lemma lepoll_Diff_sing: assumes A: "succ(n) \ A" shows "n \ A - {a}" proof - have"cons(n,n) \ A" using A by (unfold succ_def) alsohave"... \ cons(a, A-{a})" by (blast intro: subset_imp_lepoll) finallyhave"cons(n,n) \ cons(a, A-{a})" . thus ?thesis by (blast intro: cons_lepoll_consD mem_irrefl) qed
lemma Diff_sing_eqpoll: "\a \ A; A \ succ(n)\ \ A - {a} \ n" by (blast intro!: eqpollI
elim!: eqpollE
intro: Diff_sing_lepoll lepoll_Diff_sing)
lemma Un_lepoll_sum: "A \ B \ A+B" unfolding lepoll_def apply (rule_tac x = "\x\A \ B. if x\A then Inl (x) else Inr (x)" in exI) apply (rule_tac d = "\z. snd (z)" in lam_injective) apply force apply (simp add: Inl_def Inr_def) done
lemma well_ord_Un: "\well_ord(X,R); well_ord(Y,S)\ \ \T. well_ord(X \ Y, T)" by (erule well_ord_radd [THEN Un_lepoll_sum [THEN lepoll_well_ord]],
assumption)
(*Krzysztof Grabczewski*) lemma disj_Un_eqpoll_sum: "A \ B = 0 \ A \ B \ A + B" unfolding eqpoll_def apply (rule_tac x = "\a\A \ B. if a \ A then Inl (a) else Inr (a)" in exI) apply (rule_tac d = "\z. case (\x. x, \x. x, z)" in lam_bijective) apply auto done
subsection \<open>Finite and infinite sets\<close>
lemma eqpoll_imp_Finite_iff: "A \ B \ Finite(A) \ Finite(B)" unfolding Finite_def apply (blast intro: eqpoll_trans eqpoll_sym) done
lemma lepoll_nat_imp_Finite: assumes A: "A \ n" and n: "n \ nat" shows "Finite(A)" proof - have"A \ n \ Finite(A)" using n proof (induct n) case 0 hence"A = 0"by (rule lepoll_0_is_0) thus ?caseby simp next case (succ n) hence"A \ n \ A \ succ(n)" by (blast dest: lepoll_succ_disj) thus ?caseusing succ by (auto simp add: Finite_def) qed thus ?thesis using A . qed
lemma lepoll_Finite: assumes Y: "Y \ X" and X: "Finite(X)" shows "Finite(Y)" proof - obtain n where n: "n \ nat" "X \ n" using X by (auto simp add: Finite_def) have"Y \ X" by (rule Y) alsohave"... \ n" by (rule n) finallyhave"Y \ n" . thus ?thesis using n by (simp add: lepoll_nat_imp_Finite) qed
text\<open>I don't know why, but if the premise is expressed using meta-connectives then the simplifier cannot prove it automatically in conditional rewriting.\<close> lemma Finite_RepFun_iff: "(\x y. f(x)=f(y) \ x=y) \ Finite(RepFun(A,f)) \ Finite(A)" by (blast intro: Finite_RepFun Finite_RepFun_iff_lemma [of _ f])
(*Krzysztof Grabczewski's proof that the converse of a finite, well-ordered
set is well-ordered. Proofs simplified by lcp. *)
lemma nat_wf_on_converse_Memrel: "n \ nat \ wf[n](converse(Memrel(n)))" proof (induct n rule: nat_induct) case 0 thus ?caseby (blast intro: wf_onI) next case (succ x) hence wfx: "\Z. Z = 0 \ (\z\Z. \y. z \ y \ z \ x \ y \ x \ z \ x \ y \ Z)" by (simp add: wf_on_def wf_def) \<comment> \<open>not easy to erase the duplicate \<^term>\<open>z \<in> x\<close>!\<close> show ?case proof (rule wf_onI) fix Z u assume Z: "u \ Z" "\z\Z. \y\Z. \y, z\ \ converse(Memrel(succ(x)))" show False proof (cases "x \ Z") case True thus False using Z by (blast elim: mem_irrefl mem_asym) next case False thus False using wfx [of Z] Z by blast qed qed qed
lemma nat_not_Finite: "\ Finite(nat)" proof -
{ fix n assume n: "n \ nat" "nat \ n" have"n \ nat" by (rule n) alsohave"... = n"using n by (simp add: Ord_nat_eqpoll_iff Ord_nat) finallyhave"n \ n" . hence False by (blast elim: mem_irrefl)
} thus ?thesis by (auto simp add: Finite_def) qed
end
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.22Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.