src/ZF/Constructible/Internalize.thy
author paulson
Tue, 13 Aug 2002 17:42:34 +0200
changeset 13496 6f0c57def6d5
child 13503 d93f41fe35d2
permissions -rw-r--r--
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to the new theory Internalize.thy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     1
theory Internalize = L_axioms + Datatype_absolute:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     2
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     3
subsection{*Internalized Forms of Data Structuring Operators*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     4
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     5
subsubsection{*The Formula @{term is_Inl}, Internalized*}
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
(*  is_Inl(M,a,z) == \<exists>zero[M]. empty(M,zero) & pair(M,zero,a,z) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     8
constdefs Inl_fm :: "[i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
     9
    "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
    10
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    11
lemma Inl_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    12
     "[| 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
    13
by (simp add: Inl_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    14
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    15
lemma sats_Inl_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    16
   "[| x \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    17
    ==> sats(A, Inl_fm(x,z), env) <-> is_Inl(**A, nth(x,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    18
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
    19
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    20
lemma Inl_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    21
      "[| nth(i,env) = x; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    22
          i \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    23
       ==> is_Inl(**A, x, z) <-> sats(A, Inl_fm(i,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    24
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    25
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    26
theorem Inl_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    27
     "REFLECTS[\<lambda>x. is_Inl(L,f(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    28
               \<lambda>i x. is_Inl(**Lset(i),f(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    29
apply (simp only: is_Inl_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    30
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    31
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    32
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    33
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    34
subsubsection{*The Formula @{term is_Inr}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    35
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    36
(*  is_Inr(M,a,z) == \<exists>n1[M]. number1(M,n1) & pair(M,n1,a,z) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    37
constdefs Inr_fm :: "[i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    38
    "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
    39
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    40
lemma Inr_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    41
     "[| 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
    42
by (simp add: Inr_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    43
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    44
lemma sats_Inr_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    45
   "[| x \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    46
    ==> sats(A, Inr_fm(x,z), env) <-> is_Inr(**A, nth(x,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    47
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
    48
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    49
lemma Inr_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    50
      "[| nth(i,env) = x; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    51
          i \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    52
       ==> is_Inr(**A, x, z) <-> sats(A, Inr_fm(i,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    53
by simp
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
theorem Inr_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    56
     "REFLECTS[\<lambda>x. is_Inr(L,f(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    57
               \<lambda>i x. is_Inr(**Lset(i),f(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    58
apply (simp only: is_Inr_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    59
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    60
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    61
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    62
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    63
subsubsection{*The Formula @{term is_Nil}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    64
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    65
(* 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
    66
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    67
constdefs Nil_fm :: "i=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    68
    "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
    69
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    70
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
    71
by (simp add: Nil_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    72
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    73
lemma sats_Nil_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    74
   "[| x \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    75
    ==> sats(A, Nil_fm(x), env) <-> is_Nil(**A, nth(x,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    76
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
    77
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    78
lemma Nil_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    79
      "[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    80
       ==> is_Nil(**A, x) <-> sats(A, Nil_fm(i), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    81
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    82
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    83
theorem Nil_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    84
     "REFLECTS[\<lambda>x. is_Nil(L,f(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    85
               \<lambda>i x. is_Nil(**Lset(i),f(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    86
apply (simp only: is_Nil_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    87
apply (intro FOL_reflections function_reflections Inl_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    88
done
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
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    91
subsubsection{*The Formula @{term is_Cons}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    92
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    93
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    94
(*  "is_Cons(M,a,l,Z) == \<exists>p[M]. pair(M,a,l,p) & is_Inr(M,p,Z)" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    95
constdefs Cons_fm :: "[i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    96
    "Cons_fm(a,l,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    97
       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
    98
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
    99
lemma Cons_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   100
     "[| 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
   101
by (simp add: Cons_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   102
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   103
lemma sats_Cons_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   104
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   105
    ==> sats(A, Cons_fm(x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   106
       is_Cons(**A, nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   107
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
   108
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   109
lemma Cons_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   110
      "[| 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
   111
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   112
       ==>is_Cons(**A, x, y, z) <-> sats(A, Cons_fm(i,j,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   113
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   114
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   115
theorem Cons_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   116
     "REFLECTS[\<lambda>x. is_Cons(L,f(x),g(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   117
               \<lambda>i x. is_Cons(**Lset(i),f(x),g(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   118
apply (simp only: is_Cons_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   119
apply (intro FOL_reflections pair_reflection Inr_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   120
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   121
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   122
subsubsection{*The Formula @{term is_quasilist}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   123
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   124
(* 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
   125
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   126
constdefs quasilist_fm :: "i=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   127
    "quasilist_fm(x) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   128
       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
   129
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   130
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
   131
by (simp add: quasilist_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   132
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   133
lemma sats_quasilist_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   134
   "[| x \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   135
    ==> sats(A, quasilist_fm(x), env) <-> is_quasilist(**A, nth(x,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   136
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
   137
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   138
lemma quasilist_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   139
      "[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   140
       ==> is_quasilist(**A, x) <-> sats(A, quasilist_fm(i), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   141
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   142
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   143
theorem quasilist_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   144
     "REFLECTS[\<lambda>x. is_quasilist(L,f(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   145
               \<lambda>i x. is_quasilist(**Lset(i),f(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   146
apply (simp only: is_quasilist_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   147
apply (intro FOL_reflections Nil_reflection Cons_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   148
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   149
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   150
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   151
subsection{*Absoluteness for the Function @{term nth}*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   152
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   153
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   154
subsubsection{*The Formula @{term is_hd}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   155
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   156
(*   "is_hd(M,xs,H) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   157
       (is_Nil(M,xs) --> empty(M,H)) &
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   158
       (\<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
   159
       (is_quasilist(M,xs) | empty(M,H))" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   160
constdefs hd_fm :: "[i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   161
    "hd_fm(xs,H) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   162
       And(Implies(Nil_fm(xs), empty_fm(H)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   163
           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
   164
               Or(quasilist_fm(xs), empty_fm(H))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   165
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   166
lemma hd_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   167
     "[| 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
   168
by (simp add: hd_fm_def) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   169
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   170
lemma sats_hd_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   171
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   172
    ==> sats(A, hd_fm(x,y), env) <-> is_hd(**A, nth(x,env), nth(y,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   173
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
   174
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   175
lemma hd_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   176
      "[| nth(i,env) = x; nth(j,env) = y;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   177
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   178
       ==> is_hd(**A, x, y) <-> sats(A, hd_fm(i,j), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   179
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   180
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   181
theorem hd_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   182
     "REFLECTS[\<lambda>x. is_hd(L,f(x),g(x)), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   183
               \<lambda>i x. is_hd(**Lset(i),f(x),g(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   184
apply (simp only: is_hd_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   185
apply (intro FOL_reflections Nil_reflection Cons_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   186
             quasilist_reflection empty_reflection)  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   187
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   188
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   189
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   190
subsubsection{*The Formula @{term is_tl}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   191
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   192
(*     "is_tl(M,xs,T) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   193
       (is_Nil(M,xs) --> T=xs) &
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   194
       (\<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
   195
       (is_quasilist(M,xs) | empty(M,T))" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   196
constdefs tl_fm :: "[i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   197
    "tl_fm(xs,T) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   198
       And(Implies(Nil_fm(xs), Equal(T,xs)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   199
           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
   200
               Or(quasilist_fm(xs), empty_fm(T))))"
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
lemma tl_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   203
     "[| 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
   204
by (simp add: tl_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   205
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   206
lemma sats_tl_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   207
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   208
    ==> sats(A, tl_fm(x,y), env) <-> is_tl(**A, nth(x,env), nth(y,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   209
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
   210
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   211
lemma tl_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   212
      "[| nth(i,env) = x; nth(j,env) = y;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   213
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   214
       ==> is_tl(**A, x, y) <-> sats(A, tl_fm(i,j), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   215
by simp
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
theorem tl_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   218
     "REFLECTS[\<lambda>x. is_tl(L,f(x),g(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   219
               \<lambda>i x. is_tl(**Lset(i),f(x),g(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   220
apply (simp only: is_tl_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   221
apply (intro FOL_reflections Nil_reflection Cons_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   222
             quasilist_reflection empty_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   223
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   224
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   225
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   226
subsubsection{*The Operator @{term is_bool_of_o}*}
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
(*   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
   229
   "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
   230
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   231
text{*The formula @{term p} has no free variables.*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   232
constdefs bool_of_o_fm :: "[i, i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   233
 "bool_of_o_fm(p,z) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   234
    Or(And(p,number1_fm(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   235
       And(Neg(p),empty_fm(z)))"
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
lemma is_bool_of_o_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   238
     "[| 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
   239
by (simp add: bool_of_o_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   240
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   241
lemma sats_bool_of_o_fm:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   242
  assumes p_iff_sats: "P <-> sats(A, p, env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   243
  shows 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   244
      "[|z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   245
       ==> sats(A, bool_of_o_fm(p,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   246
           is_bool_of_o(**A, P, nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   247
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
   248
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   249
lemma is_bool_of_o_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   250
  "[| P <-> sats(A, p, env); nth(k,env) = z; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   251
   ==> is_bool_of_o(**A, P, z) <-> sats(A, bool_of_o_fm(p,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   252
by (simp add: sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   253
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   254
theorem bool_of_o_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   255
     "REFLECTS [P(L), \<lambda>i. P(**Lset(i))] ==>
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   256
      REFLECTS[\<lambda>x. is_bool_of_o(L, P(L,x), f(x)),  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   257
               \<lambda>i x. is_bool_of_o(**Lset(i), P(**Lset(i),x), f(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   258
apply (simp (no_asm) only: is_bool_of_o_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   259
apply (intro FOL_reflections function_reflections, assumption+)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   260
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   261
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   262
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   263
subsection{*More Internalizations*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   264
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   265
subsubsection{*The Operator @{term is_lambda}*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   266
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   267
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
   268
 @{term p} will be enclosed by three quantifiers.*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   269
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   270
(* 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
   271
    "is_lambda(M, A, is_b, z) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   272
       \<forall>p[M]. p \<in> z <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   273
        (\<exists>u[M]. \<exists>v[M]. u\<in>A & pair(M,u,v,p) & is_b(u,v))" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   274
constdefs lambda_fm :: "[i, i, i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   275
 "lambda_fm(p,A,z) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   276
    Forall(Iff(Member(0,succ(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   277
            Exists(Exists(And(Member(1,A#+3),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   278
                           And(pair_fm(1,0,2), p))))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   279
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   280
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
   281
  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
   282
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   283
lemma is_lambda_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   284
     "[| 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
   285
      ==> lambda_fm(p,x,y) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   286
by (simp add: lambda_fm_def) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   287
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   288
lemma sats_lambda_fm:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   289
  assumes is_b_iff_sats: 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   290
      "!!a0 a1 a2. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   291
        [|a0\<in>A; a1\<in>A; a2\<in>A|] 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   292
        ==> is_b(a1, a0) <-> sats(A, p, Cons(a0,Cons(a1,Cons(a2,env))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   293
  shows 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   294
      "[|x \<in> nat; y \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   295
       ==> sats(A, lambda_fm(p,x,y), env) <-> 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   296
           is_lambda(**A, nth(x,env), is_b, nth(y,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   297
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
   298
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   299
lemma is_lambda_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   300
  assumes is_b_iff_sats: 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   301
      "!!a0 a1 a2. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   302
        [|a0\<in>A; a1\<in>A; a2\<in>A|] 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   303
        ==> is_b(a1, a0) <-> sats(A, p, Cons(a0,Cons(a1,Cons(a2,env))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   304
  shows
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   305
  "[|nth(i,env) = x; nth(j,env) = y; 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   306
      i \<in> nat; j \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   307
   ==> is_lambda(**A, x, is_b, y) <-> sats(A, lambda_fm(p,i,j), env)" 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   308
by (simp add: sats_lambda_fm [OF is_b_iff_sats])
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   309
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   310
theorem is_lambda_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   311
  assumes is_b_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   312
    "!!f' f g h. REFLECTS[\<lambda>x. is_b(L, f'(x), f(x), g(x)), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   313
                     \<lambda>i x. is_b(**Lset(i), f'(x), f(x), g(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   314
  shows "REFLECTS[\<lambda>x. is_lambda(L, A(x), is_b(L,x), f(x)), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   315
               \<lambda>i x. is_lambda(**Lset(i), A(x), is_b(**Lset(i),x), f(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   316
apply (simp (no_asm_use) only: is_lambda_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   317
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
   318
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   319
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   320
subsubsection{*The Operator @{term is_Member}, Internalized*}
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
(*    "is_Member(M,x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   323
	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inl(M,u,Z)" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   324
constdefs Member_fm :: "[i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   325
    "Member_fm(x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   326
       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
   327
                      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
   328
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   329
lemma is_Member_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   330
     "[| 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
   331
by (simp add: Member_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   332
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   333
lemma sats_Member_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   334
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   335
    ==> sats(A, Member_fm(x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   336
        is_Member(**A, nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   337
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
   338
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   339
lemma Member_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   340
      "[| 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
   341
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   342
       ==> is_Member(**A, x, y, z) <-> sats(A, Member_fm(i,j,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   343
by (simp add: sats_Member_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   344
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   345
theorem Member_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   346
     "REFLECTS[\<lambda>x. is_Member(L,f(x),g(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   347
               \<lambda>i x. is_Member(**Lset(i),f(x),g(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   348
apply (simp only: is_Member_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   349
apply (intro FOL_reflections pair_reflection Inl_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   350
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   351
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   352
subsubsection{*The Operator @{term is_Equal}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   353
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   354
(*    "is_Equal(M,x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   355
	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inr(M,p,u) & is_Inl(M,u,Z)" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   356
constdefs Equal_fm :: "[i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   357
    "Equal_fm(x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   358
       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
   359
                      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
   360
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   361
lemma is_Equal_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   362
     "[| 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
   363
by (simp add: Equal_fm_def)
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 sats_Equal_fm [simp]:
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; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   367
    ==> sats(A, Equal_fm(x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   368
        is_Equal(**A, nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   369
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
   370
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   371
lemma Equal_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   372
      "[| 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
   373
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   374
       ==> is_Equal(**A, x, y, z) <-> sats(A, Equal_fm(i,j,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   375
by (simp add: sats_Equal_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   376
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   377
theorem Equal_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   378
     "REFLECTS[\<lambda>x. is_Equal(L,f(x),g(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   379
               \<lambda>i x. is_Equal(**Lset(i),f(x),g(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   380
apply (simp only: is_Equal_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   381
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
   382
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   383
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   384
subsubsection{*The Operator @{term is_Nand}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   385
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   386
(*    "is_Nand(M,x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   387
	\<exists>p[M]. \<exists>u[M]. pair(M,x,y,p) & is_Inl(M,p,u) & is_Inr(M,u,Z)" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   388
constdefs Nand_fm :: "[i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   389
    "Nand_fm(x,y,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   390
       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
   391
                      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
   392
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   393
lemma is_Nand_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   394
     "[| 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
   395
by (simp add: Nand_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   396
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   397
lemma sats_Nand_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   398
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   399
    ==> sats(A, Nand_fm(x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   400
        is_Nand(**A, nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   401
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
   402
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   403
lemma Nand_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   404
      "[| 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
   405
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   406
       ==> is_Nand(**A, x, y, z) <-> sats(A, Nand_fm(i,j,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   407
by (simp add: sats_Nand_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   408
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   409
theorem Nand_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   410
     "REFLECTS[\<lambda>x. is_Nand(L,f(x),g(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   411
               \<lambda>i x. is_Nand(**Lset(i),f(x),g(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   412
apply (simp only: is_Nand_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   413
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
   414
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   415
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   416
subsubsection{*The Operator @{term is_Forall}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   417
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   418
(* "is_Forall(M,p,Z) == \<exists>u[M]. is_Inr(M,p,u) & is_Inr(M,u,Z)" *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   419
constdefs Forall_fm :: "[i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   420
    "Forall_fm(x,Z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   421
       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
   422
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   423
lemma is_Forall_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   424
     "[| 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
   425
by (simp add: Forall_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   426
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   427
lemma sats_Forall_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   428
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   429
    ==> sats(A, Forall_fm(x,y), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   430
        is_Forall(**A, nth(x,env), nth(y,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   431
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
   432
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   433
lemma Forall_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   434
      "[| nth(i,env) = x; nth(j,env) = y; 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   435
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   436
       ==> is_Forall(**A, x, y) <-> sats(A, Forall_fm(i,j), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   437
by (simp add: sats_Forall_fm)
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
theorem Forall_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   440
     "REFLECTS[\<lambda>x. is_Forall(L,f(x),g(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   441
               \<lambda>i x. is_Forall(**Lset(i),f(x),g(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   442
apply (simp only: is_Forall_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   443
apply (intro FOL_reflections pair_reflection Inr_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   444
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   445
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   446
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   447
subsubsection{*The Operator @{term is_and}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   448
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   449
(* 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
   450
                       (~number1(M,a) & empty(M,z)) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   451
constdefs and_fm :: "[i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   452
    "and_fm(a,b,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   453
       Or(And(number1_fm(a), Equal(z,b)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   454
          And(Neg(number1_fm(a)),empty_fm(z)))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   455
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   456
lemma is_and_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   457
     "[| 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
   458
by (simp add: and_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   459
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   460
lemma sats_and_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   461
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   462
    ==> sats(A, and_fm(x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   463
        is_and(**A, nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   464
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
   465
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   466
lemma is_and_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   467
      "[| 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
   468
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   469
       ==> is_and(**A, x, y, z) <-> sats(A, and_fm(i,j,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   470
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   471
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   472
theorem is_and_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   473
     "REFLECTS[\<lambda>x. is_and(L,f(x),g(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   474
               \<lambda>i x. is_and(**Lset(i),f(x),g(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   475
apply (simp only: is_and_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   476
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   477
done
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
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   480
subsubsection{*The Operator @{term is_or}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   481
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   482
(* 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
   483
                     (~number1(M,a) & z=b) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   484
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   485
constdefs or_fm :: "[i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   486
    "or_fm(a,b,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   487
       Or(And(number1_fm(a), number1_fm(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   488
          And(Neg(number1_fm(a)), Equal(z,b)))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   489
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   490
lemma is_or_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   491
     "[| 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
   492
by (simp add: or_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   493
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   494
lemma sats_or_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   495
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   496
    ==> sats(A, or_fm(x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   497
        is_or(**A, nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   498
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
   499
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   500
lemma is_or_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   501
      "[| 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
   502
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   503
       ==> is_or(**A, x, y, z) <-> sats(A, or_fm(i,j,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   504
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   505
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   506
theorem is_or_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   507
     "REFLECTS[\<lambda>x. is_or(L,f(x),g(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   508
               \<lambda>i x. is_or(**Lset(i),f(x),g(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   509
apply (simp only: is_or_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   510
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   511
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   512
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
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   515
subsubsection{*The Operator @{term is_not}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   516
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   517
(* 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
   518
                     (~number1(M,a) & number1(M,z)) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   519
constdefs not_fm :: "[i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   520
    "not_fm(a,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   521
       Or(And(number1_fm(a), empty_fm(z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   522
          And(Neg(number1_fm(a)), number1_fm(z)))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   523
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   524
lemma is_not_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   525
     "[| 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
   526
by (simp add: not_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   527
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   528
lemma sats_is_not_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   529
   "[| x \<in> nat; z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   530
    ==> sats(A, not_fm(x,z), env) <-> is_not(**A, nth(x,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   531
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
   532
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   533
lemma is_not_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   534
      "[| nth(i,env) = x; nth(k,env) = z;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   535
          i \<in> nat; k \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   536
       ==> is_not(**A, x, z) <-> sats(A, not_fm(i,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   537
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   538
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   539
theorem is_not_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   540
     "REFLECTS[\<lambda>x. is_not(L,f(x),g(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   541
               \<lambda>i x. is_not(**Lset(i),f(x),g(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   542
apply (simp only: is_not_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   543
apply (intro FOL_reflections function_reflections)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   544
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   545
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   546
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   547
lemmas extra_reflections = 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   548
    Inl_reflection Inr_reflection Nil_reflection Cons_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   549
    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
   550
    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
   551
    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
   552
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   553
lemmas extra_iff_sats =
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   554
    Inl_iff_sats Inr_iff_sats Nil_iff_sats Cons_iff_sats quasilist_iff_sats
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   555
    hd_iff_sats tl_iff_sats is_bool_of_o_iff_sats is_lambda_iff_sats
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   556
    Member_iff_sats Equal_iff_sats Nand_iff_sats Forall_iff_sats 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   557
    is_and_iff_sats is_or_iff_sats is_not_iff_sats
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   558
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
diff changeset
   559
end