(* Title: ZF/Constructible/Relative.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory With modifications by E. Gunther, M. Pagano, and P. Sánchez Terraf
*)
section‹Relativization and Absoluteness›
theory Relative imports ZF begin
subsection‹Relativized versions of standard set-theoretic concepts›
definition
pre_image :: "[i\o,i,i,i] \ o"where "pre_image(M,r,A,z) \ ∀x[M]. x ∈ z ⟷ (∃w[M]. w∈r ∧ (∃y[M]. y∈A ∧ pair(M,x,y,w)))"
definition
is_domain :: "[i\o,i,i] \ o"where "is_domain(M,r,z) \ ∀x[M]. x ∈ z ⟷ (∃w[M]. w∈r ∧ (∃y[M]. pair(M,x,y,w)))"
definition
image :: "[i\o,i,i,i] \ o"where "image(M,r,A,z) \ ∀y[M]. y ∈ z ⟷ (∃w[M]. w∈r ∧ (∃x[M]. x∈A ∧ pair(M,x,y,w)))"
definition
is_range :: "[i\o,i,i] \ o"where 🍋‹the cleaner 🍋‹∃r'[M]. is_converse(M,r,r') ∧ is_domain(M,r',z)\
unfortunately needs an instance of separation in order to prove 🍋‹M(converse(r))›.› "is_range(M,r,z) \ ∀y[M]. y ∈ z ⟷ (∃w[M]. w∈r ∧ (∃x[M]. pair(M,x,y,w)))"
definition
successor_ordinal :: "[i\o,i] \ o"where 🍋‹a successor ordinal is any ordinal that is neither empty nor limit› "successor_ordinal(M,a) \
ordinal(M,a) ∧¬ empty(M,a) ∧¬ limit_ordinal(M,a)"
definition
finite_ordinal :: "[i\o,i] \ o"where 🍋‹an ordinal is finite if neither it nor any of its elements are limit› "finite_ordinal(M,a) \
ordinal(M,a) ∧¬ limit_ordinal(M,a) ∧
(∀x[M]. x∈a ⟶¬ limit_ordinal(M,x))"
definition
omega :: "[i\o,i] \ o"where 🍋‹omega is a limit ordinal none of whose elements are limit› "omega(M,a) \ limit_ordinal(M,a) \ (\x[M]. x\a \ \ limit_ordinal(M,x))"
text‹Useful when absoluteness reasoning has replaced the predicates by terms› lemma triv_Relation1: "Relation1(M, A, \x y. y = f(x), f)" by (simp add: Relation1_def)
lemma triv_Relation2: "Relation2(M, A, B, \x y a. a = f(x,y), f)" by (simp add: Relation2_def)
subsection‹The relativized ZF axioms›
definition
extensionality :: "(i\o) \ o"where "extensionality(M) \ ∀x[M]. ∀y[M]. (∀z[M]. z ∈ x ⟷ z ∈ y) ⟶ x=y"
definition
separation :: "[i\o, i\o] \ o"where 🍋‹The formula ‹P› should only involve parameters
belonging to‹M›and all its quantifiers must be relativized to‹M›. We do not have separation as a scheme; every instance
that we need must be assumed (and later proved) separately.› "separation(M,P) \ ∀z[M]. ∃y[M]. ∀x[M]. x ∈ y ⟷ x ∈ z ∧ P(x)"
text‹The class M is assumed to be transitive and inhabited› locale M_trans = fixes M assumes transM: "\y\x; M(x)\ \ M(y)" and M_inhabited: "\x . M(x)"
lemma (in M_trans) nonempty [simp]: "M(0)" proof - have"M(x) \ M(0)"for x proof (rule_tac P="\w. M(w) \ M(0)"in eps_induct)
{ fix x assume"\y\x. M(y) \ M(0)""M(x)"
consider (a) "\y. y\x" | (b) "x=0"by auto then have"M(x) \ M(0)" proof cases case a thenshow ?thesis using‹∀y∈x._›‹M(x)› transM by auto next case b thenshow ?thesis by simp qed
} thenshow"M(x) \ M(0)"if"\y\x. M(y) \ M(0)"for x using that by auto qed with M_inhabited show"M(0)"using M_inhabited by blast qed
text‹The class M is assumed to be transitive andto satisfy some
relativized ZF axioms› locale M_trivial = M_trans + assumes upair_ax: "upair_ax(M)" and Union_ax: "Union_ax(M)"
lemma (in M_trans) rall_abs [simp]: "M(A) \ (\x[M]. x\A \ P(x)) \ (\x\A. P(x))" by (blast intro: transM)
lemma (in M_trans) rex_abs [simp]: "M(A) \ (\x[M]. x\A \ P(x)) \ (\x\A. P(x))" by (blast intro: transM)
text‹Simplifies proofs of equalities when there's an iff-equality
available for rewriting, universally quantified over M.
But it's not the only way to prove such equalities: its
premises 🍋‹M(A)›and🍋‹M(B)› can be too strong.› lemma (in M_trans) M_equalityI: "\\x. M(x) \ x\A \ x\B; M(A); M(B)\ \ A=B" by (blast dest: transM)
(*The first premise can't simply be assumed as a schema. It is essential to take care when asserting instances of Replacement. Let K be a nonconstructible subset of nat and define f(x) = x if x \<in> K and f(x)=0 otherwise. Then RepFun(nat,f) = cons(0,K), a nonconstructible set. So we cannot assume that M(X) implies M(RepFun(X,f)) even for f \<in> M -> M.
*) lemma (in M_trans) RepFun_closed: "\strong_replacement(M, \x y. y = f(x)); M(A); \x\A. M(f(x))\ ==> M(RepFun(A,f))" apply (simp add: RepFun_def) done
lemma Replace_conj_eq: "{y . x \ A, x\A \ y=f(x)} = {y . x\A, y=f(x)}" by simp
text‹Better than ‹RepFun_closed› when having the formula 🍋‹x∈A›
makes relativization easier.› lemma (in M_trans) RepFun_closed2: "\strong_replacement(M, \x y. x\A \ y = f(x)); M(A); \x\A. M(f(x))\ ==> M(RepFun(A, λx. f(x)))" apply (simp add: RepFun_def) apply (frule strong_replacement_closed, assumption) apply (auto dest: transM simp add: Replace_conj_eq univalent_def) done
subsubsection ‹Absoluteness for🍋‹Lambda››
definition
is_lambda :: "[i\o, i, [i,i]\o, i] \ o"where "is_lambda(M, A, is_b, z) \ ∀p[M]. p ∈ z ⟷
(∃u[M]. ∃v[M]. u∈A ∧ pair(M,u,v,p) ∧ is_b(u,v))"
lemma (in M_trivial) lam_closed: "\strong_replacement(M, \x y. y = ); M(A); \x\A. M(b(x))\ ==> M(λx∈A. b(x))" by (simp add: lam_def, blast intro: RepFun_closed dest: transM)
text‹Better than ‹lam_closed›: has the formula 🍋‹x∈A›› lemma (in M_trivial) lam_closed2: "\strong_replacement(M, \x y. x\A \ y = \x, b(x)\);
M(A); ∀m[M]. m∈A ⟶ M(b(m))]==> M(Lambda(A,b))" apply (simp add: lam_def) apply (blast intro: RepFun_closed2 dest: transM) done
text‹What about ‹Pow_abs›? Powerset is NOT absolute!
This result is one direction of absoluteness.›
lemma (in M_trans) powerset_Pow: "powerset(M, x, Pow(x))" by (simp add: powerset_def)
text‹But we can't prove that the powerset in \M\ includes the
real powerset.›
lemma (in M_trans) powerset_imp_subset_Pow: "\powerset(M,x,y); M(y)\ \ y \ Pow(x)" apply (simp add: powerset_def) apply (blast dest: transM) done
lemma (in M_trans) powerset_abs: assumes "M(y)" shows "powerset(M,x,y) \ y = {a\Pow(x) . M(a)}" proof (intro iffI equalityI) (* First show the converse implication by double inclusion *) assume"powerset(M,x,y)" with‹M(y)› show"y \ {a\Pow(x) . M(a)}" using powerset_imp_subset_Pow transM by blast from‹powerset(M,x,y)› show"{a\Pow(x) . M(a)} \ y" using transM unfolding powerset_def by auto next(* we show the direct implication *) assume "y = {a \ Pow(x) . M(a)}" then show"powerset(M, x, y)" unfolding powerset_def subset_def using transM by blast qed
subsubsection‹Absoluteness for the Natural Numbers›
lemma (in M_trivial) nat_into_M [intro]: "n \ nat \ M(n)" by (induct n rule: nat_induct, simp_all)
(*NOT for the simplifier. The assumption M(z') is apparently necessary, but causes the error "Failed congruence proof!" It may be better to replace
is_nat_case by nat_case before attempting congruence reasoning.*) lemma is_nat_case_cong: "\a = a'; k = k'; z = z'; M(z'); ∧x y. [M(x); M(y)]==> is_b(x,y) ⟷ is_b'(x,y)\ ==> is_nat_case(M, a, is_b, k, z) ⟷ is_nat_case(M, a', is_b', k', z')" by (simp add: is_nat_case_def)
subsection‹Absoluteness for Ordinals› text‹These results constitute Theorem IV 5.1 of Kunen (page 126).›
lemma (in M_trans) lt_closed: "\j \ M(j)" by (blast dest: ltD intro: transM)
lemma (in M_trans) transitive_set_abs [simp]: "M(a) \ transitive_set(M,a) \ Transset(a)" by (simp add: transitive_set_def Transset_def)
lemma (in M_trans) ordinal_abs [simp]: "M(a) \ ordinal(M,a) \ Ord(a)" by (simp add: ordinal_def Ord_def)
lemma (in M_trivial) number1_abs [simp]: "M(a) \ number1(M,a) \ a = 1" by (simp add: number1_def)
lemma (in M_trivial) number2_abs [simp]: "M(a) \ number2(M,a) \ a = succ(1)" by (simp add: number2_def)
lemma (in M_trivial) number3_abs [simp]: "M(a) \ number3(M,a) \ a = succ(succ(1))" by (simp add: number3_def)
text‹Kunen continued to 20...›
(*Could not get this to work. The \<lambda>x\<in>nat is essential because everything but the recursion variable must stay unchanged. But then the recursion equations only hold for x\<in>nat (or in some other set) and not for the whole of the class M. consts natnumber_aux :: "[i\<Rightarrow>o,i] \<Rightarrow> i"
primrec "natnumber_aux(M,0) = (\<lambda>x\<in>nat. if empty(M,x) then 1 else 0)" "natnumber_aux(M,succ(n)) = (\<lambda>x\<in>nat. if (\<exists>y[M]. natnumber_aux(M,n)`y=1 \<and> successor(M,y,x)) then 1 else 0)"
text‹All the lemmas above are necessary because Powerset is not absolute.
I should have used Replacement instead!› lemma (in M_basic) cartprod_closed [intro,simp]: "\M(A); M(B)\ \ M(A*B)" by (frule cartprod_closed_lemma, assumption, force)
lemma (in M_basic) sum_closed [intro,simp]: "\M(A); M(B)\ \ M(A+B)" by (simp add: sum_def)
lemma (in M_basic) sum_abs [simp]: "\M(A); M(B); M(Z)\ \ is_sum(M,A,B,Z) \ (Z = A+B)" by (simp add: is_sum_def sum_def singleton_0 nat_into_M)
lemma (in M_trivial) Inl_in_M_iff [iff]: "M(Inl(a)) \ M(a)" by (simp add: Inl_def)
lemma (in M_trivial) Inl_abs [simp]: "M(Z) \ is_Inl(M,a,Z) \ (Z = Inl(a))" by (simp add: is_Inl_def Inl_def)
lemma (in M_trivial) Inr_in_M_iff [iff]: "M(Inr(a)) \ M(a)" by (simp add: Inr_def)
lemma (in M_trivial) Inr_abs [simp]: "M(Z) \ is_Inr(M,a,Z) \ (Z = Inr(a))" by (simp add: is_Inr_def Inr_def)
lemma Diff_Collect_eq: "A - Collect(A,P) = Collect(A, \x. \ P(x))" by blast
lemma (in M_trans) Collect_rall_eq: "M(Y) \ Collect(A, \x. \y[M]. y\Y \ P(x,y)) =
(if Y=0 then A else (∩y ∈ Y. {x ∈ A. P(x,y)}))" by (simp,blast dest: transM)
lemma (in M_basic) separation_disj: "\separation(M,P); separation(M,Q)\ \ separation(M, \z. P(z) \ Q(z))" by (simp del: separation_closed
add: separation_iff Collect_Un_Collect_eq [symmetric])
lemma (in M_basic) separation_neg: "separation(M,P) \ separation(M, \z. \P(z))" by (simp del: separation_closed
add: separation_iff Diff_Collect_eq [symmetric])
lemma (in M_basic) separation_imp: "\separation(M,P); separation(M,Q)\ ==> separation(M, λz. P(z) ⟶ Q(z))" by (simp add: separation_neg separation_disj not_disj_iff_imp [symmetric])
text‹This result is a hint of how little can be done without the Reflection Theorem. The quantifier has to be bounded by a set. We also need another instance of Separation!› lemma (in M_basic) separation_rall: "\M(Y); \y[M]. separation(M, \x. P(x,y)); ∀z[M]. strong_replacement(M, λx y. y = {u ∈ z . P(u,x)})] ==> separation(M, λx. ∀y[M]. y∈Y ⟶ P(x,y))" apply (simp del: separation_closed rall_abs
add: separation_iff Collect_rall_eq) apply (blast intro!: RepFun_closed dest: transM) done
subsubsection‹Functions andfunction space›
text‹The assumption 🍋‹M(A->B)›is unusual, but essential: in
all but trivial cases, A->B cannot be expected to belong to🍋‹M›.› lemma (in M_trivial) is_funspace_abs [simp]: "\M(A); M(B); M(F); M(A->B)\ \ is_funspace(M,A,B,F) \ F = A->B" apply (simp add: is_funspace_def) apply (rule iffI) prefer 2 apply blast apply (rule M_equalityI) apply simp_all done
lemma (in M_basic) succ_fun_eq2: "\M(B); M(n->B)\ \
succ(n) -> B = ∪{z. p ∈ (n->B)*B, ∃f[M]. ∃b[M]. p = ⟨f,b⟩∧ z = {cons(⟨n,b⟩, f)}}" apply (simp add: succ_fun_eq) apply (blast dest: transM) done
text‹🍋‹M›contains all finite function spaces. Needed to prove the
absoluteness of transitive closure. See the definition of ‹rtrancl_alt›inin‹WF_absolute.thy›.› lemma (in M_basic) finite_funspace_closed [intro,simp]: "\n\nat; M(B)\ \ M(n->B)" apply (induct_tac n, simp) apply (simp add: funspace_succ nat_into_M) done
subsection‹Relativization and Absoluteness for Boolean Operators›
definition
list_case' :: "[i, [i,i]\i, i] \ i" where 🍋‹A version of 🍋‹list_case› that's always defined.\ "list_case'(a,b,xs) \ if quasilist(xs) then list_case(a,b,xs) else 0"
definition
is_list_case :: "[i\o, i, [i,i,i]\o, i, i] \ o"where 🍋‹Returns 0 for non-lists› "is_list_case(M, a, is_b, xs, z) \
(is_Nil(M,xs) ⟶ z=a) ∧
(∀x[M]. ∀l[M]. is_Cons(M,x,l,xs) ⟶ is_b(x,l,z)) ∧
(is_quasilist(M,xs) ∨ empty(M,z))"
definition
hd' :: "i \ i" where 🍋‹A version of 🍋‹hd› that's always defined.\ "hd'(xs) \ if quasilist(xs) then hd(xs) else 0"
definition
tl' :: "i \ i" where 🍋‹A version of 🍋‹tl› that's always defined.\ "tl'(xs) \ if quasilist(xs) then tl(xs) else 0"
definition
is_hd :: "[i\o,i,i] \ o"where 🍋‹🍋‹hd([]) = 0› no constraints if not a list.
Avoiding implication prevents the simplifier's looping.\ "is_hd(M,xs,H) \
(is_Nil(M,xs) ⟶ empty(M,H)) ∧
(∀x[M]. ∀l[M]. ¬ is_Cons(M,x,l,xs) ∨ H=x) ∧
(is_quasilist(M,xs) ∨ empty(M,H))"
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.