src/ZF/Constructible/Internalize.thy
author wenzelm
Wed, 27 Mar 2013 16:38:25 +0100
changeset 51553 63327f679cff
parent 46823 57bf0cecb366
child 60770 240563fbf41d
permissions -rw-r--r--
more ambitious Goal.skip_proofs: covers Goal.prove forms as well, and do not insist in quick_and_dirty (for the sake of Isabelle/jEdit);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13503
diff changeset
     1
(*  Title:      ZF/Constructible/Internalize.thy
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13503
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13503
diff changeset
     3
*)
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13503
diff changeset
     4
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 13807
diff changeset
     5
theory Internalize imports L_axioms Datatype_absolute begin
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     6
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     7
subsection{*Internalized Forms of Data Structuring Operators*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     8
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     9
subsubsection{*The Formula @{term is_Inl}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    10
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    11
(*  is_Inl(M,a,z) == \<exists>zero[M]. empty(M,zero) & pair(M,zero,a,z) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    12
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    13
  Inl_fm :: "[i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    14
    "Inl_fm(a,z) == Exists(And(empty_fm(0), pair_fm(0,succ(a),succ(z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    15
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    16
lemma Inl_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    17
     "[| x \<in> nat; z \<in> nat |] ==> Inl_fm(x,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    18
by (simp add: Inl_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    19
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    20
lemma sats_Inl_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    21
   "[| x \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
    22
    ==> sats(A, Inl_fm(x,z), env) \<longleftrightarrow> is_Inl(##A, nth(x,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    23
by (simp add: Inl_fm_def is_Inl_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    24
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    25
lemma Inl_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    26
      "[| nth(i,env) = x; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    27
          i \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
    28
       ==> is_Inl(##A, x, z) \<longleftrightarrow> sats(A, Inl_fm(i,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    29
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    30
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    31
theorem Inl_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    32
     "REFLECTS[\<lambda>x. is_Inl(L,f(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
    33
               \<lambda>i x. is_Inl(##Lset(i),f(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
    34
apply (simp only: is_Inl_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    35
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    36
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    37
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    38
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    39
subsubsection{*The Formula @{term is_Inr}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    40
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    41
(*  is_Inr(M,a,z) == \<exists>n1[M]. number1(M,n1) & pair(M,n1,a,z) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    42
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    43
  Inr_fm :: "[i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    44
    "Inr_fm(a,z) == Exists(And(number1_fm(0), pair_fm(0,succ(a),succ(z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    45
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    46
lemma Inr_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    47
     "[| x \<in> nat; z \<in> nat |] ==> Inr_fm(x,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    48
by (simp add: Inr_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    49
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    50
lemma sats_Inr_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    51
   "[| x \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
    52
    ==> sats(A, Inr_fm(x,z), env) \<longleftrightarrow> is_Inr(##A, nth(x,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    53
by (simp add: Inr_fm_def is_Inr_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    54
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    55
lemma Inr_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    56
      "[| nth(i,env) = x; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    57
          i \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
    58
       ==> is_Inr(##A, x, z) \<longleftrightarrow> sats(A, Inr_fm(i,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    59
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    60
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    61
theorem Inr_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    62
     "REFLECTS[\<lambda>x. is_Inr(L,f(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
    63
               \<lambda>i x. is_Inr(##Lset(i),f(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
    64
apply (simp only: is_Inr_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    65
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    66
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    67
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    68
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    69
subsubsection{*The Formula @{term is_Nil}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    70
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    71
(* is_Nil(M,xs) == \<exists>zero[M]. empty(M,zero) & is_Inl(M,zero,xs) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    72
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    73
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    74
  Nil_fm :: "i=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    75
    "Nil_fm(x) == Exists(And(empty_fm(0), Inl_fm(0,succ(x))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    76
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    77
lemma Nil_type [TC]: "x \<in> nat ==> Nil_fm(x) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    78
by (simp add: Nil_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    79
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    80
lemma sats_Nil_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    81
   "[| x \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
    82
    ==> sats(A, Nil_fm(x), env) \<longleftrightarrow> is_Nil(##A, nth(x,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    83
by (simp add: Nil_fm_def is_Nil_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    84
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    85
lemma Nil_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    86
      "[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
    87
       ==> is_Nil(##A, x) \<longleftrightarrow> sats(A, Nil_fm(i), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    88
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    89
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    90
theorem Nil_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    91
     "REFLECTS[\<lambda>x. is_Nil(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
    92
               \<lambda>i x. is_Nil(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
    93
apply (simp only: is_Nil_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    94
apply (intro FOL_reflections function_reflections Inl_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    95
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    96
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    97
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    98
subsubsection{*The Formula @{term is_Cons}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    99
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   100
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   101
(*  "is_Cons(M,a,l,Z) == \<exists>p[M]. pair(M,a,l,p) & is_Inr(M,p,Z)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   102
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   103
  Cons_fm :: "[i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   104
    "Cons_fm(a,l,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   105
       Exists(And(pair_fm(succ(a),succ(l),0), Inr_fm(0,succ(Z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   106
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   107
lemma Cons_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   108
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> Cons_fm(x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   109
by (simp add: Cons_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   110
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   111
lemma sats_Cons_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   112
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   113
    ==> sats(A, Cons_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   114
       is_Cons(##A, nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   115
by (simp add: Cons_fm_def is_Cons_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   116
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   117
lemma Cons_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   118
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   119
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   120
       ==>is_Cons(##A, x, y, z) \<longleftrightarrow> sats(A, Cons_fm(i,j,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   121
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   122
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   123
theorem Cons_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   124
     "REFLECTS[\<lambda>x. is_Cons(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   125
               \<lambda>i x. is_Cons(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   126
apply (simp only: is_Cons_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   127
apply (intro FOL_reflections pair_reflection Inr_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   128
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   129
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   130
subsubsection{*The Formula @{term is_quasilist}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   131
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   132
(* is_quasilist(M,xs) == is_Nil(M,z) | (\<exists>x[M]. \<exists>l[M]. is_Cons(M,x,l,z))" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   133
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   134
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   135
  quasilist_fm :: "i=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   136
    "quasilist_fm(x) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   137
       Or(Nil_fm(x), Exists(Exists(Cons_fm(1,0,succ(succ(x))))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   138
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   139
lemma quasilist_type [TC]: "x \<in> nat ==> quasilist_fm(x) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   140
by (simp add: quasilist_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   141
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   142
lemma sats_quasilist_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   143
   "[| x \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   144
    ==> sats(A, quasilist_fm(x), env) \<longleftrightarrow> is_quasilist(##A, nth(x,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   145
by (simp add: quasilist_fm_def is_quasilist_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   146
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   147
lemma quasilist_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   148
      "[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   149
       ==> is_quasilist(##A, x) \<longleftrightarrow> sats(A, quasilist_fm(i), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   150
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   151
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   152
theorem quasilist_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   153
     "REFLECTS[\<lambda>x. is_quasilist(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   154
               \<lambda>i x. is_quasilist(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   155
apply (simp only: is_quasilist_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   156
apply (intro FOL_reflections Nil_reflection Cons_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   157
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   158
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   159
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   160
subsection{*Absoluteness for the Function @{term nth}*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   161
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   162
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   163
subsubsection{*The Formula @{term is_hd}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   164
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   165
(*   "is_hd(M,xs,H) == 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   166
       (is_Nil(M,xs) \<longrightarrow> empty(M,H)) &
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   167
       (\<forall>x[M]. \<forall>l[M]. ~ is_Cons(M,x,l,xs) | H=x) &
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   168
       (is_quasilist(M,xs) | empty(M,H))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   169
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   170
  hd_fm :: "[i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   171
    "hd_fm(xs,H) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   172
       And(Implies(Nil_fm(xs), empty_fm(H)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   173
           And(Forall(Forall(Or(Neg(Cons_fm(1,0,xs#+2)), Equal(H#+2,1)))),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   174
               Or(quasilist_fm(xs), empty_fm(H))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   175
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   176
lemma hd_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   177
     "[| x \<in> nat; y \<in> nat |] ==> hd_fm(x,y) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   178
by (simp add: hd_fm_def) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   179
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   180
lemma sats_hd_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   181
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   182
    ==> sats(A, hd_fm(x,y), env) \<longleftrightarrow> is_hd(##A, nth(x,env), nth(y,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   183
by (simp add: hd_fm_def is_hd_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   184
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   185
lemma hd_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   186
      "[| nth(i,env) = x; nth(j,env) = y;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   187
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   188
       ==> is_hd(##A, x, y) \<longleftrightarrow> sats(A, hd_fm(i,j), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   189
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   190
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   191
theorem hd_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   192
     "REFLECTS[\<lambda>x. is_hd(L,f(x),g(x)), 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   193
               \<lambda>i x. is_hd(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   194
apply (simp only: is_hd_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   195
apply (intro FOL_reflections Nil_reflection Cons_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   196
             quasilist_reflection empty_reflection)  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   197
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   198
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   199
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   200
subsubsection{*The Formula @{term is_tl}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   201
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   202
(*     "is_tl(M,xs,T) ==
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   203
       (is_Nil(M,xs) \<longrightarrow> T=xs) &
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   204
       (\<forall>x[M]. \<forall>l[M]. ~ is_Cons(M,x,l,xs) | T=l) &
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   205
       (is_quasilist(M,xs) | empty(M,T))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   206
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   207
  tl_fm :: "[i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   208
    "tl_fm(xs,T) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   209
       And(Implies(Nil_fm(xs), Equal(T,xs)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   210
           And(Forall(Forall(Or(Neg(Cons_fm(1,0,xs#+2)), Equal(T#+2,0)))),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   211
               Or(quasilist_fm(xs), empty_fm(T))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   212
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   213
lemma tl_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   214
     "[| x \<in> nat; y \<in> nat |] ==> tl_fm(x,y) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   215
by (simp add: tl_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   216
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   217
lemma sats_tl_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   218
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   219
    ==> sats(A, tl_fm(x,y), env) \<longleftrightarrow> is_tl(##A, nth(x,env), nth(y,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   220
by (simp add: tl_fm_def is_tl_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   221
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   222
lemma tl_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   223
      "[| nth(i,env) = x; nth(j,env) = y;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   224
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   225
       ==> is_tl(##A, x, y) \<longleftrightarrow> sats(A, tl_fm(i,j), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   226
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   227
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   228
theorem tl_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   229
     "REFLECTS[\<lambda>x. is_tl(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   230
               \<lambda>i x. is_tl(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   231
apply (simp only: is_tl_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   232
apply (intro FOL_reflections Nil_reflection Cons_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   233
             quasilist_reflection empty_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   234
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   235
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   236
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   237
subsubsection{*The Operator @{term is_bool_of_o}*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   238
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   239
(*   is_bool_of_o :: "[i=>o, o, i] => o"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   240
   "is_bool_of_o(M,P,z) == (P & number1(M,z)) | (~P & empty(M,z))" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   241
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   242
text{*The formula @{term p} has no free variables.*}
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   243
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   244
  bool_of_o_fm :: "[i, i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   245
  "bool_of_o_fm(p,z) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   246
    Or(And(p,number1_fm(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   247
       And(Neg(p),empty_fm(z)))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   248
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   249
lemma is_bool_of_o_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   250
     "[| p \<in> formula; z \<in> nat |] ==> bool_of_o_fm(p,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   251
by (simp add: bool_of_o_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   252
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   253
lemma sats_bool_of_o_fm:
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   254
  assumes p_iff_sats: "P \<longleftrightarrow> sats(A, p, env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   255
  shows 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   256
      "[|z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   257
       ==> sats(A, bool_of_o_fm(p,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   258
           is_bool_of_o(##A, P, nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   259
by (simp add: bool_of_o_fm_def is_bool_of_o_def p_iff_sats [THEN iff_sym])
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   260
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   261
lemma is_bool_of_o_iff_sats:
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   262
  "[| P \<longleftrightarrow> sats(A, p, env); nth(k,env) = z; k \<in> nat; env \<in> list(A)|]
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   263
   ==> is_bool_of_o(##A, P, z) \<longleftrightarrow> sats(A, bool_of_o_fm(p,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   264
by (simp add: sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   265
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   266
theorem bool_of_o_reflection:
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   267
     "REFLECTS [P(L), \<lambda>i. P(##Lset(i))] ==>
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   268
      REFLECTS[\<lambda>x. is_bool_of_o(L, P(L,x), f(x)),  
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   269
               \<lambda>i x. is_bool_of_o(##Lset(i), P(##Lset(i),x), f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   270
apply (simp (no_asm) only: is_bool_of_o_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   271
apply (intro FOL_reflections function_reflections, assumption+)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   272
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   273
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   274
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   275
subsection{*More Internalizations*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   276
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   277
subsubsection{*The Operator @{term is_lambda}*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   278
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   279
text{*The two arguments of @{term p} are always 1, 0. Remember that
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   280
 @{term p} will be enclosed by three quantifiers.*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   281
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   282
(* is_lambda :: "[i=>o, i, [i,i]=>o, i] => o"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   283
    "is_lambda(M, A, is_b, z) == 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   284
       \<forall>p[M]. p \<in> z \<longleftrightarrow>
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   285
        (\<exists>u[M]. \<exists>v[M]. u\<in>A & pair(M,u,v,p) & is_b(u,v))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   286
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   287
  lambda_fm :: "[i, i, i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   288
  "lambda_fm(p,A,z) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   289
    Forall(Iff(Member(0,succ(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   290
            Exists(Exists(And(Member(1,A#+3),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   291
                           And(pair_fm(1,0,2), p))))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   292
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   293
text{*We call @{term p} with arguments x, y by equating them with 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   294
  the corresponding quantified variables with de Bruijn indices 1, 0.*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   295
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   296
lemma is_lambda_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   297
     "[| p \<in> formula; x \<in> nat; y \<in> nat |] 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   298
      ==> lambda_fm(p,x,y) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   299
by (simp add: lambda_fm_def) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   300
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   301
lemma sats_lambda_fm:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   302
  assumes is_b_iff_sats: 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   303
      "!!a0 a1 a2. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   304
        [|a0\<in>A; a1\<in>A; a2\<in>A|] 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   305
        ==> is_b(a1, a0) \<longleftrightarrow> sats(A, p, Cons(a0,Cons(a1,Cons(a2,env))))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   306
  shows 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   307
      "[|x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   308
       ==> sats(A, lambda_fm(p,x,y), env) \<longleftrightarrow> 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   309
           is_lambda(##A, nth(x,env), is_b, nth(y,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   310
by (simp add: lambda_fm_def is_lambda_def is_b_iff_sats [THEN iff_sym]) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   311
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   312
theorem is_lambda_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   313
  assumes is_b_reflection:
13702
c7cf8fa66534 Polishing.
paulson
parents: 13655
diff changeset
   314
    "!!f g h. REFLECTS[\<lambda>x. is_b(L, f(x), g(x), h(x)), 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   315
                     \<lambda>i x. is_b(##Lset(i), f(x), g(x), h(x))]"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   316
  shows "REFLECTS[\<lambda>x. is_lambda(L, A(x), is_b(L,x), f(x)), 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   317
               \<lambda>i x. is_lambda(##Lset(i), A(x), is_b(##Lset(i),x), f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   318
apply (simp (no_asm_use) only: is_lambda_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   319
apply (intro FOL_reflections is_b_reflection pair_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   320
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   321
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   322
subsubsection{*The Operator @{term is_Member}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   323
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   324
(*    "is_Member(M,x,y,Z) ==
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   325
        \<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inl(M,u,Z)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   326
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   327
  Member_fm :: "[i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   328
    "Member_fm(x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   329
       Exists(Exists(And(pair_fm(x#+2,y#+2,1), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   330
                      And(Inl_fm(1,0), Inl_fm(0,Z#+2)))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   331
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   332
lemma is_Member_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   333
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> Member_fm(x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   334
by (simp add: Member_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   335
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   336
lemma sats_Member_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   337
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   338
    ==> sats(A, Member_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   339
        is_Member(##A, nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   340
by (simp add: Member_fm_def is_Member_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   341
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   342
lemma Member_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   343
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   344
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   345
       ==> is_Member(##A, x, y, z) \<longleftrightarrow> sats(A, Member_fm(i,j,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   346
by (simp add: sats_Member_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   347
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   348
theorem Member_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   349
     "REFLECTS[\<lambda>x. is_Member(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   350
               \<lambda>i x. is_Member(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   351
apply (simp only: is_Member_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   352
apply (intro FOL_reflections pair_reflection Inl_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   353
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   354
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   355
subsubsection{*The Operator @{term is_Equal}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   356
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   357
(*    "is_Equal(M,x,y,Z) ==
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   358
        \<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inr(M,p,u) & is_Inl(M,u,Z)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   359
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   360
  Equal_fm :: "[i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   361
    "Equal_fm(x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   362
       Exists(Exists(And(pair_fm(x#+2,y#+2,1), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   363
                      And(Inr_fm(1,0), Inl_fm(0,Z#+2)))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   364
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   365
lemma is_Equal_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   366
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> Equal_fm(x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   367
by (simp add: Equal_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   368
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   369
lemma sats_Equal_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   370
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   371
    ==> sats(A, Equal_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   372
        is_Equal(##A, nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   373
by (simp add: Equal_fm_def is_Equal_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   374
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   375
lemma Equal_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   376
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   377
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   378
       ==> is_Equal(##A, x, y, z) \<longleftrightarrow> sats(A, Equal_fm(i,j,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   379
by (simp add: sats_Equal_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   380
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   381
theorem Equal_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   382
     "REFLECTS[\<lambda>x. is_Equal(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   383
               \<lambda>i x. is_Equal(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   384
apply (simp only: is_Equal_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   385
apply (intro FOL_reflections pair_reflection Inl_reflection Inr_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   386
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   387
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   388
subsubsection{*The Operator @{term is_Nand}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   389
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   390
(*    "is_Nand(M,x,y,Z) ==
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   391
        \<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inr(M,u,Z)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   392
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   393
  Nand_fm :: "[i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   394
    "Nand_fm(x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   395
       Exists(Exists(And(pair_fm(x#+2,y#+2,1), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   396
                      And(Inl_fm(1,0), Inr_fm(0,Z#+2)))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   397
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   398
lemma is_Nand_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   399
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> Nand_fm(x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   400
by (simp add: Nand_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   401
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   402
lemma sats_Nand_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   403
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   404
    ==> sats(A, Nand_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   405
        is_Nand(##A, nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   406
by (simp add: Nand_fm_def is_Nand_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   407
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   408
lemma Nand_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   409
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   410
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   411
       ==> is_Nand(##A, x, y, z) \<longleftrightarrow> sats(A, Nand_fm(i,j,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   412
by (simp add: sats_Nand_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   413
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   414
theorem Nand_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   415
     "REFLECTS[\<lambda>x. is_Nand(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   416
               \<lambda>i x. is_Nand(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   417
apply (simp only: is_Nand_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   418
apply (intro FOL_reflections pair_reflection Inl_reflection Inr_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   419
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   420
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   421
subsubsection{*The Operator @{term is_Forall}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   422
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   423
(* "is_Forall(M,p,Z) == \<exists>u[M]. is_Inr(M,p,u) & is_Inr(M,u,Z)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   424
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   425
  Forall_fm :: "[i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   426
    "Forall_fm(x,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   427
       Exists(And(Inr_fm(succ(x),0), Inr_fm(0,succ(Z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   428
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   429
lemma is_Forall_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   430
     "[| x \<in> nat; y \<in> nat |] ==> Forall_fm(x,y) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   431
by (simp add: Forall_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   432
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   433
lemma sats_Forall_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   434
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   435
    ==> sats(A, Forall_fm(x,y), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   436
        is_Forall(##A, nth(x,env), nth(y,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   437
by (simp add: Forall_fm_def is_Forall_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   438
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   439
lemma Forall_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   440
      "[| nth(i,env) = x; nth(j,env) = y; 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   441
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   442
       ==> is_Forall(##A, x, y) \<longleftrightarrow> sats(A, Forall_fm(i,j), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   443
by (simp add: sats_Forall_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   444
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   445
theorem Forall_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   446
     "REFLECTS[\<lambda>x. is_Forall(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   447
               \<lambda>i x. is_Forall(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   448
apply (simp only: is_Forall_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   449
apply (intro FOL_reflections pair_reflection Inr_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   450
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   451
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   452
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   453
subsubsection{*The Operator @{term is_and}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   454
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   455
(* is_and(M,a,b,z) == (number1(M,a)  & z=b) | 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   456
                       (~number1(M,a) & empty(M,z)) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   457
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   458
  and_fm :: "[i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   459
    "and_fm(a,b,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   460
       Or(And(number1_fm(a), Equal(z,b)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   461
          And(Neg(number1_fm(a)),empty_fm(z)))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   462
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   463
lemma is_and_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   464
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> and_fm(x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   465
by (simp add: and_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   466
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   467
lemma sats_and_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   468
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   469
    ==> sats(A, and_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   470
        is_and(##A, nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   471
by (simp add: and_fm_def is_and_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   472
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   473
lemma is_and_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   474
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   475
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   476
       ==> is_and(##A, x, y, z) \<longleftrightarrow> sats(A, and_fm(i,j,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   477
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   478
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   479
theorem is_and_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   480
     "REFLECTS[\<lambda>x. is_and(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   481
               \<lambda>i x. is_and(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   482
apply (simp only: is_and_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   483
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   484
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   485
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   486
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   487
subsubsection{*The Operator @{term is_or}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   488
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   489
(* is_or(M,a,b,z) == (number1(M,a)  & number1(M,z)) | 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   490
                     (~number1(M,a) & z=b) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   491
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   492
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   493
  or_fm :: "[i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   494
    "or_fm(a,b,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   495
       Or(And(number1_fm(a), number1_fm(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   496
          And(Neg(number1_fm(a)), Equal(z,b)))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   497
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   498
lemma is_or_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   499
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> or_fm(x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   500
by (simp add: or_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   501
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   502
lemma sats_or_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   503
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   504
    ==> sats(A, or_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   505
        is_or(##A, nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   506
by (simp add: or_fm_def is_or_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   507
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   508
lemma is_or_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   509
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   510
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   511
       ==> is_or(##A, x, y, z) \<longleftrightarrow> sats(A, or_fm(i,j,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   512
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   513
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   514
theorem is_or_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   515
     "REFLECTS[\<lambda>x. is_or(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   516
               \<lambda>i x. is_or(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   517
apply (simp only: is_or_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   518
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   519
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   520
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   521
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   522
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   523
subsubsection{*The Operator @{term is_not}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   524
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   525
(* is_not(M,a,z) == (number1(M,a)  & empty(M,z)) | 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   526
                     (~number1(M,a) & number1(M,z)) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   527
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   528
  not_fm :: "[i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   529
    "not_fm(a,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   530
       Or(And(number1_fm(a), empty_fm(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   531
          And(Neg(number1_fm(a)), number1_fm(z)))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   532
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   533
lemma is_not_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   534
     "[| x \<in> nat; z \<in> nat |] ==> not_fm(x,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   535
by (simp add: not_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   536
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   537
lemma sats_is_not_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   538
   "[| x \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   539
    ==> sats(A, not_fm(x,z), env) \<longleftrightarrow> is_not(##A, nth(x,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   540
by (simp add: not_fm_def is_not_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   541
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   542
lemma is_not_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   543
      "[| nth(i,env) = x; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   544
          i \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   545
       ==> is_not(##A, x, z) \<longleftrightarrow> sats(A, not_fm(i,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   546
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   547
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   548
theorem is_not_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   549
     "REFLECTS[\<lambda>x. is_not(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   550
               \<lambda>i x. is_not(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   551
apply (simp only: is_not_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   552
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   553
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   554
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   555
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   556
lemmas extra_reflections = 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   557
    Inl_reflection Inr_reflection Nil_reflection Cons_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   558
    quasilist_reflection hd_reflection tl_reflection bool_of_o_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   559
    is_lambda_reflection Member_reflection Equal_reflection Nand_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   560
    Forall_reflection is_and_reflection is_or_reflection is_not_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   561
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   562
subsection{*Well-Founded Recursion!*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   563
13506
acc18a5d2b1a Various tweaks of the presentation
paulson
parents: 13505
diff changeset
   564
subsubsection{*The Operator @{term M_is_recfun}*}
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   565
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   566
text{*Alternative definition, minimizing nesting of quantifiers around MH*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   567
lemma M_is_recfun_iff:
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   568
   "M_is_recfun(M,MH,r,a,f) \<longleftrightarrow>
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   569
    (\<forall>z[M]. z \<in> f \<longleftrightarrow> 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   570
     (\<exists>x[M]. \<exists>f_r_sx[M]. \<exists>y[M]. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   571
             MH(x, f_r_sx, y) & pair(M,x,y,z) &
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   572
             (\<exists>xa[M]. \<exists>sx[M]. \<exists>r_sx[M]. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   573
                pair(M,x,a,xa) & upair(M,x,x,sx) &
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   574
               pre_image(M,r,sx,r_sx) & restriction(M,f,r_sx,f_r_sx) &
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   575
               xa \<in> r)))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   576
apply (simp add: M_is_recfun_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   577
apply (rule rall_cong, blast) 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   578
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   579
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   580
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   581
(* M_is_recfun :: "[i=>o, [i,i,i]=>o, i, i, i] => o"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   582
   "M_is_recfun(M,MH,r,a,f) ==
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   583
     \<forall>z[M]. z \<in> f \<longleftrightarrow>
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   584
               2      1           0
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   585
new def     (\<exists>x[M]. \<exists>f_r_sx[M]. \<exists>y[M]. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   586
             MH(x, f_r_sx, y) & pair(M,x,y,z) &
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   587
             (\<exists>xa[M]. \<exists>sx[M]. \<exists>r_sx[M]. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   588
                pair(M,x,a,xa) & upair(M,x,x,sx) &
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   589
               pre_image(M,r,sx,r_sx) & restriction(M,f,r_sx,f_r_sx) &
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   590
               xa \<in> r)"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   591
*)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   592
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   593
text{*The three arguments of @{term p} are always 2, 1, 0 and z*}
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   594
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   595
  is_recfun_fm :: "[i, i, i, i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   596
  "is_recfun_fm(p,r,a,f) == 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   597
   Forall(Iff(Member(0,succ(f)),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   598
    Exists(Exists(Exists(
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   599
     And(p, 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   600
      And(pair_fm(2,0,3),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   601
       Exists(Exists(Exists(
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   602
        And(pair_fm(5,a#+7,2),
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   603
         And(upair_fm(5,5,1),
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   604
          And(pre_image_fm(r#+7,1,0),
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   605
           And(restriction_fm(f#+7,0,4), Member(2,r#+7)))))))))))))))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   606
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   607
lemma is_recfun_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   608
     "[| p \<in> formula; x \<in> nat; y \<in> nat; z \<in> nat |] 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   609
      ==> is_recfun_fm(p,x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   610
by (simp add: is_recfun_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   611
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   612
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   613
lemma sats_is_recfun_fm:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   614
  assumes MH_iff_sats: 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   615
      "!!a0 a1 a2 a3. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   616
        [|a0\<in>A; a1\<in>A; a2\<in>A; a3\<in>A|] 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   617
        ==> MH(a2, a1, a0) \<longleftrightarrow> sats(A, p, Cons(a0,Cons(a1,Cons(a2,Cons(a3,env)))))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   618
  shows 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   619
      "[|x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   620
       ==> sats(A, is_recfun_fm(p,x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   621
           M_is_recfun(##A, MH, nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   622
by (simp add: is_recfun_fm_def M_is_recfun_iff MH_iff_sats [THEN iff_sym])
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   623
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   624
lemma is_recfun_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   625
  assumes MH_iff_sats: 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   626
      "!!a0 a1 a2 a3. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   627
        [|a0\<in>A; a1\<in>A; a2\<in>A; a3\<in>A|] 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   628
        ==> MH(a2, a1, a0) \<longleftrightarrow> sats(A, p, Cons(a0,Cons(a1,Cons(a2,Cons(a3,env)))))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   629
  shows
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   630
  "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   631
      i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   632
   ==> M_is_recfun(##A, MH, x, y, z) \<longleftrightarrow> sats(A, is_recfun_fm(p,i,j,k), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   633
by (simp add: sats_is_recfun_fm [OF MH_iff_sats]) 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   634
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   635
text{*The additional variable in the premise, namely @{term f'}, is essential.
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   636
It lets @{term MH} depend upon @{term x}, which seems often necessary.
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   637
The same thing occurs in @{text is_wfrec_reflection}.*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   638
theorem is_recfun_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   639
  assumes MH_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   640
    "!!f' f g h. REFLECTS[\<lambda>x. MH(L, f'(x), f(x), g(x), h(x)), 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   641
                     \<lambda>i x. MH(##Lset(i), f'(x), f(x), g(x), h(x))]"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   642
  shows "REFLECTS[\<lambda>x. M_is_recfun(L, MH(L,x), f(x), g(x), h(x)), 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   643
             \<lambda>i x. M_is_recfun(##Lset(i), MH(##Lset(i),x), f(x), g(x), h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   644
apply (simp (no_asm_use) only: M_is_recfun_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   645
apply (intro FOL_reflections function_reflections
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   646
             restriction_reflection MH_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   647
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   648
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   649
subsubsection{*The Operator @{term is_wfrec}*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   650
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   651
text{*The three arguments of @{term p} are always 2, 1, 0;
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   652
      @{term p} is enclosed by 5 quantifiers.*}
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   653
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   654
(* is_wfrec :: "[i=>o, i, [i,i,i]=>o, i, i] => o"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   655
    "is_wfrec(M,MH,r,a,z) == 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   656
      \<exists>f[M]. M_is_recfun(M,MH,r,a,f) & MH(a,f,z)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   657
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   658
  is_wfrec_fm :: "[i, i, i, i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   659
  "is_wfrec_fm(p,r,a,z) == 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   660
    Exists(And(is_recfun_fm(p, succ(r), succ(a), 0),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   661
           Exists(Exists(Exists(Exists(
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   662
             And(Equal(2,a#+5), And(Equal(1,4), And(Equal(0,z#+5), p)))))))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   663
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   664
text{*We call @{term p} with arguments a, f, z by equating them with 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   665
  the corresponding quantified variables with de Bruijn indices 2, 1, 0.*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   666
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   667
text{*There's an additional existential quantifier to ensure that the
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   668
      environments in both calls to MH have the same length.*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   669
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   670
lemma is_wfrec_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   671
     "[| p \<in> formula; x \<in> nat; y \<in> nat; z \<in> nat |] 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   672
      ==> is_wfrec_fm(p,x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   673
by (simp add: is_wfrec_fm_def) 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   674
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   675
lemma sats_is_wfrec_fm:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   676
  assumes MH_iff_sats: 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   677
      "!!a0 a1 a2 a3 a4. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   678
        [|a0\<in>A; a1\<in>A; a2\<in>A; a3\<in>A; a4\<in>A|] 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   679
        ==> MH(a2, a1, a0) \<longleftrightarrow> sats(A, p, Cons(a0,Cons(a1,Cons(a2,Cons(a3,Cons(a4,env))))))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   680
  shows 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   681
      "[|x \<in> nat; y < length(env); z < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   682
       ==> sats(A, is_wfrec_fm(p,x,y,z), env) \<longleftrightarrow> 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   683
           is_wfrec(##A, MH, nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   684
apply (frule_tac x=z in lt_length_in_nat, assumption)  
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   685
apply (frule lt_length_in_nat, assumption)  
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   686
apply (simp add: is_wfrec_fm_def sats_is_recfun_fm is_wfrec_def MH_iff_sats [THEN iff_sym], blast) 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   687
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   688
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   689
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   690
lemma is_wfrec_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   691
  assumes MH_iff_sats: 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   692
      "!!a0 a1 a2 a3 a4. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   693
        [|a0\<in>A; a1\<in>A; a2\<in>A; a3\<in>A; a4\<in>A|] 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   694
        ==> MH(a2, a1, a0) \<longleftrightarrow> sats(A, p, Cons(a0,Cons(a1,Cons(a2,Cons(a3,Cons(a4,env))))))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   695
  shows
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   696
  "[|nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   697
      i \<in> nat; j < length(env); k < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   698
   ==> is_wfrec(##A, MH, x, y, z) \<longleftrightarrow> sats(A, is_wfrec_fm(p,i,j,k), env)" 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   699
by (simp add: sats_is_wfrec_fm [OF MH_iff_sats])
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   700
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   701
theorem is_wfrec_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   702
  assumes MH_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   703
    "!!f' f g h. REFLECTS[\<lambda>x. MH(L, f'(x), f(x), g(x), h(x)), 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   704
                     \<lambda>i x. MH(##Lset(i), f'(x), f(x), g(x), h(x))]"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   705
  shows "REFLECTS[\<lambda>x. is_wfrec(L, MH(L,x), f(x), g(x), h(x)), 
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   706
               \<lambda>i x. is_wfrec(##Lset(i), MH(##Lset(i),x), f(x), g(x), h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   707
apply (simp (no_asm_use) only: is_wfrec_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   708
apply (intro FOL_reflections MH_reflection is_recfun_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   709
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   710
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   711
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   712
subsection{*For Datatypes*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   713
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   714
subsubsection{*Binary Products, Internalized*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   715
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   716
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   717
  cartprod_fm :: "[i,i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   718
(* "cartprod(M,A,B,z) ==
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   719
        \<forall>u[M]. u \<in> z \<longleftrightarrow> (\<exists>x[M]. x\<in>A & (\<exists>y[M]. y\<in>B & pair(M,x,y,u)))" *)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   720
    "cartprod_fm(A,B,z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   721
       Forall(Iff(Member(0,succ(z)),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   722
                  Exists(And(Member(0,succ(succ(A))),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   723
                         Exists(And(Member(0,succ(succ(succ(B)))),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   724
                                    pair_fm(1,0,2)))))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   725
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   726
lemma cartprod_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   727
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> cartprod_fm(x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   728
by (simp add: cartprod_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   729
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   730
lemma sats_cartprod_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   731
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   732
    ==> sats(A, cartprod_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   733
        cartprod(##A, nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   734
by (simp add: cartprod_fm_def cartprod_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   735
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   736
lemma cartprod_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   737
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   738
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   739
       ==> cartprod(##A, x, y, z) \<longleftrightarrow> sats(A, cartprod_fm(i,j,k), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   740
by (simp add: sats_cartprod_fm)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   741
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   742
theorem cartprod_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   743
     "REFLECTS[\<lambda>x. cartprod(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   744
               \<lambda>i x. cartprod(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   745
apply (simp only: cartprod_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   746
apply (intro FOL_reflections pair_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   747
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   748
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   749
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   750
subsubsection{*Binary Sums, Internalized*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   751
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   752
(* "is_sum(M,A,B,Z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   753
       \<exists>A0[M]. \<exists>n1[M]. \<exists>s1[M]. \<exists>B1[M].
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   754
         3      2       1        0
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   755
       number1(M,n1) & cartprod(M,n1,A,A0) & upair(M,n1,n1,s1) &
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   756
       cartprod(M,s1,B,B1) & union(M,A0,B1,Z)"  *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   757
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   758
  sum_fm :: "[i,i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   759
    "sum_fm(A,B,Z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   760
       Exists(Exists(Exists(Exists(
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   761
        And(number1_fm(2),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   762
            And(cartprod_fm(2,A#+4,3),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   763
                And(upair_fm(2,2,1),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   764
                    And(cartprod_fm(1,B#+4,0), union_fm(3,0,Z#+4)))))))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   765
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   766
lemma sum_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   767
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> sum_fm(x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   768
by (simp add: sum_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   769
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   770
lemma sats_sum_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   771
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   772
    ==> sats(A, sum_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   773
        is_sum(##A, nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   774
by (simp add: sum_fm_def is_sum_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   775
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   776
lemma sum_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   777
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   778
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   779
       ==> is_sum(##A, x, y, z) \<longleftrightarrow> sats(A, sum_fm(i,j,k), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   780
by simp
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   781
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   782
theorem sum_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   783
     "REFLECTS[\<lambda>x. is_sum(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   784
               \<lambda>i x. is_sum(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   785
apply (simp only: is_sum_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   786
apply (intro FOL_reflections function_reflections cartprod_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   787
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   788
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   789
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   790
subsubsection{*The Operator @{term quasinat}*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   791
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   792
(* "is_quasinat(M,z) == empty(M,z) | (\<exists>m[M]. successor(M,m,z))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   793
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   794
  quasinat_fm :: "i=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   795
    "quasinat_fm(z) == Or(empty_fm(z), Exists(succ_fm(0,succ(z))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   796
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   797
lemma quasinat_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   798
     "x \<in> nat ==> quasinat_fm(x) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   799
by (simp add: quasinat_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   800
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   801
lemma sats_quasinat_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   802
   "[| x \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   803
    ==> sats(A, quasinat_fm(x), env) \<longleftrightarrow> is_quasinat(##A, nth(x,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   804
by (simp add: quasinat_fm_def is_quasinat_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   805
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   806
lemma quasinat_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   807
      "[| nth(i,env) = x; nth(j,env) = y;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   808
          i \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   809
       ==> is_quasinat(##A, x) \<longleftrightarrow> sats(A, quasinat_fm(i), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   810
by simp
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   811
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   812
theorem quasinat_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   813
     "REFLECTS[\<lambda>x. is_quasinat(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   814
               \<lambda>i x. is_quasinat(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   815
apply (simp only: is_quasinat_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   816
apply (intro FOL_reflections function_reflections)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   817
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   818
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   819
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   820
subsubsection{*The Operator @{term is_nat_case}*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   821
text{*I could not get it to work with the more natural assumption that 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   822
 @{term is_b} takes two arguments.  Instead it must be a formula where 1 and 0
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   823
 stand for @{term m} and @{term b}, respectively.*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   824
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   825
(* is_nat_case :: "[i=>o, i, [i,i]=>o, i, i] => o"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   826
    "is_nat_case(M, a, is_b, k, z) ==
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   827
       (empty(M,k) \<longrightarrow> z=a) &
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   828
       (\<forall>m[M]. successor(M,m,k) \<longrightarrow> is_b(m,z)) &
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   829
       (is_quasinat(M,k) | empty(M,z))" *)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   830
text{*The formula @{term is_b} has free variables 1 and 0.*}
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   831
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   832
  is_nat_case_fm :: "[i, i, i, i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   833
 "is_nat_case_fm(a,is_b,k,z) == 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   834
    And(Implies(empty_fm(k), Equal(z,a)),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   835
        And(Forall(Implies(succ_fm(0,succ(k)), 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   836
                   Forall(Implies(Equal(0,succ(succ(z))), is_b)))),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   837
            Or(quasinat_fm(k), empty_fm(z))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   838
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   839
lemma is_nat_case_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   840
     "[| is_b \<in> formula;  
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   841
         x \<in> nat; y \<in> nat; z \<in> nat |] 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   842
      ==> is_nat_case_fm(x,is_b,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   843
by (simp add: is_nat_case_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   844
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   845
lemma sats_is_nat_case_fm:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   846
  assumes is_b_iff_sats: 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   847
      "!!a. a \<in> A ==> is_b(a,nth(z, env)) \<longleftrightarrow> 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   848
                      sats(A, p, Cons(nth(z,env), Cons(a, env)))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   849
  shows 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   850
      "[|x \<in> nat; y \<in> nat; z < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   851
       ==> sats(A, is_nat_case_fm(x,p,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   852
           is_nat_case(##A, nth(x,env), is_b, nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   853
apply (frule lt_length_in_nat, assumption)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   854
apply (simp add: is_nat_case_fm_def is_nat_case_def is_b_iff_sats [THEN iff_sym])
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   855
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   856
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   857
lemma is_nat_case_iff_sats:
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   858
  "[| (!!a. a \<in> A ==> is_b(a,z) \<longleftrightarrow>
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   859
                      sats(A, p, Cons(z, Cons(a,env))));
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   860
      nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   861
      i \<in> nat; j \<in> nat; k < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   862
   ==> is_nat_case(##A, x, is_b, y, z) \<longleftrightarrow> sats(A, is_nat_case_fm(i,p,j,k), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   863
by (simp add: sats_is_nat_case_fm [of A is_b])
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   864
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   865
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   866
text{*The second argument of @{term is_b} gives it direct access to @{term x},
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   867
  which is essential for handling free variable references.  Without this
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   868
  argument, we cannot prove reflection for @{term iterates_MH}.*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   869
theorem is_nat_case_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   870
  assumes is_b_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   871
    "!!h f g. REFLECTS[\<lambda>x. is_b(L, h(x), f(x), g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   872
                     \<lambda>i x. is_b(##Lset(i), h(x), f(x), g(x))]"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   873
  shows "REFLECTS[\<lambda>x. is_nat_case(L, f(x), is_b(L,x), g(x), h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   874
               \<lambda>i x. is_nat_case(##Lset(i), f(x), is_b(##Lset(i), x), g(x), h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   875
apply (simp (no_asm_use) only: is_nat_case_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   876
apply (intro FOL_reflections function_reflections
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   877
             restriction_reflection is_b_reflection quasinat_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   878
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   879
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   880
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   881
subsection{*The Operator @{term iterates_MH}, Needed for Iteration*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   882
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   883
(*  iterates_MH :: "[i=>o, [i,i]=>o, i, i, i, i] => o"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   884
   "iterates_MH(M,isF,v,n,g,z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   885
        is_nat_case(M, v, \<lambda>m u. \<exists>gm[M]. fun_apply(M,g,m,gm) & isF(gm,u),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   886
                    n, z)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   887
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   888
  iterates_MH_fm :: "[i, i, i, i, i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   889
 "iterates_MH_fm(isF,v,n,g,z) == 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   890
    is_nat_case_fm(v, 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   891
      Exists(And(fun_apply_fm(succ(succ(succ(g))),2,0), 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   892
                     Forall(Implies(Equal(0,2), isF)))), 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   893
      n, z)"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   894
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   895
lemma iterates_MH_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   896
     "[| p \<in> formula;  
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   897
         v \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat |] 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   898
      ==> iterates_MH_fm(p,v,x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   899
by (simp add: iterates_MH_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   900
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   901
lemma sats_iterates_MH_fm:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   902
  assumes is_F_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   903
      "!!a b c d. [| a \<in> A; b \<in> A; c \<in> A; d \<in> A|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   904
              ==> is_F(a,b) \<longleftrightarrow>
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   905
                  sats(A, p, Cons(b, Cons(a, Cons(c, Cons(d,env)))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   906
  shows 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   907
      "[|v \<in> nat; x \<in> nat; y \<in> nat; z < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   908
       ==> sats(A, iterates_MH_fm(p,v,x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   909
           iterates_MH(##A, is_F, nth(v,env), nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   910
apply (frule lt_length_in_nat, assumption)  
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   911
apply (simp add: iterates_MH_fm_def iterates_MH_def sats_is_nat_case_fm 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   912
              is_F_iff_sats [symmetric])
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   913
apply (rule is_nat_case_cong) 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   914
apply (simp_all add: setclass_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   915
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   916
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   917
lemma iterates_MH_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   918
  assumes is_F_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   919
      "!!a b c d. [| a \<in> A; b \<in> A; c \<in> A; d \<in> A|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   920
              ==> is_F(a,b) \<longleftrightarrow>
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   921
                  sats(A, p, Cons(b, Cons(a, Cons(c, Cons(d,env)))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   922
  shows 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   923
  "[| nth(i',env) = v; nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   924
      i' \<in> nat; i \<in> nat; j \<in> nat; k < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   925
   ==> iterates_MH(##A, is_F, v, x, y, z) \<longleftrightarrow>
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   926
       sats(A, iterates_MH_fm(p,i',i,j,k), env)"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   927
by (simp add: sats_iterates_MH_fm [OF is_F_iff_sats]) 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   928
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   929
text{*The second argument of @{term p} gives it direct access to @{term x},
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   930
  which is essential for handling free variable references.  Without this
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   931
  argument, we cannot prove reflection for @{term list_N}.*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   932
theorem iterates_MH_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   933
  assumes p_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   934
    "!!f g h. REFLECTS[\<lambda>x. p(L, h(x), f(x), g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   935
                     \<lambda>i x. p(##Lset(i), h(x), f(x), g(x))]"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   936
 shows "REFLECTS[\<lambda>x. iterates_MH(L, p(L,x), e(x), f(x), g(x), h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   937
               \<lambda>i x. iterates_MH(##Lset(i), p(##Lset(i),x), e(x), f(x), g(x), h(x))]"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   938
apply (simp (no_asm_use) only: iterates_MH_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   939
apply (intro FOL_reflections function_reflections is_nat_case_reflection
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   940
             restriction_reflection p_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   941
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   942
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
   943
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   944
subsubsection{*The Operator @{term is_iterates}*}
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   945
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   946
text{*The three arguments of @{term p} are always 2, 1, 0;
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   947
      @{term p} is enclosed by 9 (??) quantifiers.*}
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   948
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   949
(*    "is_iterates(M,isF,v,n,Z) == 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   950
      \<exists>sn[M]. \<exists>msn[M]. successor(M,n,sn) & membership(M,sn,msn) &
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   951
       1       0       is_wfrec(M, iterates_MH(M,isF,v), msn, n, Z)"*)
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   952
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   953
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   954
  is_iterates_fm :: "[i, i, i, i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   955
  "is_iterates_fm(p,v,n,Z) == 
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   956
     Exists(Exists(
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   957
      And(succ_fm(n#+2,1),
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   958
       And(Memrel_fm(1,0),
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   959
              is_wfrec_fm(iterates_MH_fm(p, v#+7, 2, 1, 0), 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   960
                          0, n#+2, Z#+2)))))"
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   961
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   962
text{*We call @{term p} with arguments a, f, z by equating them with 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   963
  the corresponding quantified variables with de Bruijn indices 2, 1, 0.*}
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   964
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   965
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   966
lemma is_iterates_type [TC]:
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   967
     "[| p \<in> formula; x \<in> nat; y \<in> nat; z \<in> nat |] 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   968
      ==> is_iterates_fm(p,x,y,z) \<in> formula"
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   969
by (simp add: is_iterates_fm_def) 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   970
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   971
lemma sats_is_iterates_fm:
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   972
  assumes is_F_iff_sats:
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   973
      "!!a b c d e f g h i j k. 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   974
              [| a \<in> A; b \<in> A; c \<in> A; d \<in> A; e \<in> A; f \<in> A; 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   975
                 g \<in> A; h \<in> A; i \<in> A; j \<in> A; k \<in> A|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   976
              ==> is_F(a,b) \<longleftrightarrow>
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   977
                  sats(A, p, Cons(b, Cons(a, Cons(c, Cons(d, Cons(e, Cons(f, 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   978
                      Cons(g, Cons(h, Cons(i, Cons(j, Cons(k, env))))))))))))"
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   979
  shows 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   980
      "[|x \<in> nat; y < length(env); z < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   981
       ==> sats(A, is_iterates_fm(p,x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   982
           is_iterates(##A, is_F, nth(x,env), nth(y,env), nth(z,env))"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   983
apply (frule_tac x=z in lt_length_in_nat, assumption)  
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   984
apply (frule lt_length_in_nat, assumption)  
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   985
apply (simp add: is_iterates_fm_def is_iterates_def sats_is_nat_case_fm 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   986
              is_F_iff_sats [symmetric] sats_is_wfrec_fm sats_iterates_MH_fm)
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   987
done
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   988
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   989
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   990
lemma is_iterates_iff_sats:
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   991
  assumes is_F_iff_sats:
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   992
      "!!a b c d e f g h i j k. 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   993
              [| a \<in> A; b \<in> A; c \<in> A; d \<in> A; e \<in> A; f \<in> A; 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   994
                 g \<in> A; h \<in> A; i \<in> A; j \<in> A; k \<in> A|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   995
              ==> is_F(a,b) \<longleftrightarrow>
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   996
                  sats(A, p, Cons(b, Cons(a, Cons(c, Cons(d, Cons(e, Cons(f, 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   997
                      Cons(g, Cons(h, Cons(i, Cons(j, Cons(k, env))))))))))))"
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   998
  shows 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   999
  "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1000
      i \<in> nat; j < length(env); k < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1001
   ==> is_iterates(##A, is_F, x, y, z) \<longleftrightarrow>
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1002
       sats(A, is_iterates_fm(p,i,j,k), env)"
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1003
by (simp add: sats_is_iterates_fm [OF is_F_iff_sats]) 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1004
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1005
text{*The second argument of @{term p} gives it direct access to @{term x},
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1006
  which is essential for handling free variable references.  Without this
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1007
  argument, we cannot prove reflection for @{term list_N}.*}
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1008
theorem is_iterates_reflection:
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1009
  assumes p_reflection:
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1010
    "!!f g h. REFLECTS[\<lambda>x. p(L, h(x), f(x), g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1011
                     \<lambda>i x. p(##Lset(i), h(x), f(x), g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1012
 shows "REFLECTS[\<lambda>x. is_iterates(L, p(L,x), f(x), g(x), h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1013
               \<lambda>i x. is_iterates(##Lset(i), p(##Lset(i),x), f(x), g(x), h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1014
apply (simp (no_asm_use) only: is_iterates_def)
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1015
apply (intro FOL_reflections function_reflections p_reflection
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1016
             is_wfrec_reflection iterates_MH_reflection)
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1017
done
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1018
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1019
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1020
subsubsection{*The Formula @{term is_eclose_n}, Internalized*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1021
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1022
(* is_eclose_n(M,A,n,Z) == is_iterates(M, big_union(M), A, n, Z) *)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1023
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1024
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1025
  eclose_n_fm :: "[i,i,i]=>i" where
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1026
  "eclose_n_fm(A,n,Z) == is_iterates_fm(big_union_fm(1,0), A, n, Z)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1027
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1028
lemma eclose_n_fm_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1029
 "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> eclose_n_fm(x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1030
by (simp add: eclose_n_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1031
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1032
lemma sats_eclose_n_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1033
   "[| x \<in> nat; y < length(env); z < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1034
    ==> sats(A, eclose_n_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1035
        is_eclose_n(##A, nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1036
apply (frule_tac x=z in lt_length_in_nat, assumption)  
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1037
apply (frule_tac x=y in lt_length_in_nat, assumption)  
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1038
apply (simp add: eclose_n_fm_def is_eclose_n_def 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1039
                 sats_is_iterates_fm) 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1040
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1041
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1042
lemma eclose_n_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1043
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1044
          i \<in> nat; j < length(env); k < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1045
       ==> is_eclose_n(##A, x, y, z) \<longleftrightarrow> sats(A, eclose_n_fm(i,j,k), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1046
by (simp add: sats_eclose_n_fm)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1047
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1048
theorem eclose_n_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1049
     "REFLECTS[\<lambda>x. is_eclose_n(L, f(x), g(x), h(x)),  
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1050
               \<lambda>i x. is_eclose_n(##Lset(i), f(x), g(x), h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1051
apply (simp only: is_eclose_n_def)
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1052
apply (intro FOL_reflections function_reflections is_iterates_reflection) 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1053
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1054
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1055
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1056
subsubsection{*Membership in @{term "eclose(A)"}*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1057
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1058
(* mem_eclose(M,A,l) == 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1059
      \<exists>n[M]. \<exists>eclosen[M]. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1060
       finite_ordinal(M,n) & is_eclose_n(M,A,n,eclosen) & l \<in> eclosen *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1061
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1062
  mem_eclose_fm :: "[i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1063
    "mem_eclose_fm(x,y) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1064
       Exists(Exists(
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1065
         And(finite_ordinal_fm(1),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1066
           And(eclose_n_fm(x#+2,1,0), Member(y#+2,0)))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1067
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1068
lemma mem_eclose_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1069
     "[| x \<in> nat; y \<in> nat |] ==> mem_eclose_fm(x,y) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1070
by (simp add: mem_eclose_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1071
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1072
lemma sats_mem_eclose_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1073
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1074
    ==> sats(A, mem_eclose_fm(x,y), env) \<longleftrightarrow> mem_eclose(##A, nth(x,env), nth(y,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1075
by (simp add: mem_eclose_fm_def mem_eclose_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1076
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1077
lemma mem_eclose_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1078
      "[| nth(i,env) = x; nth(j,env) = y;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1079
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1080
       ==> mem_eclose(##A, x, y) \<longleftrightarrow> sats(A, mem_eclose_fm(i,j), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1081
by simp
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1082
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1083
theorem mem_eclose_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1084
     "REFLECTS[\<lambda>x. mem_eclose(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1085
               \<lambda>i x. mem_eclose(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1086
apply (simp only: mem_eclose_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1087
apply (intro FOL_reflections finite_ordinal_reflection eclose_n_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1088
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1089
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1090
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1091
subsubsection{*The Predicate ``Is @{term "eclose(A)"}''*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1092
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1093
(* is_eclose(M,A,Z) == \<forall>l[M]. l \<in> Z \<longleftrightarrow> mem_eclose(M,A,l) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1094
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1095
  is_eclose_fm :: "[i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1096
    "is_eclose_fm(A,Z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1097
       Forall(Iff(Member(0,succ(Z)), mem_eclose_fm(succ(A),0)))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1098
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1099
lemma is_eclose_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1100
     "[| x \<in> nat; y \<in> nat |] ==> is_eclose_fm(x,y) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1101
by (simp add: is_eclose_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1102
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1103
lemma sats_is_eclose_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1104
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1105
    ==> sats(A, is_eclose_fm(x,y), env) \<longleftrightarrow> is_eclose(##A, nth(x,env), nth(y,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1106
by (simp add: is_eclose_fm_def is_eclose_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1107
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1108
lemma is_eclose_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1109
      "[| nth(i,env) = x; nth(j,env) = y;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1110
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1111
       ==> is_eclose(##A, x, y) \<longleftrightarrow> sats(A, is_eclose_fm(i,j), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1112
by simp
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1113
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1114
theorem is_eclose_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1115
     "REFLECTS[\<lambda>x. is_eclose(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1116
               \<lambda>i x. is_eclose(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1117
apply (simp only: is_eclose_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1118
apply (intro FOL_reflections mem_eclose_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1119
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1120
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1121
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1122
subsubsection{*The List Functor, Internalized*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1123
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1124
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1125
  list_functor_fm :: "[i,i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1126
(* "is_list_functor(M,A,X,Z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1127
        \<exists>n1[M]. \<exists>AX[M].
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1128
         number1(M,n1) & cartprod(M,A,X,AX) & is_sum(M,n1,AX,Z)" *)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1129
    "list_functor_fm(A,X,Z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1130
       Exists(Exists(
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1131
        And(number1_fm(1),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1132
            And(cartprod_fm(A#+2,X#+2,0), sum_fm(1,0,Z#+2)))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1133
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1134
lemma list_functor_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1135
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> list_functor_fm(x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1136
by (simp add: list_functor_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1137
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1138
lemma sats_list_functor_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1139
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1140
    ==> sats(A, list_functor_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1141
        is_list_functor(##A, nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1142
by (simp add: list_functor_fm_def is_list_functor_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1143
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1144
lemma list_functor_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1145
  "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1146
      i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1147
   ==> is_list_functor(##A, x, y, z) \<longleftrightarrow> sats(A, list_functor_fm(i,j,k), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1148
by simp
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1149
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1150
theorem list_functor_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1151
     "REFLECTS[\<lambda>x. is_list_functor(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1152
               \<lambda>i x. is_list_functor(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1153
apply (simp only: is_list_functor_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1154
apply (intro FOL_reflections number1_reflection
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1155
             cartprod_reflection sum_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1156
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1157
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1158
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1159
subsubsection{*The Formula @{term is_list_N}, Internalized*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1160
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1161
(* "is_list_N(M,A,n,Z) == 
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1162
      \<exists>zero[M]. empty(M,zero) & 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1163
                is_iterates(M, is_list_functor(M,A), zero, n, Z)" *)
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1164
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1165
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1166
  list_N_fm :: "[i,i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1167
  "list_N_fm(A,n,Z) == 
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1168
     Exists(
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1169
       And(empty_fm(0),
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1170
           is_iterates_fm(list_functor_fm(A#+9#+3,1,0), 0, n#+1, Z#+1)))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1171
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1172
lemma list_N_fm_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1173
 "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> list_N_fm(x,y,z) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1174
by (simp add: list_N_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1175
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1176
lemma sats_list_N_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1177
   "[| x \<in> nat; y < length(env); z < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1178
    ==> sats(A, list_N_fm(x,y,z), env) \<longleftrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1179
        is_list_N(##A, nth(x,env), nth(y,env), nth(z,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1180
apply (frule_tac x=z in lt_length_in_nat, assumption)  
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1181
apply (frule_tac x=y in lt_length_in_nat, assumption)  
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1182
apply (simp add: list_N_fm_def is_list_N_def sats_is_iterates_fm) 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1183
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1184
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1185
lemma list_N_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1186
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1187
          i \<in> nat; j < length(env); k < length(env); env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1188
       ==> is_list_N(##A, x, y, z) \<longleftrightarrow> sats(A, list_N_fm(i,j,k), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1189
by (simp add: sats_list_N_fm)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1190
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1191
theorem list_N_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1192
     "REFLECTS[\<lambda>x. is_list_N(L, f(x), g(x), h(x)),  
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1193
               \<lambda>i x. is_list_N(##Lset(i), f(x), g(x), h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1194
apply (simp only: is_list_N_def)
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1195
apply (intro FOL_reflections function_reflections 
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1196
             is_iterates_reflection list_functor_reflection) 
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1197
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1198
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1199
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1200
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1201
subsubsection{*The Predicate ``Is A List''*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1202
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1203
(* mem_list(M,A,l) == 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1204
      \<exists>n[M]. \<exists>listn[M]. 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1205
       finite_ordinal(M,n) & is_list_N(M,A,n,listn) & l \<in> listn *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1206
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1207
  mem_list_fm :: "[i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1208
    "mem_list_fm(x,y) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1209
       Exists(Exists(
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1210
         And(finite_ordinal_fm(1),
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1211
           And(list_N_fm(x#+2,1,0), Member(y#+2,0)))))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1212
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1213
lemma mem_list_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1214
     "[| x \<in> nat; y \<in> nat |] ==> mem_list_fm(x,y) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1215
by (simp add: mem_list_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1216
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1217
lemma sats_mem_list_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1218
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1219
    ==> sats(A, mem_list_fm(x,y), env) \<longleftrightarrow> mem_list(##A, nth(x,env), nth(y,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1220
by (simp add: mem_list_fm_def mem_list_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1221
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1222
lemma mem_list_iff_sats:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1223
      "[| nth(i,env) = x; nth(j,env) = y;
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1224
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1225
       ==> mem_list(##A, x, y) \<longleftrightarrow> sats(A, mem_list_fm(i,j), env)"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1226
by simp
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1227
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1228
theorem mem_list_reflection:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1229
     "REFLECTS[\<lambda>x. mem_list(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
  1230
               \<lambda>i x. mem_list(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1231
apply (simp only: mem_list_def)
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1232
apply (intro FOL_reflections finite_ordinal_reflection list_N_reflection)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1233
done
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1234
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1235
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1236
subsubsection{*The Predicate ``Is @{term "list(A)"}''*}
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1237
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1238
(* is_list(M,A,Z) == \<forall>l[M]. l \<in> Z \<longleftrightarrow> mem_list(M,A,l) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1239
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1240
  is_list_fm :: "[i,i]=>i" where
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1241
    "is_list_fm(A,Z) ==
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1242
       Forall(Iff(Member(0,succ(Z)), mem_list_fm(succ(A),0)))"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1243
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1244
lemma is_list_type [TC]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1245
     "[| x \<in> nat; y \<in> nat |] ==> is_list_fm(x,y) \<in> formula"
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1246
by (simp add: is_list_fm_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1247
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1248
lemma sats_is_list_fm [simp]:
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1249
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
  1250
    ==> sats(A, is_list_fm(x,y), env) \<longleftrightarrow> is_list(##A, nth(x,env), nth(y,env))"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1251
by (simp add: is_list_fm_def is_list_def)
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13496
diff changeset
  1252
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: