src/ZF/Constructible/L_axioms.thy
author paulson
Wed Jul 10 16:54:07 2002 +0200 (2002-07-10)
changeset 13339 0f89104dd377
parent 13323 2c287f50c9f3
child 13348 374d05460db4
permissions -rw-r--r--
Fixed quantified variable name preservation for ball and bex (bounded quants)
Requires tweaking of other scripts. Also routine tidying.
     1 header {*The ZF Axioms (Except Separation) in L*}
     2 
     3 theory L_axioms = Formula + Relative + Reflection + MetaExists:
     4 
     5 text {* The class L satisfies the premises of locale @{text M_triv_axioms} *}
     6 
     7 lemma transL: "[| y\<in>x; L(x) |] ==> L(y)"
     8 apply (insert Transset_Lset) 
     9 apply (simp add: Transset_def L_def, blast) 
    10 done
    11 
    12 lemma nonempty: "L(0)"
    13 apply (simp add: L_def) 
    14 apply (blast intro: zero_in_Lset) 
    15 done
    16 
    17 lemma upair_ax: "upair_ax(L)"
    18 apply (simp add: upair_ax_def upair_def, clarify)
    19 apply (rule_tac x="{x,y}" in rexI)  
    20 apply (simp_all add: doubleton_in_L) 
    21 done
    22 
    23 lemma Union_ax: "Union_ax(L)"
    24 apply (simp add: Union_ax_def big_union_def, clarify)
    25 apply (rule_tac x="Union(x)" in rexI)  
    26 apply (simp_all add: Union_in_L, auto) 
    27 apply (blast intro: transL) 
    28 done
    29 
    30 lemma power_ax: "power_ax(L)"
    31 apply (simp add: power_ax_def powerset_def Relative.subset_def, clarify)
    32 apply (rule_tac x="{y \<in> Pow(x). L(y)}" in rexI)  
    33 apply (simp_all add: LPow_in_L, auto)
    34 apply (blast intro: transL) 
    35 done
    36 
    37 subsubsection{*For L to satisfy Replacement *}
    38 
    39 (*Can't move these to Formula unless the definition of univalent is moved
    40 there too!*)
    41 
    42 lemma LReplace_in_Lset:
    43      "[|X \<in> Lset(i); univalent(L,X,Q); Ord(i)|] 
    44       ==> \<exists>j. Ord(j) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Lset(j)"
    45 apply (rule_tac x="\<Union>y \<in> Replace(X, %x y. Q(x,y) & L(y)). succ(lrank(y))" 
    46        in exI)
    47 apply simp
    48 apply clarify 
    49 apply (rule_tac a=x in UN_I)  
    50  apply (simp_all add: Replace_iff univalent_def) 
    51 apply (blast dest: transL L_I) 
    52 done
    53 
    54 lemma LReplace_in_L: 
    55      "[|L(X); univalent(L,X,Q)|] 
    56       ==> \<exists>Y. L(Y) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Y"
    57 apply (drule L_D, clarify) 
    58 apply (drule LReplace_in_Lset, assumption+)
    59 apply (blast intro: L_I Lset_in_Lset_succ)
    60 done
    61 
    62 lemma replacement: "replacement(L,P)"
    63 apply (simp add: replacement_def, clarify)
    64 apply (frule LReplace_in_L, assumption+, clarify) 
    65 apply (rule_tac x=Y in rexI)   
    66 apply (simp_all add: Replace_iff univalent_def, blast) 
    67 done
    68 
    69 subsection{*Instantiation of the locale @{text M_triv_axioms}*}
    70 
    71 lemma Lset_mono_le: "mono_le_subset(Lset)"
    72 by (simp add: mono_le_subset_def le_imp_subset Lset_mono) 
    73 
    74 lemma Lset_cont: "cont_Ord(Lset)"
    75 by (simp add: cont_Ord_def Limit_Lset_eq OUnion_def Limit_is_Ord) 
    76 
    77 lemmas Pair_in_Lset = Formula.Pair_in_LLimit;
    78 
    79 lemmas L_nat = Ord_in_L [OF Ord_nat];
    80 
    81 ML
    82 {*
    83 val transL = thm "transL";
    84 val nonempty = thm "nonempty";
    85 val upair_ax = thm "upair_ax";
    86 val Union_ax = thm "Union_ax";
    87 val power_ax = thm "power_ax";
    88 val replacement = thm "replacement";
    89 val L_nat = thm "L_nat";
    90 
    91 fun kill_flex_triv_prems st = Seq.hd ((REPEAT_FIRST assume_tac) st);
    92 
    93 fun trivaxL th =
    94     kill_flex_triv_prems 
    95        ([transL, nonempty, upair_ax, Union_ax, power_ax, replacement, L_nat] 
    96         MRS (inst "M" "L" th));
    97 
    98 bind_thm ("ball_abs", trivaxL (thm "M_triv_axioms.ball_abs"));
    99 bind_thm ("rall_abs", trivaxL (thm "M_triv_axioms.rall_abs"));
   100 bind_thm ("bex_abs", trivaxL (thm "M_triv_axioms.bex_abs"));
   101 bind_thm ("rex_abs", trivaxL (thm "M_triv_axioms.rex_abs"));
   102 bind_thm ("ball_iff_equiv", trivaxL (thm "M_triv_axioms.ball_iff_equiv"));
   103 bind_thm ("M_equalityI", trivaxL (thm "M_triv_axioms.M_equalityI"));
   104 bind_thm ("empty_abs", trivaxL (thm "M_triv_axioms.empty_abs"));
   105 bind_thm ("subset_abs", trivaxL (thm "M_triv_axioms.subset_abs"));
   106 bind_thm ("upair_abs", trivaxL (thm "M_triv_axioms.upair_abs"));
   107 bind_thm ("upair_in_M_iff", trivaxL (thm "M_triv_axioms.upair_in_M_iff"));
   108 bind_thm ("singleton_in_M_iff", trivaxL (thm "M_triv_axioms.singleton_in_M_iff"));
   109 bind_thm ("pair_abs", trivaxL (thm "M_triv_axioms.pair_abs"));
   110 bind_thm ("pair_in_M_iff", trivaxL (thm "M_triv_axioms.pair_in_M_iff"));
   111 bind_thm ("pair_components_in_M", trivaxL (thm "M_triv_axioms.pair_components_in_M"));
   112 bind_thm ("cartprod_abs", trivaxL (thm "M_triv_axioms.cartprod_abs"));
   113 bind_thm ("union_abs", trivaxL (thm "M_triv_axioms.union_abs"));
   114 bind_thm ("inter_abs", trivaxL (thm "M_triv_axioms.inter_abs"));
   115 bind_thm ("setdiff_abs", trivaxL (thm "M_triv_axioms.setdiff_abs"));
   116 bind_thm ("Union_abs", trivaxL (thm "M_triv_axioms.Union_abs"));
   117 bind_thm ("Union_closed", trivaxL (thm "M_triv_axioms.Union_closed"));
   118 bind_thm ("Un_closed", trivaxL (thm "M_triv_axioms.Un_closed"));
   119 bind_thm ("cons_closed", trivaxL (thm "M_triv_axioms.cons_closed"));
   120 bind_thm ("successor_abs", trivaxL (thm "M_triv_axioms.successor_abs"));
   121 bind_thm ("succ_in_M_iff", trivaxL (thm "M_triv_axioms.succ_in_M_iff"));
   122 bind_thm ("separation_closed", trivaxL (thm "M_triv_axioms.separation_closed"));
   123 bind_thm ("strong_replacementI", trivaxL (thm "M_triv_axioms.strong_replacementI"));
   124 bind_thm ("strong_replacement_closed", trivaxL (thm "M_triv_axioms.strong_replacement_closed"));
   125 bind_thm ("RepFun_closed", trivaxL (thm "M_triv_axioms.RepFun_closed"));
   126 bind_thm ("lam_closed", trivaxL (thm "M_triv_axioms.lam_closed"));
   127 bind_thm ("image_abs", trivaxL (thm "M_triv_axioms.image_abs"));
   128 bind_thm ("powerset_Pow", trivaxL (thm "M_triv_axioms.powerset_Pow"));
   129 bind_thm ("powerset_imp_subset_Pow", trivaxL (thm "M_triv_axioms.powerset_imp_subset_Pow"));
   130 bind_thm ("nat_into_M", trivaxL (thm "M_triv_axioms.nat_into_M"));
   131 bind_thm ("nat_case_closed", trivaxL (thm "M_triv_axioms.nat_case_closed"));
   132 bind_thm ("Inl_in_M_iff", trivaxL (thm "M_triv_axioms.Inl_in_M_iff"));
   133 bind_thm ("Inr_in_M_iff", trivaxL (thm "M_triv_axioms.Inr_in_M_iff"));
   134 bind_thm ("lt_closed", trivaxL (thm "M_triv_axioms.lt_closed"));
   135 bind_thm ("transitive_set_abs", trivaxL (thm "M_triv_axioms.transitive_set_abs"));
   136 bind_thm ("ordinal_abs", trivaxL (thm "M_triv_axioms.ordinal_abs"));
   137 bind_thm ("limit_ordinal_abs", trivaxL (thm "M_triv_axioms.limit_ordinal_abs"));
   138 bind_thm ("successor_ordinal_abs", trivaxL (thm "M_triv_axioms.successor_ordinal_abs"));
   139 bind_thm ("finite_ordinal_abs", trivaxL (thm "M_triv_axioms.finite_ordinal_abs"));
   140 bind_thm ("omega_abs", trivaxL (thm "M_triv_axioms.omega_abs"));
   141 bind_thm ("number1_abs", trivaxL (thm "M_triv_axioms.number1_abs"));
   142 bind_thm ("number1_abs", trivaxL (thm "M_triv_axioms.number1_abs"));
   143 bind_thm ("number3_abs", trivaxL (thm "M_triv_axioms.number3_abs"));
   144 *}
   145 
   146 declare ball_abs [simp] 
   147 declare rall_abs [simp] 
   148 declare bex_abs [simp] 
   149 declare rex_abs [simp] 
   150 declare empty_abs [simp] 
   151 declare subset_abs [simp] 
   152 declare upair_abs [simp] 
   153 declare upair_in_M_iff [iff]
   154 declare singleton_in_M_iff [iff]
   155 declare pair_abs [simp] 
   156 declare pair_in_M_iff [iff]
   157 declare cartprod_abs [simp] 
   158 declare union_abs [simp] 
   159 declare inter_abs [simp] 
   160 declare setdiff_abs [simp] 
   161 declare Union_abs [simp] 
   162 declare Union_closed [intro,simp]
   163 declare Un_closed [intro,simp]
   164 declare cons_closed [intro,simp]
   165 declare successor_abs [simp] 
   166 declare succ_in_M_iff [iff]
   167 declare separation_closed [intro,simp]
   168 declare strong_replacementI
   169 declare strong_replacement_closed [intro,simp]
   170 declare RepFun_closed [intro,simp]
   171 declare lam_closed [intro,simp]
   172 declare image_abs [simp] 
   173 declare nat_into_M [intro]
   174 declare Inl_in_M_iff [iff]
   175 declare Inr_in_M_iff [iff]
   176 declare transitive_set_abs [simp] 
   177 declare ordinal_abs [simp] 
   178 declare limit_ordinal_abs [simp] 
   179 declare successor_ordinal_abs [simp] 
   180 declare finite_ordinal_abs [simp] 
   181 declare omega_abs [simp] 
   182 declare number1_abs [simp] 
   183 declare number1_abs [simp] 
   184 declare number3_abs [simp]
   185 
   186 
   187 subsection{*Instantiation of the locale @{text reflection}*}
   188 
   189 text{*instances of locale constants*}
   190 constdefs
   191   L_F0 :: "[i=>o,i] => i"
   192     "L_F0(P,y) == \<mu>b. (\<exists>z. L(z) \<and> P(<y,z>)) --> (\<exists>z\<in>Lset(b). P(<y,z>))"
   193 
   194   L_FF :: "[i=>o,i] => i"
   195     "L_FF(P)   == \<lambda>a. \<Union>y\<in>Lset(a). L_F0(P,y)"
   196 
   197   L_ClEx :: "[i=>o,i] => o"
   198     "L_ClEx(P) == \<lambda>a. Limit(a) \<and> normalize(L_FF(P),a) = a"
   199 
   200 
   201 text{*We must use the meta-existential quantifier; otherwise the reflection
   202       terms become enormous!*} 
   203 constdefs
   204   L_Reflects :: "[i=>o,[i,i]=>o] => prop"      ("(3REFLECTS/ [_,/ _])")
   205     "REFLECTS[P,Q] == (??Cl. Closed_Unbounded(Cl) &
   206                            (\<forall>a. Cl(a) --> (\<forall>x \<in> Lset(a). P(x) <-> Q(a,x))))"
   207 
   208 
   209 theorem Triv_reflection:
   210      "REFLECTS[P, \<lambda>a x. P(x)]"
   211 apply (simp add: L_Reflects_def) 
   212 apply (rule meta_exI) 
   213 apply (rule Closed_Unbounded_Ord) 
   214 done
   215 
   216 theorem Not_reflection:
   217      "REFLECTS[P,Q] ==> REFLECTS[\<lambda>x. ~P(x), \<lambda>a x. ~Q(a,x)]"
   218 apply (unfold L_Reflects_def) 
   219 apply (erule meta_exE) 
   220 apply (rule_tac x=Cl in meta_exI, simp) 
   221 done
   222 
   223 theorem And_reflection:
   224      "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] 
   225       ==> REFLECTS[\<lambda>x. P(x) \<and> P'(x), \<lambda>a x. Q(a,x) \<and> Q'(a,x)]"
   226 apply (unfold L_Reflects_def) 
   227 apply (elim meta_exE) 
   228 apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) 
   229 apply (simp add: Closed_Unbounded_Int, blast) 
   230 done
   231 
   232 theorem Or_reflection:
   233      "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] 
   234       ==> REFLECTS[\<lambda>x. P(x) \<or> P'(x), \<lambda>a x. Q(a,x) \<or> Q'(a,x)]"
   235 apply (unfold L_Reflects_def) 
   236 apply (elim meta_exE) 
   237 apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) 
   238 apply (simp add: Closed_Unbounded_Int, blast) 
   239 done
   240 
   241 theorem Imp_reflection:
   242      "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] 
   243       ==> REFLECTS[\<lambda>x. P(x) --> P'(x), \<lambda>a x. Q(a,x) --> Q'(a,x)]"
   244 apply (unfold L_Reflects_def) 
   245 apply (elim meta_exE) 
   246 apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) 
   247 apply (simp add: Closed_Unbounded_Int, blast) 
   248 done
   249 
   250 theorem Iff_reflection:
   251      "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] 
   252       ==> REFLECTS[\<lambda>x. P(x) <-> P'(x), \<lambda>a x. Q(a,x) <-> Q'(a,x)]"
   253 apply (unfold L_Reflects_def) 
   254 apply (elim meta_exE) 
   255 apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) 
   256 apply (simp add: Closed_Unbounded_Int, blast) 
   257 done
   258 
   259 
   260 theorem Ex_reflection:
   261      "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
   262       ==> REFLECTS[\<lambda>x. \<exists>z. L(z) \<and> P(x,z), \<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z)]"
   263 apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def) 
   264 apply (elim meta_exE) 
   265 apply (rule meta_exI)
   266 apply (rule reflection.Ex_reflection [OF Lset_mono_le Lset_cont Pair_in_Lset],
   267        assumption+)
   268 done
   269 
   270 theorem All_reflection:
   271      "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
   272       ==> REFLECTS[\<lambda>x. \<forall>z. L(z) --> P(x,z), \<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z)]" 
   273 apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def) 
   274 apply (elim meta_exE) 
   275 apply (rule meta_exI)
   276 apply (rule reflection.All_reflection [OF Lset_mono_le Lset_cont Pair_in_Lset],
   277        assumption+)
   278 done
   279 
   280 theorem Rex_reflection:
   281      "REFLECTS[ \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
   282       ==> REFLECTS[\<lambda>x. \<exists>z[L]. P(x,z), \<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z)]"
   283 apply (unfold rex_def) 
   284 apply (intro And_reflection Ex_reflection, assumption)
   285 done
   286 
   287 theorem Rall_reflection:
   288      "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
   289       ==> REFLECTS[\<lambda>x. \<forall>z[L]. P(x,z), \<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z)]" 
   290 apply (unfold rall_def) 
   291 apply (intro Imp_reflection All_reflection, assumption)
   292 done
   293 
   294 lemmas FOL_reflections = 
   295         Triv_reflection Not_reflection And_reflection Or_reflection
   296         Imp_reflection Iff_reflection Ex_reflection All_reflection
   297         Rex_reflection Rall_reflection
   298 
   299 lemma ReflectsD:
   300      "[|REFLECTS[P,Q]; Ord(i)|] 
   301       ==> \<exists>j. i<j & (\<forall>x \<in> Lset(j). P(x) <-> Q(j,x))"
   302 apply (unfold L_Reflects_def Closed_Unbounded_def) 
   303 apply (elim meta_exE, clarify) 
   304 apply (blast dest!: UnboundedD) 
   305 done
   306 
   307 lemma ReflectsE:
   308      "[| REFLECTS[P,Q]; Ord(i);
   309          !!j. [|i<j;  \<forall>x \<in> Lset(j). P(x) <-> Q(j,x)|] ==> R |]
   310       ==> R"
   311 apply (drule ReflectsD, assumption, blast) 
   312 done
   313 
   314 lemma Collect_mem_eq: "{x\<in>A. x\<in>B} = A \<inter> B";
   315 by blast
   316 
   317 
   318 subsection{*Internalized Formulas for some Set-Theoretic Concepts*}
   319 
   320 lemmas setclass_simps = rall_setclass_is_ball rex_setclass_is_bex
   321 
   322 subsubsection{*Some numbers to help write de Bruijn indices*}
   323 
   324 syntax
   325     "3" :: i   ("3")
   326     "4" :: i   ("4")
   327     "5" :: i   ("5")
   328     "6" :: i   ("6")
   329     "7" :: i   ("7")
   330     "8" :: i   ("8")
   331     "9" :: i   ("9")
   332 
   333 translations
   334    "3"  == "succ(2)"
   335    "4"  == "succ(3)"
   336    "5"  == "succ(4)"
   337    "6"  == "succ(5)"
   338    "7"  == "succ(6)"
   339    "8"  == "succ(7)"
   340    "9"  == "succ(8)"
   341 
   342 
   343 subsubsection{*The Empty Set, Internalized*}
   344 
   345 constdefs empty_fm :: "i=>i"
   346     "empty_fm(x) == Forall(Neg(Member(0,succ(x))))"
   347 
   348 lemma empty_type [TC]:
   349      "x \<in> nat ==> empty_fm(x) \<in> formula"
   350 by (simp add: empty_fm_def) 
   351 
   352 lemma arity_empty_fm [simp]:
   353      "x \<in> nat ==> arity(empty_fm(x)) = succ(x)"
   354 by (simp add: empty_fm_def succ_Un_distrib [symmetric] Un_ac) 
   355 
   356 lemma sats_empty_fm [simp]:
   357    "[| x \<in> nat; env \<in> list(A)|]
   358     ==> sats(A, empty_fm(x), env) <-> empty(**A, nth(x,env))"
   359 by (simp add: empty_fm_def empty_def)
   360 
   361 lemma empty_iff_sats:
   362       "[| nth(i,env) = x; nth(j,env) = y; 
   363           i \<in> nat; env \<in> list(A)|]
   364        ==> empty(**A, x) <-> sats(A, empty_fm(i), env)"
   365 by simp
   366 
   367 theorem empty_reflection:
   368      "REFLECTS[\<lambda>x. empty(L,f(x)), 
   369                \<lambda>i x. empty(**Lset(i),f(x))]"
   370 apply (simp only: empty_def setclass_simps)
   371 apply (intro FOL_reflections)  
   372 done
   373 
   374 
   375 subsubsection{*Unordered Pairs, Internalized*}
   376 
   377 constdefs upair_fm :: "[i,i,i]=>i"
   378     "upair_fm(x,y,z) == 
   379        And(Member(x,z), 
   380            And(Member(y,z),
   381                Forall(Implies(Member(0,succ(z)), 
   382                               Or(Equal(0,succ(x)), Equal(0,succ(y)))))))"
   383 
   384 lemma upair_type [TC]:
   385      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> upair_fm(x,y,z) \<in> formula"
   386 by (simp add: upair_fm_def) 
   387 
   388 lemma arity_upair_fm [simp]:
   389      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
   390       ==> arity(upair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
   391 by (simp add: upair_fm_def succ_Un_distrib [symmetric] Un_ac) 
   392 
   393 lemma sats_upair_fm [simp]:
   394    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
   395     ==> sats(A, upair_fm(x,y,z), env) <-> 
   396             upair(**A, nth(x,env), nth(y,env), nth(z,env))"
   397 by (simp add: upair_fm_def upair_def)
   398 
   399 lemma upair_iff_sats:
   400       "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
   401           i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
   402        ==> upair(**A, x, y, z) <-> sats(A, upair_fm(i,j,k), env)"
   403 by (simp add: sats_upair_fm)
   404 
   405 text{*Useful? At least it refers to "real" unordered pairs*}
   406 lemma sats_upair_fm2 [simp]:
   407    "[| x \<in> nat; y \<in> nat; z < length(env); env \<in> list(A); Transset(A)|]
   408     ==> sats(A, upair_fm(x,y,z), env) <-> 
   409         nth(z,env) = {nth(x,env), nth(y,env)}"
   410 apply (frule lt_length_in_nat, assumption)  
   411 apply (simp add: upair_fm_def Transset_def, auto) 
   412 apply (blast intro: nth_type) 
   413 done
   414 
   415 theorem upair_reflection:
   416      "REFLECTS[\<lambda>x. upair(L,f(x),g(x),h(x)), 
   417                \<lambda>i x. upair(**Lset(i),f(x),g(x),h(x))]" 
   418 apply (simp add: upair_def)
   419 apply (intro FOL_reflections)  
   420 done
   421 
   422 subsubsection{*Ordered pairs, Internalized*}
   423 
   424 constdefs pair_fm :: "[i,i,i]=>i"
   425     "pair_fm(x,y,z) == 
   426        Exists(And(upair_fm(succ(x),succ(x),0),
   427               Exists(And(upair_fm(succ(succ(x)),succ(succ(y)),0),
   428                          upair_fm(1,0,succ(succ(z)))))))"
   429 
   430 lemma pair_type [TC]:
   431      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> pair_fm(x,y,z) \<in> formula"
   432 by (simp add: pair_fm_def) 
   433 
   434 lemma arity_pair_fm [simp]:
   435      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
   436       ==> arity(pair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
   437 by (simp add: pair_fm_def succ_Un_distrib [symmetric] Un_ac) 
   438 
   439 lemma sats_pair_fm [simp]:
   440    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
   441     ==> sats(A, pair_fm(x,y,z), env) <-> 
   442         pair(**A, nth(x,env), nth(y,env), nth(z,env))"
   443 by (simp add: pair_fm_def pair_def)
   444 
   445 lemma pair_iff_sats:
   446       "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
   447           i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
   448        ==> pair(**A, x, y, z) <-> sats(A, pair_fm(i,j,k), env)"
   449 by (simp add: sats_pair_fm)
   450 
   451 theorem pair_reflection:
   452      "REFLECTS[\<lambda>x. pair(L,f(x),g(x),h(x)), 
   453                \<lambda>i x. pair(**Lset(i),f(x),g(x),h(x))]"
   454 apply (simp only: pair_def setclass_simps)
   455 apply (intro FOL_reflections upair_reflection)  
   456 done
   457 
   458 
   459 subsubsection{*Binary Unions, Internalized*}
   460 
   461 constdefs union_fm :: "[i,i,i]=>i"
   462     "union_fm(x,y,z) == 
   463        Forall(Iff(Member(0,succ(z)),
   464                   Or(Member(0,succ(x)),Member(0,succ(y)))))"
   465 
   466 lemma union_type [TC]:
   467      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> union_fm(x,y,z) \<in> formula"
   468 by (simp add: union_fm_def) 
   469 
   470 lemma arity_union_fm [simp]:
   471      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
   472       ==> arity(union_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
   473 by (simp add: union_fm_def succ_Un_distrib [symmetric] Un_ac) 
   474 
   475 lemma sats_union_fm [simp]:
   476    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
   477     ==> sats(A, union_fm(x,y,z), env) <-> 
   478         union(**A, nth(x,env), nth(y,env), nth(z,env))"
   479 by (simp add: union_fm_def union_def)
   480 
   481 lemma union_iff_sats:
   482       "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
   483           i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
   484        ==> union(**A, x, y, z) <-> sats(A, union_fm(i,j,k), env)"
   485 by (simp add: sats_union_fm)
   486 
   487 theorem union_reflection:
   488      "REFLECTS[\<lambda>x. union(L,f(x),g(x),h(x)), 
   489                \<lambda>i x. union(**Lset(i),f(x),g(x),h(x))]"
   490 apply (simp only: union_def setclass_simps)
   491 apply (intro FOL_reflections)  
   492 done
   493 
   494 
   495 subsubsection{*Set ``Cons,'' Internalized*}
   496 
   497 constdefs cons_fm :: "[i,i,i]=>i"
   498     "cons_fm(x,y,z) == 
   499        Exists(And(upair_fm(succ(x),succ(x),0),
   500                   union_fm(0,succ(y),succ(z))))"
   501 
   502 
   503 lemma cons_type [TC]:
   504      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> cons_fm(x,y,z) \<in> formula"
   505 by (simp add: cons_fm_def) 
   506 
   507 lemma arity_cons_fm [simp]:
   508      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
   509       ==> arity(cons_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
   510 by (simp add: cons_fm_def succ_Un_distrib [symmetric] Un_ac) 
   511 
   512 lemma sats_cons_fm [simp]:
   513    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
   514     ==> sats(A, cons_fm(x,y,z), env) <-> 
   515         is_cons(**A, nth(x,env), nth(y,env), nth(z,env))"
   516 by (simp add: cons_fm_def is_cons_def)
   517 
   518 lemma cons_iff_sats:
   519       "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
   520           i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
   521        ==> is_cons(**A, x, y, z) <-> sats(A, cons_fm(i,j,k), env)"
   522 by simp
   523 
   524 theorem cons_reflection:
   525      "REFLECTS[\<lambda>x. is_cons(L,f(x),g(x),h(x)), 
   526                \<lambda>i x. is_cons(**Lset(i),f(x),g(x),h(x))]"
   527 apply (simp only: is_cons_def setclass_simps)
   528 apply (intro FOL_reflections upair_reflection union_reflection)  
   529 done
   530 
   531 
   532 subsubsection{*Successor Function, Internalized*}
   533 
   534 constdefs succ_fm :: "[i,i]=>i"
   535     "succ_fm(x,y) == cons_fm(x,x,y)"
   536 
   537 lemma succ_type [TC]:
   538      "[| x \<in> nat; y \<in> nat |] ==> succ_fm(x,y) \<in> formula"
   539 by (simp add: succ_fm_def) 
   540 
   541 lemma arity_succ_fm [simp]:
   542      "[| x \<in> nat; y \<in> nat |] 
   543       ==> arity(succ_fm(x,y)) = succ(x) \<union> succ(y)"
   544 by (simp add: succ_fm_def)
   545 
   546 lemma sats_succ_fm [simp]:
   547    "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
   548     ==> sats(A, succ_fm(x,y), env) <-> 
   549         successor(**A, nth(x,env), nth(y,env))"
   550 by (simp add: succ_fm_def successor_def)
   551 
   552 lemma successor_iff_sats:
   553       "[| nth(i,env) = x; nth(j,env) = y; 
   554           i \<in> nat; j \<in> nat; env \<in> list(A)|]
   555        ==> successor(**A, x, y) <-> sats(A, succ_fm(i,j), env)"
   556 by simp
   557 
   558 theorem successor_reflection:
   559      "REFLECTS[\<lambda>x. successor(L,f(x),g(x)), 
   560                \<lambda>i x. successor(**Lset(i),f(x),g(x))]"
   561 apply (simp only: successor_def setclass_simps)
   562 apply (intro cons_reflection)  
   563 done
   564 
   565 
   566 subsubsection{*Function Application, Internalized*}
   567 
   568 constdefs fun_apply_fm :: "[i,i,i]=>i"
   569     "fun_apply_fm(f,x,y) == 
   570        Forall(Iff(Exists(And(Member(0,succ(succ(f))),
   571                              pair_fm(succ(succ(x)), 1, 0))),
   572                   Equal(succ(y),0)))"
   573 
   574 lemma fun_apply_type [TC]:
   575      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> fun_apply_fm(x,y,z) \<in> formula"
   576 by (simp add: fun_apply_fm_def) 
   577 
   578 lemma arity_fun_apply_fm [simp]:
   579      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
   580       ==> arity(fun_apply_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
   581 by (simp add: fun_apply_fm_def succ_Un_distrib [symmetric] Un_ac) 
   582 
   583 lemma sats_fun_apply_fm [simp]:
   584    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
   585     ==> sats(A, fun_apply_fm(x,y,z), env) <-> 
   586         fun_apply(**A, nth(x,env), nth(y,env), nth(z,env))"
   587 by (simp add: fun_apply_fm_def fun_apply_def)
   588 
   589 lemma fun_apply_iff_sats:
   590       "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
   591           i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
   592        ==> fun_apply(**A, x, y, z) <-> sats(A, fun_apply_fm(i,j,k), env)"
   593 by simp
   594 
   595 theorem fun_apply_reflection:
   596      "REFLECTS[\<lambda>x. fun_apply(L,f(x),g(x),h(x)), 
   597                \<lambda>i x. fun_apply(**Lset(i),f(x),g(x),h(x))]" 
   598 apply (simp only: fun_apply_def setclass_simps)
   599 apply (intro FOL_reflections pair_reflection)  
   600 done
   601 
   602 
   603 subsubsection{*Variants of Satisfaction Definitions for Ordinals, etc.*}
   604 
   605 text{*Differs from the one in Formula by using "ordinal" rather than "Ord"*}
   606 
   607 
   608 lemma sats_subset_fm':
   609    "[|x \<in> nat; y \<in> nat; env \<in> list(A)|]
   610     ==> sats(A, subset_fm(x,y), env) <-> subset(**A, nth(x,env), nth(y,env))" 
   611 by (simp add: subset_fm_def Relative.subset_def) 
   612 
   613 theorem subset_reflection:
   614      "REFLECTS[\<lambda>x. subset(L,f(x),g(x)), 
   615                \<lambda>i x. subset(**Lset(i),f(x),g(x))]" 
   616 apply (simp only: Relative.subset_def setclass_simps)
   617 apply (intro FOL_reflections)  
   618 done
   619 
   620 lemma sats_transset_fm':
   621    "[|x \<in> nat; env \<in> list(A)|]
   622     ==> sats(A, transset_fm(x), env) <-> transitive_set(**A, nth(x,env))"
   623 by (simp add: sats_subset_fm' transset_fm_def transitive_set_def) 
   624 
   625 theorem transitive_set_reflection:
   626      "REFLECTS[\<lambda>x. transitive_set(L,f(x)),
   627                \<lambda>i x. transitive_set(**Lset(i),f(x))]"
   628 apply (simp only: transitive_set_def setclass_simps)
   629 apply (intro FOL_reflections subset_reflection)  
   630 done
   631 
   632 lemma sats_ordinal_fm':
   633    "[|x \<in> nat; env \<in> list(A)|]
   634     ==> sats(A, ordinal_fm(x), env) <-> ordinal(**A,nth(x,env))"
   635 by (simp add: sats_transset_fm' ordinal_fm_def ordinal_def)
   636 
   637 lemma ordinal_iff_sats:
   638       "[| nth(i,env) = x;  i \<in> nat; env \<in> list(A)|]
   639        ==> ordinal(**A, x) <-> sats(A, ordinal_fm(i), env)"
   640 by (simp add: sats_ordinal_fm')
   641 
   642 theorem ordinal_reflection:
   643      "REFLECTS[\<lambda>x. ordinal(L,f(x)), \<lambda>i x. ordinal(**Lset(i),f(x))]"
   644 apply (simp only: ordinal_def setclass_simps)
   645 apply (intro FOL_reflections transitive_set_reflection)  
   646 done
   647 
   648 
   649 subsubsection{*Membership Relation, Internalized*}
   650 
   651 constdefs Memrel_fm :: "[i,i]=>i"
   652     "Memrel_fm(A,r) == 
   653        Forall(Iff(Member(0,succ(r)),
   654                   Exists(And(Member(0,succ(succ(A))),
   655                              Exists(And(Member(0,succ(succ(succ(A)))),
   656                                         And(Member(1,0),
   657                                             pair_fm(1,0,2))))))))"
   658 
   659 lemma Memrel_type [TC]:
   660      "[| x \<in> nat; y \<in> nat |] ==> Memrel_fm(x,y) \<in> formula"
   661 by (simp add: Memrel_fm_def) 
   662 
   663 lemma arity_Memrel_fm [simp]:
   664      "[| x \<in> nat; y \<in> nat |] 
   665       ==> arity(Memrel_fm(x,y)) = succ(x) \<union> succ(y)"
   666 by (simp add: Memrel_fm_def succ_Un_distrib [symmetric] Un_ac) 
   667 
   668 lemma sats_Memrel_fm [simp]:
   669    "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
   670     ==> sats(A, Memrel_fm(x,y), env) <-> 
   671         membership(**A, nth(x,env), nth(y,env))"
   672 by (simp add: Memrel_fm_def membership_def)
   673 
   674 lemma Memrel_iff_sats:
   675       "[| nth(i,env) = x; nth(j,env) = y; 
   676           i \<in> nat; j \<in> nat; env \<in> list(A)|]
   677        ==> membership(**A, x, y) <-> sats(A, Memrel_fm(i,j), env)"
   678 by simp
   679 
   680 theorem membership_reflection:
   681      "REFLECTS[\<lambda>x. membership(L,f(x),g(x)), 
   682                \<lambda>i x. membership(**Lset(i),f(x),g(x))]"
   683 apply (simp only: membership_def setclass_simps)
   684 apply (intro FOL_reflections pair_reflection)  
   685 done
   686 
   687 subsubsection{*Predecessor Set, Internalized*}
   688 
   689 constdefs pred_set_fm :: "[i,i,i,i]=>i"
   690     "pred_set_fm(A,x,r,B) == 
   691        Forall(Iff(Member(0,succ(B)),
   692                   Exists(And(Member(0,succ(succ(r))),
   693                              And(Member(1,succ(succ(A))),
   694                                  pair_fm(1,succ(succ(x)),0))))))"
   695 
   696 
   697 lemma pred_set_type [TC]:
   698      "[| A \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat |] 
   699       ==> pred_set_fm(A,x,r,B) \<in> formula"
   700 by (simp add: pred_set_fm_def) 
   701 
   702 lemma arity_pred_set_fm [simp]:
   703    "[| A \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat |] 
   704     ==> arity(pred_set_fm(A,x,r,B)) = succ(A) \<union> succ(x) \<union> succ(r) \<union> succ(B)"
   705 by (simp add: pred_set_fm_def succ_Un_distrib [symmetric] Un_ac) 
   706 
   707 lemma sats_pred_set_fm [simp]:
   708    "[| U \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat; env \<in> list(A)|]
   709     ==> sats(A, pred_set_fm(U,x,r,B), env) <-> 
   710         pred_set(**A, nth(U,env), nth(x,env), nth(r,env), nth(B,env))"
   711 by (simp add: pred_set_fm_def pred_set_def)
   712 
   713 lemma pred_set_iff_sats:
   714       "[| nth(i,env) = U; nth(j,env) = x; nth(k,env) = r; nth(l,env) = B; 
   715           i \<in> nat; j \<in> nat; k \<in> nat; l \<in> nat; env \<in> list(A)|]
   716        ==> pred_set(**A,U,x,r,B) <-> sats(A, pred_set_fm(i,j,k,l), env)"
   717 by (simp add: sats_pred_set_fm)
   718 
   719 theorem pred_set_reflection:
   720      "REFLECTS[\<lambda>x. pred_set(L,f(x),g(x),h(x),b(x)), 
   721                \<lambda>i x. pred_set(**Lset(i),f(x),g(x),h(x),b(x))]" 
   722 apply (simp only: pred_set_def setclass_simps)
   723 apply (intro FOL_reflections pair_reflection)  
   724 done
   725 
   726 
   727 
   728 subsubsection{*Domain of a Relation, Internalized*}
   729 
   730 (* "is_domain(M,r,z) == 
   731 	\<forall>x[M]. (x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. pair(M,x,y,w))))" *)
   732 constdefs domain_fm :: "[i,i]=>i"
   733     "domain_fm(r,z) == 
   734        Forall(Iff(Member(0,succ(z)),
   735                   Exists(And(Member(0,succ(succ(r))),
   736                              Exists(pair_fm(2,0,1))))))"
   737 
   738 lemma domain_type [TC]:
   739      "[| x \<in> nat; y \<in> nat |] ==> domain_fm(x,y) \<in> formula"
   740 by (simp add: domain_fm_def) 
   741 
   742 lemma arity_domain_fm [simp]:
   743      "[| x \<in> nat; y \<in> nat |] 
   744       ==> arity(domain_fm(x,y)) = succ(x) \<union> succ(y)"
   745 by (simp add: domain_fm_def succ_Un_distrib [symmetric] Un_ac) 
   746 
   747 lemma sats_domain_fm [simp]:
   748    "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
   749     ==> sats(A, domain_fm(x,y), env) <-> 
   750         is_domain(**A, nth(x,env), nth(y,env))"
   751 by (simp add: domain_fm_def is_domain_def)
   752 
   753 lemma domain_iff_sats:
   754       "[| nth(i,env) = x; nth(j,env) = y; 
   755           i \<in> nat; j \<in> nat; env \<in> list(A)|]
   756        ==> is_domain(**A, x, y) <-> sats(A, domain_fm(i,j), env)"
   757 by simp
   758 
   759 theorem domain_reflection:
   760      "REFLECTS[\<lambda>x. is_domain(L,f(x),g(x)), 
   761                \<lambda>i x. is_domain(**Lset(i),f(x),g(x))]"
   762 apply (simp only: is_domain_def setclass_simps)
   763 apply (intro FOL_reflections pair_reflection)  
   764 done
   765 
   766 
   767 subsubsection{*Range of a Relation, Internalized*}
   768 
   769 (* "is_range(M,r,z) == 
   770 	\<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. pair(M,x,y,w))))" *)
   771 constdefs range_fm :: "[i,i]=>i"
   772     "range_fm(r,z) == 
   773        Forall(Iff(Member(0,succ(z)),
   774                   Exists(And(Member(0,succ(succ(r))),
   775                              Exists(pair_fm(0,2,1))))))"
   776 
   777 lemma range_type [TC]:
   778      "[| x \<in> nat; y \<in> nat |] ==> range_fm(x,y) \<in> formula"
   779 by (simp add: range_fm_def) 
   780 
   781 lemma arity_range_fm [simp]:
   782      "[| x \<in> nat; y \<in> nat |] 
   783       ==> arity(range_fm(x,y)) = succ(x) \<union> succ(y)"
   784 by (simp add: range_fm_def succ_Un_distrib [symmetric] Un_ac) 
   785 
   786 lemma sats_range_fm [simp]:
   787    "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
   788     ==> sats(A, range_fm(x,y), env) <-> 
   789         is_range(**A, nth(x,env), nth(y,env))"
   790 by (simp add: range_fm_def is_range_def)
   791 
   792 lemma range_iff_sats:
   793       "[| nth(i,env) = x; nth(j,env) = y; 
   794           i \<in> nat; j \<in> nat; env \<in> list(A)|]
   795        ==> is_range(**A, x, y) <-> sats(A, range_fm(i,j), env)"
   796 by simp
   797 
   798 theorem range_reflection:
   799      "REFLECTS[\<lambda>x. is_range(L,f(x),g(x)), 
   800                \<lambda>i x. is_range(**Lset(i),f(x),g(x))]"
   801 apply (simp only: is_range_def setclass_simps)
   802 apply (intro FOL_reflections pair_reflection)  
   803 done
   804 
   805  
   806 subsubsection{*Field of a Relation, Internalized*}
   807 
   808 (* "is_field(M,r,z) == 
   809 	\<exists>dr[M]. is_domain(M,r,dr) & 
   810             (\<exists>rr[M]. is_range(M,r,rr) & union(M,dr,rr,z))" *)
   811 constdefs field_fm :: "[i,i]=>i"
   812     "field_fm(r,z) == 
   813        Exists(And(domain_fm(succ(r),0), 
   814               Exists(And(range_fm(succ(succ(r)),0), 
   815                          union_fm(1,0,succ(succ(z)))))))"
   816 
   817 lemma field_type [TC]:
   818      "[| x \<in> nat; y \<in> nat |] ==> field_fm(x,y) \<in> formula"
   819 by (simp add: field_fm_def) 
   820 
   821 lemma arity_field_fm [simp]:
   822      "[| x \<in> nat; y \<in> nat |] 
   823       ==> arity(field_fm(x,y)) = succ(x) \<union> succ(y)"
   824 by (simp add: field_fm_def succ_Un_distrib [symmetric] Un_ac) 
   825 
   826 lemma sats_field_fm [simp]:
   827    "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
   828     ==> sats(A, field_fm(x,y), env) <-> 
   829         is_field(**A, nth(x,env), nth(y,env))"
   830 by (simp add: field_fm_def is_field_def)
   831 
   832 lemma field_iff_sats:
   833       "[| nth(i,env) = x; nth(j,env) = y; 
   834           i \<in> nat; j \<in> nat; env \<in> list(A)|]
   835        ==> is_field(**A, x, y) <-> sats(A, field_fm(i,j), env)"
   836 by simp
   837 
   838 theorem field_reflection:
   839      "REFLECTS[\<lambda>x. is_field(L,f(x),g(x)), 
   840                \<lambda>i x. is_field(**Lset(i),f(x),g(x))]"
   841 apply (simp only: is_field_def setclass_simps)
   842 apply (intro FOL_reflections domain_reflection range_reflection
   843              union_reflection)
   844 done
   845 
   846 
   847 subsubsection{*Image under a Relation, Internalized*}
   848 
   849 (* "image(M,r,A,z) == 
   850         \<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. x\<in>A & pair(M,x,y,w))))" *)
   851 constdefs image_fm :: "[i,i,i]=>i"
   852     "image_fm(r,A,z) == 
   853        Forall(Iff(Member(0,succ(z)),
   854                   Exists(And(Member(0,succ(succ(r))),
   855                              Exists(And(Member(0,succ(succ(succ(A)))),
   856 	 			        pair_fm(0,2,1)))))))"
   857 
   858 lemma image_type [TC]:
   859      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> image_fm(x,y,z) \<in> formula"
   860 by (simp add: image_fm_def) 
   861 
   862 lemma arity_image_fm [simp]:
   863      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
   864       ==> arity(image_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
   865 by (simp add: image_fm_def succ_Un_distrib [symmetric] Un_ac) 
   866 
   867 lemma sats_image_fm [simp]:
   868    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
   869     ==> sats(A, image_fm(x,y,z), env) <-> 
   870         image(**A, nth(x,env), nth(y,env), nth(z,env))"
   871 by (simp add: image_fm_def Relative.image_def)
   872 
   873 lemma image_iff_sats:
   874       "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
   875           i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
   876        ==> image(**A, x, y, z) <-> sats(A, image_fm(i,j,k), env)"
   877 by (simp add: sats_image_fm)
   878 
   879 theorem image_reflection:
   880      "REFLECTS[\<lambda>x. image(L,f(x),g(x),h(x)), 
   881                \<lambda>i x. image(**Lset(i),f(x),g(x),h(x))]"
   882 apply (simp only: Relative.image_def setclass_simps)
   883 apply (intro FOL_reflections pair_reflection)  
   884 done
   885 
   886 
   887 subsubsection{*The Concept of Relation, Internalized*}
   888 
   889 (* "is_relation(M,r) == 
   890         (\<forall>z[M]. z\<in>r --> (\<exists>x[M]. \<exists>y[M]. pair(M,x,y,z)))" *)
   891 constdefs relation_fm :: "i=>i"
   892     "relation_fm(r) == 
   893        Forall(Implies(Member(0,succ(r)), Exists(Exists(pair_fm(1,0,2)))))"
   894 
   895 lemma relation_type [TC]:
   896      "[| x \<in> nat |] ==> relation_fm(x) \<in> formula"
   897 by (simp add: relation_fm_def) 
   898 
   899 lemma arity_relation_fm [simp]:
   900      "x \<in> nat ==> arity(relation_fm(x)) = succ(x)"
   901 by (simp add: relation_fm_def succ_Un_distrib [symmetric] Un_ac) 
   902 
   903 lemma sats_relation_fm [simp]:
   904    "[| x \<in> nat; env \<in> list(A)|]
   905     ==> sats(A, relation_fm(x), env) <-> is_relation(**A, nth(x,env))"
   906 by (simp add: relation_fm_def is_relation_def)
   907 
   908 lemma relation_iff_sats:
   909       "[| nth(i,env) = x; nth(j,env) = y; 
   910           i \<in> nat; env \<in> list(A)|]
   911        ==> is_relation(**A, x) <-> sats(A, relation_fm(i), env)"
   912 by simp
   913 
   914 theorem is_relation_reflection:
   915      "REFLECTS[\<lambda>x. is_relation(L,f(x)), 
   916                \<lambda>i x. is_relation(**Lset(i),f(x))]"
   917 apply (simp only: is_relation_def setclass_simps)
   918 apply (intro FOL_reflections pair_reflection)  
   919 done
   920 
   921 
   922 subsubsection{*The Concept of Function, Internalized*}
   923 
   924 (* "is_function(M,r) == 
   925 	\<forall>x[M]. \<forall>y[M]. \<forall>y'[M]. \<forall>p[M]. \<forall>p'[M]. 
   926            pair(M,x,y,p) --> pair(M,x,y',p') --> p\<in>r --> p'\<in>r --> y=y'" *)
   927 constdefs function_fm :: "i=>i"
   928     "function_fm(r) == 
   929        Forall(Forall(Forall(Forall(Forall(
   930          Implies(pair_fm(4,3,1),
   931                  Implies(pair_fm(4,2,0),
   932                          Implies(Member(1,r#+5),
   933                                  Implies(Member(0,r#+5), Equal(3,2))))))))))"
   934 
   935 lemma function_type [TC]:
   936      "[| x \<in> nat |] ==> function_fm(x) \<in> formula"
   937 by (simp add: function_fm_def) 
   938 
   939 lemma arity_function_fm [simp]:
   940      "x \<in> nat ==> arity(function_fm(x)) = succ(x)"
   941 by (simp add: function_fm_def succ_Un_distrib [symmetric] Un_ac) 
   942 
   943 lemma sats_function_fm [simp]:
   944    "[| x \<in> nat; env \<in> list(A)|]
   945     ==> sats(A, function_fm(x), env) <-> is_function(**A, nth(x,env))"
   946 by (simp add: function_fm_def is_function_def)
   947 
   948 lemma function_iff_sats:
   949       "[| nth(i,env) = x; nth(j,env) = y; 
   950           i \<in> nat; env \<in> list(A)|]
   951        ==> is_function(**A, x) <-> sats(A, function_fm(i), env)"
   952 by simp
   953 
   954 theorem is_function_reflection:
   955      "REFLECTS[\<lambda>x. is_function(L,f(x)), 
   956                \<lambda>i x. is_function(**Lset(i),f(x))]"
   957 apply (simp only: is_function_def setclass_simps)
   958 apply (intro FOL_reflections pair_reflection)  
   959 done
   960 
   961 
   962 subsubsection{*Typed Functions, Internalized*}
   963 
   964 (* "typed_function(M,A,B,r) == 
   965         is_function(M,r) & is_relation(M,r) & is_domain(M,r,A) &
   966         (\<forall>u[M]. u\<in>r --> (\<forall>x[M]. \<forall>y[M]. pair(M,x,y,u) --> y\<in>B))" *)
   967 
   968 constdefs typed_function_fm :: "[i,i,i]=>i"
   969     "typed_function_fm(A,B,r) == 
   970        And(function_fm(r),
   971          And(relation_fm(r),
   972            And(domain_fm(r,A),
   973              Forall(Implies(Member(0,succ(r)),
   974                   Forall(Forall(Implies(pair_fm(1,0,2),Member(0,B#+3)))))))))"
   975 
   976 lemma typed_function_type [TC]:
   977      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> typed_function_fm(x,y,z) \<in> formula"
   978 by (simp add: typed_function_fm_def) 
   979 
   980 lemma arity_typed_function_fm [simp]:
   981      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
   982       ==> arity(typed_function_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
   983 by (simp add: typed_function_fm_def succ_Un_distrib [symmetric] Un_ac) 
   984 
   985 lemma sats_typed_function_fm [simp]:
   986    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
   987     ==> sats(A, typed_function_fm(x,y,z), env) <-> 
   988         typed_function(**A, nth(x,env), nth(y,env), nth(z,env))"
   989 by (simp add: typed_function_fm_def typed_function_def)
   990 
   991 lemma typed_function_iff_sats:
   992   "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
   993       i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
   994    ==> typed_function(**A, x, y, z) <-> sats(A, typed_function_fm(i,j,k), env)"
   995 by simp
   996 
   997 lemmas function_reflections = 
   998         empty_reflection upair_reflection pair_reflection union_reflection
   999 	cons_reflection successor_reflection 
  1000         fun_apply_reflection subset_reflection
  1001 	transitive_set_reflection membership_reflection
  1002 	pred_set_reflection domain_reflection range_reflection field_reflection
  1003         image_reflection
  1004 	is_relation_reflection is_function_reflection
  1005 
  1006 lemmas function_iff_sats = 
  1007         empty_iff_sats upair_iff_sats pair_iff_sats union_iff_sats
  1008 	cons_iff_sats successor_iff_sats
  1009         fun_apply_iff_sats  Memrel_iff_sats
  1010 	pred_set_iff_sats domain_iff_sats range_iff_sats field_iff_sats
  1011         image_iff_sats
  1012 	relation_iff_sats function_iff_sats
  1013 
  1014 
  1015 theorem typed_function_reflection:
  1016      "REFLECTS[\<lambda>x. typed_function(L,f(x),g(x),h(x)), 
  1017                \<lambda>i x. typed_function(**Lset(i),f(x),g(x),h(x))]"
  1018 apply (simp only: typed_function_def setclass_simps)
  1019 apply (intro FOL_reflections function_reflections)  
  1020 done
  1021 
  1022 
  1023 subsubsection{*Composition of Relations, Internalized*}
  1024 
  1025 (* "composition(M,r,s,t) == 
  1026         \<forall>p[M]. p \<in> t <-> 
  1027                (\<exists>x[M]. \<exists>y[M]. \<exists>z[M]. \<exists>xy[M]. \<exists>yz[M]. 
  1028                 pair(M,x,z,p) & pair(M,x,y,xy) & pair(M,y,z,yz) & 
  1029                 xy \<in> s & yz \<in> r)" *)
  1030 constdefs composition_fm :: "[i,i,i]=>i"
  1031   "composition_fm(r,s,t) == 
  1032      Forall(Iff(Member(0,succ(t)),
  1033              Exists(Exists(Exists(Exists(Exists( 
  1034               And(pair_fm(4,2,5),
  1035                And(pair_fm(4,3,1),
  1036                 And(pair_fm(3,2,0),
  1037                  And(Member(1,s#+6), Member(0,r#+6))))))))))))"
  1038 
  1039 lemma composition_type [TC]:
  1040      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> composition_fm(x,y,z) \<in> formula"
  1041 by (simp add: composition_fm_def) 
  1042 
  1043 lemma arity_composition_fm [simp]:
  1044      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
  1045       ==> arity(composition_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
  1046 by (simp add: composition_fm_def succ_Un_distrib [symmetric] Un_ac) 
  1047 
  1048 lemma sats_composition_fm [simp]:
  1049    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
  1050     ==> sats(A, composition_fm(x,y,z), env) <-> 
  1051         composition(**A, nth(x,env), nth(y,env), nth(z,env))"
  1052 by (simp add: composition_fm_def composition_def)
  1053 
  1054 lemma composition_iff_sats:
  1055       "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
  1056           i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
  1057        ==> composition(**A, x, y, z) <-> sats(A, composition_fm(i,j,k), env)"
  1058 by simp
  1059 
  1060 theorem composition_reflection:
  1061      "REFLECTS[\<lambda>x. composition(L,f(x),g(x),h(x)), 
  1062                \<lambda>i x. composition(**Lset(i),f(x),g(x),h(x))]"
  1063 apply (simp only: composition_def setclass_simps)
  1064 apply (intro FOL_reflections pair_reflection)  
  1065 done
  1066 
  1067 
  1068 subsubsection{*Injections, Internalized*}
  1069 
  1070 (* "injection(M,A,B,f) == 
  1071 	typed_function(M,A,B,f) &
  1072         (\<forall>x[M]. \<forall>x'[M]. \<forall>y[M]. \<forall>p[M]. \<forall>p'[M]. 
  1073           pair(M,x,y,p) --> pair(M,x',y,p') --> p\<in>f --> p'\<in>f --> x=x')" *)
  1074 constdefs injection_fm :: "[i,i,i]=>i"
  1075  "injection_fm(A,B,f) == 
  1076     And(typed_function_fm(A,B,f),
  1077        Forall(Forall(Forall(Forall(Forall(
  1078          Implies(pair_fm(4,2,1),
  1079                  Implies(pair_fm(3,2,0),
  1080                          Implies(Member(1,f#+5),
  1081                                  Implies(Member(0,f#+5), Equal(4,3)))))))))))"
  1082 
  1083 
  1084 lemma injection_type [TC]:
  1085      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> injection_fm(x,y,z) \<in> formula"
  1086 by (simp add: injection_fm_def) 
  1087 
  1088 lemma arity_injection_fm [simp]:
  1089      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
  1090       ==> arity(injection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
  1091 by (simp add: injection_fm_def succ_Un_distrib [symmetric] Un_ac) 
  1092 
  1093 lemma sats_injection_fm [simp]:
  1094    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
  1095     ==> sats(A, injection_fm(x,y,z), env) <-> 
  1096         injection(**A, nth(x,env), nth(y,env), nth(z,env))"
  1097 by (simp add: injection_fm_def injection_def)
  1098 
  1099 lemma injection_iff_sats:
  1100   "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
  1101       i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
  1102    ==> injection(**A, x, y, z) <-> sats(A, injection_fm(i,j,k), env)"
  1103 by simp
  1104 
  1105 theorem injection_reflection:
  1106      "REFLECTS[\<lambda>x. injection(L,f(x),g(x),h(x)), 
  1107                \<lambda>i x. injection(**Lset(i),f(x),g(x),h(x))]"
  1108 apply (simp only: injection_def setclass_simps)
  1109 apply (intro FOL_reflections function_reflections typed_function_reflection)  
  1110 done
  1111 
  1112 
  1113 subsubsection{*Surjections, Internalized*}
  1114 
  1115 (*  surjection :: "[i=>o,i,i,i] => o"
  1116     "surjection(M,A,B,f) == 
  1117         typed_function(M,A,B,f) &
  1118         (\<forall>y[M]. y\<in>B --> (\<exists>x[M]. x\<in>A & fun_apply(M,f,x,y)))" *)
  1119 constdefs surjection_fm :: "[i,i,i]=>i"
  1120  "surjection_fm(A,B,f) == 
  1121     And(typed_function_fm(A,B,f),
  1122        Forall(Implies(Member(0,succ(B)),
  1123                       Exists(And(Member(0,succ(succ(A))),
  1124                                  fun_apply_fm(succ(succ(f)),0,1))))))"
  1125 
  1126 lemma surjection_type [TC]:
  1127      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> surjection_fm(x,y,z) \<in> formula"
  1128 by (simp add: surjection_fm_def) 
  1129 
  1130 lemma arity_surjection_fm [simp]:
  1131      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
  1132       ==> arity(surjection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
  1133 by (simp add: surjection_fm_def succ_Un_distrib [symmetric] Un_ac) 
  1134 
  1135 lemma sats_surjection_fm [simp]:
  1136    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
  1137     ==> sats(A, surjection_fm(x,y,z), env) <-> 
  1138         surjection(**A, nth(x,env), nth(y,env), nth(z,env))"
  1139 by (simp add: surjection_fm_def surjection_def)
  1140 
  1141 lemma surjection_iff_sats:
  1142   "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
  1143       i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
  1144    ==> surjection(**A, x, y, z) <-> sats(A, surjection_fm(i,j,k), env)"
  1145 by simp
  1146 
  1147 theorem surjection_reflection:
  1148      "REFLECTS[\<lambda>x. surjection(L,f(x),g(x),h(x)), 
  1149                \<lambda>i x. surjection(**Lset(i),f(x),g(x),h(x))]"
  1150 apply (simp only: surjection_def setclass_simps)
  1151 apply (intro FOL_reflections function_reflections typed_function_reflection)  
  1152 done
  1153 
  1154 
  1155 
  1156 subsubsection{*Bijections, Internalized*}
  1157 
  1158 (*   bijection :: "[i=>o,i,i,i] => o"
  1159     "bijection(M,A,B,f) == injection(M,A,B,f) & surjection(M,A,B,f)" *)
  1160 constdefs bijection_fm :: "[i,i,i]=>i"
  1161  "bijection_fm(A,B,f) == And(injection_fm(A,B,f), surjection_fm(A,B,f))"
  1162 
  1163 lemma bijection_type [TC]:
  1164      "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> bijection_fm(x,y,z) \<in> formula"
  1165 by (simp add: bijection_fm_def) 
  1166 
  1167 lemma arity_bijection_fm [simp]:
  1168      "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
  1169       ==> arity(bijection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
  1170 by (simp add: bijection_fm_def succ_Un_distrib [symmetric] Un_ac) 
  1171 
  1172 lemma sats_bijection_fm [simp]:
  1173    "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
  1174     ==> sats(A, bijection_fm(x,y,z), env) <-> 
  1175         bijection(**A, nth(x,env), nth(y,env), nth(z,env))"
  1176 by (simp add: bijection_fm_def bijection_def)
  1177 
  1178 lemma bijection_iff_sats:
  1179   "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
  1180       i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
  1181    ==> bijection(**A, x, y, z) <-> sats(A, bijection_fm(i,j,k), env)"
  1182 by simp
  1183 
  1184 theorem bijection_reflection:
  1185      "REFLECTS[\<lambda>x. bijection(L,f(x),g(x),h(x)), 
  1186                \<lambda>i x. bijection(**Lset(i),f(x),g(x),h(x))]"
  1187 apply (simp only: bijection_def setclass_simps)
  1188 apply (intro And_reflection injection_reflection surjection_reflection)  
  1189 done
  1190 
  1191 
  1192 subsubsection{*Order-Isomorphisms, Internalized*}
  1193 
  1194 (*  order_isomorphism :: "[i=>o,i,i,i,i,i] => o"
  1195    "order_isomorphism(M,A,r,B,s,f) == 
  1196         bijection(M,A,B,f) & 
  1197         (\<forall>x[M]. x\<in>A --> (\<forall>y[M]. y\<in>A -->
  1198           (\<forall>p[M]. \<forall>fx[M]. \<forall>fy[M]. \<forall>q[M].
  1199             pair(M,x,y,p) --> fun_apply(M,f,x,fx) --> fun_apply(M,f,y,fy) --> 
  1200             pair(M,fx,fy,q) --> (p\<in>r <-> q\<in>s))))"
  1201   *)
  1202 
  1203 constdefs order_isomorphism_fm :: "[i,i,i,i,i]=>i"
  1204  "order_isomorphism_fm(A,r,B,s,f) == 
  1205    And(bijection_fm(A,B,f), 
  1206      Forall(Implies(Member(0,succ(A)),
  1207        Forall(Implies(Member(0,succ(succ(A))),
  1208          Forall(Forall(Forall(Forall(
  1209            Implies(pair_fm(5,4,3),
  1210              Implies(fun_apply_fm(f#+6,5,2),
  1211                Implies(fun_apply_fm(f#+6,4,1),
  1212                  Implies(pair_fm(2,1,0), 
  1213                    Iff(Member(3,r#+6), Member(0,s#+6)))))))))))))))"
  1214 
  1215 lemma order_isomorphism_type [TC]:
  1216      "[| A \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat |]  
  1217       ==> order_isomorphism_fm(A,r,B,s,f) \<in> formula"
  1218 by (simp add: order_isomorphism_fm_def) 
  1219 
  1220 lemma arity_order_isomorphism_fm [simp]:
  1221      "[| A \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat |] 
  1222       ==> arity(order_isomorphism_fm(A,r,B,s,f)) = 
  1223           succ(A) \<union> succ(r) \<union> succ(B) \<union> succ(s) \<union> succ(f)" 
  1224 by (simp add: order_isomorphism_fm_def succ_Un_distrib [symmetric] Un_ac) 
  1225 
  1226 lemma sats_order_isomorphism_fm [simp]:
  1227    "[| U \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat; env \<in> list(A)|]
  1228     ==> sats(A, order_isomorphism_fm(U,r,B,s,f), env) <-> 
  1229         order_isomorphism(**A, nth(U,env), nth(r,env), nth(B,env), 
  1230                                nth(s,env), nth(f,env))"
  1231 by (simp add: order_isomorphism_fm_def order_isomorphism_def)
  1232 
  1233 lemma order_isomorphism_iff_sats:
  1234   "[| nth(i,env) = U; nth(j,env) = r; nth(k,env) = B; nth(j',env) = s; 
  1235       nth(k',env) = f; 
  1236       i \<in> nat; j \<in> nat; k \<in> nat; j' \<in> nat; k' \<in> nat; env \<in> list(A)|]
  1237    ==> order_isomorphism(**A,U,r,B,s,f) <-> 
  1238        sats(A, order_isomorphism_fm(i,j,k,j',k'), env)" 
  1239 by simp
  1240 
  1241 theorem order_isomorphism_reflection:
  1242      "REFLECTS[\<lambda>x. order_isomorphism(L,f(x),g(x),h(x),g'(x),h'(x)), 
  1243                \<lambda>i x. order_isomorphism(**Lset(i),f(x),g(x),h(x),g'(x),h'(x))]"
  1244 apply (simp only: order_isomorphism_def setclass_simps)
  1245 apply (intro FOL_reflections function_reflections bijection_reflection)  
  1246 done
  1247 
  1248 subsubsection{*Limit Ordinals, Internalized*}
  1249 
  1250 text{*A limit ordinal is a non-empty, successor-closed ordinal*}
  1251 
  1252 (* "limit_ordinal(M,a) == 
  1253 	ordinal(M,a) & ~ empty(M,a) & 
  1254         (\<forall>x[M]. x\<in>a --> (\<exists>y[M]. y\<in>a & successor(M,x,y)))" *)
  1255 
  1256 constdefs limit_ordinal_fm :: "i=>i"
  1257     "limit_ordinal_fm(x) == 
  1258         And(ordinal_fm(x),
  1259             And(Neg(empty_fm(x)),
  1260 	        Forall(Implies(Member(0,succ(x)),
  1261                                Exists(And(Member(0,succ(succ(x))),
  1262                                           succ_fm(1,0)))))))"
  1263 
  1264 lemma limit_ordinal_type [TC]:
  1265      "x \<in> nat ==> limit_ordinal_fm(x) \<in> formula"
  1266 by (simp add: limit_ordinal_fm_def) 
  1267 
  1268 lemma arity_limit_ordinal_fm [simp]:
  1269      "x \<in> nat ==> arity(limit_ordinal_fm(x)) = succ(x)"
  1270 by (simp add: limit_ordinal_fm_def succ_Un_distrib [symmetric] Un_ac) 
  1271 
  1272 lemma sats_limit_ordinal_fm [simp]:
  1273    "[| x \<in> nat; env \<in> list(A)|]
  1274     ==> sats(A, limit_ordinal_fm(x), env) <-> limit_ordinal(**A, nth(x,env))"
  1275 by (simp add: limit_ordinal_fm_def limit_ordinal_def sats_ordinal_fm')
  1276 
  1277 lemma limit_ordinal_iff_sats:
  1278       "[| nth(i,env) = x; nth(j,env) = y; 
  1279           i \<in> nat; env \<in> list(A)|]
  1280        ==> limit_ordinal(**A, x) <-> sats(A, limit_ordinal_fm(i), env)"
  1281 by simp
  1282 
  1283 theorem limit_ordinal_reflection:
  1284      "REFLECTS[\<lambda>x. limit_ordinal(L,f(x)), 
  1285                \<lambda>i x. limit_ordinal(**Lset(i),f(x))]"
  1286 apply (simp only: limit_ordinal_def setclass_simps)
  1287 apply (intro FOL_reflections ordinal_reflection 
  1288              empty_reflection successor_reflection)  
  1289 done
  1290 
  1291 subsubsection{*Omega: The Set of Natural Numbers*}
  1292 
  1293 (* omega(M,a) == limit_ordinal(M,a) & (\<forall>x[M]. x\<in>a --> ~ limit_ordinal(M,x)) *)
  1294 constdefs omega_fm :: "i=>i"
  1295     "omega_fm(x) == 
  1296        And(limit_ordinal_fm(x),
  1297            Forall(Implies(Member(0,succ(x)),
  1298                           Neg(limit_ordinal_fm(0)))))"
  1299 
  1300 lemma omega_type [TC]:
  1301      "x \<in> nat ==> omega_fm(x) \<in> formula"
  1302 by (simp add: omega_fm_def) 
  1303 
  1304 lemma arity_omega_fm [simp]:
  1305      "x \<in> nat ==> arity(omega_fm(x)) = succ(x)"
  1306 by (simp add: omega_fm_def succ_Un_distrib [symmetric] Un_ac) 
  1307 
  1308 lemma sats_omega_fm [simp]:
  1309    "[| x \<in> nat; env \<in> list(A)|]
  1310     ==> sats(A, omega_fm(x), env) <-> omega(**A, nth(x,env))"
  1311 by (simp add: omega_fm_def omega_def)
  1312 
  1313 lemma omega_iff_sats:
  1314       "[| nth(i,env) = x; nth(j,env) = y; 
  1315           i \<in> nat; env \<in> list(A)|]
  1316        ==> omega(**A, x) <-> sats(A, omega_fm(i), env)"
  1317 by simp
  1318 
  1319 theorem omega_reflection:
  1320      "REFLECTS[\<lambda>x. omega(L,f(x)), 
  1321                \<lambda>i x. omega(**Lset(i),f(x))]"
  1322 apply (simp only: omega_def setclass_simps)
  1323 apply (intro FOL_reflections limit_ordinal_reflection)  
  1324 done
  1325 
  1326 
  1327 lemmas fun_plus_reflections =
  1328         typed_function_reflection composition_reflection
  1329         injection_reflection surjection_reflection
  1330         bijection_reflection order_isomorphism_reflection
  1331         ordinal_reflection limit_ordinal_reflection omega_reflection
  1332 
  1333 lemmas fun_plus_iff_sats = 
  1334 	typed_function_iff_sats composition_iff_sats
  1335         injection_iff_sats surjection_iff_sats bijection_iff_sats 
  1336         order_isomorphism_iff_sats
  1337         ordinal_iff_sats limit_ordinal_iff_sats omega_iff_sats
  1338 
  1339 end