src/ZF/Constructible/Datatype_absolute.thy
changeset 13350 626b79677dfa
parent 13348 374d05460db4
child 13352 3cd767f8d78b
     1.1 --- a/src/ZF/Constructible/Datatype_absolute.thy	Thu Jul 11 16:57:14 2002 +0200
     1.2 +++ b/src/ZF/Constructible/Datatype_absolute.thy	Thu Jul 11 17:18:28 2002 +0200
     1.3 @@ -105,8 +105,7 @@
     1.4              z = nat_case(v, \<lambda>m. F(g`m), n))"
     1.5  by (simp add: iterates_nat_def recursor_def transrec_def 
     1.6                eclose_sing_Ord_eq trans_wfrec_relativize nat_into_M
     1.7 -              wf_Memrel trans_Memrel relation_Memrel nat_case_closed)
     1.8 -
     1.9 +              wf_Memrel trans_Memrel relation_Memrel)
    1.10  
    1.11  lemma (in M_wfrank) iterates_closed [intro,simp]:
    1.12    "[|n \<in> nat; M(v); \<forall>x[M]. M(F(x));
    1.13 @@ -121,32 +120,54 @@
    1.14                wf_Memrel trans_Memrel relation_Memrel nat_case_closed)
    1.15  
    1.16  
    1.17 +constdefs
    1.18 +  is_list_functor :: "[i=>o,i,i,i] => o"
    1.19 +    "is_list_functor(M,A,X,Z) == 
    1.20 +        \<exists>n1[M]. \<exists>AX[M]. 
    1.21 +         number1(M,n1) & cartprod(M,A,X,AX) & is_sum(M,n1,AX,Z)"
    1.22 +
    1.23 +  is_list_case :: "[i=>o,i,i,i,i] => o"
    1.24 +    "is_list_case(M,A,g,x,y) == 
    1.25 +        is_nat_case(M, 0, 
    1.26 +             \<lambda>m u. \<exists>gm[M]. fun_apply(M,g,m,gm) & is_list_functor(M,A,gm,u),
    1.27 +             x, y)"
    1.28 +
    1.29 +lemma (in M_axioms) list_functor_abs [simp]: 
    1.30 +     "[| M(A); M(X); M(Z) |] ==> is_list_functor(M,A,X,Z) <-> (Z = {0} + A*X)"
    1.31 +by (simp add: is_list_functor_def singleton_0 nat_into_M)
    1.32 +
    1.33 +
    1.34  locale M_datatypes = M_wfrank +
    1.35 -(*THEY NEED RELATIVIZATION*)
    1.36    assumes list_replacement1: 
    1.37 -	   "[|M(A); n \<in> nat|] ==> 
    1.38 -	    strong_replacement(M, 
    1.39 -	      \<lambda>x z. \<exists>y[M]. \<exists>g[M]. \<exists>sucn[M]. \<exists>memr[M]. 
    1.40 -                     pair(M,x,y,z) & successor(M,n,sucn) & 
    1.41 -                     membership(M,sucn,memr) &
    1.42 -		     is_recfun (memr, x,
    1.43 -				\<lambda>n f. nat_case(0, \<lambda>m. {0} + A \<times> f`m, n), g) &
    1.44 -		     y = nat_case(0, \<lambda>m. {0} + A \<times> g`m, x))"
    1.45 +       "[|M(A); n \<in> nat|] ==> 
    1.46 +	strong_replacement(M, 
    1.47 +	  \<lambda>x z. \<exists>y[M]. \<exists>g[M]. \<exists>sucn[M]. \<exists>memr[M]. 
    1.48 +		 pair(M,x,y,z) & successor(M,n,sucn) & 
    1.49 +		 membership(M,sucn,memr) &
    1.50 +		 M_is_recfun (M, memr, x,
    1.51 +	              \<lambda>n f z. z = nat_case(0, \<lambda>m. {0} + A * f`m, n), g) &
    1.52 +		 is_nat_case(M, 0, 
    1.53 +                      \<lambda>m u. is_list_functor(M,A,g`m,u), x, y))"
    1.54 +(*THEY NEED RELATIVIZATION*)
    1.55        and list_replacement2: 
    1.56 -           "M(A) ==> strong_replacement(M, \<lambda>x y. y = (\<lambda>X. {0} + A \<times> X)^x (0))"
    1.57 +           "M(A) ==> strong_replacement(M, \<lambda>x y. y = (\<lambda>X. {0} + A * X)^x (0))"
    1.58 +
    1.59  
    1.60  
    1.61  lemma (in M_datatypes) list_replacement1':
    1.62    "[|M(A); n \<in> nat|]
    1.63     ==> strong_replacement
    1.64 -	  (M, \<lambda>x y. \<exists>z[M]. y = \<langle>x,z\<rangle> &
    1.65 +	  (M, \<lambda>x z. \<exists>y[M]. z = \<langle>x,y\<rangle> &
    1.66                 (\<exists>g[M]. is_recfun (Memrel(succ(n)), x,
    1.67 -		          \<lambda>n f. nat_case(0, \<lambda>m. {0} + A \<times> f`m, n), g) &
    1.68 - 	       z = nat_case(0, \<lambda>m. {0} + A \<times> g ` m, x)))"
    1.69 -by (insert list_replacement1, simp add: nat_into_M) 
    1.70 +		          \<lambda>n f. nat_case(0, \<lambda>m. {0} + A * f`m, n), g) &
    1.71 + 	       y = nat_case(0, \<lambda>m. {0} + A * g ` m, x)))"
    1.72 +apply (insert list_replacement1 [of A n], simp add: nat_into_M)
    1.73 +apply (simp add: nat_into_M apply_abs
    1.74 +                 is_recfun_abs [of "\<lambda>n f. nat_case(0, \<lambda>m. {0} + A * f`m, n)"])
    1.75 +done
    1.76  
    1.77  lemma (in M_datatypes) list_replacement2': 
    1.78 -  "M(A) ==> strong_replacement(M, \<lambda>x y. y = (\<lambda>X. {0} + A \<times> X)^x (0))"
    1.79 +  "M(A) ==> strong_replacement(M, \<lambda>x y. y = (\<lambda>X. {0} + A * X)^x (0))"
    1.80  by (insert list_replacement2, simp add: nat_into_M) 
    1.81  
    1.82