(* Title: ZF/OrderArith.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory Copyright 1994 University of Cambridge
*)
section\<open>Combining Orderings: Foundations of Ordinal Arithmetic\<close>
theory OrderArith imports Order Sum Ordinal begin
definition (*disjoint sum of two relations; underlies ordinal addition*)
radd :: "[i,i,i,i]\i" where "radd(A,r,B,s) \
{z: (A+B) * (A+B).
(\<exists>x y. z = \<langle>Inl(x), Inr(y)\<rangle>) |
(\<exists>x' x. z = \<langle>Inl(x'), Inl(x)\<rangle> \<and> \<langle>x',x\<rangle>:r) |
(\<exists>y' y. z = \<langle>Inr(y'), Inr(y)\<rangle> \<and> \<langle>y',y\<rangle>:s)}"
definition (*lexicographic product of two relations; underlies ordinal multiplication*)
rmult :: "[i,i,i,i]\i" where "rmult(A,r,B,s) \
{z: (A*B) * (A*B). \<exists>x' y' x y. z = \<langle>\<langle>x',y'\<rangle>, \<langle>x,y\<rangle>\<rangle> \<and>
(\<langle>x',x\<rangle>: r | (x'=x \<and> \<langle>y',y\<rangle>: s))}"
definition (*inverse image of a relation*)
rvimage :: "[i,i,i]\i" where "rvimage(A,f,r) \ {z \ A*A. \x y. z = \x,y\ \ \f`x,f`y\: r}"
lemma linear_radd: "\linear(A,r); linear(B,s)\ \ linear(A+B,radd(A,r,B,s))" by (unfold linear_def, blast)
subsubsection\<open>Well-foundedness\<close>
lemma wf_on_radd: "\wf[A](r); wf[B](s)\ \ wf[A+B](radd(A,r,B,s))" apply (rule wf_onI2) apply (subgoal_tac "\x\A. Inl (x) \ Ba") \<comment> \<open>Proving the lemma, which is needed twice!\<close> prefer 2 apply (erule_tac V = "y \ A + B" in thin_rl) apply (rule_tac ballI) apply (erule_tac r = r and a = x in wf_on_induct, assumption) apply blast txt\<open>Returning to main part of proof\<close> apply safe apply blast apply (erule_tac r = s and a = ya in wf_on_induct, assumption, blast) done
(*Could we prove an ord_iso result? Perhaps
ord_iso(A+B, radd(A,r,B,s), A \<union> B, r \<union> s) *) lemma sum_disjoint_bij: "A \ B = 0 \
(\<lambda>z\<in>A+B. case(\<lambda>x. x, \<lambda>y. y, z)) \<in> bij(A+B, A \<union> B)" apply (rule_tac d = "\z. if z \ A then Inl (z) else Inr (z) " in lam_bijective) apply auto done
subsubsection\<open>Associativity\<close>
lemma sum_assoc_bij: "(\z\(A+B)+C. case(case(Inl, \y. Inr(Inl(y))), \y. Inr(Inr(y)), z)) \<in> bij((A+B)+C, A+(B+C))" apply (rule_tac d = "case (\x. Inl (Inl (x)), case (\x. Inl (Inr (x)), Inr))" in lam_bijective) apply auto done
subsection\<open>Multiplication of Relations -- Lexicographic Product\<close>
subsubsection\<open>Rewrite rule. Can be used to obtain introduction rules\<close>
lemma rmult_iff [iff]: "\\a',b'\, \a,b\\ \ rmult(A,r,B,s) \
(\<langle>a',a\<rangle>: r \<and> a':A \<and> a \<in> A \<and> b': B \<and> b \<in> B) |
(\<langle>b',b\<rangle>: s \<and> a'=a \<and> a \<in> A \<and> b': B \<and> b \<in> B)"
by (unfold rmult_def, blast)
lemma rmultE: "\\\a',b'\, \a,b\\ \ rmult(A,r,B,s); \<lbrakk>\<langle>a',a\<rangle>: r; a':A; a \<in> A; b':B; b \<in> B\<rbrakk> \<Longrightarrow> Q; \<lbrakk>\<langle>b',b\<rangle>: s; a \<in> A; a'=a; b':B; b \<in> B\<rbrakk> \<Longrightarrow> Q \<rbrakk> \<Longrightarrow> Q" by blast
text\<open>But note that the combination of \<open>wf_imp_wf_on\<close> and \<open>wf_rvimage\<close> gives \<^prop>\<open>wf(r) \<Longrightarrow> wf[C](rvimage(A,f,r))\<close>\<close> lemma wf_on_rvimage: "\f \ A\B; wf[B](r)\ \ wf[A](rvimage(A,f,r))" apply (rule wf_onI2) apply (subgoal_tac "\z\A. f`z=f`y \ z \ Ba") apply blast apply (erule_tac a = "f`y"in wf_on_induct) apply (blast intro!: apply_funtype) apply (blast intro!: apply_funtype dest!: rvimage_iff [THEN iffD1]) done
(*Note that we need only wf[A](...) and linear(A,...) to get the result!*) lemma well_ord_rvimage: "\f \ inj(A,B); well_ord(B,r)\ \ well_ord(A, rvimage(A,f,r))" apply (rule well_ordI) unfolding well_ord_def tot_ord_def apply (blast intro!: wf_on_rvimage inj_is_fun) apply (blast intro!: linear_rvimage) done
lemma Pow_sum_bij: "(\Z \ Pow(A+B). \{x \ A. Inl(x) \ Z}, {y \ B. Inr(y) \ Z}\) \<in> bij(Pow(A+B), Pow(A)*Pow(B))" apply (rule_tac d = "\\X,Y\. {Inl (x). x \ X} \ {Inr (y). y \ Y}" in lam_bijective) apply force+ done
text\<open>As a special case, we have \<^term>\<open>bij(Pow(A*B), A \<rightarrow> Pow(B))\<close>\<close> lemma Pow_Sigma_bij: "(\r \ Pow(Sigma(A,B)). \x \ A. r``{x}) \<in> bij(Pow(Sigma(A,B)), \<Prod>x \<in> A. Pow(B(x)))" apply (rule_tac d = "\f. \x \ A. \y \ f`x. {\x,y\}" in lam_bijective) apply (blast intro: lam_type) apply (blast dest: apply_type, simp_all) apply fast (*strange, but blast can't do it*) apply (rule fun_extension, auto) by blast
end
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.