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