(* Title: ZF/OrderArith.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory Copyright 1994 University of Cambridge
*)
section‹Combining Orderings: Foundations of Ordinal Arithmetic›
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).
(∃x y. z = ⟨Inl(x), Inr(y)⟩) |
(∃x' x. z = \Inl(x'), Inl(x)⟩∧⟨x',x\:r) |
(∃y' y. z = \Inr(y'), Inr(y)⟩∧⟨y',y\: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). ∃x' y' x y. z = ⟨⟨x',y'⟩, ⟨x,y⟩⟩∧
(⟨x',x\: r | (x'=x ∧⟨y',y\: 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‹Well-foundedness›
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") 🍋‹Proving the lemma, which is needed twice!› 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‹Returning to main part of proof› 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 \
(λz∈A+B. case(λx. x, λy. y, z)) ∈ bij(A+B, A ∪ B)" apply (rule_tac d = "\z. if z \ A then Inl (z) else Inr (z) "in lam_bijective) apply auto done
subsubsection‹Associativity›
lemma sum_assoc_bij: "(\z\(A+B)+C. case(case(Inl, \y. Inr(Inl(y))), \y. Inr(Inr(y)), z)) ∈ 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
(*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 measure_iff [iff]: "\x,y\ \ measure(A,f) \ x \ A \ y \ A \ f(x) by (simp (no_asm) add: measure_def)
lemma linear_measure: assumes Ordf: "\x. x \ A \ Ord(f(x))" and inj: "\x y. \x \ A; y \ A; f(x) = f(y)\ \ x=y" shows"linear(A, measure(A,f))" apply (auto simp add: linear_def) apply (rule_tac i="f(x)"and j="f(y)"in Ord_linear_lt) apply (simp_all add: Ordf) apply (blast intro: inj) done
lemma wf_on_measure: "wf[B](measure(A,f))" by (rule wf_imp_wf_on [OF wf_measure])
lemma well_ord_measure: assumes Ordf: "\x. x \ A \ Ord(f(x))" and inj: "\x y. \x \ A; y \ A; f(x) = f(y)\ \ x=y" shows"well_ord(A, measure(A,f))" apply (rule well_ordI) apply (rule wf_on_measure) apply (blast intro: linear_measure Ordf inj) done
lemma measure_type: "measure(A,f) \ A*A" by (auto simp add: measure_def)
subsubsection‹Well-foundedness of Unions›
lemma wf_on_Union: assumes wfA: "wf[A](r)" and wfB: "\a. a\A \ wf[B(a)](s)" and ok: "\a u v. \\u,v\ \ s; v \ B(a); a \ A\ ==> (∃a'\A. \a',a⟩∈ r ∧ u ∈ B(a')) | u \ B(a)" shows"wf[\a\A. B(a)](s)" apply (rule wf_onI2) apply (erule UN_E) apply (subgoal_tac "\z \ B(a). z \ Ba", blast) apply (rule_tac a = a in wf_on_induct [OF wfA], assumption) apply (rule ballI) apply (rule_tac a = z in wf_on_induct [OF wfB], assumption, assumption) apply (rename_tac u) apply (drule_tac x=u in bspec, blast) apply (erule mp, clarify) apply (frule ok, assumption+, blast) done
subsubsection‹Bijections involving Powersets›
lemma Pow_sum_bij: "(\Z \ Pow(A+B). \{x \ A. Inl(x) \ Z}, {y \ B. Inr(y) \ Z}\) ∈ 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‹As a special case, we have🍋‹bij(Pow(A*B), A → Pow(B))›› lemma Pow_Sigma_bij: "(\r \ Pow(Sigma(A,B)). \x \ A. r``{x}) ∈ bij(Pow(Sigma(A,B)), ∏x ∈ 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
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 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 und die Messung sind noch experimentell.