diff --git a/thys/Delta_System_Lemma/Cardinal_Library.thy b/thys/Delta_System_Lemma/Cardinal_Library.thy new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/Cardinal_Library.thy @@ -0,0 +1,708 @@ +section\Cardinal Arithmetic under Choice\label{sec:cardinal-lib}\ + +theory Cardinal_Library + imports + ZF_Library + ZF.Cardinal_AC + +begin + +text\This theory includes results on cardinalities that depend on $\AC$\ + + +subsection\Results on cardinal exponentiation\ + +text\Non trivial instances of cardinal exponentiation require that + the relevant function spaces are well-ordered, hence this + implies a strong use of choice.\ + +lemma cexp_eqpoll_cong: + assumes + "A \ A'" "B \ B'" + shows + "A\<^bsup>\B\<^esup> = A'\<^bsup>\B'\<^esup>" + unfolding cexp_def using cardinal_eqpoll_iff + function_space_eqpoll_cong assms + by simp + +lemma cexp_cexp_cmult: "(\\<^bsup>\\1\<^esup>)\<^bsup>\\2\<^esup> = \\<^bsup>\\2 \ \1\<^esup>" +proof - + have "(\\<^bsup>\\1\<^esup>)\<^bsup>\\2\<^esup> = (\1 \ \)\<^bsup>\\2\<^esup>" + using cardinal_eqpoll + by (intro cexp_eqpoll_cong) (simp_all add:cexp_def) + also + have " \ = \\<^bsup>\\2 \ \1\<^esup>" + unfolding cexp_def using curry_eqpoll cardinal_cong by blast + also + have " \ = \\<^bsup>\\2 \ \1\<^esup>" + using cardinal_eqpoll[THEN eqpoll_sym] + unfolding cmult_def by (intro cexp_eqpoll_cong) (simp) + finally + show ?thesis . +qed + +lemma cardinal_Pow: "|Pow(X)| = 2\<^bsup>\X\<^esup>" \ \Perhaps it's better with |X|\ + using cardinal_eqpoll_iff[THEN iffD2, OF Pow_eqpoll_function_space] + unfolding cexp_def by simp + +lemma cantor_cexp: + assumes "Card(\)" + shows "\ < 2\<^bsup>\\\<^esup>" + using assms Card_is_Ord Card_cexp +proof (intro not_le_iff_lt[THEN iffD1] notI) + assume "2\<^bsup>\\\<^esup> \ \" + then + have "|Pow(\)| \ \" + using cardinal_Pow by simp + with assms + have "Pow(\) \ \" + using cardinal_eqpoll_iff Card_le_imp_lepoll Card_cardinal_eq + by auto + then + obtain g where "g \ inj(Pow(\), \)" + by blast + then + show "False" + using cantor_inj by simp +qed simp + +lemma cexp_left_mono: + assumes "\1 \ \2" + shows "\1\<^bsup>\\\<^esup> \ \2\<^bsup>\\\<^esup>" + (* \ \short, unreadable proof: \ + unfolding cexp_def + using subset_imp_lepoll[THEN lepoll_imp_Card_le] + assms le_subset_iff[THEN iffD1, OF assms] + Pi_weaken_type[of _ _ "\_. \1" "\_. \2"] by auto *) +proof - + from assms + have "\1 \ \2" + using le_subset_iff by simp + then + have "\ \ \1 \ \ \ \2" + using Pi_weaken_type by auto + then + show ?thesis unfolding cexp_def + using lepoll_imp_Card_le subset_imp_lepoll by simp +qed + +lemma cantor_cexp': + assumes "2 \ \" "Card(\)" + shows "\ < \\<^bsup>\\\<^esup>" + using cexp_left_mono assms cantor_cexp lt_trans2 by blast + +lemma InfCard_cexp: + assumes "2 \ \" "InfCard(\)" + shows "InfCard(\\<^bsup>\\\<^esup>)" + using assms cantor_cexp'[THEN leI] le_trans Card_cexp + unfolding InfCard_def by auto + +lemmas InfCard_cexp' = InfCard_cexp[OF nats_le_InfCard, simplified] + \ \\<^term>\InfCard(\) \ InfCard(\) \ InfCard(\\<^bsup>\\\<^esup>)\\ + + +subsection\Miscellaneous\ + +lemma cardinal_RepFun_le: "|{f(a) . a\A}| \ |A|" +proof - + have "(\x\A. f(x)) \ surj(A, {f(a) . a\A})" + unfolding surj_def using lam_funtype by auto + then + show ?thesis + using surj_implies_cardinal_le by blast +qed + +lemma subset_imp_le_cardinal: "A \ B \ |A| \ |B|" + using subset_imp_lepoll[THEN lepoll_imp_Card_le] . + +lemma lt_cardinal_imp_not_subset: "|A| < |B| \ \ B \ A" + using subset_imp_le_cardinal le_imp_not_lt by blast + +lemma cardinal_lt_csucc_iff: "Card(K) \ |K'| < K\<^sup>+ \ |K'| \ K" + by (simp add: Card_lt_csucc_iff) + +lemma cardinal_UN_le_nat: + "(\i. i\\ \ |X(i)| \ \) \ |\i\\. X(i)| \ \" + by (simp add: cardinal_UN_le InfCard_nat) + +lemma leqpoll_imp_cardinal_UN_le: + notes [dest] = InfCard_is_Card Card_is_Ord + assumes "InfCard(K)" "J \ K" "\i. i\J \ |X(i)| \ K" + shows "|\i\J. X(i)| \ K" +proof - + from \J \ K\ + obtain f where "f \ inj(J,K)" by blast + define Y where "Y(k) \ if k\range(f) then X(converse(f)`k) else 0" for k + have "i\J \ f`i \ K" for i + using inj_is_fun[OF \f \ inj(J,K)\] by auto + have "(\i\J. X(i)) \ (\i\K. Y(i))" + proof (standard, elim UN_E) + fix x i + assume "i\J" "x\X(i)" + with \f \ inj(J,K)\ \i\J \ f`i \ K\ + have "x \ Y(f`i)" "f`i \ K" + unfolding Y_def + using inj_is_fun[OF \f \ inj(J,K)\] + right_inverse apply_rangeI by auto + then + show "x \ (\i\K. Y(i))" by auto + qed + then + have "|\i\J. X(i)| \ |\i\K. Y(i)|" + unfolding Y_def using subset_imp_le_cardinal by simp + with assms \\i. i\J \ f`i \ K\ + show "|\i\J. X(i)| \ K" + using inj_converse_fun[OF \f \ inj(J,K)\] unfolding Y_def + by (rule_tac le_trans[OF _ cardinal_UN_le]) (auto intro:Ord_0_le)+ +qed + +lemma cardinal_lt_csucc_iff': + includes Ord_dests + assumes "Card(\)" + shows "\ < |X| \ \\<^sup>+ \ |X|" + using assms cardinal_lt_csucc_iff[of \ X] Card_csucc[of \] + not_le_iff_lt[of "\\<^sup>+" "|X|"] not_le_iff_lt[of "|X|" \] + by blast + +lemma lepoll_imp_subset_bij: "X \ Y \ (\Z. Z \ Y \ Z \ X)" +proof + assume "X \ Y" + then + obtain j where "j \ inj(X,Y)" + by blast + then + have "range(j) \ Y" "j \ bij(X,range(j))" + using inj_bij_range inj_is_fun range_fun_subset_codomain + by blast+ + then + show "\Z. Z \ Y \ Z \ X" + using eqpoll_sym unfolding eqpoll_def + by force +next + assume "\Z. Z \ Y \ Z \ X" + then + obtain Z f where "f \ bij(Z,X)" "Z \ Y" + unfolding eqpoll_def by force + then + have "converse(f) \ inj(X,Y)" + using bij_is_inj inj_weaken_type bij_converse_bij by blast + then + show "X \ Y" by blast +qed + +text\The following result proves to be very useful when combining + \<^term>\cardinal\ and \<^term>\eqpoll\ in a calculation.\ + +lemma cardinal_Card_eqpoll_iff: "Card(\) \ |X| = \ \ X \ \" + using Card_cardinal_eq[of \] cardinal_eqpoll_iff[of X \] by auto + \ \Compare @{thm "le_Card_iff"}\ + +lemma lepoll_imp_lepoll_cardinal: assumes "X \ Y" shows "X \ |Y|" + using assms cardinal_Card_eqpoll_iff[of "|Y|" Y] + lepoll_eq_trans[of _ _ "|Y|"] by simp + +lemma lepoll_Un: + assumes "InfCard(\)" "A \ \" "B \ \" + shows "A \ B \ \" +proof - + have "A \ B \ sum(A,B)" + using Un_lepoll_sum . + moreover + note assms + moreover from this + have "|sum(A,B)| \ \ \ \" + using sum_lepoll_mono[of A \ B \] lepoll_imp_Card_le + unfolding cadd_def by auto + ultimately + show ?thesis + using InfCard_cdouble_eq Card_cardinal_eq + InfCard_is_Card Card_le_imp_lepoll[of "sum(A,B)" \] + lepoll_trans[of "A\B"] + by auto +qed + +lemma cardinal_Un_le: + assumes "InfCard(\)" "|A| \ \" "|B| \ \" + shows "|A \ B| \ \" + using assms lepoll_Un le_Card_iff InfCard_is_Card by auto + +text\This is the unconditional version under choice of + @{thm Cardinal.Finite_cardinal_iff}.\ +lemma Finite_cardinal_iff': "Finite(|i|) \ Finite(i)" + using cardinal_eqpoll_iff eqpoll_imp_Finite_iff by fastforce + +lemma cardinal_subset_of_Card: + assumes "Card(\)" "a \ \" + shows "|a| < \ \ |a| = \" +proof - + from assms + have "|a| < |\| \ |a| = |\|" + using subset_imp_le_cardinal le_iff by simp + with assms + show ?thesis + using Card_cardinal_eq by simp +qed + +lemma cardinal_cases: + includes Ord_dests + shows "Card(\) \ |X| < \ \ \ |X| \ \" + using not_le_iff_lt + by auto + + +subsection\Countable and uncountable sets\ + +\ \Kunen's Definition I.10.5\ +definition + countable :: "i\o" where + "countable(X) \ X \ \" + +lemma countableI[intro]: "X \ \ \ countable(X)" + unfolding countable_def by simp + +lemma countableD[dest]: "countable(X) \ X \ \" + unfolding countable_def by simp + +lemma countable_iff_cardinal_le_nat: "countable(X) \ |X| \ \" + using le_Card_iff[of \ X] Card_nat + unfolding countable_def by simp + +lemma lepoll_countable: "X \ Y \ countable(Y) \ countable(X)" + using lepoll_trans[of X Y] by blast + +\ \Next lemma can be proved without using AC\ +lemma surj_countable: "countable(X) \ f \ surj(X,Y) \ countable(Y)" + using surj_implies_cardinal_le[of f X Y, THEN le_trans] + countable_iff_cardinal_le_nat by simp + +lemma Finite_imp_countable: "Finite(X) \ countable(X)" + unfolding Finite_def + by (auto intro:InfCard_nat nats_le_InfCard[of _ \, + THEN le_imp_lepoll] dest!:eq_lepoll_trans[of X _ \]) + +lemma countable_imp_countable_UN: + assumes "countable(J)" "\i. i\J \ countable(X(i))" + shows "countable(\i\J. X(i))" + using assms leqpoll_imp_cardinal_UN_le[of \ J X] InfCard_nat + countable_iff_cardinal_le_nat + by auto + +lemma countable_union_countable: + assumes "\x. x \ C \ countable(x)" "countable(C)" + shows "countable(\C)" + using assms countable_imp_countable_UN[of C "\x. x"] by simp + +abbreviation + uncountable :: "i\o" where + "uncountable(X) \ \ countable(X)" + +lemma uncountable_iff_nat_lt_cardinal: + "uncountable(X) \ \ < |X|" + using countable_iff_cardinal_le_nat not_le_iff_lt by simp + +lemma uncountable_not_empty: "uncountable(X) \ X \ 0" + using empty_lepollI by auto + +lemma uncountable_imp_Infinite: "uncountable(X) \ Infinite(X)" + using uncountable_iff_nat_lt_cardinal[of X] lepoll_nat_imp_Infinite[of X] + cardinal_le_imp_lepoll[of \ X] leI + by simp + +lemma uncountable_not_subset_countable: + assumes "countable(X)" "uncountable(Y)" + shows "\ (Y \ X)" + using assms lepoll_trans subset_imp_lepoll[of Y X] + by blast + + +subsection\Results on Alephs\ + +lemma nat_lt_Aleph1: "\ < \\<^bsub>1\<^esub>" + by (simp add: Aleph_def lt_csucc) + +lemma zero_lt_Aleph1: "0 < \\<^bsub>1\<^esub>" + by (rule lt_trans[of _ "\"], auto simp add: ltI nat_lt_Aleph1) + +lemma le_aleph1_nat: "Card(k) \ k<\\<^bsub>1\<^esub> \ k \ \" + by (simp add: Aleph_def Card_lt_csucc_iff Card_nat) + +lemma Aleph_succ: "\\<^bsub>succ(\)\<^esub> = \\<^bsub>\\<^esub>\<^sup>+" + unfolding Aleph_def by simp + +lemma lesspoll_aleph_plus_one: + assumes "Ord(\)" + shows "d \ \\<^bsub>succ(\)\<^esub> \ d \ \\<^bsub>\\<^esub>" + using assms lesspoll_csucc Aleph_succ Card_is_Ord by simp + +lemma cardinal_Aleph [simp]: "Ord(\) \ |\\<^bsub>\\<^esub>| = \\<^bsub>\\<^esub>" + using Card_cardinal_eq by simp + +\ \Could be proved without using AC\ +lemma Aleph_lesspoll_increasing: + includes Aleph_intros + shows "a < b \ \\<^bsub>a\<^esub> \ \\<^bsub>b\<^esub>" + using cardinal_lt_iff_lesspoll[of "\\<^bsub>a\<^esub>" "\\<^bsub>b\<^esub>"] Card_cardinal_eq[of "\\<^bsub>b\<^esub>"] + lt_Ord lt_Ord2 Card_Aleph[THEN Card_is_Ord] by auto + +lemma uncountable_iff_subset_eqpoll_Aleph1: + includes Ord_dests + notes Aleph_zero_eq_nat[simp] Card_nat[simp] Aleph_succ[simp] + shows "uncountable(X) \ (\S. S \ X \ S \ \\<^bsub>1\<^esub>)" +proof + assume "uncountable(X)" + then + have "\\<^bsub>1\<^esub> \ X" + using uncountable_iff_nat_lt_cardinal cardinal_lt_csucc_iff' + cardinal_le_imp_lepoll by force + then + obtain S where "S \ X" "S \ \\<^bsub>1\<^esub>" + using lepoll_imp_subset_bij by auto + then + show "\S. S \ X \ S \ \\<^bsub>1\<^esub>" + using cardinal_cong Card_csucc[of \] Card_cardinal_eq by auto +next + assume "\S. S \ X \ S \ \\<^bsub>1\<^esub>" + then + have "\\<^bsub>1\<^esub> \ X" + using subset_imp_lepoll[THEN [2] eq_lepoll_trans, of "\\<^bsub>1\<^esub>" _ X, + OF eqpoll_sym] by auto + then + show "uncountable(X)" + using Aleph_lesspoll_increasing[of 0 1, THEN [2] lesspoll_trans1, + of "\\<^bsub>1\<^esub>"] lepoll_trans[of "\\<^bsub>1\<^esub>" X \] + by auto +qed + +lemma lt_Aleph_imp_cardinal_UN_le_nat: "function(G) \ domain(G) \ \ \ + \n\domain(G). |G`n|<\\<^bsub>1\<^esub> \ |\n\domain(G). G`n|\\" +proof - + assume "function(G)" + let ?N="domain(G)" and ?R="\n\domain(G). G`n" + assume "?N \ \" + assume Eq1: "\n\?N. |G`n|<\\<^bsub>1\<^esub>" + { + fix n + assume "n\?N" + with Eq1 have "|G`n| \ \" + using le_aleph1_nat by simp + } + then + have "n\?N \ |G`n| \ \" for n . + with \?N \ \\ + show ?thesis + using InfCard_nat leqpoll_imp_cardinal_UN_le by simp +qed + +lemma Aleph1_eq_cardinal_vimage: "f:\\<^bsub>1\<^esub>\\ \ \n\\. |f-``{n}| = \\<^bsub>1\<^esub>" +proof - + assume "f:\\<^bsub>1\<^esub>\\" + then + have "function(f)" "domain(f) = \\<^bsub>1\<^esub>" "range(f)\\" + by (simp_all add: domain_of_fun fun_is_function range_fun_subset_codomain) + let ?G="\n\range(f). f-``{n}" + from \f:\\<^bsub>1\<^esub>\\\ + have "range(f) \ \" by (simp add: range_fun_subset_codomain) + then + have "domain(?G) \ \" + using subset_imp_lepoll by simp + have "function(?G)" by (simp add:function_lam) + from \f:\\<^bsub>1\<^esub>\\\ + have "n\\ \ f-``{n} \ \\<^bsub>1\<^esub>" for n + using Pi_vimage_subset by simp + with \range(f) \ \\ + have "\\<^bsub>1\<^esub> = (\n\range(f). f-``{n})" + proof (intro equalityI, intro subsetI) + fix x + assume "x \ \\<^bsub>1\<^esub>" + with \f:\\<^bsub>1\<^esub>\\\ \function(f)\ \domain(f) = \\<^bsub>1\<^esub>\ + have "x \ f-``{f`x}" "f`x \ range(f)" + using function_apply_Pair vimage_iff apply_rangeI by simp_all + then + show "x \ (\n\range(f). f-``{n})" by auto + qed auto + { + assume "\n\range(f). |f-``{n}| < \\<^bsub>1\<^esub>" + then + have "\n\domain(?G). |?G`n| < \\<^bsub>1\<^esub>" + using zero_lt_Aleph1 by (auto) + with \function(?G)\ \domain(?G) \ \\ + have "|\n\domain(?G). ?G`n|\\" + using lt_Aleph_imp_cardinal_UN_le_nat by blast + then + have "|\n\range(f). f-``{n}|\\" by simp + with \\\<^bsub>1\<^esub> = _\ + have "|\\<^bsub>1\<^esub>| \ \" by simp + then + have "\\<^bsub>1\<^esub> \ \" + using Card_Aleph Card_cardinal_eq + by simp + then + have "False" + using nat_lt_Aleph1 by (blast dest:lt_trans2) + } + with \range(f)\\\ + obtain n where "n\\" "\(|f -`` {n}| < \\<^bsub>1\<^esub>)" + by blast + moreover from this + have "\\<^bsub>1\<^esub> \ |f-``{n}|" + using not_lt_iff_le Card_is_Ord by auto + moreover + note \n\\ \ f-``{n} \ \\<^bsub>1\<^esub>\ + ultimately + show ?thesis + using subset_imp_le_cardinal[THEN le_anti_sym, of _ "\\<^bsub>1\<^esub>"] + Card_Aleph Card_cardinal_eq by auto +qed + +\ \There is some asymmetry between assumptions and conclusion + (\<^term>\(\)\ versus \<^term>\cardinal\)\ +lemma eqpoll_Aleph1_cardinal_vimage: + assumes "X \ \\<^bsub>1\<^esub>" "f : X \ \" + shows "\n\\. |f-``{n}| = \\<^bsub>1\<^esub>" +proof - + from assms + obtain g where "g\bij(\\<^bsub>1\<^esub>,X)" + using eqpoll_sym by blast + with \f : X \ \\ + have "f O g : \\<^bsub>1\<^esub> \ \" "converse(g) \ bij(X, \\<^bsub>1\<^esub>)" + using bij_is_fun comp_fun bij_converse_bij by blast+ + then + obtain n where "n\\" "|(f O g)-``{n}| = \\<^bsub>1\<^esub>" + using Aleph1_eq_cardinal_vimage by auto + then + have "\\<^bsub>1\<^esub> = |converse(g) `` (f -``{n})|" + using image_comp converse_comp + unfolding vimage_def by simp + also from \converse(g) \ bij(X, \\<^bsub>1\<^esub>)\ \f: X\ \\ + have "\ = |f -``{n}|" + using range_of_subset_eqpoll[of "converse(g)" X _ "f -``{n}"] + bij_is_inj cardinal_cong bij_is_fun eqpoll_sym Pi_vimage_subset + by fastforce + finally + show ?thesis using \n\\\ by auto +qed + + +subsection\Applications of transfinite recursive constructions\ + +definition + rec_constr :: "[i,i] \ i" where + "rec_constr(f,\) \ transrec(\,\a g. f`(g``a))" + +text\The function \<^term>\rec_constr\ allows to perform \<^emph>\recursive + constructions\: given a choice function on the powerset of some + set, a transfinite sequence is created by successively choosing + some new element. + + The next result explains its use.\ + +lemma rec_constr_unfold: "rec_constr(f,\) = f`({rec_constr(f,\). \\\})" + using def_transrec[OF rec_constr_def, of f \] image_lam by simp + +lemma rec_constr_type: assumes "f:Pow(G)\ G" "Ord(\)" + shows "rec_constr(f,\) \ G" + using assms(2,1) + by (induct rule:trans_induct) + (subst rec_constr_unfold, rule apply_type[of f "Pow(G)" "\_. G"], auto) + +text\The next lemma is an application of recursive constructions. + It works under the assumption that whenever the already constructed + subsequence is small enough, another element can be added.\ + +lemma bounded_cardinal_selection: + includes Ord_dests + assumes + "\X. |X| < \ \ X \ G \ \a\G. \s\X. Q(s,a)" "b\G" "Card(\)" + shows + "\S. S : \ \ G \ (\\ \ \. \\ \ \. \<\ \ Q(S`\,S`\))" +proof - + let ?cdlt\="{X\Pow(G) . |X|<\}" \ \“cardinal less than \<^term>\\\”\ + and ?inQ="\Y.{a\G. \s\Y. Q(s,a)}" + from assms + have "\Y \ ?cdlt\. \a. a \ ?inQ(Y)" + by blast + then + have "\f. f \ Pi(?cdlt\,?inQ)" + using AC_ball_Pi[of ?cdlt\ ?inQ] by simp + then + obtain f where f_type:"f \ Pi(?cdlt\,?inQ)" + by auto + moreover + define Cb where "Cb \ \_\Pow(G)-?cdlt\. b" + moreover from \b\G\ + have "Cb \ Pow(G)-?cdlt\ \ G" + unfolding Cb_def by simp + moreover + note \Card(\)\ + ultimately + have "f \ Cb : (\x\Pow(G). ?inQ(x) \ G)" using + fun_Pi_disjoint_Un[ of f ?cdlt\ ?inQ Cb "Pow(G)-?cdlt\" "\_.G"] + Diff_partition[of "{X\Pow(G). |X|<\}" "Pow(G)", OF Collect_subset] + by auto + moreover + have "?inQ(x) \ G = G" for x by auto + ultimately + have "f \ Cb : Pow(G) \ G" by simp + define S where "S\\\\\. rec_constr(f \ Cb, \)" + from \f \ Cb: Pow(G) \ G\ \Card(\)\ + have "S : \ \ G" + using Ord_in_Ord unfolding S_def + by (intro lam_type rec_constr_type) auto + moreover + have "\\\\. \\\\. \ < \ \ Q(S ` \, S ` \)" + proof (intro ballI impI) + fix \ \ + assume "\\\" + with \Card(\)\ + have "{rec_constr(f \ Cb, x) . x\\} = {S`x . x \ \}" + using Ord_trans[OF _ _ Card_is_Ord, of _ \ \] + unfolding S_def + by auto + moreover from \\\\\ \S : \ \ G\ \Card(\)\ + have "{S`x . x \ \} \ G" + using Ord_trans[OF _ _ Card_is_Ord, of _ \ \] + apply_type[of S \ "\_. G"] by auto + moreover from \Card(\)\ \\\\\ + have "|{S`x . x \ \}| < \" + using cardinal_RepFun_le[of \] Ord_in_Ord + lt_trans1[of "|{S`x . x \ \}|" "|\|" \] + Card_lt_iff[THEN iffD2, of \ \, OF _ _ ltI] + by force + moreover + have "\x\\. Q(S`x, f ` {S`x . x \ \})" + proof - + from calculation and f_type + have "f ` {S`x . x \ \} \ {a\G. \x\\. Q(S`x,a)}" + using apply_type[of f ?cdlt\ ?inQ "{S`x . x \ \}"] + by blast + then + show ?thesis by simp + qed + moreover + assume "\\\" "\ < \" + moreover + note \\\\\ \Cb \ Pow(G)-?cdlt\ \ G\ + ultimately + show "Q(S ` \, S ` \)" + using fun_disjoint_apply1[of "{S`x . x \ \}" Cb f] + domain_of_fun[of Cb] ltD[of \ \] + by (subst (2) S_def, auto) (subst rec_constr_unfold, auto) + qed + ultimately + show ?thesis by blast +qed + +text\The following basic result can, in turn, be proved by a + bounded-cardinal selection.\ +lemma Infinite_iff_lepoll_nat: "Infinite(X) \ \ \ X" +proof + assume "Infinite(X)" + then + obtain b where "b\X" + using Infinite_not_empty by auto + { + fix Y + assume "|Y| < \" + then + have "Finite(Y)" + using Finite_cardinal_iff' ltD nat_into_Finite by blast + with \Infinite(X)\ + have "X \ Y" by auto + } + with \b\X\ + obtain S where "S : \ \ X" "\\\\. \\\\. \ < \ \ S`\ \ S`\" + using bounded_cardinal_selection[of \ X "\x y. x\y"] + Card_nat by blast + moreover from this + have "\ \ \ \ \ \ \ \ \\\ \ S`\ \ S`\" for \ \ + by (rule_tac lt_neq_symmetry[of "\" "\\ \. S`\ \ S`\"]) + auto + ultimately + show "\ \ X" + unfolding lepoll_def inj_def by blast +qed (intro lepoll_nat_imp_Infinite) + +lemma Infinite_InfCard_cardinal: "Infinite(X) \ InfCard(|X|)" + using lepoll_eq_trans eqpoll_sym lepoll_nat_imp_Infinite + Infinite_iff_lepoll_nat Inf_Card_is_InfCard cardinal_eqpoll + by simp + +lemma Finite_to_one_surj_imp_cardinal_eq: + assumes "F \ Finite_to_one(X,Y) \ surj(X,Y)" "Infinite(X)" + shows "|Y| = |X|" +proof - + from \F \ Finite_to_one(X,Y) \ surj(X,Y)\ + have "X = (\y\Y. {x\X . F`x = y})" + using apply_type by fastforce + show ?thesis + proof (cases "Finite(Y)") + case True + with \X = (\y\Y. {x\X . F`x = y})\ and assms + show ?thesis + using Finite_RepFun[THEN [2] Finite_Union, of Y "\y. {x\X . F`x = y}"] + by auto + next + case False + moreover from this + have "Y \ |Y|" + using cardinal_eqpoll eqpoll_sym eqpoll_imp_lepoll by simp + moreover + note assms + moreover from calculation + have "y \ Y \ |{x\X . F`x = y}| \ |Y|" for y + using Infinite_imp_nats_lepoll[THEN lepoll_imp_Card_le, of Y + "|{x\X . F`x = y}|"] cardinal_idem by auto + ultimately + have "|\y\Y. {x\X . F`x = y}| \ |Y|" + using leqpoll_imp_cardinal_UN_le[of "|Y|" Y] + Infinite_InfCard_cardinal[of Y] by simp + moreover from \F \ Finite_to_one(X,Y) \ surj(X,Y)\ + have "|Y| \ |X|" + using surj_implies_cardinal_le by auto + moreover + note \X = (\y\Y. {x\X . F`x = y})\ + ultimately + show ?thesis + using le_anti_sym by auto + qed +qed + +lemma cardinal_map_Un: + assumes "Infinite(X)" "Finite(b)" + shows "|{a \ b . a \ X}| = |X|" +proof - + have "(\a\X. a \ b) \ Finite_to_one(X,{a \ b . a \ X})" + "(\a\X. a \ b) \ surj(X,{a \ b . a \ X})" + unfolding surj_def + proof + fix d + have "Finite({a \ X . a \ b = d})" (is "Finite(?Y(b,d))") + using \Finite(b)\ + proof (induct arbitrary:d) + case 0 + have "{a \ X . a \ 0 = d} = (if d\X then {d} else 0)" + by auto + then + show ?case by simp + next + case (cons c b) + from \c \ b\ + have "?Y(cons(c,b),d) \ (if c\d then ?Y(b,d) \ ?Y(b,d-{c}) else 0)" + by auto + with cons + show ?case + using subset_Finite + by simp + qed + moreover + assume "d \ {x \ b . x \ X}" + ultimately + show "Finite({a \ X . (\x\X. x \ b) ` a = d})" + by simp + qed (auto intro:lam_funtype) + with assms + show ?thesis + using Finite_to_one_surj_imp_cardinal_eq by fast +qed + +end \ No newline at end of file diff --git a/thys/Delta_System_Lemma/Cofinality.thy b/thys/Delta_System_Lemma/Cofinality.thy new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/Cofinality.thy @@ -0,0 +1,1205 @@ +section\Cofinality\label{sec:cofinality}\ + +theory Cofinality + imports + ZF_Library +begin + + +subsection\Basic results and definitions\ + +text\A set \<^term>\X\ is \<^emph>\cofinal\ in \<^term>\A\ (with respect to the relation + \<^term>\r\) if every element of \<^term>\A\ is “bounded + above” by some element of \<^term>\X\. Note that \<^term>\X\ does not need + to be a subset of \<^term>\A\.\ +definition + cofinal :: "[i,i,i] \ o" where + "cofinal(X,A,r) \ \a\A. \x\X. \a,x\\r \ a = x" + +(* +(* Alternative definitions *) +definition + cofinal_predic :: "[i,i,[i,i]\o] \ o" where + "cofinal_predic(X,A,r) \ \a\A. \x\X. r(a,x) \ a = x" + +definition + f_cofinal :: "[i\i,i,i,i] \ o" where + "f_cofinal(f,C,A,r) \ \a\A. \x\C. \a,f(x)\\r \ a = f(x)" + +(* The next definition doesn't work if 0 is the top element of A. + But it works for limit ordinals. *) +definition + cofinal_fun' :: "[i,i,i] \ o" where + "cofinal_fun'(f,A,r) == f_cofinal(\x. f`x,domain(f),A, r)" +*) + +text\A function is cofinal if it range is.\ +definition + cofinal_fun :: "[i,i,i] \ o" where + "cofinal_fun(f,A,r) \ \a\A. \x\domain(f). \a,f`x\\r \ a = f`x" + +lemma cofinal_funI: + assumes "\a. a\A \ \x\domain(f). \a,f`x\\r \ a = f`x" + shows "cofinal_fun(f,A,r)" + using assms unfolding cofinal_fun_def by simp + +lemma cofinal_funD: + assumes "cofinal_fun(f,A,r)" "a\A" + shows "\x\domain(f). \a,f`x\\r \ a = f`x" + using assms unfolding cofinal_fun_def by simp + +lemma cofinal_in_cofinal: + assumes + "trans(r)" "cofinal(Y,X,r)" "cofinal(X,A,r)" + shows + "cofinal(Y,A,r)" + unfolding cofinal_def +proof + fix a + assume "a\A" + moreover from \cofinal(X,A,r)\ + have "b\A\\x\X. \b,x\\r \ b=x" for b + unfolding cofinal_def by simp + ultimately + obtain y where "y\X" "\a,y\\r \ a=y" by auto + moreover from \cofinal(Y,X,r)\ + have "c\X\\y\Y. \c,y\\r \ c=y" for c + unfolding cofinal_def by simp + ultimately + obtain x where "x\Y" "\y,x\\r \ y=x" by auto + with \a\A\ \y\X\ \\a,y\\r \ a=y\ \trans(r)\ + show "\x\Y. \a,x\\r \ a=x" unfolding trans_def by auto +qed + +lemma codomain_is_cofinal: + assumes "cofinal_fun(f,A,r)" "f:C \ D" + shows "cofinal(D,A,r)" + unfolding cofinal_def +proof + fix b + assume "b \ A" + moreover from assms + have "a\A \ \x\domain(f). \a, f ` x\ \ r \ a = f`x" for a + unfolding cofinal_fun_def by simp + ultimately + obtain x where "x\domain(f)" "\b, f ` x\ \ r \ b = f`x" + by blast + moreover from \f:C \ D\ \x\domain(f)\ + have "f`x\D" + using domain_of_fun apply_rangeI by simp + ultimately + show "\y\D. \b, y\ \ r \ b = y" by auto +qed + +lemma cofinal_range_iff_cofinal_fun: + assumes "function(f)" + shows "cofinal(range(f),A,r) \ cofinal_fun(f,A,r)" + unfolding cofinal_fun_def +proof (intro iffI ballI) + fix a + assume "a\A" \cofinal(range(f),A,r)\ + then + obtain y where "y\range(f)" "\a,y\ \ r \ a = y" + unfolding cofinal_def by blast + moreover from this + obtain x where "\x,y\\f" + unfolding range_def domain_def converse_def by blast + moreover + note \function(f)\ + ultimately + have "\a, f ` x\ \ r \ a = f ` x" + using function_apply_equality by blast + with \\x,y\\f\ + show "\x\domain(f). \a, f ` x\ \ r \ a = f ` x" by blast +next + assume "\a\A. \x\domain(f). \a, f ` x\ \ r \ a = f ` x" + with assms + show "cofinal(range(f), A, r)" + using function_apply_Pair[of f] unfolding cofinal_def by fast +qed + +lemma cofinal_comp: + assumes + "f\ mono_map(C,s,D,r)" "cofinal_fun(f,D,r)" "h:B \ C" "cofinal_fun(h,C,s)" + "trans(r)" + shows "cofinal_fun(f O h,D,r)" + unfolding cofinal_fun_def +proof + fix a + from \f\ mono_map(C,s,D,r)\ + have "f:C \ D" + using mono_map_is_fun by simp + with \h:B \ C\ + have "domain(f) = C" "domain(h) = B" + using domain_of_fun by simp_all + moreover + assume "a \ D" + moreover + note \cofinal_fun(f,D,r)\ + ultimately + obtain c where "c\C" "\a, f ` c\ \ r \ a = f ` c" + unfolding cofinal_fun_def by blast + with \cofinal_fun(h,C,s)\ \domain(h) = B\ + obtain b where "b \ B" "\c, h ` b\ \ s \ c = h ` b" + unfolding cofinal_fun_def by blast + moreover from this and \h:B \ C\ + have "h`b \ C" by simp + moreover + note \f \ mono_map(C,s,D,r)\ \c\C\ + ultimately + have "\f`c, f` (h ` b)\ \ r \ f`c = f` (h ` b)" + unfolding mono_map_def by blast + with \\a, f ` c\ \ r \ a = f ` c\ \trans(r)\ \h:B \ C\ \b\B\ + have "\a, (f O h) ` b\ \ r \ a = (f O h) ` b" + using transD by auto + moreover from \h:B \ C\ \domain(f) = C\ \domain(h) = B\ + have "domain(f O h) = B" + using range_fun_subset_codomain by blast + moreover + note \b\B\ + ultimately + show "\x\domain(f O h). \a, (f O h) ` x\ \ r \ a = (f O h) ` x" by blast +qed + +definition + cf_fun :: "[i,i] \ o" where + "cf_fun(f,\) \ cofinal_fun(f,\,Memrel(\))" + +lemma cf_funI[intro!]: "cofinal_fun(f,\,Memrel(\)) \ cf_fun(f,\)" + unfolding cf_fun_def by simp + +lemma cf_funD[dest!]: "cf_fun(f,\) \ cofinal_fun(f,\,Memrel(\))" + unfolding cf_fun_def by simp + +lemma cf_fun_comp: + assumes + "Ord(\)" "f\ mono_map(C,s,\,Memrel(\))" "cf_fun(f,\)" + "h:B \ C" "cofinal_fun(h,C,s)" + shows "cf_fun(f O h,\)" + using assms cofinal_comp[OF _ _ _ _ trans_Memrel] by auto + +definition + cf :: "i\i" where + "cf(\) \ \ \. \A. A\\ \ cofinal(A,\,Memrel(\)) \ \ = ordertype(A,Memrel(\))" + +lemma Ord_cf [TC]: "Ord(cf(\))" + unfolding cf_def using Ord_Least by simp + +lemma gamma_cofinal_gamma: + assumes "Ord(\)" + shows "cofinal(\,\,Memrel(\))" + unfolding cofinal_def by auto + +lemma cf_is_ordertype: + assumes "Ord(\)" + shows "\A. A\\ \ cofinal(A,\,Memrel(\)) \ cf(\) = ordertype(A,Memrel(\))" + (is "?P(cf(\))") + using gamma_cofinal_gamma LeastI[of ?P \] ordertype_Memrel[symmetric] assms + unfolding cf_def by blast + +lemma cf_fun_succ': + assumes "Ord(\)" "Ord(\)" "f:\\succ(\)" + shows "(\x\\. f`x=\) \ cf_fun(f,succ(\))" +proof (intro iffI) + assume "(\x\\. f`x=\)" + with assms + show "cf_fun(f,succ(\))" + using domain_of_fun[OF \f:\\succ(\)\] + unfolding cf_fun_def cofinal_fun_def by auto +next + assume "cf_fun(f,succ(\))" + with assms + obtain x where "x\\" "\\,f`x\ \ Memrel(succ(\)) \ \ = f ` x" + using domain_of_fun[OF \f:\\succ(\)\] + unfolding cf_fun_def cofinal_fun_def by auto + moreover from \Ord(\)\ + have "\\,y\ \ Memrel(succ(\))" for y + using foundation unfolding Memrel_def by blast + ultimately + show "\x\\. f ` x = \" by blast +qed + +lemma cf_fun_succ: + "Ord(\) \ f:1\succ(\) \ f`0=\ \ cf_fun(f,succ(\))" + using cf_fun_succ' by blast + +lemma ordertype_0_not_cofinal_succ: + assumes "ordertype(A,Memrel(succ(i))) = 0" "A\succ(i)" "Ord(i)" + shows "\cofinal(A,succ(i),Memrel(succ(i)))" +proof + have 1:"ordertype(A,Memrel(succ(i))) = ordertype(0,Memrel(0))" + using \ordertype(A,Memrel(succ(i))) = 0\ ordertype_0 by simp + from \A\succ(i)\ \Ord(i)\ + have "\f. f \ \A, Memrel(succ(i))\ \ \0, Memrel(0)\" + using well_ord_Memrel well_ord_subset + ordertype_eq_imp_ord_iso[OF 1] Ord_0 by blast + then + have "A=0" + using ord_iso_is_bij bij_imp_eqpoll eqpoll_0_is_0 by blast + moreover + assume "cofinal(A, succ(i), Memrel(succ(i)))" + moreover + note \Ord(i)\ + ultimately + show "False" + using not_mem_empty unfolding cofinal_def by auto +qed + +text\I thank Edwin Pacheco Rodríguez for the following lemma.\ +lemma cf_succ: + assumes "Ord(\)" + shows "cf(succ(\)) = 1" +proof - + define f where "f \ {\0,\\}" + then + have "f : 1\succ(\)" "f`0 = \" + using fun_extend3[of 0 0 "succ(\)" 0 \] singleton_0 by auto + with assms + have "cf_fun(f,succ(\))" + using cf_fun_succ unfolding cofinal_fun_def by simp + from \f:1\succ(\)\ + have "0\domain(f)" using domain_of_fun by simp + define A where "A={f`0}" + with \cf_fun(f,succ(\))\ \0\domain(f)\ \f`0=\\ + have "cofinal(A,succ(\),Memrel(succ(\)))" + unfolding cofinal_def cofinal_fun_def by simp + moreover from \f`0=\\ \A={f`0}\ + have "A \ succ(\)" unfolding succ_def by auto + moreover from \Ord(\)\ \A\ succ(\)\ + have "well_ord(A,Memrel(succ(\)))" + using Ord_succ well_ord_Memrel well_ord_subset relation_Memrel by blast + moreover from \Ord(\)\ + have "\(\A. A \ succ(\) \ cofinal(A, succ(\), Memrel(succ(\))) \ 0 = ordertype(A, Memrel(succ(\))))" + (is "\?P(0)") + using ordertype_0_not_cofinal_succ unfolding cf_def by auto + moreover + have "1 = ordertype(A,Memrel(succ(\)))" + proof - + from \A={f`0}\ + have "A\1" using singleton_eqpoll_1 by simp + with \well_ord(A,Memrel(succ(\)))\ + show ?thesis using nat_1I ordertype_eq_n by simp + qed + ultimately + show "cf(succ(\)) = 1" using Ord_1 Least_equality[of ?P 1] + unfolding cf_def by blast +qed + +lemma cf_zero [simp]: + "cf(0) = 0" + unfolding cf_def cofinal_def using + ordertype_0 subset_empty_iff Least_le[of _ 0] by auto + +lemma surj_is_cofinal: "f \ surj(\,\) \ cf_fun(f,\)" + unfolding surj_def cofinal_fun_def cf_fun_def + using domain_of_fun by force + +lemma cf_zero_iff: "Ord(\) \ cf(\) = 0 \ \ = 0" +proof (intro iffI) + assume "\ = 0" "Ord(\)" + then + show "cf(\) = 0" using cf_zero by simp +next + assume "cf(\) = 0" "Ord(\)" + moreover from this + obtain A where "A\\" "cf(\) = ordertype(A,Memrel(\))" + "cofinal(A,\,Memrel(\))" + using cf_is_ordertype by blast + ultimately + have "cofinal(0,\,Memrel(\))" + using ordertype_zero_imp_zero[of A "Memrel(\)"] by simp + then + show "\=0" + unfolding cofinal_def by blast +qed + +\ \TODO: define Succ (predicate for successor ordinals)\ +lemma cf_eq_one_iff: + assumes "Ord(\)" + shows "cf(\) = 1 \ (\\. Ord(\) \ \ = succ(\))" +proof (intro iffI) + assume "\\. Ord(\) \ \ = succ(\)" + then + show "cf(\) = 1" using cf_succ by auto +next + assume "cf(\) = 1" + moreover from assms + obtain A where "A \ \" "cf(\) = ordertype(A,Memrel(\))" + "cofinal(A,\,Memrel(\))" + using cf_is_ordertype by blast + ultimately + have "ordertype(A,Memrel(\)) = 1" by simp + moreover + define f where "f\converse(ordermap(A,Memrel(\)))" + moreover from this \ordertype(A,Memrel(\)) = 1\ \A \ \\ assms + have "f \ surj(1,A)" + using well_ord_subset[OF well_ord_Memrel, THEN ordermap_bij, + THEN bij_converse_bij, of \ A] bij_is_surj + by simp + with \cofinal(A,\,Memrel(\))\ + have "\a\\. \a, f`0\ \ Memrel(\) \ a = f`0" + unfolding cofinal_def surj_def + by auto + with assms \A \ \\ \f \ surj(1,A)\ + show "\\. Ord(\) \ \ = succ(\)" + using Ord_has_max_imp_succ[of \ "f`0"] + surj_is_fun[of f 1 A] apply_type[of f 1 "\_.A" 0] + unfolding lt_def + by (auto intro:Ord_in_Ord) +qed + +lemma ordertype_in_cf_imp_not_cofinal: + assumes + "ordertype(A,Memrel(\)) \ cf(\)" + "A \ \" + shows + "\ cofinal(A,\,Memrel(\))" +proof + note \A \ \\ + moreover + assume "cofinal(A,\,Memrel(\))" + ultimately + have "\B. B \ \ \ cofinal(B, \, Memrel(\)) \ ordertype(A,Memrel(\)) = ordertype(B, Memrel(\))" + (is "?P(ordertype(A,_))") + by blast + moreover from assms + have "ordertype(A,Memrel(\)) < cf(\)" + using Ord_cf ltI by blast + ultimately + show "False" + unfolding cf_def using less_LeastE[of ?P "ordertype(A,Memrel(\))"] + by auto +qed + +lemma cofinal_mono_map_cf: + assumes "Ord(\)" + shows "\j \ mono_map(cf(\), Memrel(cf(\)), \, Memrel(\)) . cf_fun(j,\)" +proof - + note assms + moreover from this + obtain A where "A \ \" "cf(\) = ordertype(A,Memrel(\))" + "cofinal(A,\,Memrel(\))" + using cf_is_ordertype by blast + moreover + define j where "j \ converse(ordermap(A,Memrel(\)))" + moreover from calculation + have "j :cf(\) \\<^sub>< \" + using ordertype_ord_iso[THEN ord_iso_sym, + THEN ord_iso_is_mono_map, THEN mono_map_mono, + of A "Memrel(\)" \] well_ord_Memrel[THEN well_ord_subset] + by simp + moreover from calculation + have "j \ surj(cf(\),A)" + using well_ord_Memrel[THEN well_ord_subset, THEN ordertype_ord_iso, + THEN ord_iso_sym, of \ A, THEN ord_iso_is_bij, + THEN bij_is_surj] + by simp + with \cofinal(A,\,Memrel(\))\ + have "cf_fun(j,\)" + using cofinal_range_iff_cofinal_fun[of j \ "Memrel(\)"] + surj_range[of j "cf(\)" A] surj_is_fun fun_is_function + by fastforce + with \j \ mono_map(_,_,_,_)\ + show ?thesis by auto +qed + + +subsection\The factorization lemma\ + +text\In this subsection we prove a factorization lemma for cofinal functions +into ordinals, which shows that any cofinal function between ordinals can be +“decomposed” in such a way that a commutative triangle of strictly increasing +maps arises. + +The factorization lemma has a kind of +fundamental character, in that the rest of the basic results on cofinality +(for, instance, idempotence) follow easily from it, in a more algebraic way. + +This is a consequence that the proof encapsulates uses of transfinite +recursion in the basic theory of cofinality; indeed, only one use is needed. +In the setting of Isabelle/ZF, this is convenient since the machinery of +recursion is pretty clumsy. On the downside, this way of presenting things +results in a longer proof of the factorization lemma. This approach was +taken by the author in the notes \cite{apunte_st} for an introductory course +in Set Theory. + +To organize the use of the hypotheses of the factorization lemma, +we set up a locale containing all the relevant ingredients. +\ +locale cofinal_factor = + fixes j \ \ \ f + assumes j_mono: "j :\ \\<^sub>< \" + and ords: "Ord(\)" "Ord(\)" "Limit(\)" + and f_type: "f: \ \ \" +begin + +text\Here, \<^term>\f\ is cofinal function from \<^term>\\\ to \<^term>\\\, and the +ordinal \<^term>\\\ is meant to be the cofinality of \<^term>\\\. Hence, there exists +an increasing map \<^term>\j\ from \<^term>\\\ to \<^term>\\\ by the last lemma. + +The main goal is to construct an increasing function \<^term>\g:\\\\ such that +the composition \<^term>\f O g\ is still cofinal but also increasing.\ + +definition + factor_body :: "[i,i,i] \ o" where + "factor_body(\,h,x) \ (x\\ \ j`\ \ f`x \ (\\<\ . f`(h`\) < f`x)) \ x=\" + +definition + factor_rec :: "[i,i] \ i" where + "factor_rec(\,h) \ \ x. factor_body(\,h,x)" + +txt\\<^term>\factor_rec\ is the inductive step for the definition by transfinite +recursion of the \<^emph>\factor\ function (called \<^term>\g\ above), which in +turn is obtained by minimizing the predicate \<^term>\factor_body\. Next we show +that this predicate is monotonous.\ + +lemma factor_body_mono: + assumes + "\\\" "\<\" + "factor_body(\,\x\\. G(x),x)" + shows + "factor_body(\,\x\\. G(x),x)" +proof - + from \\<\\ + have "\\\" using ltD by simp + moreover + note \\\\\ + moreover from calculation + have "\\\" using ords ltD Ord_cf Ord_trans by blast + ultimately + have "j`\ \ j`\" using j_mono mono_map_increasing by blast + moreover from \\\\\ + have "j`\\\" + using j_mono domain_of_fun apply_rangeI mono_map_is_fun by force + moreover from this + have "Ord(j`\)" + using Ord_in_Ord ords Limit_is_Ord by auto + ultimately + have "j`\ \ j`\" unfolding lt_def by blast + then + have "j`\ \ f`\ \ j`\ \ f`\" for \ using le_trans by blast + moreover + have "f`((\w\\. G(w))`y) < f`z" if "z\\" "\x<\. f`((\w\\. G(w))`x) < f`z" "y<\" for y z + proof - + note \y<\\ + also + note \\<\\ + finally + have "y<\" by simp + with \\x<\. f`((\w\\. G(w))`x) < f`z\ + have "f ` ((\w\\. G(w)) ` y) < f ` z" by simp + moreover from \y<\\ \y<\\ + have "(\w\\. G(w)) ` y = (\w\\. G(w)) ` y" + using beta_if by (auto dest:ltD) + ultimately show ?thesis by simp + qed + moreover + note \factor_body(\,\x\\. G(x),x)\ + ultimately + show ?thesis + unfolding factor_body_def by blast +qed + +lemma factor_body_simp[simp]: "factor_body(\,g,\)" + unfolding factor_body_def by simp + +lemma factor_rec_mono: + assumes + "\\\" "\<\" + shows + "factor_rec(\,\x\\. G(x)) \ factor_rec(\,\x\\. G(x))" + unfolding factor_rec_def + using assms ords factor_body_mono Least_antitone by simp + +text\We now define the factor as higher-order function. +Later it will be restricted to a set to obtain a bona fide function of +type @{typ i}.\ +definition + factor :: "i \ i" where + "factor(\) \ transrec(\,factor_rec)" + +lemma factor_unfold: + "factor(\) = factor_rec(\,\x\\. factor(x))" + using def_transrec[OF factor_def] . + +lemma factor_mono: + assumes "\\\" "\<\" "factor(\)\\" "factor(\)\\" + shows "factor(\) \ factor(\)" +proof - + have "factor(\) = factor_rec(\, \x\\. factor(x))" + using factor_unfold . + also from assms and factor_rec_mono + have "... \ factor_rec(\, \x\\. factor(x))" + by simp + also + have "factor_rec(\, \x\\. factor(x)) = factor(\)" + using def_transrec[OF factor_def, symmetric] . + finally show ?thesis . +qed + +text\The factor satisfies the predicate body of the minimization.\ + +lemma factor_body_factor: + "factor_body(\,\x\\. factor(x),factor(\))" + using ords factor_unfold[of \] + LeastI[of "factor_body(_,_)" \] + unfolding factor_rec_def by simp + +lemma factor_type [TC]: "Ord(factor(\))" + using ords factor_unfold[of \] + unfolding factor_rec_def by simp + +text\The value \<^term>\\\ in \<^term>\factor_body\ (and therefore, in +\<^term>\factor\) is meant to be a “default value”. Whenever it is not +attained, the factor function behaves as expected: It is increasing +and its composition with \<^term>\f\ also is.\ + +lemma f_factor_increasing: + assumes "\\\" "\<\" "factor(\)\\" + shows "f`factor(\) < f`factor(\)" +proof - + from assms + have "f ` ((\x\\. factor(x)) ` \) < f ` factor(\)" + using factor_unfold[of \] ords LeastI[of "factor_body(\,\x\\. factor(x))"] + unfolding factor_rec_def factor_body_def + by (auto simp del:beta_if) + with \\<\\ + show ?thesis using ltD by auto +qed + +lemma factor_increasing: + assumes "\\\" "\<\" "factor(\)\\" "factor(\)\\" + shows "factor(\))" + using assms f_factor_increasing factor_mono by (force intro:le_neq_imp_lt) + +lemma factor_in_delta: + assumes "factor(\) \ \" + shows "factor(\) \ \" + using assms factor_body_factor ords + unfolding factor_body_def by auto + +text\Finally, we define the (set) factor function as the restriction of +factor to the ordinal \<^term>\\\.\ + +definition + fun_factor :: "i" where + "fun_factor \ \\\\. factor(\)" + +lemma fun_factor_is_mono_map: + assumes "\\. \ \ \ \ factor(\) \ \" + shows "fun_factor \ mono_map(\, Memrel(\), \, Memrel(\))" + unfolding mono_map_def +proof (intro CollectI ballI impI) + (* Proof that \<^term>\fun_factor\ respects membership *) + fix \ \ + assume "\\\" "\\\" + moreover + note assms + moreover from calculation + have "factor(\)\\" "factor(\)\\" "Ord(\)" + using factor_in_delta Ord_in_Ord ords by auto + moreover + assume "\\, \\ \ Memrel(\)" + ultimately + show "\fun_factor ` \, fun_factor ` \\ \ Memrel(\)" + unfolding fun_factor_def + using ltI factor_increasing[THEN ltD] factor_in_delta + by simp +next + (* Proof of type *) + from assms + show "fun_factor : \ \ \" + unfolding fun_factor_def + using ltI lam_type factor_in_delta by simp +qed + +lemma f_fun_factor_is_mono_map: + assumes "\\. \ \ \ \ factor(\) \ \" + shows "f O fun_factor \ mono_map(\, Memrel(\), \, Memrel(\))" + unfolding mono_map_def + using f_type +proof (intro CollectI ballI impI comp_fun[of _ _ \]) + from assms + show "fun_factor : \ \ \" + using fun_factor_is_mono_map mono_map_is_fun by simp + (* Proof that f O ?g respects membership *) + fix \ \ + assume "\\, \\ \ Memrel(\)" + then + have "\<\" + using Ord_in_Ord[of "\"] ltI ords by blast + assume "\\\" "\\\" + moreover from this and assms + have "factor(\)\\" "factor(\)\\" by auto + moreover + have "Ord(\)" "\\0" using ords Limit_is_Ord by auto + moreover + note \\<\\ \fun_factor : \ \ \\ + ultimately + show "\(f O fun_factor) ` \, (f O fun_factor) ` \\ \ Memrel(\)" + using ltD[of "f ` factor(\)" "f ` factor(\)"] + f_factor_increasing apply_in_range f_type + unfolding fun_factor_def by auto +qed + +end (* cofinal_factor *) + +text\We state next the factorization lemma.\ + +lemma cofinal_fun_factorization: + notes le_imp_subset [dest] lt_trans2 [trans] + assumes + "Ord(\)" "Limit(\)" "f: \ \ \" "cf_fun(f,\)" + shows + "\g \ cf(\) \\<^sub>< \. f O g : cf(\) \\<^sub>< \ \ + cofinal_fun(f O g,\,Memrel(\))" +proof - + from \Limit(\)\ + have "Ord(\)" using Limit_is_Ord by simp + then + obtain j where "j :cf(\) \\<^sub>< \" "cf_fun(j,\)" + using cofinal_mono_map_cf by blast + then + have "domain(j) = cf(\)" + using domain_of_fun mono_map_is_fun by force + from \j \ _\ assms + interpret cofinal_factor j \ "cf(\)" + by (unfold_locales) (simp_all) + text\The core of the argument is to show that the factor function + indeed maps into \<^term>\\\, therefore its values satisfy the first + disjunct of \<^term>\factor_body\. This holds in turn because no + restriction of the factor composed with \<^term>\f\ to a proper initial + segment of \<^term>\cf(\)\ can be cofinal in \<^term>\\\ by definition of + cofinality. Hence there must be a witness that satisfies the first + disjunct.\ + have factor_not_delta: "factor(\)\\" if "\ \ cf(\)" for \ + text\For this, we induct on \<^term>\\\ ranging over \<^term>\cf(\)\.\ + proof (induct \ rule:Ord_induct[OF _ Ord_cf[of \]]) + case 1 with that show ?case . + next + case (2 \) + then + have IH: "z\\ \ factor(z)\\" for z by simp + define h where "h \ \x\\. f`factor(x)" + from IH + have "z\\ \ factor(z) \ \" for z + using factor_in_delta by blast + with \f:\\\\ + have "h : \ \ \" unfolding h_def using apply_funtype lam_type by auto + then + have "h : \ \\<^sub>< \" + unfolding mono_map_def + proof (intro CollectI ballI impI) + fix x y + assume "x\\" "y\\" + moreover from this and IH + have "factor(y) \ \" by simp + moreover from calculation and \h \ \ \ \\ + have "h`x \ \" "h`y \ \" by simp_all + moreover from \\\cf(\)\ and \y\\\ + have "y \ cf(\)" + using Ord_trans Ord_cf by blast + moreover from this + have "Ord(y)" + using Ord_cf Ord_in_Ord by blast + moreover + assume "\x,y\ \ Memrel(\)" + moreover from calculation + have "xh ` x, h ` y\ \ Memrel(\)" + unfolding h_def using f_factor_increasing ltD by (auto) + qed + with \\\cf(\)\ \Ord(\)\ + have "ordertype(h``\,Memrel(\)) = \" (* Maybe should use range(h) *) + using mono_map_ordertype_image[of \] Ord_cf Ord_in_Ord by blast + also + note \\ \cf(\)\ + finally + have "ordertype(h``\,Memrel(\)) \ cf(\)" by simp + moreover from \h \ \ \ \\ + have "h``\ \ \" + using mono_map_is_fun Image_sub_codomain by blast + ultimately + have "\ cofinal(h``\,\,Memrel(\))" + using ordertype_in_cf_imp_not_cofinal by simp + then + obtain \_0 where "\_0\\" "\x\h `` \. \ \\_0, x\ \ Memrel(\) \ \_0 \ x" + unfolding cofinal_def by auto + with \Ord(\)\ \h``\ \ \\ + have "\x\h `` \. x \ \_0" + using well_ord_Memrel[of \] well_ord_is_linear[of \ "Memrel(\)"] + unfolding linear_def by blast + from \\_0 \ \\ \j \ mono_map(_,_,\,_)\ \Ord(\)\ + have "j`\ \ \" + using mono_map_is_fun apply_in_range by force + with \\_0 \ \\ \Ord(\)\ + have "\_0 \ j`\ \ \" + using Un_least_mem_iff Ord_in_Ord by auto + with \cf_fun(f,\)\ + obtain \ where "\\domain(f)" "\\_0 \ j`\, f ` \\ \ Memrel(\) \ \_0 \ j`\ = f ` \" + by (auto simp add:cofinal_fun_def) blast + moreover from this and \f:\\\\ + have "\ \ \" using domain_of_fun by auto + moreover + note \Ord(\)\ + moreover from this and \f:\\\\ \\_0 \ \\ + have "Ord(f`\)" + using apply_in_range Ord_in_Ord by blast + moreover from calculation and \\_0 \ \\ and \Ord(\)\ and \j`\ \ \\ + have "Ord(\_0)" "Ord(j`\)" "Ord(\)" + using Ord_in_Ord by auto + moreover from \\x\h `` \. x \ \_0\ \Ord(\_0)\ \h:\\\\ + have "x\\ \ h`x < \_0" for x + using fun_is_function[of h \ "\_. \"] + Image_subset_Ord_imp_lt domain_of_fun[of h \ "\_. \"] + by blast + moreover + have "x\\ \ h`x < f`\" for x + proof - + fix x + assume "x\\" + with \\x\h `` \. x \ \_0\ \Ord(\_0)\ \h:\\\\ + have "h`x < \_0" + using fun_is_function[of h \ "\_. \"] + Image_subset_Ord_imp_lt domain_of_fun[of h \ "\_. \"] + by blast + also from \\\_0 \ _, f ` \\ \ Memrel(\) \ \_0 \ _= f ` \\ + \Ord(f`\)\ \Ord(\_0)\ \Ord(j`\)\ + have "\_0 \ f`\" + using Un_leD1[OF leI [OF ltI]] Un_leD1[OF le_eqI] by blast + finally + show "h`x < f`\" . + qed + ultimately + have "factor_body(\,\x\\. factor(x),\)" + unfolding h_def factor_body_def using ltD + by (auto dest:Un_memD2 Un_leD2[OF le_eqI]) + with \Ord(\)\ + have "factor(\) \ \" + using factor_unfold[of \] Least_le unfolding factor_rec_def by auto + with \\\\\ \Ord(\)\ + have "factor(\) \ \" + using leI[of \] ltI[of \] by (auto dest:ltD) + then + show ?case by (auto elim:mem_irrefl) + qed + moreover + have "cofinal_fun(f O fun_factor, \, Memrel(\))" + proof (intro cofinal_funI) + fix a + assume "a \ \" + with \cf_fun(j,\)\ \domain(j) = cf(\)\ + obtain x where "x\cf(\)" "a \ j`x \ a = j`x" + by (auto simp add:cofinal_fun_def) blast + with factor_not_delta + have "x \ domain(f O fun_factor)" + using f_fun_factor_is_mono_map mono_map_is_fun domain_of_fun by force + moreover + have "a \ (f O fun_factor) `x \ a = (f O fun_factor) `x" + proof - + from \x\cf(\)\ factor_not_delta + have "j ` x \ f ` factor(x)" + using mem_not_refl factor_body_factor factor_in_delta + unfolding factor_body_def by auto + with \a \ j`x \ a = j`x\ + have "a \ f ` factor(x) \ a = f ` factor(x)" + using ltD by blast + with \x\cf(\)\ + show ?thesis using lam_funtype[of "cf(\)" factor] + unfolding fun_factor_def by auto + qed + moreover + note \a \ \\ + moreover from calculation and \Ord(\)\ and factor_not_delta + have "(f O fun_factor) `x \ \" + using Limit_nonzero apply_in_range mono_map_is_fun[of "f O fun_factor"] + f_fun_factor_is_mono_map by blast + ultimately + show "\x \ domain(f O fun_factor). \a, (f O fun_factor) ` x\ \ Memrel(\) + \ a = (f O fun_factor) `x" + by blast + qed + ultimately + show ?thesis + using fun_factor_is_mono_map f_fun_factor_is_mono_map by blast +qed + +text\As a final observation in this part, we note that if the original +cofinal map was increasing, then the factor function is also cofinal.\ +lemma factor_is_cofinal: + assumes + "Ord(\)" "Ord(\)" + "f :\ \\<^sub>< \" "f O g \ mono_map(\,r,\,Memrel(\))" + "cofinal_fun(f O g,\,Memrel(\))" "g: \ \ \" + shows + "cf_fun(g,\)" + unfolding cf_fun_def cofinal_fun_def +proof + fix a + assume "a \ \" + with \f \ mono_map(\,_,\,_)\ + have "f`a \ \" + using mono_map_is_fun by force + with \cofinal_fun(f O g,\,_)\ + obtain y where "y\\" "\f`a, (f O g) ` y\ \ Memrel(\) \ f`a = (f O g) ` y" + unfolding cofinal_fun_def using domain_of_fun[OF \g:\ \ \\] by blast + with \g:\ \ \\ + have "\f`a, f ` (g ` y)\ \ Memrel(\) \ f`a = f ` (g ` y)" "g`y \ \" + using comp_fun_apply[of g \ \ y f] by auto + with assms(1-3) and \a\\\ + have "\a, g ` y\ \ Memrel(\) \ a = g ` y" + using Memrel_mono_map_reflects Memrel_mono_map_is_inj[of \ f \ \] + inj_apply_equality[of f \ \] by blast + with \y\\\ + show "\x\domain(g). \a, g ` x\ \ Memrel(\) \ a = g ` x" + using domain_of_fun[OF \g:\ \ \\] by blast +qed + + +subsection\Classical results on cofinalities\ + +text\Now the rest of the results follow in a more algebraic way. The +next proof one invokes a case analysis on whether the argument is zero, +a successor ordinal or a limit one; the last case being the most +relevant one and is immediate from the factorization lemma.\ + +lemma cf_le_domain_cofinal_fun: + assumes + "Ord(\)" "Ord(\)" "f:\ \ \" "cf_fun(f,\)" + shows + "cf(\)\\" + using assms +proof (cases rule:Ord_cases) + case 0 + with \Ord(\)\ + show ?thesis using Ord_0_le by simp +next + case (succ \) + with assms + obtain x where "x\\" "f`x=\" using cf_fun_succ' by blast + then + have "\\0" by blast + let ?f="{\0,f`x\}" + from \f`x=\\ + have "?f:1\succ(\)" + using singleton_0 singleton_fun[of 0 \] singleton_subsetI fun_weaken_type by simp + with \Ord(\)\ \f`x=\\ + have "cf(succ(\)) = 1" using cf_succ by simp + with \\\0\ succ + show ?thesis using Ord_0_lt_iff succ_leI \Ord(\)\ by simp +next + case (limit) + with assms + obtain g where "g :cf(\) \\<^sub>< \" + using cofinal_fun_factorization by blast + with assms + show ?thesis using mono_map_imp_le by simp +qed + +lemma cf_ordertype_cofinal: + assumes + "Limit(\)" "A\\" "cofinal(A,\,Memrel(\))" + shows + "cf(\) = cf(ordertype(A,Memrel(\)))" +proof (intro le_anti_sym) + from \Limit(\)\ + have "Ord(\)" + using Limit_is_Ord by simp + with \A \ \\ + have "well_ord(A,Memrel(\))" + using well_ord_Memrel well_ord_subset by blast + then + obtain f \ where "f:\\, Memrel(\)\ \ \A,Memrel(\)\" "Ord(\)" "\ = ordertype(A,Memrel(\))" + using ordertype_ord_iso Ord_ordertype ord_iso_sym by blast + moreover from this + have "f: \ \ A" + using ord_iso_is_mono_map mono_map_is_fun[of f _ "Memrel(\)"] by blast + moreover from this + have "function(f)" + using fun_is_function by simp + moreover from \f:\\, Memrel(\)\ \ \A,Memrel(\)\\ + have "range(f) = A" + using ord_iso_is_bij bij_is_surj surj_range by blast + moreover note \cofinal(A,\,_)\ + ultimately + have "cf_fun(f,\)" + using cofinal_range_iff_cofinal_fun by blast + moreover from \Ord(\)\ + obtain h where "h :cf(\) \\<^sub>< \" "cf_fun(h,\)" + using cofinal_mono_map_cf by blast + moreover from \Ord(\)\ + have "trans(Memrel(\))" + using trans_Memrel by simp + moreover + note \A\\\ + ultimately + have "cofinal_fun(f O h,\,Memrel(\))" + using cofinal_comp ord_iso_is_mono_map[OF \f:\\,_\ \ \A,_\\] mono_map_is_fun + mono_map_mono by blast + moreover from \f:\\A\ \A\\\ \h\mono_map(cf(\),_,\,_)\ + have "f O h : cf(\) \ \" + using Pi_mono[of A \] comp_fun mono_map_is_fun by blast + moreover + note \Ord(\)\ \Ord(\)\ \\ = ordertype(A,Memrel(\))\ + ultimately + show "cf(\) \ cf(ordertype(A,Memrel(\)))" + using cf_le_domain_cofinal_fun[of _ _ "f O h"] + by (auto simp add:cf_fun_def) + (********************************************************) + from \f:\\, _\ \ \A,_\\ \A\\\ + have "f :\ \\<^sub>< \" + using mono_map_mono[OF ord_iso_is_mono_map] by simp + then + have "f: \ \ \" + using mono_map_is_fun by simp + with \cf_fun(f,\)\ \Limit(\)\ \Ord(\)\ + obtain g where "g :cf(\) \\<^sub>< \" + "f O g :cf(\) \\<^sub>< \" + "cofinal_fun(f O g,\,Memrel(\))" + using cofinal_fun_factorization by blast + moreover from this + have "g:cf(\)\\" + using mono_map_is_fun by simp + moreover + note \Ord(\)\ + moreover from calculation and \f :\ \\<^sub>< \\ \Ord(\)\ + have "cf_fun(g,\)" + using factor_is_cofinal by blast + moreover + note \\ = ordertype(A,Memrel(\))\ + ultimately + show "cf(ordertype(A,Memrel(\))) \ cf(\)" + using cf_le_domain_cofinal_fun[OF _ Ord_cf mono_map_is_fun] by simp +qed + +lemma cf_idemp: + assumes "Limit(\)" + shows "cf(\) = cf(cf(\))" +proof - + from assms + obtain A where "A\\" "cofinal(A,\,Memrel(\))" "cf(\) = ordertype(A,Memrel(\))" + using Limit_is_Ord cf_is_ordertype by blast + with assms + have "cf(\) = cf(ordertype(A,Memrel(\)))" using cf_ordertype_cofinal by simp + also + have "... = cf(cf(\))" + using \cf(\) = ordertype(A,Memrel(\))\ by simp + finally + show "cf(\) = cf(cf(\))" . +qed + +lemma cf_le_cardinal: + assumes "Limit(\)" + shows "cf(\) \ |\|" +proof - + from assms + have \Ord(\)\ using Limit_is_Ord by simp + then + obtain f where "f \ surj(|\|,\)" + using Ord_cardinal_eqpoll unfolding eqpoll_def bij_def by blast + with \Ord(\)\ + show ?thesis + using Card_is_Ord[OF Card_cardinal] surj_is_cofinal + cf_le_domain_cofinal_fun[of \] surj_is_fun by blast +qed + +lemma regular_is_Card: + notes le_imp_subset [dest] + assumes "Limit(\)" "\ = cf(\)" + shows "Card(\)" +proof - + from assms + have "|\| \ \" + using Limit_is_Ord Ord_cardinal_le by blast + also from \\ = cf(\)\ + have "\ \ cf(\)" by simp + finally + have "|\| \ cf(\)" . + with assms + show ?thesis unfolding Card_def using cf_le_cardinal by force +qed + +lemma Limit_cf: assumes "Limit(\)" shows "Limit(cf(\))" + using Ord_cf[of \, THEN Ord_cases] + \ \\<^term>\cf(\)\ being 0 or successor leads to contradiction\ +proof (cases) + case 1 + with \Limit(\)\ + show ?thesis using cf_zero_iff Limit_is_Ord by simp +next + case (2 \) + moreover + note \Limit(\)\ + moreover from calculation + have "cf(\) = 1" + using cf_idemp cf_succ by fastforce + ultimately + show ?thesis + using succ_LimitE cf_eq_one_iff Limit_is_Ord + by auto +qed + +lemma InfCard_cf: "Limit(\) \ InfCard(cf(\))" + using regular_is_Card cf_idemp Limit_cf nat_le_Limit Limit_cf + unfolding InfCard_def by simp + +lemma cf_le_cf_fun: + notes [dest] = Limit_is_Ord + assumes "cf(\) \ \" "Limit(\)" + shows "\f. f:\ \ \ \ cf_fun(f, \)" +proof - + note assms + moreover from this + obtain h where h_cofinal_mono: "cf_fun(h,\)" + "h :cf(\) \\<^sub>< \" + "h : cf(\) \ \" + using cofinal_mono_map_cf mono_map_is_fun by force + moreover from calculation + obtain g where "g \ inj(cf(\), \)" + using le_imp_lepoll by blast + from this and calculation(2,3,5) + obtain f where "f \ surj(\, cf(\))" "f: \ \ cf(\)" + using inj_imp_surj[OF _ Limit_has_0[THEN ltD]] + surj_is_fun Limit_cf by blast + moreover from this + have "cf_fun(f,cf(\))" + using surj_is_cofinal by simp + moreover + note h_cofinal_mono \Limit(\)\ + moreover from calculation + have "cf_fun(h O f,\)" + using cf_fun_comp by blast + moreover from calculation + have "h O f \ \ -> \" + using comp_fun by simp + ultimately + show ?thesis by blast +qed + +lemma Limit_cofinal_fun_lt: + notes [dest] = Limit_is_Ord + assumes "Limit(\)" "f: \ \ \" "cf_fun(f,\)" "n\\" + shows "\\\\. n < f`\" +proof - + from \Limit(\)\ \n\\\ + have "succ(n) \ \" + using Limit_has_succ[OF _ ltI, THEN ltD] by auto + moreover + note \f: \ \ _\ + moreover from this + have "domain(f) = \" + using domain_of_fun by simp + moreover + note \cf_fun(f,\)\ + ultimately + obtain \ where "\ \ \" "succ(n) \ f`\ \ succ(n) = f `\" + using cf_funD[THEN cofinal_funD] by blast + moreover from this + consider (1) "succ(n) \ f`\" | (2) "succ(n) = f `\" + by blast + then + have "n < f`\" + proof (cases) + case 1 + moreover + have "n \ succ(n)" by simp + moreover + note \Limit(\)\ \f: \ \ _\ \\ \ \\ + moreover from this + have "Ord(f ` \)" + using apply_type[of f \ "\_. \", THEN [2] Ord_in_Ord] + by blast + ultimately + show ?thesis + using Ord_trans[of n "succ(n)" "f ` \"] ltI by blast + next + case 2 + have "n \ f ` \" by (simp add:2[symmetric]) + with \Limit(\)\ \f: \ \ _\ \\ \ \\ + show ?thesis + using ltI + apply_type[of f \ "\_. \", THEN [2] Ord_in_Ord] + by blast + qed + ultimately + show ?thesis by blast +qed + +context + includes Ord_dests Aleph_dests Aleph_intros Aleph_mem_dests mono_map_rules +begin + +text\We end this section by calculating the cofinality of Alephs, for +the zero and limit case. The successor case depends on $\AC$.\ + +lemma cf_nat: "cf(\) = \" + using Limit_nat[THEN InfCard_cf] cf_le_cardinal[of \] + Card_nat[THEN Card_cardinal_eq] le_anti_sym + unfolding InfCard_def by auto + +lemma cf_Aleph_zero: "cf(\\<^bsub>0\<^esub>) = \\<^bsub>0\<^esub>" + using cf_nat unfolding Aleph_def by simp + +lemma cf_Aleph_Limit: + assumes "Limit(\)" + shows "cf(\\<^bsub>\\<^esub>) = cf(\)" +proof - + note \Limit(\)\ + moreover from this + have "(\x\\. \\<^bsub>x\<^esub>) : \ \ \\<^bsub>\\<^esub>" (is "?f : _ \ _") + using lam_funtype[of _ Aleph] fun_weaken_type[of _ _ _ "\\<^bsub>\\<^esub>"] by blast + moreover from \Limit(\)\ + have "x \ y \ \\<^bsub>x\<^esub> \ \\<^bsub>y\<^esub>" if "x \ \" "y \ \" for x y + using that Ord_in_Ord[of \] Ord_trans[of _ _ \] by blast + ultimately + have "?f \ mono_map(\,Memrel(\),\\<^bsub>\\<^esub>, Memrel(\\<^bsub>\\<^esub>))" + by auto + with \Limit(\)\ + have "?f \ \\, Memrel(\)\ \ \?f``\, Memrel(\\<^bsub>\\<^esub>)\" + using mono_map_imp_ord_iso_Memrel[of \ "\\<^bsub>\\<^esub>" ?f] + Card_Aleph (* Already an intro rule, but need it explicitly *) + by blast + then + have "converse(?f) \ \?f``\, Memrel(\\<^bsub>\\<^esub>)\ \ \\, Memrel(\)\" + using ord_iso_sym by simp + with \Limit(\)\ + have "ordertype(?f``\, Memrel(\\<^bsub>\\<^esub>)) = \" + using ordertype_eq[OF _ well_ord_Memrel] + ordertype_Memrel by auto + moreover from \Limit(\)\ + have "cofinal(?f``\, \\<^bsub>\\<^esub>, Memrel(\\<^bsub>\\<^esub>))" + unfolding cofinal_def + proof (standard, intro ballI) + fix a + assume "a\\\<^bsub>\\<^esub>" "\\<^bsub>\\<^esub> = (\i<\. \\<^bsub>i\<^esub>)" + moreover from this + obtain i where "i<\" "a\\\<^bsub>i\<^esub>" + by auto + moreover from this and \Limit(\)\ + have "Ord(i)" using ltD Ord_in_Ord by blast + moreover from \Limit(\)\ and calculation + have "succ(i) \ \" using ltD by auto + moreover from this and \Ord(i)\ + have "\\<^bsub>i\<^esub> < \\<^bsub>succ(i)\<^esub>" + by (auto) + ultimately + have "\a,\\<^bsub>i\<^esub>\ \ Memrel(\\<^bsub>\\<^esub>)" + using ltD by (auto dest:Aleph_increasing) + moreover from \i<\\ + have "\\<^bsub>i\<^esub> \ ?f``\" + using ltD apply_in_image[OF \?f : _ \ _\] by auto + ultimately + show "\x\?f `` \. \a, x\ \ Memrel(\\<^bsub>\\<^esub>) \ a = x" by blast + qed + moreover + note \?f: \ \ \\<^bsub>\\<^esub>\ \Limit(\)\ + ultimately + show "cf(\\<^bsub>\\<^esub>) = cf(\)" + using cf_ordertype_cofinal[OF Limit_Aleph Image_sub_codomain, of \ ?f \ \ ] + Limit_is_Ord by simp +qed + +end (* includes *) + +end \ No newline at end of file diff --git a/thys/Delta_System_Lemma/Cohen_Posets.thy b/thys/Delta_System_Lemma/Cohen_Posets.thy new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/Cohen_Posets.thy @@ -0,0 +1,248 @@ +subsection\Application to Cohen posets\label{sec:cohen}\ + +theory Cohen_Posets + imports + Delta_System + +begin + +text\We end this session by applying DSL to the combinatorics of +finite function posets. We first define some basic concepts; we take +a different approach from \cite{2020arXiv200109715G}, in that the +order relation is presented as a predicate (of type @{typ \[i,i] \ o\}). + +Two elements of a poset are \<^emph>\compatible\ if they have a common lower +bound.\ + +definition compat_in :: "[i,[i,i]\o,i,i]\o" where + "compat_in(A,r,p,q) \ \d\A . r(d,p) \ r(d,q)" + +text\An \<^emph>\antichain\ is a subset of pairwise incompatible members.\ + +definition + antichain :: "[i,[i,i]\o,i]\o" where + "antichain(P,leq,A) \ A\P \ (\p\A. \q\A. + p\q \ \compat_in(P,leq,p,q))" + +text\A poset has the \<^emph>\countable chain condition\ (ccc) if all of its +antichains are countable.\ + +definition + ccc :: "[i,[i,i]\o]\o" where + "ccc(P,leq) \ \A. antichain(P,leq,A) \ countable(A)" + +text\Finally, the \<^emph>\Cohen poset\ is the set of finite partial functions +between two sets with the order of reverse inclusion.\ + +definition + Fn :: "[i,i] \ i" where + "Fn(I,J) \ \{(d\J) . d \ {x \ Pow(I). Finite(x)}}" + +abbreviation + Supset :: "i \ i \ o" (infixl \\\ 50) where + "f \ g \ g \ f" + +lemma FnI[intro]: + assumes "p : d \ J" "d \ I" "Finite(d)" + shows "p \ Fn(I,J)" + using assms unfolding Fn_def by auto + +lemma FnD[dest]: + assumes "p \ Fn(I,J)" + shows "\d. p : d \ J \ d \ I \ Finite(d)" + using assms unfolding Fn_def by auto + +lemma Fn_is_function: "p \ Fn(I,J) \ function(p)" + unfolding Fn_def using fun_is_function by auto + +lemma restrict_eq_imp_compat: + assumes "f \ Fn(I, J)" "g \ Fn(I, J)" + "restrict(f, domain(f) \ domain(g)) = restrict(g, domain(f) \ domain(g))" + shows "f \ g \ Fn(I, J)" +proof - + from assms + obtain d1 d2 where "f : d1 \ J" "d1 \ Pow(I)" "Finite(d1)" + "g : d2 \ J" "d2 \ Pow(I)" "Finite(d2)" + by blast + with assms + show ?thesis + using domain_of_fun + restrict_eq_imp_Un_into_Pi[of f d1 "\_. J" g d2 "\_. J"] + by auto +qed + +text\We finally arrive to our application of DSL.\ + +lemma ccc_Fn_nat: "ccc(Fn(I,2), (\))" +proof - + { + fix A + assume "\ countable(A)" + assume "A \ Fn(I, 2)" + moreover from this + have "countable({p\A. domain(p) = d})" for d + proof (cases "Finite(d) \ d \ I") + case True + with \A \ Fn(I, 2)\ + have "{p \ A . domain(p) = d} \ d \ 2" + using domain_of_fun by fastforce + moreover from True + have "Finite(d \ 2)" + using Finite_Pi lesspoll_nat_is_Finite by auto + ultimately + show ?thesis using subset_Finite[of _ "d\2" ] Finite_imp_countable + by auto + next + case False + with \A \ Fn(I, 2)\ + have "{p \ A . domain(p) = d} = 0" + by (intro equalityI) (auto dest!: domain_of_fun) + then + show ?thesis using empty_lepollI by auto + qed + moreover + have "uncountable({domain(p) . p \ A})" + proof + from \A \ Fn(I, 2)\ + have "A = (\d\{domain(p) . p \ A}. {p\A. domain(p) = d})" + by auto + moreover + assume "countable({domain(p) . p \ A})" + moreover + note \\d. countable({p\A. domain(p) = d})\ \\countable(A)\ + ultimately + show "False" + using countable_imp_countable_UN[of "{domain(p). p\A}" + "\d. {p \ A. domain(p) = d }"] + by auto + qed + moreover from \A \ Fn(I, 2)\ + have "p \ A \ Finite(domain(p))" for p + using lesspoll_nat_is_Finite[of "domain(p)"] + domain_of_fun[of p _ "\_. 2"] by auto + ultimately + obtain D where "delta_system(D)" "D \ {domain(p) . p \ A}" "D \ \\<^bsub>1\<^esub>" + using delta_system_uncountable[of "{domain(p) . p \ A}"] by auto + then + have delta:"\d1\D. \d2\D. d1 \ d2 \ d1 \ d2 = \D" + using delta_system_root_eq_Inter + by simp + moreover from \D \ \\<^bsub>1\<^esub>\ + have "uncountable(D)" + using uncountable_iff_subset_eqpoll_Aleph1 by auto + moreover from this and \D \ {domain(p) . p \ A}\ + obtain p1 where "p1 \ A" "domain(p1) \ D" + using uncountable_not_empty[of D] by blast + moreover from this and \p1 \ A \ Finite(domain(p1))\ + have "Finite(domain(p1))" using Finite_domain by simp + moreover + define r where "r \ \D" + ultimately + have "Finite(r)" using subset_Finite[of "r" "domain(p1)"] by auto + have "countable({restrict(p,r) . p\A})" + proof - + have "f \ Fn(I, 2) \ restrict(f,r) \ Pow(r \ 2)" for f + using restrict_subset_Sigma[of f _ "\_. 2" r] + by (auto dest!:FnD simp: Pi_def) auto + with \A \ Fn(I, 2)\ + have "{restrict(f,r) . f \ A } \ Pow(r \ 2)" + by fast + with \Finite(r)\ + show ?thesis + using Finite_Sigma[THEN Finite_Pow, of r "\_. 2"] + by (intro Finite_imp_countable) (auto intro:subset_Finite) + qed + moreover + have "uncountable({p\A. domain(p) \ D})" (is "uncountable(?X)") + proof + from \D \ {domain(p) . p \ A}\ + have "(\p\?X. domain(p)) \ surj(?X, D)" + using lam_type unfolding surj_def by auto + moreover + assume "countable(?X)" + moreover + note \uncountable(D)\ + ultimately + show False + using surj_countable by auto + qed + moreover + have "D = (\f\Pow(r\2) . {domain(p) . p\{ x\A. restrict(x,r) = f \ domain(x) \ D}})" + proof - + { + fix z + assume "z \ D" + with \D \ _\ + obtain p where "domain(p) = z" "p \ A" + by auto + moreover from \A \ Fn(I, 2)\ and this + have "p : z \ 2" + using domain_of_fun by (auto dest!:FnD) + moreover from this + have "restrict(p,r) \ r \ 2" + using function_restrictI[of p r] fun_is_function[of p z "\_. 2"] + restrict_subset_Sigma[of p z "\_. 2" r] + by (auto simp:Pi_def) + ultimately + have "\p\A. restrict(p,r) \ Pow(r\2) \ domain(p) = z" by auto + } + then + show ?thesis + by (intro equalityI) (force)+ + qed + obtain f where "uncountable({domain(p) . p\{x\A. restrict(x,r) = f \ domain(x) \ D}})" + (is "uncountable(?Y(f))") + proof - + { + from \Finite(r)\ + have "countable(Pow(r\2))" + using Finite_Sigma[THEN Finite_Pow, THEN Finite_imp_countable] + by simp + moreover + assume "countable(?Y(f))" for f + moreover + note \D = (\f\Pow(r\2) .?Y(f))\ + moreover + note \uncountable(D)\ + ultimately + have "False" + using countable_imp_countable_UN[of "Pow(r\2)" ?Y] by auto + } + with that + show ?thesis by auto + qed + then + obtain j where "j \ inj(nat, ?Y(f))" + using uncountable_iff_nat_lt_cardinal[THEN iffD1, THEN leI, + THEN cardinal_le_imp_lepoll, THEN lepollD] + by auto + then + have "j`0 \ j`1" "j`0 \ ?Y(f)" "j`1 \ ?Y(f)" + using inj_is_fun[THEN apply_type, of j nat "?Y(f)"] + unfolding inj_def by auto + then + obtain p q where "domain(p) \ domain(q)" "p \ A" "q \ A" + "domain(p) \ D" "domain(q) \ D" + "restrict(p,r) = restrict(q,r)" by auto + moreover from this and delta + have "domain(p) \ domain(q) = r" unfolding r_def by simp + moreover + note \A \ Fn(I, 2)\ + moreover from calculation + have "p \ q \ Fn(I, 2)" + by (rule_tac restrict_eq_imp_compat) auto + ultimately + have "\p\A. \q\A. p \ q \ compat_in(Fn(I, 2), (\), p, q)" + unfolding compat_in_def + by (rule_tac bexI[of _ p], rule_tac bexI[of _ q]) blast + } + then + show ?thesis unfolding ccc_def antichain_def by auto +qed + +text\The fact that a poset $P$ has the ccc has useful consequences for the +theory of forcing, since it implies that cardinals from the original +model are exactly the cardinals in any generic extension by $P$ +\cite[Chap.~IV]{kunen2011set}.\ + +end \ No newline at end of file diff --git a/thys/Delta_System_Lemma/Delta_System.thy b/thys/Delta_System_Lemma/Delta_System.thy new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/Delta_System.thy @@ -0,0 +1,274 @@ +section\The Delta System Lemma\label{sec:dsl}\ + +theory Delta_System + imports + Cardinal_Library + +begin + +text\A \<^emph>\delta system\ is family of sets with a common pairwise +intersection.\ + +definition + delta_system :: "i \ o" where + "delta_system(D) \ \r. \A\D. \B\D. A \ B \ A \ B = r" + +lemma delta_systemI[intro]: + assumes "\A\D. \B\D. A \ B \ A \ B = r" + shows "delta_system(D)" + using assms unfolding delta_system_def by simp + +lemma delta_systemD[dest]: + "delta_system(D) \ \r. \A\D. \B\D. A \ B \ A \ B = r" + unfolding delta_system_def by simp + +text\Hence, pairwise intersections equal the intersection of the whole +family.\ + +lemma delta_system_root_eq_Inter: + assumes "delta_system(D)" + shows "\A\D. \B\D. A \ B \ A \ B = \D" +proof (clarify, intro equalityI, auto) + fix A' B' x C + assume hyp:"A'\D" "B'\ D" "A'\B'" "x\A'" "x\B'" "C\D" + with assms + obtain r where delta:"\A\D. \B\D. A \ B \ A \ B = r" + by auto + show "x \ C" + proof (cases "C=A'") + case True + with hyp and assms + show ?thesis by simp + next + case False + moreover + note hyp + moreover from calculation and delta + have "r = C \ A'" "A' \ B' = r" "x\r" by auto + ultimately + show ?thesis by simp + qed +qed + +text\The \<^emph>\Delta System Lemma\ (DSL) states that any uncountable family of +finite sets includes an uncountable delta system. This is the simplest +non trivial version; others, for cardinals greater than \<^term>\\\<^bsub>1\<^esub>\ assume +some weak versions of the generalized continuum hypothesis for the +cardinals involved. + +The proof is essentially the one in \cite[III.2.6]{kunen2011set} for the +case \<^term>\\\<^bsub>1\<^esub>\; another similar presentation can be found in +\cite[Chap.~16]{JW}.\ + +lemma delta_system_Aleph1: + assumes "\A\F. Finite(A)" "F \ \\<^bsub>1\<^esub>" + shows "\D. D \ F \ delta_system(D) \ D \ \\<^bsub>1\<^esub>" +proof - + text\Since all members are finite,\ + from \\A\F. Finite(A)\ + have "(\A\F. |A|) : F \ \" (is "?cards : _") + by (rule_tac lam_type) simp + moreover from this + have a:"?cards -`` {n} = { A\F . |A| = n }" for n + using vimage_lam by auto + moreover + note \F \ \\<^bsub>1\<^esub>\ + moreover from calculation + text\there are uncountably many have the same cardinal:\ + obtain n where "n\\" "|?cards -`` {n}| = \\<^bsub>1\<^esub>" + using eqpoll_Aleph1_cardinal_vimage[of F ?cards] by auto + moreover + define G where "G \ ?cards -`` {n}" + moreover from calculation + have "G \ F" by auto + ultimately + text\Therefore, without loss of generality, we can assume that all + elements of the family have cardinality \<^term>\n\\\.\ + have "A\G \ |A| = n" and "G \ \\<^bsub>1\<^esub>" for A + using cardinal_Card_eqpoll_iff by auto + with \n\\\ + text\So we prove the result by induction on this \<^term>\n\ and + generalizing \<^term>\G\, since the argument requires changing the + family in order to apply the inductive hypothesis.\ + have "\D. D \ G \ delta_system(D) \ D \ \\<^bsub>1\<^esub>" + proof (induct arbitrary:G) + case 0 \ \This case is impossible\ + then + have "G \ {0}" + using cardinal_0_iff_0 by auto + with \G \ \\<^bsub>1\<^esub>\ + show ?case + using nat_lt_Aleph1 subset_imp_le_cardinal[of G "{0}"] + lt_trans2 cardinal_Card_eqpoll_iff by auto + next + case (succ n) + then + have "\a\G. Finite(a)" + using Finite_cardinal_iff' nat_into_Finite[of "succ(n)"] + by fastforce + show "\D. D \ G \ delta_system(D) \ D \ \\<^bsub>1\<^esub>" + proof (cases "\p. {A\G . p \ A} \ \\<^bsub>1\<^esub>") + case True \ \the positive case, uncountably many sets with a + common element\ + then + obtain p where "{A\G . p \ A} \ \\<^bsub>1\<^esub>" by blast + moreover from this + have "{A-{p} . A\{X\G. p\X}} \ \\<^bsub>1\<^esub>" (is "?F \ _") + using Diff_bij[of "{A\G . p \ A}" "{p}"] + comp_bij[OF bij_converse_bij, where C="\\<^bsub>1\<^esub>"] by fast + text\Now using the hypothesis of the successor case,\ + moreover from \\A. A\G \ |A|=succ(n)\ \\a\G. Finite(a)\ + and this + have "p\A \ A\G \ |A - {p}| = n" for A + using Finite_imp_succ_cardinal_Diff[of _ p] by force + moreover from this and \n\\\ + have "\a\?F. Finite(a)" + using Finite_cardinal_iff' nat_into_Finite by auto + moreover + text\we may apply the inductive hypothesis to the new family \<^term>\?F\:\ + note \(\A. A \ ?F \ |A| = n) \ ?F \ \\<^bsub>1\<^esub> \ + \D. D \ ?F \ delta_system(D) \ D \ \\<^bsub>1\<^esub>\ + ultimately + obtain D where "D\{A-{p} . A\{X\G. p\X}}" "delta_system(D)" "D \ \\<^bsub>1\<^esub>" + by auto + moreover from this + obtain r where "\A\D. \B\D. A \ B \ A \ B = r" + by fastforce + then + have "\A\D.\B\D. A\{p} \ B\{p}\(A \ {p}) \ (B \ {p}) = r\{p}" + by blast + ultimately + have "delta_system({B \ {p} . B\D})" (is "delta_system(?D)") + by fastforce + moreover from \D \ \\<^bsub>1\<^esub>\ + have "|D| = \\<^bsub>1\<^esub>" "Infinite(D)" + using cardinal_eqpoll_iff + by (auto intro!: uncountable_iff_subset_eqpoll_Aleph1[THEN iffD2] + uncountable_imp_Infinite) force + moreover from this + have "?D \ \\<^bsub>1\<^esub>" + using cardinal_map_Un[of D "{p}"] naturals_lt_nat + cardinal_eqpoll_iff[THEN iffD1] by simp + moreover + note \D \ {A-{p} . A\{X\G. p\X}}\ + have "?D \ G" + proof - + { + fix A + assume "A\G" "p\A" + moreover from this + have "A = A - {p} \ {p}" + by blast + ultimately + have "A -{p} \ {p} \ G" + by auto + } + with \D \ {A-{p} . A\{X\G. p\X}}\ + show ?thesis + by blast + qed + ultimately + show "\D. D \ G \ delta_system(D) \ D \ \\<^bsub>1\<^esub>" by auto + next + case False + note \\ (\p. {A \ G . p \ A} \ \\<^bsub>1\<^esub>)\ \ \the other case\ + moreover from \G \ \\<^bsub>1\<^esub>\ + have "{A \ G . p \ A} \ \\<^bsub>1\<^esub>" (is "?G(p) \ _") for p + by (blast intro:lepoll_eq_trans[OF subset_imp_lepoll]) + ultimately + have "?G(p) \ \\<^bsub>1\<^esub>" for p + unfolding lesspoll_def by simp + then (* may omit the previous step if unfolding here: *) + have "?G(p) \ \" for p + using lesspoll_aleph_plus_one[of 0] Aleph_zero_eq_nat by auto + moreover + have "{A \ G . S \ A \ 0} = (\p\S. ?G(p))" for S + by auto + ultimately + have "countable(S) \ countable({A \ G . S \ A \ 0})" for S + using InfCard_nat Card_nat + le_Card_iff[THEN iffD2, THEN [3] leqpoll_imp_cardinal_UN_le, + THEN [2] le_Card_iff[THEN iffD1], of \ S] + unfolding countable_def by simp + text\For every countable subfamily of \<^term>\G\ there is another some + element disjoint from all of them:\ + have "\A\G. \S\X. S \ A = 0" if "|X| < \\<^bsub>1\<^esub>" "X \ G" for X + proof - + from \n\\\ \\A. A\G \ |A| = succ(n)\ + have "A\G \ Finite(A)" for A + using cardinal_Card_eqpoll_iff + unfolding Finite_def by fastforce + with \X\G\ + have "A\X \ countable(A)" for A + using Finite_imp_countable by auto + with \|X| < \\<^bsub>1\<^esub>\ + have "countable(\X)" + using Card_nat[THEN cardinal_lt_csucc_iff, of X] + countable_union_countable countable_iff_cardinal_le_nat + unfolding Aleph_def by simp + with \countable(_) \ countable({A \ G . _ \ A \ 0})\ + have "countable({A \ G . (\X) \ A \ 0})" . + with \G \ \\<^bsub>1\<^esub>\ + obtain B where "B\G" "B \ {A \ G . (\X) \ A \ 0}" + using nat_lt_Aleph1 cardinal_Card_eqpoll_iff[of "\\<^bsub>1\<^esub>" G] + uncountable_not_subset_countable[of "{A \ G . (\X) \ A \ 0}" G] + uncountable_iff_nat_lt_cardinal + by auto + then + show "\A\G. \S\X. S \ A = 0" by auto + qed + moreover from \G \ \\<^bsub>1\<^esub>\ + obtain b where "b\G" + using uncountable_iff_subset_eqpoll_Aleph1 + uncountable_not_empty by blast + ultimately + text\Hence, the hypotheses to perform a bounded-cardinal selection + are satisfied,\ + obtain S where "S:\\<^bsub>1\<^esub>\G" "\\\\<^bsub>1\<^esub> \ \\\\<^bsub>1\<^esub> \ \<\ \ S`\ \ S`\ = 0" + for \ \ + using bounded_cardinal_selection[of "\\<^bsub>1\<^esub>" G "\s a. s \ a = 0" b] + by force + then + have "\ \ \\<^bsub>1\<^esub> \ \ \ \\<^bsub>1\<^esub> \ \\\ \ S`\ \ S`\ = 0" for \ \ + using lt_neq_symmetry[of "\\<^bsub>1\<^esub>" "\\ \. S`\ \ S`\ = 0"] Card_is_Ord + by auto blast + text\and a symmetry argument shows that obtained \<^term>\S\ is + an injective \<^term>\\\<^bsub>1\<^esub>\-sequence of disjoint elements of \<^term>\G\.\ + moreover from this and \\A. A\G \ |A| = succ(n)\ \S : \\<^bsub>1\<^esub> \ G\ + have "S \ inj(\\<^bsub>1\<^esub>, G)" + using cardinal_succ_not_0 Int_eq_zero_imp_not_eq[of "\\<^bsub>1\<^esub>" "\x. S`x"] + unfolding inj_def by fastforce + moreover from calculation + have "range(S) \ \\<^bsub>1\<^esub>" + using inj_bij_range eqpoll_sym unfolding eqpoll_def by fast + moreover from calculation + have "range(S) \ G" + using inj_is_fun range_fun_subset_codomain by fast + ultimately + show "\D. D \ G \ delta_system(D) \ D \ \\<^bsub>1\<^esub>" + using inj_is_fun range_eq_image[of S "\\<^bsub>1\<^esub>" G] + image_function[OF fun_is_function, OF inj_is_fun, of S "\\<^bsub>1\<^esub>" G] + domain_of_fun[OF inj_is_fun, of S "\\<^bsub>1\<^esub>" G] + by (rule_tac x="S``\\<^bsub>1\<^esub>" in exI) auto + text\This finishes the successor case and hence the proof.\ + qed + qed + with \G \ F\ + show ?thesis by blast +qed + +lemma delta_system_uncountable: + assumes "\A\F. Finite(A)" "uncountable(F)" + shows "\D. D \ F \ delta_system(D) \ D \ \\<^bsub>1\<^esub>" +proof - + from assms + obtain S where "S \ F" "S \ \\<^bsub>1\<^esub>" + using uncountable_iff_subset_eqpoll_Aleph1[of F] by auto + moreover from \\A\F. Finite(A)\ and this + have "\A\S. Finite(A)" by auto + ultimately + show ?thesis using delta_system_Aleph1[of S] + by auto +qed + +end \ No newline at end of file diff --git a/thys/Delta_System_Lemma/Konig.thy b/thys/Delta_System_Lemma/Konig.thy new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/Konig.thy @@ -0,0 +1,187 @@ +theory Konig + imports + Cofinality + Cardinal_Library + +begin + +text\Now, using the Axiom of choice, we can show that all successor +cardinals are regular.\ + +lemma cf_csucc: + assumes "InfCard(z)" + shows "cf(z\<^sup>+) = z\<^sup>+" +proof (rule ccontr) + assume "cf(z\<^sup>+) \ z\<^sup>+" + moreover from \InfCard(z)\ + have "Ord(z\<^sup>+)" "Ord(z)" "Limit(z)" "Limit(z\<^sup>+)" "Card(z\<^sup>+)" "Card(z)" + using InfCard_csucc Card_is_Ord InfCard_is_Card InfCard_is_Limit + by fastforce+ + moreover from calculation + have "cf(z\<^sup>+) < z\<^sup>+" + using cf_le_cardinal[of "z\<^sup>+", THEN le_iff[THEN iffD1]] + Card_cardinal_eq + by simp + ultimately + obtain G where "G:cf(z\<^sup>+)\ z\<^sup>+" "\\\z\<^sup>+. \y\cf(z\<^sup>+). \ < G`y" + using Limit_cofinal_fun_lt[of "z\<^sup>+" _ "cf(z\<^sup>+)"] Ord_cf + cf_le_cf_fun[of "z\<^sup>+" "cf(z\<^sup>+)"] le_refl[of "cf(z\<^sup>+)"] + by auto + with \Card(z)\ \Card(z\<^sup>+)\ \Ord(z\<^sup>+)\ + have "\\\cf(z\<^sup>+). |G`\| \ z" + using apply_type[of G "cf(z\<^sup>+)" "\_. z\<^sup>+", THEN ltI] Card_lt_iff[THEN iffD2] + Ord_in_Ord[OF Card_is_Ord, of "z\<^sup>+"] cardinal_lt_csucc_iff[THEN iffD1] + by auto + from \cf(z\<^sup>+) < z\<^sup>+\ \InfCard(z)\ \Ord(z)\ + have "cf(z\<^sup>+) \ z" + using cardinal_lt_csucc_iff[of "z" "cf(z\<^sup>+)"] Card_csucc[of "z"] + le_Card_iff[of "z" "cf(z\<^sup>+)"] InfCard_is_Card + Card_lt_iff[of "cf(z\<^sup>+)" "z\<^sup>+"] lt_Ord[of "cf(z\<^sup>+)" "z\<^sup>+"] + by simp + with \cf(z\<^sup>+) < z\<^sup>+\ \\\\cf(z\<^sup>+). |G`\| \ _\ \InfCard(z)\ + have "|\\\cf(z\<^sup>+). G`\| \ z" + using InfCard_csucc[of z] + subset_imp_lepoll[THEN lepoll_imp_Card_le, of "\\\cf(z\<^sup>+). G`\" "z"] + by (rule_tac leqpoll_imp_cardinal_UN_le) auto + moreover + note \Ord(z)\ + moreover from \\\\z\<^sup>+. \y\cf(z\<^sup>+). \ < G`y\ and this + have "z\<^sup>+ \ (\\\cf(z\<^sup>+). G`\)" + by (blast dest:ltD) + ultimately + have "z\<^sup>+ \ z" + using subset_imp_le_cardinal[of "z\<^sup>+" "\\\cf(z\<^sup>+). G`\"] le_trans + InfCard_is_Card Card_csucc[of z] Card_cardinal_eq + by auto + with \Ord(z)\ + show "False" + using lt_csucc[of z] not_lt_iff_le[THEN iffD2, of z "z\<^sup>+"] + Card_csucc[THEN Card_is_Ord] + by auto +qed + +text\And this finishes the calculation of cofinality of Alephs.\ + +lemma cf_Aleph_succ: "Ord(z) \ cf(\\<^bsub>succ(z)\<^esub>) = \\<^bsub>succ(z)\<^esub>" + using Aleph_succ cf_csucc InfCard_Aleph by simp + +subsection\König's Theorem\label{sec:konig}\ + +text\We end this section by proving König's Theorem on the cofinality +of cardinal exponentiation. This is a strengthening of Cantor's theorem +and it is essentially the only basic way to prove strict cardinal +inequalities. + +It is proved rather straightforwardly with the tools already developed.\ + +lemma konigs_theorem: + notes [dest] = InfCard_is_Card Card_is_Ord + and [trans] = lt_trans1 lt_trans2 + assumes + "InfCard(\)" "InfCard(\)" "cf(\) \ \" + shows + "\ < \\<^bsup>\\\<^esup>" + using assms(1,2) Card_cexp +proof (intro not_le_iff_lt[THEN iffD1] notI) + assume "\\<^bsup>\\\<^esup> \ \" + moreover + note \InfCard(\)\ + moreover from calculation + have "\ \ \ \ \" + using Card_cardinal_eq[OF InfCard_is_Card, symmetric] + Card_le_imp_lepoll + unfolding cexp_def by simp + ultimately + obtain G where "G \ surj(\, \ \ \)" + using inj_imp_surj[OF _ function_space_nonempty, + OF _ nat_into_InfCard] by blast + from assms + obtain f where "f:\ \ \" "cf_fun(f,\)" + using cf_le_cf_fun[OF _ InfCard_is_Limit] by blast + define H where "H(\) \ \ x. x\\ \ (\m. G`m`\ \ x)" + (is "_ \ \ x. ?P(\,x)") for \ + have H_satisfies: "?P(\,H(\))" if "\ \ \" for \ + proof - + obtain h where "?P(\,h)" + proof - + from \\\\\ \f:\ \ \\ \InfCard(\)\ + have "f`\ < \" + using apply_type[of _ _ "\_ . \"] by (auto intro:ltI) + have "|{G`m`\ . m \ {x\\ . x < f`\}}| \ |{x\\ . x < f`\}|" + using cardinal_RepFun_le by simp + also from \f`\ < \\ \InfCard(\)\ + have "|{x\\ . x < f`\}| < |\|" + using Card_lt_iff[OF lt_Ord, THEN iffD2, of "f`\" \ \] + Ord_eq_Collect_lt[of "f`\" \] Card_cardinal_eq + by force + finally + have "|{G`m`\ . m \ {x\\ . x < f`\}}| < |\|" . + moreover from \f`\ < \\ \InfCard(\)\ + have "m \ m\\" for m + using Ord_trans[of m "f`\" \] + by (auto dest:ltD) + ultimately + have "\h. ?P(\,h)" + using lt_cardinal_imp_not_subset by blast + with that + show ?thesis by blast + qed + with assms + show "?P(\,H(\))" + using LeastI[of "?P(\)" h] lt_Ord Ord_in_Ord + unfolding H_def by fastforce + qed + then + have "(\\\\. H(\)): \ \ \" + using lam_type by auto + with \G \ surj(\, \ \ \)\ + obtain n where "n\\" "G`n = (\\\\. H(\))" + unfolding surj_def by blast + moreover + note \InfCard(\)\ \f: \ \ \\ \cf_fun(f,_)\ + ultimately + obtain \ where "n < f`\" "\\\" + using Limit_cofinal_fun_lt[OF InfCard_is_Limit] by blast + moreover from calculation and \G`n = (\\\\. H(\))\ + have "G`n`\ = H(\)" + using ltD by simp + moreover from calculation and H_satisfies + have "\m. G`m`\ \ H(\)" by simp + ultimately + show "False" by blast +qed blast+ + +lemma cf_cexp: + assumes + "Card(\)" "InfCard(\)" "2 \ \" + shows + "\ < cf(\\<^bsup>\\\<^esup>)" +proof (rule ccontr) + assume "\ \ < cf(\\<^bsup>\\\<^esup>)" + with \InfCard(\)\ + have "cf(\\<^bsup>\\\<^esup>) \ \" + using not_lt_iff_le Ord_cf InfCard_is_Card Card_is_Ord by simp + moreover + note assms + moreover from calculation + have "InfCard(\\<^bsup>\\\<^esup>)" using InfCard_cexp by simp + moreover from calculation + have "\\<^bsup>\\\<^esup> < (\\<^bsup>\\\<^esup>)\<^bsup>\\\<^esup>" + using konigs_theorem by simp + ultimately + show "False" using cexp_cexp_cmult InfCard_csquare_eq by auto +qed + +text\Finally, the next two corollaries illustrate the only possible +exceptions to the value of the cardinality of the continuum: The limit +cardinals of countable cofinality. That these are the only exceptions +is a consequence of Easton's Theorem~\cite[Thm 15.18]{Jech_Millennium}.\ + +corollary cf_continuum: "\\<^bsub>0\<^esub> < cf(2\<^bsup>\\\<^bsub>0\<^esub>\<^esup>)" + using cf_cexp InfCard_Aleph nat_into_Card by simp + +corollary continuum_not_eq_Aleph_nat: "2\<^bsup>\\\<^bsub>0\<^esub>\<^esup> \ \\<^bsub>\\<^esub>" + using cf_continuum cf_Aleph_Limit[OF Limit_nat] cf_nat + Aleph_zero_eq_nat by auto + +end \ No newline at end of file diff --git a/thys/Delta_System_Lemma/ROOT b/thys/Delta_System_Lemma/ROOT new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/ROOT @@ -0,0 +1,23 @@ +chapter AFP + +session Delta_System_Lemma (AFP) = "ZF-Constructible" + + description " + Cofinality and Delta System Lemma + + We formalize the basic results on cofinality of linearly ordered + sets and ordinals and Shanin's Lemma for uncountable families of + finite sets. This last result is used to prove the countable chain + condition for Cohen posets. We work in the set theory framework of + Isabelle/ZF, using the Axiom of Choice as needed. + " + options [timeout = 600] + theories + "Konig" + "Delta_System" + "Cohen_Posets" + document_files + "root.tex" + "header-delta-system.tex" + "multidef.sty" + "root.bib" + "root.bst" diff --git a/thys/Delta_System_Lemma/ZF_Library.thy b/thys/Delta_System_Lemma/ZF_Library.thy new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/ZF_Library.thy @@ -0,0 +1,996 @@ +section\Library of basic $\ZF$ results\label{sec:zf-lib}\ + +theory ZF_Library + imports + "ZF-Constructible.Normal" + +begin + +text\This theory gathers basic ``combinatorial'' results that can be proved +in $\ZF$ (that is, without using the Axiom of Choice $\AC$). +\ + +text\We begin by setting up math-friendly notation.\ + +no_notation oadd (infixl \++\ 65) +no_notation sum (infixr \+\ 65) +notation oadd (infixl \+\ 65) +notation nat (\\\) +notation csucc (\_\<^sup>+\ [90]) +no_notation Aleph (\\_\ [90] 90) +notation Aleph (\\\<^bsub>_\<^esub>\) +syntax "_ge" :: "[i,i] \ o" (infixl \\\ 50) +translations "x \ y" \ "y \ x" + + +subsection\Some minimal arithmetic/ordinal stuff\ + +lemma Un_leD1 : "i \ j \ k \ Ord(i) \ Ord(j) \ Ord(k) \ i \ k" + by (rule Un_least_lt_iff[THEN iffD1[THEN conjunct1]],simp_all) + +lemma Un_leD2 : "i \ j \ k \ Ord(i) \ Ord(j) \ Ord(k) \ j \ k" + by (rule Un_least_lt_iff[THEN iffD1[THEN conjunct2]],simp_all) + +lemma Un_memD1: "i \ j \ k \ Ord(i) \ Ord(j) \ Ord(k) \ i \ k" + by (drule ltI, assumption, drule leI, rule Un_least_lt_iff[THEN iffD1[THEN conjunct1]],simp_all) + +lemma Un_memD2 : "i \ j \ k \ Ord(i) \ Ord(j) \ Ord(k) \ j \ k" + by (drule ltI, assumption, drule leI, rule Un_least_lt_iff[THEN iffD1[THEN conjunct2]],simp_all) + +text\This lemma allows to apply arithmetic simprocs to ordinal addition\ +lemma nat_oadd_add[simp]: + assumes "m \ \" "n \ \" shows "n + m = n #+ m" + using assms + by induct simp_all + +lemma Ord_has_max_imp_succ: + assumes "Ord(\)" "\ \ \" "\\\\. \ \ \" + shows "\ = succ(\)" + using assms Ord_trans[of _ \ \] + unfolding lt_def + by (intro equalityI subsetI) auto + +lemma Least_antitone: + assumes + "Ord(j)" "P(j)" "\i. P(i) \ Q(i)" + shows + "(\ i. Q(i)) \ (\ i. P(i))" + using assms LeastI2[of P j Q] Least_le by simp + +lemma Least_set_antitone: + "Ord(j) \ j\A \ A \ B \ (\ i. i\B) \ (\ i. i\A)" + using subset_iff by (auto intro:Least_antitone) + +lemma le_neq_imp_lt: + "x\y \ x\y \ xStrict upper bound of a set of ordinals.\ +definition + str_bound :: "i\i" where + "str_bound(A) \ \a\A. succ(a)" + +lemma str_bound_type [TC]: "\a\A. Ord(a) \ Ord(str_bound(A))" + unfolding str_bound_def by auto + +lemma str_bound_lt: "\a\A. Ord(a) \ \a\A. a < str_bound(A)" + unfolding str_bound_def using str_bound_type + by (blast intro:ltI) + +lemma naturals_lt_nat[intro]: "n \ \ \ n < \" + unfolding lt_def by simp + +text\The next two lemmas are handy when one is constructing +some object recursively. The first handles injectivity (of recursively +constructed sequences of sets), while the second is helpful for +establishing a symmetry argument.\ +lemma Int_eq_zero_imp_not_eq: + assumes + "\x y. x\D \ y \ D \ x \ y \ A(x) \ A(y) = 0" + "\x. x\D \ A(x) \ 0" "a\D" "b\D" "a\b" + shows + "A(a) \ A(b)" + using assms by fastforce + +lemma lt_neq_symmetry: + assumes + "\\ \. \ \ \ \ \ \ \ \ \ < \ \ Q(\,\)" + "\\ \. Q(\,\) \ Q(\,\)" + "\ \ \" "\ \ \" "\ \ \" + "Ord(\)" + shows + "Q(\,\)" +proof - + from assms + consider "\<\" | "\<\" + using Ord_linear_lt[of \ \ thesis] Ord_in_Ord[of \] + by auto + then + show ?thesis by cases (auto simp add:assms) +qed + +lemma cardinal_succ_not_0: "|A| = succ(n) \ A \ 0" + by auto + +lemma Ord_eq_Collect_lt: "i<\ \ {j\\. j \almost the same proof as @{thm nat_eq_Collect_lt}\ + apply (rule equalityI) + apply (blast dest: ltD) + apply (auto simp add: Ord_mem_iff_lt) + apply (rule Ord_trans ltI[OF _ lt_Ord]; auto simp add:lt_def dest:ltD)+ + done + + +subsection\Manipulation of function spaces\ + +definition + Finite_to_one :: "[i,i] \ i" where + "Finite_to_one(X,Y) \ {f:X\Y. \y\Y. Finite({x\X . f`x = y})}" + +lemma Finite_to_oneI[intro]: + assumes "f:X\Y" "\y. y\Y \ Finite({x\X . f`x = y})" + shows "f \ Finite_to_one(X,Y)" + using assms unfolding Finite_to_one_def by simp + +lemma Finite_to_oneD[dest]: + "f \ Finite_to_one(X,Y) \ f:X\Y" + "f \ Finite_to_one(X,Y) \ y\Y \ Finite({x\X . f`x = y})" + unfolding Finite_to_one_def by simp_all + +lemma subset_Diff_Un: "X \ A \ A = (A - X) \ X " by auto + +lemma Diff_bij: + assumes "\A\F. X \ A" shows "(\A\F. A-X) \ bij(F, {A-X. A\F})" + using assms unfolding bij_def inj_def surj_def + by (auto intro:lam_type, subst subset_Diff_Un[of X]) auto + +lemma function_space_nonempty: + assumes "b\B" + shows "(\x\A. b) : A \ B" + using assms lam_type by force + +lemma vimage_lam: "(\x\A. f(x)) -`` B = { x\A . f(x) \ B }" + using lam_funtype[of A f, THEN [2] domain_type] + lam_funtype[of A f, THEN [2] apply_equality] lamI[of _ A f] + by auto blast + +lemma range_fun_subset_codomain: + assumes "h:B \ C" + shows "range(h) \ C" + unfolding range_def domain_def converse_def using range_type[OF _ assms] by auto + +lemma Pi_rangeD: + assumes "f\Pi(A,B)" "b \ range(f)" + shows "\a\A. f`a = b" + using assms apply_equality[OF _ assms(1), of _ b] + domain_type[OF _ assms(1)] by auto + +lemma Pi_range_eq: "f \ Pi(A,B) \ range(f) = {f ` x . x \ A}" + using Pi_rangeD[of f A B] apply_rangeI[of f A B] + by blast + +lemma Pi_vimage_subset : "f \ Pi(A,B) \ f-``C \ A" + unfolding Pi_def by auto + +lemma apply_in_range: + assumes + "Ord(\)" "\\0" "f: A \ \" + shows + "f`x\\" +proof (cases "x\A") + case True + from assms \x\A\ + show ?thesis + using domain_of_fun apply_rangeI by simp +next + case False + from assms \x\A\ + show ?thesis + using apply_0 Ord_0_lt ltD domain_of_fun by auto +qed + +lemma range_eq_image: + assumes "f:A\B" + shows "range(f) = f``A" +proof + show "f `` A \ range(f)" + unfolding image_def by blast + { + fix x + assume "x\range(f)" + with assms + have "x\f``A" + using domain_of_fun[of f A "\_. B"] by auto + } + then + show "range(f) \ f `` A" .. +qed + +lemma Image_sub_codomain: "f:A\B \ f``C \ B" + using image_subset fun_is_rel[of _ _ "\_ . B"] by force + +lemma inj_to_Image: + assumes + "f:A\B" "f \ inj(A,B)" + shows + "f \ inj(A,f``A)" + using assms inj_inj_range range_eq_image by force + +lemma inj_imp_surj: + fixes f b + notes inj_is_fun[dest] + defines [simp]: "ifx(x) \ if x\range(f) then converse(f)`x else b" + assumes "f \ inj(B,A)" "b\B" + shows "(\x\A. ifx(x)) \ surj(A,B)" +proof - + from assms + have "converse(f) \ surj(range(f),B)" "range(f) \ A" + "converse(f) : range(f) \ B" + using inj_converse_surj range_fun_subset_codomain surj_is_fun by blast+ + with \b\B\ + show "(\x\A. ifx(x)) \ surj(A,B)" + unfolding surj_def + proof (intro CollectI lam_type ballI; elim CollectE) + fix y + assume "y \ B" "\y\B. \x\range(f). converse(f) ` x = y" + with \range(f) \ A\ + show "\x\A. (\x\A. ifx(x)) ` x = y" + by (drule_tac bspec, auto) + qed simp +qed + +lemma fun_Pi_disjoint_Un: + assumes "f \ Pi(A,B)" "g \ Pi(C,D)" "A \ C = 0" + shows "f \ g \ Pi(A \ C, \x. B(x) \ D(x))" + using assms + by (simp add: Pi_iff extension Un_rls) (unfold function_def, blast) + +lemma Un_restrict_decomposition: + assumes "f \ Pi(A,B)" + shows "f = restrict(f, A \ C) \ restrict(f, A - C)" + using assms +proof (rule fun_extension) + from assms + have "restrict(f,A\C) \ restrict(f,A-C) \ Pi(A\C \ (A-C), \x. B(x)\B(x))" + using restrict_type2[of f A B] + by (rule_tac fun_Pi_disjoint_Un) force+ + moreover + have "(A \ C) \ (A - C) = A" by auto + ultimately + show "restrict(f, A \ C) \ restrict(f, A - C) \ Pi(A, B)" by simp +next + fix x + assume "x \ A" + with assms + show "f ` x = (restrict(f, A \ C) \ restrict(f, A - C)) ` x" + using restrict fun_disjoint_apply1[of _ "restrict(f,_)"] + fun_disjoint_apply2[of _ "restrict(f,_)"] + domain_restrict[of f] apply_0 domain_of_fun + by (cases "x\C") simp_all +qed + +lemma restrict_eq_imp_Un_into_Pi: + assumes "f \ Pi(A,B)" "g \ Pi(C,D)" "restrict(f, A \ C) = restrict(g, A \ C)" + shows "f \ g \ Pi(A \ C, \x. B(x) \ D(x))" +proof - + note assms + moreover from this + have "x \ g \ x \ restrict(g, A \ C)" for x + using restrict_subset[of g "A \ C"] by auto + moreover from calculation + have "x \ f \ x \ restrict(f, A - C) \ x \ restrict(g, A \ C)" for x + by (subst (asm) Un_restrict_decomposition[of f A B "C"]) auto + ultimately + have "f \ g = restrict(f, A - C) \ g" + using restrict_subset[of g "A \ C"] + by (subst Un_restrict_decomposition[of f A B "C"]) auto + moreover + have "A - C \ C = A \ C" by auto + moreover + note assms + ultimately + show ?thesis + using fun_Pi_disjoint_Un[OF + restrict_type2[of f A B "A-C"], of g C D] + by auto +qed + +lemma restrict_eq_imp_Un_into_Pi': + assumes "f \ Pi(A,B)" "g \ Pi(C,D)" + "restrict(f, domain(f) \ domain(g)) = restrict(g, domain(f) \ domain(g))" + shows "f \ g \ Pi(A \ C, \x. B(x) \ D(x))" + using assms domain_of_fun restrict_eq_imp_Un_into_Pi by simp + +lemma restrict_subset_Sigma: "f \ Sigma(C,B) \ restrict(f,A) \ Sigma(A\C, B)" + by (auto simp add: restrict_def) + + +subsection\Finite sets\ + +lemma Replace_sing1: + "\ (\a. P(d,a)) \ (\y y'. P(d,y) \ P(d,y') \ y=y') \ \ \a. {y . x \ {d}, P(x,y)} = {a}" + by blast + +\ \Not really necessary\ +lemma Replace_sing2: + assumes "\a. \ P(d,a)" + shows "{y . x \ {d}, P(x,y)} = 0" + using assms by auto + +lemma Replace_sing3: + assumes "\c e. c \ e \ P(d,c) \ P(d,e)" + shows "{y . x \ {d}, P(x,y)} = 0" +proof - + { + fix z + { + assume "\y. P(d, y) \ y = z" + with assms + have "False" by auto + } + then + have "z \ {y . x \ {d}, P(x,y)}" + using Replace_iff by auto + } + then + show ?thesis + by (intro equalityI subsetI) simp_all +qed + +lemma Replace_Un: "{b . a \ A \ B, Q(a, b)} = + {b . a \ A, Q(a, b)} \ {b . a \ B, Q(a, b)}" + by (intro equalityI subsetI) (auto simp add:Replace_iff) + +lemma Replace_subset_sing: "\z. {y . x \ {d}, P(x,y)} \ {z}" +proof - + consider + (1) "(\a. P(d,a)) \ (\y y'. P(d,y) \ P(d,y') \ y=y')" | + (2) "\a. \ P(d,a)" | (3) "\c e. c \ e \ P(d,c) \ P(d,e)" by auto + then + show "\z. {y . x \ {d}, P(x,y)} \ {z}" + proof (cases) + case 1 + then show ?thesis using Replace_sing1[of P d] by auto + next + case 2 + then show ?thesis by auto + next + case 3 + then show ?thesis using Replace_sing3[of P d] by auto + qed +qed + +lemma Finite_Replace: "Finite(A) \ Finite(Replace(A,Q))" +proof (induct rule:Finite_induct) + case 0 + then + show ?case by simp +next + case (cons x B) + moreover + have "{b . a \ cons(x, B), Q(a, b)} = + {b . a \ B, Q(a, b)} \ {b . a \ {x}, Q(a, b)}" + using Replace_Un unfolding cons_def by auto + moreover + obtain d where "{b . a \ {x}, Q(a, b)} \ {d}" + using Replace_subset_sing[of _ Q] by blast + moreover from this + have "Finite({b . a \ {x}, Q(a, b)})" + using subset_Finite by simp + ultimately + show ?case using subset_Finite by simp +qed + +lemma Finite_domain: "Finite(A) \ Finite(domain(A))" + using Finite_Replace unfolding domain_def + by auto + +lemma Finite_converse: "Finite(A) \ Finite(converse(A))" + using Finite_Replace unfolding converse_def + by auto + +lemma Finite_range: "Finite(A) \ Finite(range(A))" + using Finite_domain Finite_converse unfolding range_def + by blast + +lemma Finite_Sigma: "Finite(A) \ \x. Finite(B(x)) \ Finite(Sigma(A,B))" + unfolding Sigma_def using Finite_RepFun Finite_Union + by simp + +lemma Finite_Pi: "Finite(A) \ \x. Finite(B(x)) \ Finite(Pi(A,B))" + using Finite_Sigma + Finite_Pow subset_Finite[of "Pi(A,B)" "Pow(Sigma(A,B))"] + unfolding Pi_def + by auto + + +subsection\Basic results on equipollence, cardinality and related concepts\ + +lemma lepollD[dest]: "A \ B \ \f. f \ inj(A, B)" + unfolding lepoll_def . + +lemma lepollI[intro]: "f \ inj(A, B) \ A \ B" + unfolding lepoll_def by blast + +lemma eqpollD[dest]: "A \ B \ \f. f \ bij(A, B)" + unfolding eqpoll_def . + +declare bij_imp_eqpoll[intro] + +lemma range_of_subset_eqpoll: + assumes "f \ inj(X,Y)" "S \ X" + shows "S \ f `` S" + using assms restrict_bij by blast + +text\I thank Miguel Pagano for this proof.\ +lemma function_space_eqpoll_cong: + assumes + "A \ A'" "B \ B'" + shows + "A \ B \ A' \ B'" +proof - + from assms(1)[THEN eqpoll_sym] assms(2) + obtain f g where "f \ bij(A',A)" "g \ bij(B,B')" + by blast + then + have "converse(g) : B' \ B" "converse(f): A \ A'" + using bij_converse_bij bij_is_fun by auto + show ?thesis + unfolding eqpoll_def + proof (intro exI fg_imp_bijective, rule_tac [1-2] lam_type) + fix F + assume "F: A \ B" + with \f \ bij(A',A)\ \g \ bij(B,B')\ + show "g O F O f : A' \ B'" + using bij_is_fun comp_fun by blast + next + fix F + assume "F: A' \ B'" + with \converse(g) : B' \ B\ \converse(f): A \ A'\ + show "converse(g) O F O converse(f) : A \ B" + using comp_fun by blast + next + from \f\_\ \g\_\ \converse(f)\_\ \converse(g)\_\ + have "(\x. x \ A' \ B' \ converse(g) O x O converse(f) \ A \ B)" + using bij_is_fun comp_fun by blast + then + have "(\x\A \ B. g O x O f) O (\x\A' \ B'. converse(g) O x O converse(f)) + = (\x\A' \ B' . (g O converse(g)) O x O (converse(f) O f))" + using lam_cong comp_assoc comp_lam[of "A' \ B'" ] by auto + also + have "... = (\x\A' \ B' . id(B') O x O (id(A')))" + using left_comp_inverse[OF bij_is_inj[OF \f\_\]] + right_comp_inverse[OF bij_is_surj[OF \g\_\]] + by auto + also + have "... = (\x\A' \ B' . x)" + using left_comp_id[OF fun_is_rel] right_comp_id[OF fun_is_rel] lam_cong by auto + also + have "... = id(A'\B')" unfolding id_def by simp + finally + show "(\x\A -> B. g O x O f) O (\x\A' -> B'. converse(g) O x O converse(f)) = id(A' -> B')" . + next + from \f\_\ \g\_\ + have "(\x. x \ A \ B \ g O x O f \ A' \ B')" + using bij_is_fun comp_fun by blast + then + have "(\x\A' -> B'. converse(g) O x O converse(f)) O (\x\A -> B. g O x O f) + = (\x\A \ B . (converse(g) O g) O x O (f O converse(f)))" + using comp_lam comp_assoc by auto + also + have "... = (\x\A \ B . id(B) O x O (id(A)))" + using + right_comp_inverse[OF bij_is_surj[OF \f\_\]] + left_comp_inverse[OF bij_is_inj[OF \g\_\]] lam_cong + by auto + also + have "... = (\x\A \ B . x)" + using left_comp_id[OF fun_is_rel] right_comp_id[OF fun_is_rel] lam_cong by auto + also + have "... = id(A\B)" unfolding id_def by simp + finally + show "(\x\A' \ B'. converse(g) O x O converse(f)) O (\x\A -> B. g O x O f) = id(A -> B)" . + qed +qed + +lemma curry_eqpoll: + fixes d \1 \2 \ + shows "\1 \ \2 \ \ \ \1 \ \2 \ \" + unfolding eqpoll_def +proof (intro exI, rule lam_bijective, + rule_tac [1-2] lam_type, rule_tac [2] lam_type) + fix f z + assume "f : \1 \ \2 \ \" "z \ \1 \ \2" + then + show "f`fst(z)`snd(z) \ \" + by simp +next + fix f x y + assume "f : \1 \ \2 \ \" "x\\1" "y\\2" + then + show "f`\x,y\ \ \" by simp +next \ \one composition is the identity:\ + fix f + assume "f : \1 \ \2 \ \" + then + show "(\x\\1 \ \2. (\x\\1. \xa\\2. f ` \x, xa\) ` fst(x) ` snd(x)) = f" + by (auto intro:fun_extension) +qed simp \ \the other composition follows automatically\ + +lemma Pow_eqpoll_function_space: + fixes d X + notes bool_of_o_def [simp] + defines [simp]:"d(A) \ (\x\X. bool_of_o(x\A))" + \ \the witnessing map for the thesis:\ + shows "Pow(X) \ X \ 2" + unfolding eqpoll_def +proof (intro exI, rule lam_bijective) + \ \We give explicit mutual inverses\ + fix A + assume "A\Pow(X)" + then + show "d(A) : X \ 2" + using lam_type[of _ "\x. bool_of_o(x\A)" "\_. 2"] + by force + from \A\Pow(X)\ + show "{y\X. d(A)`y = 1} = A" + by (auto) +next + fix f + assume "f: X\2" + then + show "d({y \ X . f ` y = 1}) = f" + using apply_type[OF \f: X\2\] + by (force intro:fun_extension) +qed blast + +lemma cantor_inj: "f \ inj(Pow(A),A)" + using inj_imp_surj[OF _ Pow_bottom] cantor_surj by blast + +definition + cexp :: "[i,i] \ i" ("_\<^bsup>\_\<^esup>" [76,1] 75) where + "\\<^bsup>\\\<^esup> \ |\ \ \|" + +lemma Card_cexp: "Card(\\<^bsup>\\\<^esup>)" + unfolding cexp_def Card_cardinal by simp + +lemma eq_csucc_ord: + "Ord(i) \ i\<^sup>+ = |i|\<^sup>+" + using Card_lt_iff Least_cong unfolding csucc_def by auto + +text\I thank Miguel Pagano for this proof.\ +lemma lesspoll_csucc: + assumes "Ord(\)" + shows "d \ \\<^sup>+ \ d \ \" +proof + assume "d \ \\<^sup>+" + moreover + note Card_is_Ord \Ord(\)\ + moreover from calculation + have "\ < \\<^sup>+" "Card(\\<^sup>+)" + using Ord_cardinal_eqpoll csucc_basic by simp_all + moreover from calculation + have "d \ |\|\<^sup>+" "Card(|\|)" "d \ |d|" + using eq_csucc_ord[of \] lesspoll_imp_eqpoll eqpoll_sym by simp_all + moreover from calculation + have "|d| < |\|\<^sup>+" + using lesspoll_cardinal_lt csucc_basic by simp + moreover from calculation + have "|d| \ |\|" + using Card_lt_csucc_iff le_imp_lepoll by simp + moreover from calculation + have "|d| \ \" + using lepoll_eq_trans Ord_cardinal_eqpoll by simp + ultimately + show "d \ \" + using eq_lepoll_trans by simp +next + from \Ord(\)\ + have "\ < \\<^sup>+" "Card(\\<^sup>+)" + using csucc_basic by simp_all + moreover + assume "d \ \" + ultimately + have "d \ \\<^sup>+" + using le_imp_lepoll leI lepoll_trans by simp + moreover + from \d \ \\ \Ord(\)\ + have "\\<^sup>+ \ \" if "d \ \\<^sup>+" + using eqpoll_sym[OF that] eq_lepoll_trans[OF _ \d\\\] by simp + moreover from calculation \Card(_)\ + have "\ d \ \\<^sup>+" + using lesspoll_irrefl lesspoll_trans1 lt_Card_imp_lesspoll[OF _ \\ <_\] + by auto + ultimately + show "d \ \\<^sup>+" + unfolding lesspoll_def by simp +qed + +abbreviation + Infinite :: "i\o" where + "Infinite(X) \ \ Finite(X)" + +lemma Infinite_not_empty: "Infinite(X) \ X \ 0" + using empty_lepollI by auto + +lemma Infinite_imp_nats_lepoll: + assumes "Infinite(X)" "n \ \" + shows "n \ X" + using \n \ \\ +proof (induct) + case 0 + then + show ?case using empty_lepollI by simp +next + case (succ x) + show ?case + proof - + from \Infinite(X)\ and \x \ \\ + have "\ (x \ X)" + using eqpoll_sym unfolding Finite_def by auto + with \x \ X\ + obtain f where "f \ inj(x,X)" "f \ surj(x,X)" + unfolding bij_def eqpoll_def by auto + moreover from this + obtain b where "b \ X" "\a\x. f`a \ b" + using inj_is_fun unfolding surj_def by auto + ultimately + have "f \ inj(x,X-{b})" + unfolding inj_def by (auto intro:Pi_type) + then + have "cons(\x, b\, f) \ inj(succ(x), cons(b, X - {b}))" + using inj_extend[of f x "X-{b}" x b] unfolding succ_def + by (auto dest:mem_irrefl) + moreover from \b\X\ + have "cons(b, X - {b}) = X" by auto + ultimately + show "succ(x) \ X" by auto + qed +qed + +lemma zero_lesspoll: assumes "0<\" shows "0 \ \" + using assms eqpoll_0_iff[THEN iffD1, of \] eqpoll_sym + unfolding lesspoll_def lepoll_def + by (auto simp add:inj_def) + +lemma lepoll_nat_imp_Infinite: "\ \ X \ Infinite(X)" +proof (rule ccontr, simp) + assume "\ \ X" "Finite(X)" + moreover from this + obtain n where "X \ n" "n \ \" + unfolding Finite_def by auto + moreover from calculation + have "\ \ n" + using lepoll_eq_trans by simp + ultimately + show "False" + using lepoll_nat_imp_Finite nat_not_Finite by simp +qed + +lemma InfCard_imp_Infinite: "InfCard(\) \ Infinite(\)" + using le_imp_lepoll[THEN lepoll_nat_imp_Infinite, of \] + unfolding InfCard_def by simp + +lemma lt_surj_empty_imp_Card: + assumes "Ord(\)" "\\. \ < \ \ surj(\,\) = 0" + shows "Card(\)" +proof - + { + assume "|\| < \" + with assms + have "False" + using LeastI[of "\i. i \ \" \, OF eqpoll_refl] + Least_le[of "\i. i \ \" "|\|", OF Ord_cardinal_eqpoll] + unfolding Card_def cardinal_def eqpoll_def bij_def + by simp + } + with assms + show ?thesis + using Ord_cardinal_le[of \] not_lt_imp_le[of "|\|" \] le_anti_sym + unfolding Card_def by auto +qed + + +subsection\Morphisms of binary relations\ + +text\The main case of interest is in the case of partial orders.\ + +lemma mono_map_mono: + assumes + "f \ mono_map(A,r,B,s)" "B \ C" + shows + "f \ mono_map(A,r,C,s)" + unfolding mono_map_def +proof (intro CollectI ballI impI) + from \f \ mono_map(A,_,B,_)\ + have "f: A \ B" + using mono_map_is_fun by simp + with \B\C\ + show "f: A \ C" + using fun_weaken_type by simp + fix x y + assume "x\A" "y\A" "\x,y\ \ r" + moreover from this and \f: A \ B\ + have "f`x \ B" "f`y \ B" + using apply_type by simp_all + moreover + note \f \ mono_map(_,r,_,s)\ + ultimately + show "\f ` x, f ` y\ \ s" + unfolding mono_map_def by blast +qed + +lemma ordertype_zero_imp_zero: "ordertype(A,r) = 0 \ A = 0" + using ordermap_type[of A r] + by (cases "A=0") auto + +lemma mono_map_increasing: + "j\mono_map(A,r,B,s) \ a\A \ c\A \ \a,c\\r \ \j`a,j`c\\s" + unfolding mono_map_def by simp + +lemma linear_mono_map_reflects: + assumes + "linear(\,r)" "trans[\](s)" "irrefl(\,s)" "f\mono_map(\,r,\,s)" + "x\\" "y\\" "\f`x,f`y\\s" + shows + "\x,y\\r" +proof - + from \f\mono_map(_,_,_,_)\ + have preserves:"x\\ \ y\\ \ \x,y\\r \ \f`x,f`y\\s" for x y + unfolding mono_map_def by blast + { + assume "\x, y\ \ r" "x\\" "y\\" + moreover + note \\f`x,f`y\\s\ and \linear(\,r)\ + moreover from calculation + have "y = x \ \y,x\\r" + unfolding linear_def by blast + moreover + note preserves [of y x] + ultimately + have "y = x \ \f`y, f`x\\ s" by blast + moreover from \f\mono_map(_,_,\,_)\ \x\\\ \y\\\ + have "f`x\\" "f`y\\" + using apply_type[OF mono_map_is_fun] by simp_all + moreover + note \\f`x,f`y\\s\ \trans[\](s)\ \irrefl(\,s)\ + ultimately + have "False" + using trans_onD[of \ s "f`x" "f`y" "f`x"] irreflE by blast + } + with assms + show "\x,y\\r" by blast +qed + +lemma irrefl_Memrel: "irrefl(x, Memrel(x))" + unfolding irrefl_def using mem_irrefl by auto + +lemmas Memrel_mono_map_reflects = linear_mono_map_reflects + [OF well_ord_is_linear[OF well_ord_Memrel] well_ord_is_trans_on[OF well_ord_Memrel] + irrefl_Memrel] + +\ \Same proof as Paulson's @{thm mono_map_is_inj}\ +lemma mono_map_is_inj': + "\ linear(A,r); irrefl(B,s); f \ mono_map(A,r,B,s) \ \ f \ inj(A,B)" + unfolding irrefl_def mono_map_def inj_def using linearE + by (clarify, rename_tac x w) + (erule_tac x=w and y=x in linearE, assumption+, (force intro: apply_type)+) + +lemma mono_map_imp_ord_iso_image: + assumes + "linear(\,r)" "trans[\](s)" "irrefl(\,s)" "f\mono_map(\,r,\,s)" + shows + "f \ ord_iso(\,r,f``\,s)" + unfolding ord_iso_def +proof (intro CollectI ballI iffI) + \ \Enough to show it's bijective and preserves both ways\ + from assms + have "f \ inj(\,\)" + using mono_map_is_inj' by blast + moreover from \f \ mono_map(_,_,_,_)\ + have "f \ surj(\, f``\)" + unfolding mono_map_def using surj_image by auto + ultimately + show "f \ bij(\, f``\)" + unfolding bij_def using inj_is_fun inj_to_Image by simp + from \f\mono_map(_,_,_,_)\ + show "x\\ \ y\\ \ \x,y\\r \ \f`x,f`y\\s" for x y + unfolding mono_map_def by blast + with assms + show "\f`x,f`y\\s \ x\\ \ y\\ \ \x,y\\r" for x y + using linear_mono_map_reflects + by blast +qed + +text\We introduce the following notation for strictly increasing maps +between ordinals.\ + +abbreviation + mono_map_Memrel :: "[i,i] \ i" (infixr \\\<^sub><\ 60) where + "\ \\<^sub>< \ \ mono_map(\,Memrel(\),\,Memrel(\))" + +lemma mono_map_imp_ord_iso_Memrel: + assumes + "Ord(\)" "Ord(\)" "f:\ \\<^sub>< \" + shows + "f \ ord_iso(\,Memrel(\),f``\,Memrel(\))" + using assms mono_map_imp_ord_iso_image[OF well_ord_is_linear[OF well_ord_Memrel] + well_ord_is_trans_on[OF well_ord_Memrel] irrefl_Memrel] by blast + +lemma mono_map_ordertype_image': + assumes + "X\\" "Ord(\)" "Ord(\)" "f \ mono_map(X,Memrel(\),\,Memrel(\))" + shows + "ordertype(f``X,Memrel(\)) = ordertype(X,Memrel(\))" + using assms mono_map_is_fun[of f X _ \] ordertype_eq + mono_map_imp_ord_iso_image[OF well_ord_is_linear[OF well_ord_Memrel, THEN linear_subset] + well_ord_is_trans_on[OF well_ord_Memrel] irrefl_Memrel, of \ X \ f] + well_ord_subset[OF well_ord_Memrel] Image_sub_codomain[of f X \ X] by auto + +lemma mono_map_ordertype_image: + assumes + "Ord(\)" "Ord(\)" "f:\ \\<^sub>< \" + shows + "ordertype(f``\,Memrel(\)) = \" + using assms mono_map_is_fun ordertype_Memrel ordertype_eq[of f \ "Memrel(\)"] + mono_map_imp_ord_iso_Memrel well_ord_subset[OF well_ord_Memrel] Image_sub_codomain[of _ \] + by auto + +lemma apply_in_image: "f:A\B \ a\A \ f`a \ f``A" + using range_eq_image apply_rangeI[of f] by simp + +lemma Image_subset_Ord_imp_lt: + assumes + "Ord(\)" "h``A \ \" "x\domain(h)" "x\A" "function(h)" + shows + "h`x < \" + using assms + unfolding domain_def using imageI ltI function_apply_equality by auto + +lemma ordermap_le_arg: + assumes + "X\\" "x\X" "Ord(\)" + shows + "x\X \ ordermap(X,Memrel(\))`x\x" +proof (induct rule:Ord_induct[OF subsetD, OF assms]) + case (1 x) + have "wf[X](Memrel(\))" + using wf_imp_wf_on[OF wf_Memrel] . + with 1 + have "ordermap(X,Memrel(\))`x = {ordermap(X,Memrel(\))`y . y\{y\X . y\x \ y\\}}" + using ordermap_unfold Ord_trans[of _ x \] by auto + also from assms + have "... = {ordermap(X,Memrel(\))`y . y\{y\X . y\x}}" + using Ord_trans[of _ x \] Ord_in_Ord by blast + finally + have ordm:"ordermap(X,Memrel(\))`x = {ordermap(X,Memrel(\))`y . y\{y\X . y\x}}" . + from 1 + have "y\x \ y\X \ ordermap(X,Memrel(\))`y \ y" for y by simp + with \x\\\ and \Ord(\)\ + have "y\x \ y\X \ ordermap(X,Memrel(\))`y \ x" for y + using ltI[OF _ Ord_in_Ord[of \ x]] lt_trans1 ltD by blast + with ordm + have "ordermap(X,Memrel(\))`x \ x" by auto + with \x\X\ assms + show ?case + using subset_imp_le Ord_in_Ord[of \ x] Ord_ordermap + well_ord_subset[OF well_ord_Memrel, of \] by force +qed + +lemma subset_imp_ordertype_le: + assumes + "X\\" "Ord(\)" + shows + "ordertype(X,Memrel(\))\\" +proof - + { + fix x + assume "x\X" + with assms + have "ordermap(X,Memrel(\))`x \ x" + using ordermap_le_arg by simp + with \x\X\ and assms + have "ordermap(X,Memrel(\))`x \ \" (is "?y \ _") + using ltD[of ?y "succ(x)"] Ord_trans[of ?y x \] by auto + } + then + have "ordertype(X, Memrel(\)) \ \" + using ordertype_unfold[of X] by auto + with assms + show ?thesis + using subset_imp_le Ord_ordertype[OF well_ord_subset, OF well_ord_Memrel] by simp +qed + +lemma mono_map_imp_le: + assumes + "f\mono_map(\, Memrel(\),\, Memrel(\))" "Ord(\)" "Ord(\)" + shows + "\\\" +proof - + from assms + have "f \ \\, Memrel(\)\ \ \f``\, Memrel(\)\" + using mono_map_imp_ord_iso_Memrel by simp + then + have "converse(f) \ \f``\, Memrel(\)\ \ \\, Memrel(\)\" + using ord_iso_sym by simp + with \Ord(\)\ + have "\ = ordertype(f``\,Memrel(\))" + using ordertype_eq well_ord_Memrel ordertype_Memrel by auto + also from assms + have "ordertype(f``\,Memrel(\)) \ \" + using subset_imp_ordertype_le mono_map_is_fun[of f] Image_sub_codomain[of f] by force + finally + show ?thesis . +qed + +\ \\<^term>\Ord(A) \ f \ mono_map(A, Memrel(A), B, Memrel(Aa)) \ f \ inj(A, B)\\ +lemmas Memrel_mono_map_is_inj = mono_map_is_inj + [OF well_ord_is_linear[OF well_ord_Memrel] + wf_imp_wf_on[OF wf_Memrel]] + +lemma mono_mapI: + assumes "f: A\B" "\x y. x\A \ y\A \ \x,y\\r \ \f`x,f`y\\s" + shows "f \ mono_map(A,r,B,s)" + unfolding mono_map_def using assms by simp + +lemmas mono_mapD = mono_map_is_fun mono_map_increasing + +bundle mono_map_rules = mono_mapI[intro!] mono_map_is_fun[dest] mono_mapD[dest] + +lemma nats_le_InfCard: + assumes "n \ \" "InfCard(\)" + shows "n \ \" + using assms Ord_is_Transset + le_trans[of n \ \, OF le_subset_iff[THEN iffD2]] + unfolding InfCard_def Transset_def by simp + +lemma nat_into_InfCard: + assumes "n \ \" "InfCard(\)" + shows "n \ \" + using assms le_imp_subset[of \ \] + unfolding InfCard_def by auto + + +subsection\Alephs are infinite cardinals\ + +lemma Aleph_zero_eq_nat: "\\<^bsub>0\<^esub> = \" + unfolding Aleph_def by simp + +lemma InfCard_Aleph: + notes Aleph_zero_eq_nat[simp] + assumes "Ord(\)" + shows "InfCard(\\<^bsub>\\<^esub>)" +proof - + have "\ (\\<^bsub>\\<^esub> \ \)" + proof (cases "\=0") + case True + then show ?thesis using mem_irrefl by auto + next + case False + with \Ord(\)\ + have "\ \ \\<^bsub>\\<^esub>" using Ord_0_lt[of \] ltD by (auto dest:Aleph_increasing) + then show ?thesis using foundation by blast + qed + with \Ord(\)\ + have "\ (|\\<^bsub>\\<^esub>| \ \)" + using Card_cardinal_eq by auto + then + have "\ Finite(\\<^bsub>\\<^esub>)" by auto + with \Ord(\)\ + show ?thesis + using Inf_Card_is_InfCard by simp +qed + +lemmas Limit_Aleph = InfCard_Aleph[THEN InfCard_is_Limit] + +lemmas Aleph_cont = Normal_imp_cont[OF Normal_Aleph] +lemmas Aleph_sup = Normal_Union[OF _ _ Normal_Aleph] + +bundle Ord_dests = Limit_is_Ord[dest] Card_is_Ord[dest] +bundle Aleph_dests = Aleph_cont[dest] Aleph_sup[dest] +bundle Aleph_intros = Aleph_increasing[intro!] +bundle Aleph_mem_dests = Aleph_increasing[OF ltI, THEN ltD, dest] + + +end \ No newline at end of file diff --git a/thys/Delta_System_Lemma/document/header-delta-system.tex b/thys/Delta_System_Lemma/document/header-delta-system.tex new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/document/header-delta-system.tex @@ -0,0 +1,295 @@ +\usepackage[utf8]{inputenc} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{bbm} % Para el \bb{1} +\usepackage{multidef} +\usepackage{verbatim} +\usepackage{stmaryrd} %% para \llbracket +% \usepackage{hyperref} +\usepackage{xcolor} +\usepackage{framed} + +%% +%% \usepackage[bottom=2cm, top=2cm, left=2cm, right=2cm]{geometry} +%% \usepackage{titling} +%% \setlength{\droptitle}{-10ex} +%% +\renewcommand{\o}{\vee} +\renewcommand{\O}{\bigvee} +\newcommand{\y}{\wedge} +\newcommand{\Y}{\bigwedge} +\newcommand{\limp}{\longrightarrow} +\newcommand{\lsii}{\longleftrightarrow} +%% +%\newcommand{\DeclareMathOperator}[2]{\newcommand{#1}{\mathop{\mathrm{#2}}}} + +\DeclareMathOperator{\cf}{cf} +\DeclareMathOperator{\dom}{domain} +\DeclareMathOperator{\im}{img} +\DeclareMathOperator{\Fn}{Fn} +\DeclareMathOperator{\rk}{rk} +\DeclareMathOperator{\mos}{mos} +\DeclareMathOperator{\trcl}{trcl} +\DeclareMathOperator{\Con}{Con} +\DeclareMathOperator{\Club}{Club} + + +\newcommand{\modelo}[1]{\mathbf{#1}} +\newcommand{\axiomas}[1]{\mathit{#1}} +\newcommand{\clase}[1]{\mathsf{#1}} +\newcommand{\poset}[1]{\mathbb{#1}} +\newcommand{\operador}[1]{\mathbf{#1}} + +%% \newcommand{\Lim}{\clase{Lim}} +%% \newcommand{\Reg}{\clase{Reg}} +%% \newcommand{\Card}{\clase{Card}} +%% \newcommand{\On}{\clase{On}} +%% \newcommand{\WF}{\clase{WF}} +%% \newcommand{\HF}{\clase{HF}} +%% \newcommand{\HC}{\clase{HC}} +%% +%% El siguiente comando reemplaza todos los anteriores: +%% +\multidef{\clase{#1}}{Card,HC,HF,Lim,On->Ord,Reg,WF,Ord} +\newcommand{\ON}{\On} + +%% En lugar de usar todo el paquete bbm: +\DeclareMathAlphabet{\mathbbm}{U}{bbm}{m}{n} +\newcommand{\1}{\mathbbm{1}} +\newcommand{\PP}{\mathbbm{P}} + +%% +%% \newcommand{\calD}{\mathcal{D}} +%% \newcommand{\calS}{\mathcal{S}} +%% \newcommand{\calU}{\mathcal{U}} +%% \newcommand{\calB}{\mathcal{B}} +%% \newcommand{\calL}{\mathcal{L}} +%% \newcommand{\calF}{\mathcal{F}} +%% \newcommand{\calT}{\mathcal{T}} +%% \newcommand{\calW}{\mathcal{W}} +%% \newcommand{\calA}{\mathcal{A}} +%% +%% El siguiente comando reemplaza todos los anteriores: +%% +\multidef[prefix=cal]{\mathcal{#1}}{A-Z} +%% +%% \newcommand{\A}{\modelo{A}} +%% \newcommand{\BB}{\modelo{B}} +%% \newcommand{\ZZ}{\modelo{Z}} +%% \newcommand{\PP}{\modelo{P}} +%% \newcommand{\QQ}{\modelo{Q}} +%% \newcommand{\RR}{\modelo{R}} +%% +%% El siguiente comando reemplaza todos los anteriores: +%% +\multidef{\modelo{#1}}{A,BB->B,CC->C,NN->N,QQ->Q,RR->R,ZZ->Z} + +\multidef[prefix=p]{\mathbb{#1}}{A-Z} +%% \newcommand{\B}{\modelo{B}} +%% \newcommand{\C}{\modelo{C}} +%% \newcommand{\F}{\modelo{F}} +%% \newcommand{\D}{\modelo{D}} + +\newcommand{\Th}{\mb{Th}} +\newcommand{\Mod}{\mb{Mod}} + +\newcommand{\Se}{\operador{S^\prec}} +\newcommand{\Pu}{\operador{P_u}} +\renewcommand{\Pr}{\operador{P_R}} +\renewcommand{\H}{\operador{H}} +\renewcommand{\S}{\operador{S}} +\newcommand{\I}{\operador{I}} +\newcommand{\E}{\operador{E}} + +\newcommand{\se}{\preccurlyeq} +\newcommand{\ee}{\succ} +\newcommand{\id}{\approx} +\newcommand{\subm}{\subseteq} +\newcommand{\ext}{\supseteq} +\newcommand{\iso}{\cong} +%% +\renewcommand{\emptyset}{\varnothing} +\newcommand{\rel}{\mathcal{R}} +\newcommand{\Pow}{\mathop{\mathcal{P}}} +\renewcommand{\P}{\Pow} +\newcommand{\BP}{\mathrm{BP}} +\newcommand{\func}{\rightarrow} +\newcommand{\ord}{\mathrm{Ord}} +\newcommand{\R}{\mathbb{R}} +\newcommand{\N}{\mathbb{N}} +\newcommand{\Z}{\mathbb{Z}} +\renewcommand{\I}{\mathbb{I}} +\newcommand{\Q}{\mathbb{Q}} +\newcommand{\B}{\mathbf{B}} +\newcommand{\lb}{\langle} +\newcommand{\rb}{\rangle} +\newcommand{\impl}{\rightarrow} +\newcommand{\ent}{\Rightarrow} +\newcommand{\tne}{\Leftarrow} +\newcommand{\sii}{\Leftrightarrow} +\renewcommand{\phi}{\varphi} +\newcommand{\phis}{{\varphi^*}} +\renewcommand{\th}{\theta} +\newcommand{\Lda}{\Lambda} +\newcommand{\La}{\Lambda} +\newcommand{\lda}{\lambda} +\newcommand{\ka}{\kappa} +\newcommand{\del}{\delta} +\newcommand{\de}{\delta} +\newcommand{\ze}{\zeta} +%\newcommand{\ }{\ } +\newcommand{\la}{\lambda} +\newcommand{\al}{\alpha} +\newcommand{\be}{\beta} +\newcommand{\ga}{\gamma} +\newcommand{\Ga}{\Gamma} +\newcommand{\ep}{\varepsilon} +\newcommand{\De}{\Delta} +\newcommand{\defi}{\mathrel{\mathop:}=} +\newcommand{\forces}{\Vdash} +%\newcommand{\ap}{\mathbin{\wideparen{\ }}} +\newcommand{\Tree}{{\mathrm{Tr}_\N}} +\newcommand{\PTree}{{\mathrm{PTr}_\N}} +\newcommand{\NWO}{\mathit{NWO}} +\newcommand{\Suc}{{\N^{<\N}}}% +\newcommand{\init}{\mathsf{i}} +\newcommand{\ap}{\mathord{^\smallfrown}} +\newcommand{\Cantor}{\mathcal{C}} +%\newcommand{\C}{\Cantor} +\newcommand{\Baire}{\mathcal{N}} +\newcommand{\sig}{\ensuremath{\sigma}} +\newcommand{\fsig}{\ensuremath{F_\sigma}} +\newcommand{\gdel}{\ensuremath{G_\delta}} +\newcommand{\Sig}{\ensuremath{\boldsymbol{\Sigma}}} +\newcommand{\bPi}{\ensuremath{\boldsymbol{\Pi}}} +\newcommand{\Del}{\ensuremath{\boldsymbol\Delta}} +%\renewcommand{\F}{\operador{F}} +\newcommand{\ths}{{\theta^*}} +\newcommand{\om}{\ensuremath{\omega}} +%\renewcommand{\c}{\complement} +\newcommand{\comp}{\mathsf{c}} +\newcommand{\co}[1]{\left(#1\right)^\comp} +\newcommand{\len}[1]{\left|#1\right|} +\DeclareMathOperator{\tlim}{\overline{\mathrm{TLim}}} +\newcommand{\card}[1]{{\left|#1\right|}} +\newcommand{\bigcard}[1]{{\bigl|#1\bigr|}} +% +% Cardinality +% +\newcommand{\lec}{\leqslant_c} +\newcommand{\gec}{\geqslant_c} +\newcommand{\lc}{<_c} +\newcommand{\gc}{>_c} +\newcommand{\eqc}{=_c} +\newcommand{\biy}{\approx} +\newcommand*{\ale}[1]{\aleph_{#1}} +% +\newcommand{\Zerm}{\axiomas{Z}} +\newcommand{\ZC}{\axiomas{ZC}} +\newcommand{\AC}{\axiomas{AC}} +\newcommand{\DC}{\axiomas{DC}} +\newcommand{\MA}{\axiomas{MA}} +\newcommand{\CH}{\axiomas{CH}} +\newcommand{\ZFC}{\axiomas{ZFC}} +\newcommand{\ZF}{\axiomas{ZF}} +\newcommand{\Inf}{\axiomas{Inf}} +% +% Cardinal characteristics +% +\newcommand{\cont}{\mathfrak{c}} +\newcommand{\spl}{\mathfrak{s}} +\newcommand{\bound}{\mathfrak{b}} +\newcommand{\mad}{\mathfrak{a}} +\newcommand{\tower}{\mathfrak{t}} +% +\renewcommand{\hom}[2]{{}^{#1}\hskip-0.116ex{#2}} +\newcommand{\pred}[1][{}]{\mathop{\mathrm{pred}_{#1}}} +%% Postfix operator with supressable space: +%% \newcommand*{\iseg}{\relax\ifnum\lastnodetype>0 \mskip\medmuskip\fi{\downarrow}} % +\newcommand*{\iseg}{{\downarrow}} +\newcommand{\rr}{\mathrel{R}} +\newcommand{\restr}{\upharpoonright} +%\newcommand{\type}{\mathtt{}} +\newcommand{\app}{\mathop{\mathrm{Aprox}}} +\newcommand{\hess}{\triangleleft} +\newcommand{\bx}{\bar{x}} +\newcommand{\by}{\bar{y}} +\newcommand{\bz}{\bar{z}} +\newcommand{\union}{\mathop{\textstyle\bigcup}} +\newcommand{\sm}{\setminus} +\newcommand{\sbq}{\subseteq} +\newcommand{\nsbq}{\subseteq} +\newcommand{\mty}{\emptyset} +\newcommand{\dimg}{\text{\textup{``}}} % direct image +\newcommand{\quine}[1]{\ulcorner{\!#1\!}\urcorner} +%\newcommand{\ntrm}[1]{\textsl{\textbf{#1}}} +\newcommand{\Null}{\calN\!\mathit{ull}} +\DeclareMathOperator{\club}{Club} +\DeclareMathOperator{\otp}{otp} +\DeclareMathOperator{\val}{\mathit{val}} +\DeclareMathOperator{\chk}{\mathit{check}} +\DeclareMathOperator{\edrel}{\mathit{edrel}} +\DeclareMathOperator{\eclose}{\mathit{eclose}} +\DeclareMathOperator{\Memrel}{\mathit{Memrel}} +\renewcommand{\PP}{\mathbb{P}} +\renewcommand{\app}{\mathrm{App}} +\newcommand{\formula}{\isatt{formula}} +\newcommand{\tyi}{\isatt{i}} +\newcommand{\tyo}{\isatt{o}} +\newcommand{\forceisa}{\mathop{\mathtt{forces}}} +\newcommand{\equ}{\mathbf{e}} +\newcommand{\bel}{\mathbf{b}} +\newcommand{\atr}{\mathit{atr}} +\newcommand{\concat}{\mathbin{@}} +\newcommand{\dB}[1]{\mathbf{#1}} +\newcommand{\ed}{\mathrel{\isatt{ed}}} +\newcommand{\frecR}{\mathrel{\isatt{frecR}}} +\newcommand{\forceseq}{\mathop{\isatt{forces{\isacharunderscore}eq}}} +\newcommand{\forcesmem}{\mathop{\isatt{forces{\isacharunderscore}mem}}} +\newcommand{\forcesat}{\mathop{\isatt{forces{\isacharunderscore}at}}} +\newcommand{\pleq}{\preceq} + + +%%%%%%%%%%%%%%%%%%%%%%%%% +% Variant aleph, beth, etc +% From http://tex.stackexchange.com/q/170476/69595 +\makeatletter +\@ifpackageloaded{txfonts}\@tempswafalse\@tempswatrue +\if@tempswa + \DeclareFontFamily{U}{txsymbols}{} + \DeclareFontFamily{U}{txAMSb}{} + \DeclareSymbolFont{txsymbols}{OMS}{txsy}{m}{n} + \SetSymbolFont{txsymbols}{bold}{OMS}{txsy}{bx}{n} + \DeclareFontSubstitution{OMS}{txsy}{m}{n} + \DeclareSymbolFont{txAMSb}{U}{txsyb}{m}{n} + \SetSymbolFont{txAMSb}{bold}{U}{txsyb}{bx}{n} + \DeclareFontSubstitution{U}{txsyb}{m}{n} + \DeclareMathSymbol{\aleph}{\mathord}{txsymbols}{64} + \DeclareMathSymbol{\beth}{\mathord}{txAMSb}{105} + \DeclareMathSymbol{\gimel}{\mathord}{txAMSb}{106} + \DeclareMathSymbol{\daleth}{\mathord}{txAMSb}{107} +\fi +\makeatother + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Theorem Environments +%% +% \newtheorem{theorem}{Theorem} +% \newtheorem{lemma}[theorem]{Lemma} +% \newtheorem{prop}[theorem]{Proposition} +% \newtheorem{corollary}[theorem]{Corollary} +% \newtheorem{claim}{Claim} +% \newtheorem*{claim*}{Claim} +% \theoremstyle{definition} +% \newtheorem{definition}[theorem]{Definition} +% \newtheorem{remark}[theorem]{Remark} +% \newtheorem{example}[theorem]{Example} +% \theoremstyle{remark} +% \newtheorem*{remark*}{Remark} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% \newenvironment{inducc}{\begin{list}{}{\itemindent=2.5em \labelwidth=4em}}{\end{list}} +%% \newcommand{\caso}[1]{\item[\fbox{#1}]} +\newenvironment{proofofclaim}{\begin{proof}[Proof of Claim]}{\end{proof}} diff --git a/thys/Delta_System_Lemma/document/multidef.sty b/thys/Delta_System_Lemma/document/multidef.sty new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/document/multidef.sty @@ -0,0 +1,133 @@ +%% +%% This is file `multidef.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% multidef.dtx (with options: `package') +%% +%% (c) 2016/03/14 Nicolas Markey +%% +%% This work may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3 of this license +%% or (at your option) any later version. The latest version of this +%% license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% The Current Maintainer of this work is Nicolas Markey. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +\RequirePackage{xkeyval} +\define@boolkeys{mdef}{noerr,nowarn}[true] +\DeclareOptionX{noerr}[true]{\setkeys{mdef}{noerr=#1}} +\DeclareOptionX{nowarn}[true]{\setkeys{mdef}{nowarn=#1}} +\ExecuteOptionsX{noerr=false,nowarn=false} +\ProcessOptionsX +\ifKV@mdef@noerr +\presetkeys{mdef}{noerr=true}{} +\else +\presetkeys{mdef}{noerr=false}{} +\fi +\ifKV@mdef@nowarn +\presetkeys{mdef}{nowarn=true}{} +\else +\presetkeys{mdef}{nowarn=false}{} +\fi +\define@key{mdef}{prefix}{\def\@mdprefix{#1}} +\define@key{mdef}{p}{\def\@mdprefix{#1}} +\define@key{mdef}{suffix}{\def\@mdsuffix{#1}} +\define@key{mdef}{s}{\def\@mdsuffix{#1}} +\define@key{mdef}{arg}{\def\@mdargs{#1}} +\define@key{mdef}{args}{\def\@mdargs{#1}} +\define@boolkeys{mdef}{long,global}[true] +\presetkeys{mdef} + {p=,s=,prefix=,suffix=,long=false,global=false,arg=0,args=0}{} +\def\@mdef@az{a-z} +\def\@mdef@AZ{A-Z} +\def\@mdef@alphabet{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z} +\def\@mdef@Alphabet{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z} +\newcommand\multidef[3][]{% + \setkeys{mdef}{#1}% + \def\@mdef@com##1{#2}% + \@mdef#3,\@end} +\def\@mdef #1,#2\@end{\expandafter\def\expandafter\@arg + \expandafter{\romannumeral-\expandafter`\expandafter\.#1}% + \ifx\@arg\@mdef@az + \expandafter\@mdef \@mdef@alphabet,\@end + \else + \ifx\@arg\@mdef@AZ + \expandafter\@mdef \@mdef@Alphabet,\@end + \else + \expandafter\@@mdef\@arg->->->\@end + \fi + \fi + \def\@arg{#2}% + \ifx\@arg\@empty\else\@mdef #2\@end\fi} +\newtoks\@mdef@redeftok +\def\@mdef@comma{} +\def\@@mdef#1->#2->#3\@end{% + \@ifundefined{\@mdprefix#1\@mdsuffix} + {\@@@mdef{#1}{#2}} + {\edef\@mdef@redef{\the\@mdef@redeftok\@mdef@comma + \@backslashchar\@mdprefix#1\@mdsuffix} + \def\@mdef@comma{, } + \@mdef@redeftok=\expandafter{\@mdef@redef} + \ifKV@mdef@noerr + \@@@mdef{#1}{#2}% + \ifKV@mdef@nowarn\else + \PackageWarning{multidef} + {command \expandafter\noexpand\csname\@mdprefix#1\@mdsuffix\endcsname + redefined} + \fi + \else + \PackageError{multidef} + {command \expandafter\noexpand\csname\@mdprefix#1\@mdsuffix\endcsname + already defined}\@ehc + \fi + \ifKV@mdef@nowarn\else + \@ifundefined{@mdwarnonce} + {\def\@mdwarnonce{}% + \@mdef@finalwarn} + {} + \fi} +} +\def\@mdef@finalwarn{% + \AtEndDocument{\PackageWarningNoLine{multidef}{There were + redefined commands (\the\@mdef@redeftok)}}} +\def\@@@mdef#1#2{\def\@arg@{#2}% + \ifx\@arg@\@empty + \@mdef@def{#1}{#1}% + \else + \@mdef@def{#1}{#2}% + \fi} +\def\@mdef@def#1#2{% + \let\reserved@b\@gobble + \ifKV@mdef@global\let\@mdglobal\global\else\let\@mdglobal\relax\fi + \ifKV@mdef@long\let\@mdlong\long\else\let\@mdlong\relax\fi + \def\l@ngrel@x{\@mdlong\@mdglobal} + \expandafter\expandafter\expandafter\@yargd@f\expandafter\@mdargs\csname + \@mdprefix#1\@mdsuffix\expandafter\endcsname\expandafter{\@mdef@com{#2}} +} +%% +%% +%% End of file `multidef.sty'. diff --git a/thys/Delta_System_Lemma/document/root.bib b/thys/Delta_System_Lemma/document/root.bib new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/document/root.bib @@ -0,0 +1,81 @@ +@article{DBLP:journals/jar/PaulsonG96, + author = {Lawrence C. Paulson and + Krzysztof Grabczewski}, + title = {Mechanizing Set Theory}, + journal = {J. Autom. Reasoning}, + volume = {17}, + number = {3}, + pages = {291--323}, + year = {1996}, + xurl = {https://doi.org/10.1007/BF00283132}, + doi = {10.1007/BF00283132}, + timestamp = {Sat, 20 May 2017 00:22:31 +0200}, + biburl = {https://dblp.org/rec/bib/journals/jar/PaulsonG96}, + bibsource = {dblp computer science bibliography, https://dblp.org} +} + +@inproceedings{2020arXiv200109715G, + author = {Gunther, Emmanuel and Pagano, Miguel and S{\'a}nchez Terraf, Pedro}, + title = "{Formalization of Forcing in Isabelle/ZF}", + isbn = {978-3-662-45488-6}, + booktitle = {Automated Reasoning. 10th International Joint Conference, IJCAR 2020, Paris, France, July 1--4, 2020, Proceedings, Part II}, + volume = 12167, + series = {Lecture Notes in Artificial Intelligence}, + editor = {Peltier, Nicolas and Sofronie-Stokkermans, Viorica}, + publisher = {Springer International Publishing}, + doi = {10.1007/978-3-030-51054-1}, + pages = {221--235}, + keywords = {Computer Science - Logic in Computer Science, Mathematics - Logic, 03B35 (Primary) 03E40, 03B70, 68T15 (Secondary), F.4.1}, + year = 2020, + eid = {arXiv:2001.09715}, +archivePrefix = {arXiv}, + eprint = {2001.09715}, + primaryClass = {cs.LO}, + adsurl = {https://ui.adsabs.harvard.edu/abs/2020arXiv200109715G}, + abstract = {We formalize the theory of forcing in the set theory framework of +Isabelle/ZF. Under the assumption of the existence of a countable +transitive model of $\mathit{ZFC}$, we construct a proper generic extension and show +that the latter also satisfies $\mathit{ZFC}$. In doing so, we remodularized +Paulson's ZF-Constructibility library.}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + +@Book{Jech_Millennium, + author = "Thomas Jech", + title = "Set Theory. The Millennium Edition", + series = "Springer Monographs in Mathematics", + publisher = "Springer-Verlag", + edition = "Third", + year = "2002", + note = {Corrected fourth printing, 2006} +} + +@misc{apunte_st, + author = {S{\'a}nchez Terraf, Pedro}, + title = "Course notes on set theory", + howpublished = {online}, + year = 2019, + note = "In Spanish", + url = {https://cs.famaf.unc.edu.ar/~pedro/home_en.html#set_theory} +} + +@book{kunen2011set, + title={Set Theory}, + author={Kunen, K.}, + edition = {Second}, + isbn=9781848900509, + series={Studies in Logic}, + url={https://books.google.com.ar/books?id=Zn8ppwAACAAJ}, + year=2011, + publisher={College Publications}, + note = {Revised edition, 2013} +} + +@Book{JW, + author = "Winfried Just and Martin Weese", + title = "Discovering Modern Set Theory. II", + series = "Grad. Studies in Mathematics", + volume = "18", + publisher = "American Mathematical Society", + year = "1997" +} diff --git a/thys/Delta_System_Lemma/document/root.bst b/thys/Delta_System_Lemma/document/root.bst new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/document/root.bst @@ -0,0 +1,1561 @@ +%% +%% by pedro +%% Based on file `model1b-num-names.bst' +%% +%% +%% +ENTRY + { address + archive + author + booktitle + chapter + doi + edition + editor + eid + eprint + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + url + volume + year + zbl + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + skip$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\textit{" swap$ * "}" * } + if$ +} +%% by pedro +FUNCTION {slanted} +{ duplicate$ empty$ + { pop$ "" } + { "\textsl{" swap$ * "}" * } + if$ +} +FUNCTION {smallcaps} +{ duplicate$ empty$ + { pop$ "" } + { "\textsc{" swap$ * "}" * } + if$ +} +FUNCTION {bold} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} + + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edition" } + +FUNCTION {bbl.volume} +{ "volume" } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "number" } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chapter" } + +FUNCTION {bbl.techrep} +{ "Technical Report" } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.th} +{ "th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {format.zbl} +{ zbl empty$ + { "" } +% { "\urlprefix\url{" url * "}" * } + { "\zbl{" zbl * "}" * } % changed in titto-lncs-02.bst + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } +% { "\urlprefix\url{" url * "}" * } + { "\url{" url * "}" * } % changed in titto-lncs-02.bst + if$ +} + +FUNCTION {format.doi} % added in splncs04.bst +{ doi empty$ + { "" } + { after.block 'output.state := + "\doi{" doi * "}" * } + if$ +} + +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f{.}.~}{vv~}{ll}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names smallcaps +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + capitalize + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ 'skip$ + { "t" change.case$ } + if$ + "title" bibinfo.check +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in + ":" * + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + % extra.label * + %% by pedro + " (" swap$ * ")" * +} +FUNCTION{format.year} +{ year "year" bibinfo.check duplicate$ empty$ + { "empty year in " cite$ * + "; set to ????" * + warning$ + pop$ "????" + } + { + } + if$ + % extra.label * + " (" swap$ * ")" * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ + %% by pedro + "``" swap$ * "''" * +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + %% by pedro + { series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { %slanted + } + if$ + "volume and number" number either.or.check + volume tie.or.space.prefix + "volume" bibinfo.check + bold + * * + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} + +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.pages.simple} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { +% bbl.pages swap$ + n.dashify + } + { +% bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ": " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + %% by pedro + bold + pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ": " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ + format.year * +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + { "" } + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + " " * + get.bbl.editor + capitalize + "(" swap$ * "), " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.check format.org.or.pub +} +FUNCTION {format.publisher.address.year} +{ publisher "publisher" bibinfo.check format.org.or.pub + format.journal.pages + format.year * +} + +FUNCTION {school.address.year} +{ school "school" bibinfo.warn + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + format.year * +} + +FUNCTION {format.publisher.address.pages} +{ publisher "publisher" bibinfo.check format.org.or.pub + format.year * + +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.organization.address.year} +{ organization "organization" bibinfo.check format.org.or.pub + format.journal.pages + format.year * +} + +FUNCTION {article} +{ "%Type = Article" write$ + output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + crossref missing$ + { + journal + "journal" bibinfo.check + %% by pedro + emphasize + "journal" output.check + add.blank + format.vol.num.pages output + } + { format.article.crossref output.nonnull + } + if$ +% format.journal.pages + new.sentence + format.note output + format.doi output + fin.entry +} +FUNCTION {book} +{ "%Type = Book" write$ + output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { %% by pedro + format.bvolume output + format.number.series output + % format.bvolume output + format.publisher.address.year output + } + { + format.book.crossref output.nonnull + } + if$ + format.edition output + % format.date "year" output.check + new.sentence + format.note output + format.doi output + format.eprint output + fin.entry +} +FUNCTION {booklet} +{ "%Type = Booklet" write$ + output.bibitem + format.authors output + author format.key output + format.title "title" output.check + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.date "year" output.check + new.sentence + format.note output + format.doi output + format.eprint output + fin.entry +} + +FUNCTION {inbook} +{ "%Type = Inbook" write$ + output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + format.title "title" output.check + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.number.series output + format.publisher.address output + format.pages "pages" output.check + format.edition output + format.date "year" output.check + } + { + format.book.crossref output.nonnull + } + if$ +% format.edition output +% format.pages "pages" output.check + new.sentence + format.note output + format.doi output + fin.entry +} + +FUNCTION {incollection} +{ "%Type = Incollection" write$ + output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages "pages" output.check + % format.publisher.address output + % format.date "year" output.check + format.publisher.address.year output + format.edition output + } + { format.incoll.inproc.crossref output.nonnull + } + if$ +% format.pages "pages" output.check + new.sentence + format.note output + format.doi output + fin.entry +} +FUNCTION {inproceedings} +{ "%Type = Inproceedings" write$ + output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + crossref missing$ + { + journal + "journal" bibinfo.check + "journal" output.check + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + publisher empty$ + { %format.organization.address output + format.organization.address.year output +% format.journal.pages + } + { organization "organization" bibinfo.check output + format.publisher.address.year output + % format.date "year" output.check +% format.journal.pages + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.journal.pages + } + if$ +% format.pages.simple "pages" output.check +%%% La que sigue la muevo adentro del "if" +% format.journal.pages + new.sentence + format.note output + format.doi output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ "%Type = Manual" write$ + output.bibitem + format.authors output + author format.key output + format.btitle "title" output.check + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.date "year" output.check + new.sentence + format.note output + format.doi output + format.eprint output + fin.entry +} + +FUNCTION {mastersthesis} +{ "%Type = Masterthesis" write$ + output.bibitem + format.authors "author" output.check + author format.key output + format.btitle + "title" output.check + bbl.mthesis format.thesis.type output.nonnull +% school "school" bibinfo.warn output +% address "address" bibinfo.check output +% format.date "year" output.check + school.address.year output + new.sentence + format.note output + format.doi output + format.eprint output + fin.entry +} + +FUNCTION {misc} +{ "%Type = Misc" write$ + output.bibitem + format.authors output + author format.key output + format.title output + howpublished "howpublished" bibinfo.check output + format.date "year" output.check + new.sentence + format.note output + format.url output + format.doi output + format.eprint output + new.block + fin.entry +} +FUNCTION {phdthesis} +{ "%Type = Phdthesis" write$ + output.bibitem + format.authors "author" output.check + author format.key output + format.btitle + "title" output.check + bbl.phdthesis format.thesis.type output.nonnull +% school "school" bibinfo.warn output +% address "address" bibinfo.check output +% format.date "year" output.check + school.address.year output + new.sentence + format.note output + format.doi output + format.eprint output + fin.entry +} + +FUNCTION {proceedings} +{ "%Type = Proceedings" write$ + output.bibitem + format.editors output + editor format.key output + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.date "year" output.check + new.sentence + format.note output + format.doi output + fin.entry +} + +FUNCTION {techreport} +{ "%Type = Techreport" write$ + output.bibitem + format.authors "author" output.check + author format.key output + format.btitle + "title" output.check + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.sentence + format.note output + format.url output + format.doi output + format.eprint output + fin.entry +} + +FUNCTION {unpublished} +{ "%Type = Unpublished" write$ + output.bibitem + format.authors "author" output.check + author format.key output + format.title "title" output.check + format.date "year" output.check + new.sentence + format.note "note" output.check + format.url output + format.doi output + format.eprint output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + { pop$ "????" } + { purify$ #-1 #4 substring$ } + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { t sortify * } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{small}\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand{\doi}[1]{doi:\href{https://doi.org/#1}{#1}}" + write$ newline$ + "\providecommand{\eprint}[2][]{arXiv:\href{https://arxiv.org/abs/#2}{#2}}" + write$ newline$ + "\providecommand{\zbl}[1]{\hfill {\small Zbl~\href{https://zbmath.org/?q=an\%3A#1}{#1}}}" + write$ newline$ + "\ifx\xfnm\relax \def\xfnm[#1]{\unskip,\space#1}\fi" + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}\end{small}" write$ newline$ +} +EXECUTE {end.bib} diff --git a/thys/Delta_System_Lemma/document/root.tex b/thys/Delta_System_Lemma/document/root.tex new file mode 100644 --- /dev/null +++ b/thys/Delta_System_Lemma/document/root.tex @@ -0,0 +1,119 @@ +\documentclass[11pt,a4paper]{article} +\usepackage{isabelle,isabellesym} +\usepackage[numbers]{natbib} + +\usepackage{relsize} +\DeclareRobustCommand{\isactrlbsub}{\emph\bgroup\math{}\sb\bgroup\mbox\bgroup\isaspacing\itshape\smaller} +\DeclareRobustCommand{\isactrlesub}{\egroup\egroup\endmath\egroup} +\DeclareRobustCommand{\isactrlbsup}{\emph\bgroup\math{}\sp\bgroup\mbox\bgroup\isaspacing\itshape\smaller} +\DeclareRobustCommand{\isactrlesup}{\egroup\egroup\endmath\egroup} + +% further packages required for unusual symbols (see also +% isabellesym.sty), use only when needed + +\usepackage{amssymb} + %for \, \, \, \, \, \, + %\, \, \, \, \, + %\, \, \ + +%\usepackage{eurosym} + %for \ + +%\usepackage[only,bigsqcap]{stmaryrd} + %for \ + +%\usepackage{eufrak} + %for \ ... \, \ ... \ (also included in amssymb) + +%\usepackage{textcomp} + %for \, \, \, \, \, + %\ + +\input{header-delta-system} + +% this should be the last package used +\usepackage{pdfsetup} + +% urls in roman style, theory text in math-similar italics +\urlstyle{tt} +\isabellestyle{it} + +% for uniform font size +%\renewcommand{\isastyle}{\isastyleminor} + +\renewcommand{\isacharunderscorekeyword}{\mbox{\_}} +\renewcommand{\isacharunderscore}{\mbox{\_}} +\renewcommand{\isasymtturnstile}{\isamath{\Vdash}} +\renewcommand{\isacharminus}{-} + +\begin{document} + +\title{Cofinality and the Delta System Lemma} +\author{ + Pedro S\'anchez Terraf\thanks{Universidad Nacional de C\'ordoba. + Facultad de Matem\'atica, Astronom\'{\i}a, F\'{\i}sica y + Computaci\'on.} + \thanks{% + Centro de Investigaci\'on y Estudios de Matem\'atica + (CIEM-FaMAF), Conicet. C\'ordoba. Argentina. + Supported by Secyt-UNC project 33620180100465CB.} +} +\maketitle + +\begin{abstract} + We formalize the basic results on cofinality of linearly ordered + sets and ordinals and \v{S}anin's Lemma for uncountable families of + finite sets. We work in the set theory framework of + Isabelle/ZF, using the Axiom of Choice as needed. +\end{abstract} + + +\tableofcontents + +% sane default for proof documents +\parindent 0pt\parskip 0.5ex + +\section{Introduction} + +The session we present gathers very basic results built on the set +theory formalization of Isabelle/ZF +\cite{DBLP:journals/jar/PaulsonG96}. In a sense, some of the material +formalized here corresponds to a natural continuation of that +work. This is even clearer after perusing Section~\ref{sec:zf-lib}, +where notions like cardinal exponentiation are first defined, together +with various lemmas that do not depend on the Axiom of Choice ($\AC$); +the same holds for the basic theory of cofinality of ordinals, which +is developed in Section~\ref{sec:cofinality}. In +Section~\ref{sec:cardinal-lib}, (un)countability is defined +and several results proved, now using $\AC$ freely; the latter is also +needed to prove König's Theorem on cofinality of cardinal +exponentiation. The simplest infinitary version of the Delta +System Lemma (DSL, also known as the ``Sunflower Lemma'') due to \v{S}anin +is proved in Section~\ref{sec:dsl}, and it is applied to prove +that Cohen posets satisfy the \emph{countable chain condition}. + +A greater part of this development was motivated by an ongoing joint +project on the formalization of the ctm approach to +forcing~\cite{2020arXiv200109715G} by Gunther, Pagano, Steinberg, and +the author. Indeed, most of the results presented here are required +for the development of forcing. As it turns out, the material as +formalized presently will not be part of the forcing formalization, +since for that goal we need relativized versions of both the concepts +and the proofs. + +A cross-linked HTML version of the development can be found at +\url{https://cs.famaf.unc.edu.ar/~pedro/Delta_System_Lemma/html}. + +% generated text of all theories +\input{session} + +% optional bibliography +\bibliographystyle{root} +\bibliography{root} + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/thys/ROOTS b/thys/ROOTS --- a/thys/ROOTS +++ b/thys/ROOTS @@ -1,572 +1,573 @@ ADS_Functor AI_Planning_Languages_Semantics AODV AVL-Trees AWN Abortable_Linearizable_Modules Abs_Int_ITP2012 Abstract-Hoare-Logics Abstract-Rewriting Abstract_Completeness Abstract_Soundness Adaptive_State_Counting Affine_Arithmetic Aggregation_Algebras Akra_Bazzi Algebraic_Numbers Algebraic_VCs Allen_Calculus Amicable_Numbers Amortized_Complexity AnselmGod Applicative_Lifting Approximation_Algorithms Architectural_Design_Patterns Aristotles_Assertoric_Syllogistic Arith_Prog_Rel_Primes ArrowImpossibilityGS Attack_Trees Auto2_HOL Auto2_Imperative_HOL AutoFocus-Stream Automated_Stateful_Protocol_Verification Automatic_Refinement AxiomaticCategoryTheory BDD BNF_CC BNF_Operations Banach_Steinhaus Bell_Numbers_Spivey Berlekamp_Zassenhaus Bernoulli Bertrands_Postulate Bicategory BinarySearchTree Binding_Syntax_Theory Binomial-Heaps Binomial-Queues BirdKMP Bondy Boolean_Expression_Checkers Bounded_Deducibility_Security Buchi_Complementation Budan_Fourier Buffons_Needle Buildings BytecodeLogicJmlTypes C2KA_DistributedSystems CAVA_Automata CAVA_LTL_Modelchecker CCS CISC-Kernel CRDT CYK CakeML CakeML_Codegen Call_Arity Card_Equiv_Relations Card_Multisets Card_Number_Partitions Card_Partitions Cartan_FP Case_Labeling Catalan_Numbers Category Category2 Category3 Cauchy Cayley_Hamilton Certification_Monads Chandy_Lamport Chord_Segments Circus Clean ClockSynchInst Closest_Pair_Points CofGroups Coinductive Coinductive_Languages Collections Comparison_Sort_Lower_Bound Compiling-Exceptions-Correctly Complete_Non_Orders Completeness Complex_Geometry Complx ComponentDependencies ConcurrentGC ConcurrentIMP Concurrent_Ref_Alg Concurrent_Revisions Consensus_Refined Constructive_Cryptography Constructor_Funs Containers CoreC++ Core_DOM Core_SC_DOM Count_Complex_Roots CryptHOL CryptoBasedCompositionalProperties DFS_Framework DPT-SAT-Solver DataRefinementIBP Datatype_Order_Generator Decl_Sem_Fun_PL Decreasing-Diagrams Decreasing-Diagrams-II Deep_Learning +Delta_System_Lemma Density_Compiler Dependent_SIFUM_Refinement Dependent_SIFUM_Type_Systems Depth-First-Search Derangements Deriving Descartes_Sign_Rule Dict_Construction Differential_Dynamic_Logic Differential_Game_Logic Dijkstra_Shortest_Path Diophantine_Eqns_Lin_Hom Dirichlet_L Dirichlet_Series DiscretePricing Discrete_Summation DiskPaxos DynamicArchitectures Dynamic_Tables E_Transcendental Echelon_Form EdmondsKarp_Maxflow Efficient-Mergesort Elliptic_Curves_Group_Law Encodability_Process_Calculi Epistemic_Logic Ergodic_Theory Error_Function Euler_MacLaurin Euler_Partition Example-Submission Extended_Finite_State_Machine_Inference Extended_Finite_State_Machines FFT FLP FOL-Fitting FOL_Harrison FOL_Seq_Calc1 Factored_Transition_System_Bounding Falling_Factorial_Sum Farkas FeatherweightJava Featherweight_OCL Fermat3_4 FileRefinement FinFun Finger-Trees Finite-Map-Extras Finite_Automata_HF First_Order_Terms First_Welfare_Theorem Fishburn_Impossibility Fisher_Yates Flow_Networks Floyd_Warshall Flyspeck-Tame FocusStreamsCaseStudies Forcing Formal_SSA Formula_Derivatives Fourier Free-Boolean-Algebra Free-Groups FunWithFunctions FunWithTilings Functional-Automata Functional_Ordered_Resolution_Prover Furstenberg_Topology GPU_Kernel_PL Gabow_SCC Game_Based_Crypto Gauss-Jordan-Elim-Fun Gauss_Jordan Gauss_Sums Gaussian_Integers GenClock General-Triangle Generalized_Counting_Sort Generic_Deriving Generic_Join GewirthPGCProof Girth_Chromatic GoedelGod Goedel_HFSet_Semantic Goedel_HFSet_Semanticless Goedel_Incompleteness Goodstein_Lambda GraphMarkingIBP Graph_Saturation Graph_Theory Green Groebner_Bases Groebner_Macaulay Gromov_Hyperbolicity Group-Ring-Module HOL-CSP HOLCF-Prelude HRB-Slicing Heard_Of Hello_World HereditarilyFinite Hermite Hidden_Markov_Models Higher_Order_Terms Hoare_Time HotelKeyCards Huffman Hybrid_Logic Hybrid_Multi_Lane_Spatial_Logic Hybrid_Systems_VCs HyperCTL IEEE_Floating_Point IMAP-CRDT IMO2019 IMP2 IMP2_Binary_Heap IP_Addresses Imperative_Insertion_Sort Impossible_Geometry Incompleteness Incredible_Proof_Machine Inductive_Confidentiality Inductive_Inference InfPathElimination InformationFlowSlicing InformationFlowSlicing_Inter Integration Interval_Arithmetic_Word32 Iptables_Semantics Irrational_Series_Erdos_Straus Irrationality_J_Hancl Isabelle_C Isabelle_Marries_Dirac Isabelle_Meta_Model Jacobson_Basic_Algebra Jinja JinjaThreads JiveDataStoreModel Jordan_Hoelder Jordan_Normal_Form KAD KAT_and_DRA KBPs KD_Tree Key_Agreement_Strong_Adversaries Kleene_Algebra Knot_Theory Knuth_Bendix_Order Knuth_Morris_Pratt Koenigsberg_Friendship Kruskal Kuratowski_Closure_Complement LLL_Basis_Reduction LLL_Factorization LOFT LTL LTL_Master_Theorem LTL_Normal_Form LTL_to_DRA LTL_to_GBA Lam-ml-Normalization LambdaAuth LambdaMu Lambda_Free_EPO Lambda_Free_KBOs Lambda_Free_RPOs Lambert_W Landau_Symbols Laplace_Transform Latin_Square LatticeProperties Launchbury Lazy-Lists-II Lazy_Case Lehmer Lifting_Definition_Option LightweightJava LinearQuantifierElim Linear_Inequalities Linear_Programming Linear_Recurrences Liouville_Numbers List-Index List-Infinite List_Interleaving List_Inversions List_Update LocalLexing Localization_Ring Locally-Nameless-Sigma Lowe_Ontological_Argument Lower_Semicontinuous Lp Lucas_Theorem MFMC_Countable MFODL_Monitor_Optimized MFOTL_Monitor MSO_Regex_Equivalence Markov_Models Marriage Mason_Stothers Matrices_for_ODEs Matrix Matrix_Tensor Matroids Max-Card-Matching Median_Of_Medians_Selection Menger Mersenne_Primes MiniML Minimal_SSA Minkowskis_Theorem Minsky_Machines Modal_Logics_for_NTS Modular_Assembly_Kit_Security Monad_Memo_DP Monad_Normalisation MonoBoolTranAlgebra MonoidalCategory Monomorphic_Monad MuchAdoAboutTwo Multi_Party_Computation Multirelations Myhill-Nerode Name_Carrying_Type_Inference Nash_Williams Nat-Interval-Logic Native_Word Nested_Multisets_Ordinals Network_Security_Policy_Verification Neumann_Morgenstern_Utility No_FTL_observers Nominal2 Noninterference_CSP Noninterference_Concurrent_Composition Noninterference_Generic_Unwinding Noninterference_Inductive_Unwinding Noninterference_Ipurge_Unwinding Noninterference_Sequential_Composition NormByEval Nullstellensatz Octonions OpSets Open_Induction Optics Optimal_BST Orbit_Stabiliser Order_Lattice_Props Ordered_Resolution_Prover Ordinal Ordinal_Partitions Ordinals_and_Cardinals Ordinary_Differential_Equations PAC_Checker PCF PLM POPLmark-deBruijn PSemigroupsConvolution Pairing_Heap Paraconsistency Parity_Game Partial_Function_MR Partial_Order_Reduction Password_Authentication_Protocol Pell Perfect-Number-Thm Perron_Frobenius Physical_Quantities Pi_Calculus Pi_Transcendental Planarity_Certificates Poincare_Bendixson Poincare_Disc Polynomial_Factorization Polynomial_Interpolation Polynomials Pop_Refinement Posix-Lexing Possibilistic_Noninterference Power_Sum_Polynomials Pratt_Certificate Presburger-Automata Prim_Dijkstra_Simple Prime_Distribution_Elementary Prime_Harmonic_Series Prime_Number_Theorem Priority_Queue_Braun Priority_Search_Trees Probabilistic_Noninterference Probabilistic_Prime_Tests Probabilistic_System_Zoo Probabilistic_Timed_Automata Probabilistic_While Program-Conflict-Analysis Projective_Geometry Promela Proof_Strategy_Language PropResPI Propositional_Proof_Systems Prpu_Maxflow PseudoHoops Psi_Calculi Ptolemys_Theorem QHLProver QR_Decomposition Quantales Quaternions Quick_Sort_Cost RIPEMD-160-SPARK ROBDD RSAPSS Ramsey-Infinite Random_BSTs Random_Graph_Subgraph_Threshold Randomised_BSTs Randomised_Social_Choice Rank_Nullity_Theorem Real_Impl Recursion-Addition Recursion-Theory-I Refine_Imperative_HOL Refine_Monadic RefinementReactive Regex_Equivalence Regular-Sets Regular_Algebras Relation_Algebra Relational-Incorrectness-Logic Relational_Disjoint_Set_Forests Relational_Method Relational_Minimum_Spanning_Trees Relational_Paths Rep_Fin_Groups Residuated_Lattices Resolution_FOL Rewriting_Z Ribbon_Proofs Robbins-Conjecture Robinson_Arithmetic Root_Balanced_Tree Routing Roy_Floyd_Warshall SATSolverVerification SC_DOM_Components SDS_Impossibility SIFPL SIFUM_Type_Systems SPARCv8 Safe_Distance Safe_OCL Saturation_Framework Secondary_Sylow Security_Protocol_Refinement Selection_Heap_Sort SenSocialChoice Separata Separation_Algebra Separation_Logic_Imperative_HOL SequentInvertibility Shadow_SC_DOM Shivers-CFA ShortestPath Show Sigma_Commit_Crypto Signature_Groebner Simpl Simple_Firewall Simplex Skew_Heap Skip_Lists Slicing Sliding_Window_Algorithm Smith_Normal_Form Smooth_Manifolds Sort_Encodings Source_Coding_Theorem Special_Function_Bounds Splay_Tree Sqrt_Babylonian Stable_Matching Statecharts Stateful_Protocol_Composition_and_Typing Stellar_Quorums Stern_Brocot Stewart_Apollonius Stirling_Formula Stochastic_Matrices Stone_Algebras Stone_Kleene_Relation_Algebras Stone_Relation_Algebras Store_Buffer_Reduction Stream-Fusion Stream_Fusion_Code Strong_Security Sturm_Sequences Sturm_Tarski Stuttering_Equivalence Subresultants Subset_Boolean_Algebras SumSquares SuperCalc Surprise_Paradox Symmetric_Polynomials Syntax_Independent_Logic Szpilrajn TESL_Language TLA Tail_Recursive_Functions Tarskis_Geometry Taylor_Models Timed_Automata Topological_Semantics Topology TortoiseHare Transcendence_Series_Hancl_Rucki Transformer_Semantics Transition_Systems_and_Automata Transitive-Closure Transitive-Closure-II Treaps Tree-Automata Tree_Decomposition Triangle Trie Twelvefold_Way Tycon Types_Tableaus_and_Goedels_God UPF UPF_Firewall UTP Universal_Turing_Machine UpDown_Scheme Valuation VectorSpace VeriComp Verified-Prover Verified_SAT_Based_AI_Planning VerifyThis2018 VerifyThis2019 Vickrey_Clarke_Groves VolpanoSmith WHATandWHERE_Security WOOT_Strong_Eventual_Consistency WebAssembly Weight_Balanced_Trees Well_Quasi_Orders Winding_Number_Eval Word_Lib WorkerWrapper XML ZFC_in_HOL Zeta_3_Irrational Zeta_Function pGCL