src/ZF/Constructible/Datatype_absolute.thy
changeset 13352 3cd767f8d78b
parent 13350 626b79677dfa
child 13353 1800e7134d2e
     1.1 --- a/src/ZF/Constructible/Datatype_absolute.thy	Thu Jul 11 17:56:28 2002 +0200
     1.2 +++ b/src/ZF/Constructible/Datatype_absolute.thy	Fri Jul 12 11:24:40 2002 +0200
     1.3 @@ -95,9 +95,9 @@
     1.4  lemma (in M_trancl) iterates_relativize:
     1.5    "[|n \<in> nat; M(v); \<forall>x[M]. M(F(x));
     1.6       strong_replacement(M, 
     1.7 -       \<lambda>x z. \<exists>y[M]. \<exists>g[M]. pair(M, x, y, z) &
     1.8 -              is_recfun (Memrel(succ(n)), x,
     1.9 -                         \<lambda>n f. nat_case(v, \<lambda>m. F(f`m), n), g) &
    1.10 +       \<lambda>x z. \<exists>y[M]. \<exists>g[M]. pair(M,x,y,z) &
    1.11 +              M_is_recfun(M, \<lambda>n f z. z = nat_case(v, \<lambda>m. F(f`m), n), 
    1.12 +                          Memrel(succ(n)), x, g) &
    1.13                y = nat_case(v, \<lambda>m. F(g`m), x))|] 
    1.14     ==> iterates(F,n,v) = z <-> 
    1.15         (\<exists>g[M]. is_recfun(Memrel(succ(n)), n, 
    1.16 @@ -105,7 +105,8 @@
    1.17              z = nat_case(v, \<lambda>m. F(g`m), n))"
    1.18  by (simp add: iterates_nat_def recursor_def transrec_def 
    1.19                eclose_sing_Ord_eq trans_wfrec_relativize nat_into_M
    1.20 -              wf_Memrel trans_Memrel relation_Memrel)
    1.21 +              wf_Memrel trans_Memrel relation_Memrel
    1.22 +              is_recfun_abs [of "\<lambda>n g. nat_case(v, \<lambda>m. F(g`m), n)"])
    1.23  
    1.24  lemma (in M_wfrank) iterates_closed [intro,simp]:
    1.25    "[|n \<in> nat; M(v); \<forall>x[M]. M(F(x));
    1.26 @@ -126,8 +127,9 @@
    1.27          \<exists>n1[M]. \<exists>AX[M]. 
    1.28           number1(M,n1) & cartprod(M,A,X,AX) & is_sum(M,n1,AX,Z)"
    1.29  
    1.30 -  is_list_case :: "[i=>o,i,i,i,i] => o"
    1.31 -    "is_list_case(M,A,g,x,y) == 
    1.32 +  list_functor_case :: "[i=>o,i,i,i,i] => o"
    1.33 +    --{*Abbreviation for the definition of lists below*}
    1.34 +    "list_functor_case(M,A,g,x,y) == 
    1.35          is_nat_case(M, 0, 
    1.36               \<lambda>m u. \<exists>gm[M]. fun_apply(M,g,m,gm) & is_list_functor(M,A,gm,u),
    1.37               x, y)"
    1.38 @@ -136,6 +138,12 @@
    1.39       "[| M(A); M(X); M(Z) |] ==> is_list_functor(M,A,X,Z) <-> (Z = {0} + A*X)"
    1.40  by (simp add: is_list_functor_def singleton_0 nat_into_M)
    1.41  
    1.42 +lemma (in M_axioms) list_functor_case_abs: 
    1.43 +     "[| M(A); M(n); M(y); M(g) |] 
    1.44 +      ==> list_functor_case(M,A,g,n,y) <-> 
    1.45 +          y = nat_case(0, \<lambda>m. {0} + A * g`m, n)"
    1.46 +by (simp add: list_functor_case_def nat_into_M)
    1.47 +
    1.48  
    1.49  locale M_datatypes = M_wfrank +
    1.50    assumes list_replacement1: 
    1.51 @@ -144,10 +152,9 @@
    1.52  	  \<lambda>x z. \<exists>y[M]. \<exists>g[M]. \<exists>sucn[M]. \<exists>memr[M]. 
    1.53  		 pair(M,x,y,z) & successor(M,n,sucn) & 
    1.54  		 membership(M,sucn,memr) &
    1.55 -		 M_is_recfun (M, memr, x,
    1.56 -	              \<lambda>n f z. z = nat_case(0, \<lambda>m. {0} + A * f`m, n), g) &
    1.57 -		 is_nat_case(M, 0, 
    1.58 -                      \<lambda>m u. is_list_functor(M,A,g`m,u), x, y))"
    1.59 +		 M_is_recfun(M, \<lambda>n f z. list_functor_case(M,A,f,n,z), 
    1.60 +                             memr, x, g) &
    1.61 +                 list_functor_case(M,A,g,x,y))"
    1.62  (*THEY NEED RELATIVIZATION*)
    1.63        and list_replacement2: 
    1.64             "M(A) ==> strong_replacement(M, \<lambda>x y. y = (\<lambda>X. {0} + A * X)^x (0))"
    1.65 @@ -162,7 +169,7 @@
    1.66  		          \<lambda>n f. nat_case(0, \<lambda>m. {0} + A * f`m, n), g) &
    1.67   	       y = nat_case(0, \<lambda>m. {0} + A * g ` m, x)))"
    1.68  apply (insert list_replacement1 [of A n], simp add: nat_into_M)
    1.69 -apply (simp add: nat_into_M apply_abs
    1.70 +apply (simp add: nat_into_M list_functor_case_abs
    1.71                   is_recfun_abs [of "\<lambda>n f. nat_case(0, \<lambda>m. {0} + A * f`m, n)"])
    1.72  done
    1.73