text\<open>The second argument of \<^term>\<open>is_a\<close> gives it direct access to \<^term>\<open>x\<close>,
which is essential for handling free variable references. Treatment is
based on that of \<open>is_nat_case_reflection\<close>.\<close> theorem is_formula_case_reflection: assumes is_a_reflection: "\h f g g'. REFLECTS[\x. is_a(L, h(x), f(x), g(x), g'(x)), \<lambda>i x. is_a(##Lset(i), h(x), f(x), g(x), g'(x))]" and is_b_reflection: "\h f g g'. REFLECTS[\x. is_b(L, h(x), f(x), g(x), g'(x)), \<lambda>i x. is_b(##Lset(i), h(x), f(x), g(x), g'(x))]" and is_c_reflection: "\h f g g'. REFLECTS[\x. is_c(L, h(x), f(x), g(x), g'(x)), \<lambda>i x. is_c(##Lset(i), h(x), f(x), g(x), g'(x))]" and is_d_reflection: "\h f g g'. REFLECTS[\x. is_d(L, h(x), f(x), g(x)), \<lambda>i x. is_d(##Lset(i), h(x), f(x), g(x))]" shows"REFLECTS[\x. is_formula_case(L, is_a(L,x), is_b(L,x), is_c(L,x), is_d(L,x), g(x), h(x)), \<lambda>i x. is_formula_case(##Lset(i), is_a(##Lset(i), x), is_b(##Lset(i), x), is_c(##Lset(i), x), is_d(##Lset(i), x), g(x), h(x))]" apply (simp (no_asm_use) only: is_formula_case_def) apply (intro FOL_reflections function_reflections finite_ordinal_reflection
mem_formula_reflection
Member_reflection Equal_reflection Nand_reflection Forall_reflection
is_a_reflection is_b_reflection is_c_reflection is_d_reflection) done
subsection \<open>Absoluteness for the Function \<^term>\<open>satisfies\<close>\<close>
definition
is_depth_apply :: "[i\o,i,i,i] \ o" where \<comment> \<open>Merely a useful abbreviation for the sequel.\<close> "is_depth_apply(M,h,p,z) \ \<exists>dp[M]. \<exists>sdp[M]. \<exists>hsdp[M].
finite_ordinal(M,dp) \<and> is_depth(M,p,dp) \<and> successor(M,dp,sdp) \<and>
fun_apply(M,h,sdp,hsdp) \<and> fun_apply(M,hsdp,p,z)"
lemma (in M_datatypes) is_depth_apply_abs [simp]: "\M(h); p \ formula; M(z)\ \<Longrightarrow> is_depth_apply(M,h,p,z) \<longleftrightarrow> z = h ` succ(depth(p)) ` p" by (simp add: is_depth_apply_def formula_into_M depth_type eq_commute)
text\<open>There is at present some redundancy between the relativizations in
e.g. \<open>satisfies_is_a\<close> and those in e.g. \<open>Member_replacement\<close>.\<close>
text\<open>These constants let us instantiate the parameters \<^term>\<open>a\<close>, \<^term>\<open>b\<close>, \<^term>\<open>c\<close>, \<^term>\<open>d\<close>, etc., of the locale \<open>Formula_Rec\<close>.\<close> definition
satisfies_a :: "[i,i,i]\i" where "satisfies_a(A) \ \<lambda>x y. \<lambda>env \<in> list(A). bool_of_o (nth(x,env) \<in> nth(y,env))"
definition
satisfies_is_a :: "[i\o,i,i,i,i]\o" where "satisfies_is_a(M,A) \ \<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) \<longrightarrow>
is_lambda(M, lA, \<lambda>env z. is_bool_of_o(M, \<exists>nx[M]. \<exists>ny[M].
is_nth(M,x,env,nx) \<and> is_nth(M,y,env,ny) \<and> nx \<in> ny, z),
zz)"
definition
satisfies_b :: "[i,i,i]\i" where "satisfies_b(A) \ \<lambda>x y. \<lambda>env \<in> list(A). bool_of_o (nth(x,env) = nth(y,env))"
definition
satisfies_is_b :: "[i\o,i,i,i,i]\o" where \<comment> \<open>We simplify the formula to have just \<^term>\<open>nx\<close> rather than
introducing \<^term>\<open>ny\<close> with \<^term>\<open>nx=ny\<close>\<close> "satisfies_is_b(M,A) \ \<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) \<longrightarrow>
is_lambda(M, lA, \<lambda>env z. is_bool_of_o(M, \<exists>nx[M]. is_nth(M,x,env,nx) \<and> is_nth(M,y,env,nx), z),
zz)"
definition
satisfies_c :: "[i,i,i,i,i]\i" where "satisfies_c(A) \ \p q rp rq. \env \ list(A). not(rp ` env and rq ` env)"
definition
satisfies_MH :: "[i\o,i,i,i,i]\o" where \<comment> \<open>The variable \<^term>\<open>u\<close> is unused, but gives \<^term>\<open>satisfies_MH\<close>
the correct arity.\<close> "satisfies_MH \ \<lambda>M A u f z. \<forall>fml[M]. is_formula(M,fml) \<longrightarrow>
is_lambda (M, fml,
is_formula_case (M, satisfies_is_a(M,A),
satisfies_is_b(M,A),
satisfies_is_c(M,A,f), satisfies_is_d(M,A,f)),
z)"
definition
is_satisfies :: "[i\o,i,i,i]\o" where "is_satisfies(M,A) \ is_formula_rec (M, satisfies_MH(M,A))"
text\<open>This lemma relates the fragments defined above to the original primitive
recursion in\<^term>\<open>satisfies\<close>. Inductionis not required: the definitions are directly equal!\<close> lemma satisfies_eq: "satisfies(A,p) =
formula_rec (satisfies_a(A), satisfies_b(A),
satisfies_c(A), satisfies_d(A), p)" by (simp add: satisfies_formula_def satisfies_a_def satisfies_b_def
satisfies_c_def satisfies_d_def)
text\<open>Further constraints on the class \<^term>\<open>M\<close> in order to prove
absoluteness for the constants defined above. The ultimate goal is the absoluteness of the function\<^term>\<open>satisfies\<close>.\<close> locale M_satisfies = M_eclose + assumes
Member_replacement: "\M(A); x \ nat; y \ nat\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M].
env \<in> list(A) \<and> is_nth(M,x,env,nx) \<and> is_nth(M,y,env,ny) \<and>
is_bool_of_o(M, nx \<in> ny, bo) \<and>
pair(M, env, bo, z))" and
Equal_replacement: "\M(A); x \ nat; y \ nat\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M].
env \<in> list(A) \<and> is_nth(M,x,env,nx) \<and> is_nth(M,y,env,ny) \<and>
is_bool_of_o(M, nx = ny, bo) \<and>
pair(M, env, bo, z))" and
Nand_replacement: "\M(A); M(rp); M(rq)\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z. \<exists>rpe[M]. \<exists>rqe[M]. \<exists>andpq[M]. \<exists>notpq[M].
fun_apply(M,rp,env,rpe) \<and> fun_apply(M,rq,env,rqe) \<and>
is_and(M,rpe,rqe,andpq) \<and> is_not(M,andpq,notpq) \<and>
env \<in> list(A) \<and> pair(M, env, notpq, z))" and
Forall_replacement: "\M(A); M(rp)\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z. \<exists>bo[M].
env \<in> list(A) \<and>
is_bool_of_o (M, \<forall>a[M]. \<forall>co[M]. \<forall>rpco[M].
a\<in>A \<longrightarrow> is_Cons(M,a,env,co) \<longrightarrow>
fun_apply(M,rp,co,rpco) \<longrightarrow> number1(M, rpco),
bo) \<and>
pair(M,env,bo,z))" and
formula_rec_replacement: \<comment> \<open>For the \<^term>\<open>transrec\<close>\<close> "\n \ nat; M(A)\ \ transrec_replacement(M, satisfies_MH(M,A), n)" and
formula_rec_lambda_replacement: \<comment> \<open>For the \<open>\<lambda>-abstraction\<close> in the \<^term>\<open>transrec\<close> body\<close> "\M(g); M(A)\ \
strong_replacement (M, \<lambda>x y. mem_formula(M,x) \<and>
(\<exists>c[M]. is_formula_case(M, satisfies_is_a(M,A),
satisfies_is_b(M,A),
satisfies_is_c(M,A,g),
satisfies_is_d(M,A,g), x, c) \<and>
pair(M, x, c, y)))"
lemma (in M_satisfies) Member_replacement': "\M(A); x \ nat; y \ nat\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z. env \<in> list(A) \<and>
z = \<langle>env, bool_of_o(nth(x, env) \<in> nth(y, env))\<rangle>)" by (insert Member_replacement, simp)
lemma (in M_satisfies) Equal_replacement': "\M(A); x \ nat; y \ nat\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z. env \<in> list(A) \<and>
z = \<langle>env, bool_of_o(nth(x, env) = nth(y, env))\<rangle>)" by (insert Equal_replacement, simp)
lemma (in M_satisfies) Nand_replacement': "\M(A); M(rp); M(rq)\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z. env \<in> list(A) \<and> z = \<langle>env, not(rp`env and rq`env)\<rangle>)" by (insert Nand_replacement, simp)
lemma (in M_satisfies) Forall_replacement': "\M(A); M(rp)\ \<Longrightarrow> strong_replacement
(M, \<lambda>env z.
env \<in> list(A) \<and>
z = \<langle>env, bool_of_o (\<forall>a\<in>A. rp ` Cons(a,env) = 1)\<rangle>)" by (insert Forall_replacement, simp)
lemma (in M_satisfies) fr_replace: "\n \ nat; M(A)\ \ transrec_replacement(M,satisfies_MH(M,A),n)" by (blast intro: formula_rec_replacement)
lemma (in M_satisfies) formula_case_satisfies_closed: "\M(g); M(A); x \ formula\ \
M(formula_case (satisfies_a(A), satisfies_b(A), \<lambda>u v. satisfies_c(A, u, v,
g ` succ(depth(u)) ` u, g ` succ(depth(v)) ` v), \<lambda>u. satisfies_d (A, u, g ` succ(depth(u)) ` u),
x))" by (blast intro: a_closed b_closed c_closed d_closed)
lemma (in M_satisfies) fr_lam_replace: "\M(g); M(A)\ \
strong_replacement (M, \<lambda>x y. x \<in> formula \<and>
y = \<langle>x,
formula_rec_case(satisfies_a(A),
satisfies_b(A),
satisfies_c(A),
satisfies_d(A), g, x)\<rangle>)" apply (insert formula_rec_lambda_replacement) apply (simp add: formula_rec_case_def formula_case_satisfies_closed
formula_case_abs [OF a_rel b_rel c_rel d_rel]) done
text\<open>Instantiate locale \<open>Formula_Rec\<close> for the Function\<^term>\<open>satisfies\<close>\<close>
lemma formula_rec_replacement_Reflects: "REFLECTS [\x. \u[L]. u \ B \ (\y[L]. pair(L, u, y, x) \
is_wfrec (L, satisfies_MH(L,A), mesa, u, y)), \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> (\<exists>y \<in> Lset(i). pair(##Lset(i), u, y, x) \<and>
is_wfrec (##Lset(i), satisfies_MH(##Lset(i),A), mesa, u, y))]" by (intro FOL_reflections function_reflections satisfies_MH_reflection
is_wfrec_reflection)
text\<open>Finally: the point of the whole theory!\<close> lemmas satisfies_closed = M_satisfies.satisfies_closed [OF M_satisfies_L] and satisfies_abs = M_satisfies.satisfies_abs [OF M_satisfies_L]
end
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.34Bemerkung:
Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können
¤
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.