561 apply (simp only: successor_def setclass_simps) |
561 apply (simp only: successor_def setclass_simps) |
562 apply (intro cons_reflection) |
562 apply (intro cons_reflection) |
563 done |
563 done |
564 |
564 |
565 |
565 |
566 subsubsection{*Function Application, Internalized*} |
566 subsubsection{*Big Union, Internalized*} |
567 |
567 |
568 constdefs fun_apply_fm :: "[i,i,i]=>i" |
568 (* "big_union(M,A,z) == \<forall>x[M]. x \<in> z <-> (\<exists>y[M]. y\<in>A & x \<in> y)" *) |
569 "fun_apply_fm(f,x,y) == |
569 constdefs big_union_fm :: "[i,i]=>i" |
570 Forall(Iff(Exists(And(Member(0,succ(succ(f))), |
570 "big_union_fm(A,z) == |
571 pair_fm(succ(succ(x)), 1, 0))), |
571 Forall(Iff(Member(0,succ(z)), |
572 Equal(succ(y),0)))" |
572 Exists(And(Member(0,succ(succ(A))), Member(1,0)))))" |
573 |
573 |
574 lemma fun_apply_type [TC]: |
574 lemma big_union_type [TC]: |
575 "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> fun_apply_fm(x,y,z) \<in> formula" |
575 "[| x \<in> nat; y \<in> nat |] ==> big_union_fm(x,y) \<in> formula" |
576 by (simp add: fun_apply_fm_def) |
576 by (simp add: big_union_fm_def) |
577 |
577 |
578 lemma arity_fun_apply_fm [simp]: |
578 lemma arity_big_union_fm [simp]: |
579 "[| x \<in> nat; y \<in> nat; z \<in> nat |] |
579 "[| x \<in> nat; y \<in> nat |] |
580 ==> arity(fun_apply_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
580 ==> arity(big_union_fm(x,y)) = succ(x) \<union> succ(y)" |
581 by (simp add: fun_apply_fm_def succ_Un_distrib [symmetric] Un_ac) |
581 by (simp add: big_union_fm_def succ_Un_distrib [symmetric] Un_ac) |
582 |
582 |
583 lemma sats_fun_apply_fm [simp]: |
583 lemma sats_big_union_fm [simp]: |
584 "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
584 "[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
585 ==> sats(A, fun_apply_fm(x,y,z), env) <-> |
585 ==> sats(A, big_union_fm(x,y), env) <-> |
586 fun_apply(**A, nth(x,env), nth(y,env), nth(z,env))" |
586 big_union(**A, nth(x,env), nth(y,env))" |
587 by (simp add: fun_apply_fm_def fun_apply_def) |
587 by (simp add: big_union_fm_def big_union_def) |
588 |
588 |
589 lemma fun_apply_iff_sats: |
589 lemma big_union_iff_sats: |
590 "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
590 "[| nth(i,env) = x; nth(j,env) = y; |
591 i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
591 i \<in> nat; j \<in> nat; env \<in> list(A)|] |
592 ==> fun_apply(**A, x, y, z) <-> sats(A, fun_apply_fm(i,j,k), env)" |
592 ==> big_union(**A, x, y) <-> sats(A, big_union_fm(i,j), env)" |
593 by simp |
593 by simp |
594 |
594 |
595 theorem fun_apply_reflection: |
595 theorem big_union_reflection: |
596 "REFLECTS[\<lambda>x. fun_apply(L,f(x),g(x),h(x)), |
596 "REFLECTS[\<lambda>x. big_union(L,f(x),g(x)), |
597 \<lambda>i x. fun_apply(**Lset(i),f(x),g(x),h(x))]" |
597 \<lambda>i x. big_union(**Lset(i),f(x),g(x))]" |
598 apply (simp only: fun_apply_def setclass_simps) |
598 apply (simp only: big_union_def setclass_simps) |
599 apply (intro FOL_reflections pair_reflection) |
599 apply (intro FOL_reflections) |
600 done |
600 done |
601 |
601 |
602 |
602 |
603 subsubsection{*Variants of Satisfaction Definitions for Ordinals, etc.*} |
603 subsubsection{*Variants of Satisfaction Definitions for Ordinals, etc.*} |
604 |
604 |
919 theorem pre_image_reflection: |
919 theorem pre_image_reflection: |
920 "REFLECTS[\<lambda>x. pre_image(L,f(x),g(x),h(x)), |
920 "REFLECTS[\<lambda>x. pre_image(L,f(x),g(x),h(x)), |
921 \<lambda>i x. pre_image(**Lset(i),f(x),g(x),h(x))]" |
921 \<lambda>i x. pre_image(**Lset(i),f(x),g(x),h(x))]" |
922 apply (simp only: Relative.pre_image_def setclass_simps) |
922 apply (simp only: Relative.pre_image_def setclass_simps) |
923 apply (intro FOL_reflections pair_reflection) |
923 apply (intro FOL_reflections pair_reflection) |
|
924 done |
|
925 |
|
926 |
|
927 subsubsection{*Function Application, Internalized*} |
|
928 |
|
929 (* "fun_apply(M,f,x,y) == |
|
930 (\<exists>xs[M]. \<exists>fxs[M]. |
|
931 upair(M,x,x,xs) & image(M,f,xs,fxs) & big_union(M,fxs,y))" *) |
|
932 constdefs fun_apply_fm :: "[i,i,i]=>i" |
|
933 "fun_apply_fm(f,x,y) == |
|
934 Exists(Exists(And(upair_fm(succ(succ(x)), succ(succ(x)), 1), |
|
935 And(image_fm(succ(succ(f)), 1, 0), |
|
936 big_union_fm(0,succ(succ(y)))))))" |
|
937 |
|
938 lemma fun_apply_type [TC]: |
|
939 "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> fun_apply_fm(x,y,z) \<in> formula" |
|
940 by (simp add: fun_apply_fm_def) |
|
941 |
|
942 lemma arity_fun_apply_fm [simp]: |
|
943 "[| x \<in> nat; y \<in> nat; z \<in> nat |] |
|
944 ==> arity(fun_apply_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
|
945 by (simp add: fun_apply_fm_def succ_Un_distrib [symmetric] Un_ac) |
|
946 |
|
947 lemma sats_fun_apply_fm [simp]: |
|
948 "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
949 ==> sats(A, fun_apply_fm(x,y,z), env) <-> |
|
950 fun_apply(**A, nth(x,env), nth(y,env), nth(z,env))" |
|
951 by (simp add: fun_apply_fm_def fun_apply_def) |
|
952 |
|
953 lemma fun_apply_iff_sats: |
|
954 "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
|
955 i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
|
956 ==> fun_apply(**A, x, y, z) <-> sats(A, fun_apply_fm(i,j,k), env)" |
|
957 by simp |
|
958 |
|
959 theorem fun_apply_reflection: |
|
960 "REFLECTS[\<lambda>x. fun_apply(L,f(x),g(x),h(x)), |
|
961 \<lambda>i x. fun_apply(**Lset(i),f(x),g(x),h(x))]" |
|
962 apply (simp only: fun_apply_def setclass_simps) |
|
963 apply (intro FOL_reflections upair_reflection image_reflection |
|
964 big_union_reflection) |
924 done |
965 done |
925 |
966 |
926 |
967 |
927 subsubsection{*The Concept of Relation, Internalized*} |
968 subsubsection{*The Concept of Relation, Internalized*} |
928 |
969 |
1034 ==> typed_function(**A, x, y, z) <-> sats(A, typed_function_fm(i,j,k), env)" |
1075 ==> typed_function(**A, x, y, z) <-> sats(A, typed_function_fm(i,j,k), env)" |
1035 by simp |
1076 by simp |
1036 |
1077 |
1037 lemmas function_reflections = |
1078 lemmas function_reflections = |
1038 empty_reflection upair_reflection pair_reflection union_reflection |
1079 empty_reflection upair_reflection pair_reflection union_reflection |
1039 cons_reflection successor_reflection |
1080 big_union_reflection cons_reflection successor_reflection |
1040 fun_apply_reflection subset_reflection |
1081 fun_apply_reflection subset_reflection |
1041 transitive_set_reflection membership_reflection |
1082 transitive_set_reflection membership_reflection |
1042 pred_set_reflection domain_reflection range_reflection field_reflection |
1083 pred_set_reflection domain_reflection range_reflection field_reflection |
1043 image_reflection pre_image_reflection |
1084 image_reflection pre_image_reflection |
1044 is_relation_reflection is_function_reflection |
1085 is_relation_reflection is_function_reflection |