src/ZF/Constructible/Satisfies_absolute.thy
author paulson
Fri, 16 Aug 2002 16:41:48 +0200
changeset 13505 52a16cb7fefb
parent 13504 59066e97b551
child 13535 007559e981c7
permissions -rw-r--r--
Relativized right up to L satisfies V=L!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     1
(*  Title:      ZF/Constructible/Satisfies_absolute.thy
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     2
    ID:         $Id$
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     4
    Copyright   2002  University of Cambridge
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     5
*)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     6
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
     7
header {*Absoluteness for the Satisfies Relation on Formulas*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
     8
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     9
theory Satisfies_absolute = Datatype_absolute + Rec_Separation: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    10
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    11
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
    12
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    13
subsubsection{*The Formula @{term is_depth}, Internalized*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    14
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    15
(*    "is_depth(M,p,n) == 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    16
       \<exists>sn[M]. \<exists>formula_n[M]. \<exists>formula_sn[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    17
         2          1                0
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    18
        is_formula_N(M,n,formula_n) & p \<notin> formula_n &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    19
        successor(M,n,sn) & is_formula_N(M,sn,formula_sn) & p \<in> formula_sn" *)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    20
constdefs depth_fm :: "[i,i]=>i"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    21
  "depth_fm(p,n) == 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    22
     Exists(Exists(Exists(
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    23
       And(formula_N_fm(n#+3,1),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    24
         And(Neg(Member(p#+3,1)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    25
          And(succ_fm(n#+3,2),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    26
           And(formula_N_fm(2,0), Member(p#+3,0))))))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    27
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    28
lemma depth_fm_type [TC]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    29
 "[| x \<in> nat; y \<in> nat |] ==> depth_fm(x,y) \<in> formula"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    30
by (simp add: depth_fm_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    31
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    32
lemma sats_depth_fm [simp]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    33
   "[| x \<in> nat; y < length(env); env \<in> list(A)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    34
    ==> sats(A, depth_fm(x,y), env) <->
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    35
        is_depth(**A, nth(x,env), nth(y,env))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    36
apply (frule_tac x=y in lt_length_in_nat, assumption)  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    37
apply (simp add: depth_fm_def is_depth_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    38
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    39
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    40
lemma depth_iff_sats:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    41
      "[| nth(i,env) = x; nth(j,env) = y; 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    42
          i \<in> nat; j < length(env); env \<in> list(A)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    43
       ==> is_depth(**A, x, y) <-> sats(A, depth_fm(i,j), env)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    44
by (simp add: sats_depth_fm)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    45
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    46
theorem depth_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    47
     "REFLECTS[\<lambda>x. is_depth(L, f(x), g(x)),  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    48
               \<lambda>i x. is_depth(**Lset(i), f(x), g(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    49
apply (simp only: is_depth_def setclass_simps)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    50
apply (intro FOL_reflections function_reflections formula_N_reflection) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    51
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    52
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    53
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    54
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    55
subsubsection{*The Operator @{term is_formula_case}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    56
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    57
text{*The arguments of @{term is_a} are always 2, 1, 0, and the formula
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    58
      will be enclosed by three quantifiers.*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    59
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    60
(* is_formula_case :: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    61
    "[i=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i]=>o, i, i] => o"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    62
  "is_formula_case(M, is_a, is_b, is_c, is_d, v, z) == 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    63
      (\<forall>x[M]. \<forall>y[M]. x\<in>nat --> y\<in>nat --> is_Member(M,x,y,v) --> is_a(x,y,z)) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    64
      (\<forall>x[M]. \<forall>y[M]. x\<in>nat --> y\<in>nat --> is_Equal(M,x,y,v) --> is_b(x,y,z)) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    65
      (\<forall>x[M]. \<forall>y[M]. x\<in>formula --> y\<in>formula --> 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    66
                     is_Nand(M,x,y,v) --> is_c(x,y,z)) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    67
      (\<forall>x[M]. x\<in>formula --> is_Forall(M,x,v) --> is_d(x,z))" *)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    68
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    69
constdefs formula_case_fm :: "[i, i, i, i, i, i]=>i"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    70
 "formula_case_fm(is_a, is_b, is_c, is_d, v, z) == 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    71
        And(Forall(Forall(Implies(finite_ordinal_fm(1), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    72
                           Implies(finite_ordinal_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    73
                            Implies(Member_fm(1,0,v#+2), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    74
                             Forall(Implies(Equal(0,z#+3), is_a))))))),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    75
        And(Forall(Forall(Implies(finite_ordinal_fm(1), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    76
                           Implies(finite_ordinal_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    77
                            Implies(Equal_fm(1,0,v#+2), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    78
                             Forall(Implies(Equal(0,z#+3), is_b))))))),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    79
        And(Forall(Forall(Implies(mem_formula_fm(1), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    80
                           Implies(mem_formula_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    81
                            Implies(Nand_fm(1,0,v#+2), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    82
                             Forall(Implies(Equal(0,z#+3), is_c))))))),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    83
        Forall(Implies(mem_formula_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    84
                       Implies(Forall_fm(0,succ(v)), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    85
                             Forall(Implies(Equal(0,z#+2), is_d))))))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    86
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    87
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    88
lemma is_formula_case_type [TC]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    89
     "[| is_a \<in> formula;  is_b \<in> formula;  is_c \<in> formula;  is_d \<in> formula;  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    90
         x \<in> nat; y \<in> nat |] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    91
      ==> formula_case_fm(is_a, is_b, is_c, is_d, x, y) \<in> formula"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    92
by (simp add: formula_case_fm_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    93
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    94
lemma sats_formula_case_fm:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    95
  assumes is_a_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    96
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    97
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    98
        ==> ISA(a2, a1, a0) <-> sats(A, is_a, Cons(a0,Cons(a1,Cons(a2,env))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    99
  and is_b_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   100
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   101
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   102
        ==> ISB(a2, a1, a0) <-> sats(A, is_b, Cons(a0,Cons(a1,Cons(a2,env))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   103
  and is_c_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   104
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   105
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   106
        ==> ISC(a2, a1, a0) <-> sats(A, is_c, Cons(a0,Cons(a1,Cons(a2,env))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   107
  and is_d_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   108
      "!!a0 a1. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   109
        [|a0\<in>A; a1\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   110
        ==> ISD(a1, a0) <-> sats(A, is_d, Cons(a0,Cons(a1,env)))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   111
  shows 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   112
      "[|x \<in> nat; y < length(env); env \<in> list(A)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   113
       ==> sats(A, formula_case_fm(is_a,is_b,is_c,is_d,x,y), env) <->
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   114
           is_formula_case(**A, ISA, ISB, ISC, ISD, nth(x,env), nth(y,env))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   115
apply (frule_tac x=y in lt_length_in_nat, assumption)  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   116
apply (simp add: formula_case_fm_def is_formula_case_def 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   117
                 is_a_iff_sats [THEN iff_sym] is_b_iff_sats [THEN iff_sym]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   118
                 is_c_iff_sats [THEN iff_sym] is_d_iff_sats [THEN iff_sym])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   119
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   120
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   121
lemma formula_case_iff_sats:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   122
  assumes is_a_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   123
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   124
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   125
        ==> ISA(a2, a1, a0) <-> sats(A, is_a, Cons(a0,Cons(a1,Cons(a2,env))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   126
  and is_b_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   127
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   128
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   129
        ==> ISB(a2, a1, a0) <-> sats(A, is_b, Cons(a0,Cons(a1,Cons(a2,env))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   130
  and is_c_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   131
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   132
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   133
        ==> ISC(a2, a1, a0) <-> sats(A, is_c, Cons(a0,Cons(a1,Cons(a2,env))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   134
  and is_d_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   135
      "!!a0 a1. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   136
        [|a0\<in>A; a1\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   137
        ==> ISD(a1, a0) <-> sats(A, is_d, Cons(a0,Cons(a1,env)))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   138
  shows 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   139
      "[|nth(i,env) = x; nth(j,env) = y; 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   140
      i \<in> nat; j < length(env); env \<in> list(A)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   141
       ==> is_formula_case(**A, ISA, ISB, ISC, ISD, x, y) <->
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   142
           sats(A, formula_case_fm(is_a,is_b,is_c,is_d,i,j), env)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   143
by (simp add: sats_formula_case_fm [OF is_a_iff_sats is_b_iff_sats 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   144
                                       is_c_iff_sats is_d_iff_sats])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   145
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   146
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   147
text{*The second argument of @{term is_a} gives it direct access to @{term x},
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   148
  which is essential for handling free variable references.  Treatment is
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   149
  based on that of @{text is_nat_case_reflection}.*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   150
theorem is_formula_case_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   151
  assumes is_a_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   152
    "!!h f g g'. REFLECTS[\<lambda>x. is_a(L, h(x), f(x), g(x), g'(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   153
                     \<lambda>i x. is_a(**Lset(i), h(x), f(x), g(x), g'(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   154
  and is_b_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   155
    "!!h f g g'. REFLECTS[\<lambda>x. is_b(L, h(x), f(x), g(x), g'(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   156
                     \<lambda>i x. is_b(**Lset(i), h(x), f(x), g(x), g'(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   157
  and is_c_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   158
    "!!h f g g'. REFLECTS[\<lambda>x. is_c(L, h(x), f(x), g(x), g'(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   159
                     \<lambda>i x. is_c(**Lset(i), h(x), f(x), g(x), g'(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   160
  and is_d_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   161
    "!!h f g g'. REFLECTS[\<lambda>x. is_d(L, h(x), f(x), g(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   162
                     \<lambda>i x. is_d(**Lset(i), h(x), f(x), g(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   163
  shows "REFLECTS[\<lambda>x. is_formula_case(L, is_a(L,x), is_b(L,x), is_c(L,x), is_d(L,x), g(x), h(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   164
               \<lambda>i x. is_formula_case(**Lset(i), is_a(**Lset(i), x), is_b(**Lset(i), x), is_c(**Lset(i), x), is_d(**Lset(i), x), g(x), h(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   165
apply (simp (no_asm_use) only: is_formula_case_def setclass_simps)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   166
apply (intro FOL_reflections function_reflections finite_ordinal_reflection
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   167
         mem_formula_reflection
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   168
         Member_reflection Equal_reflection Nand_reflection Forall_reflection
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   169
         is_a_reflection is_b_reflection is_c_reflection is_d_reflection)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   170
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   171
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   172
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   173
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   174
subsection {*Absoluteness for @{term formula_rec}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   175
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   176
constdefs
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   177
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   178
  formula_rec_case :: "[[i,i]=>i, [i,i]=>i, [i,i,i,i]=>i, [i,i]=>i, i, i] => i"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   179
    --{* the instance of @{term formula_case} in @{term formula_rec}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   180
   "formula_rec_case(a,b,c,d,h) ==
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   181
        formula_case (a, b,
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   182
                \<lambda>u v. c(u, v, h ` succ(depth(u)) ` u, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   183
                              h ` succ(depth(v)) ` v),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   184
                \<lambda>u. d(u, h ` succ(depth(u)) ` u))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   185
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   186
  is_formula_rec :: "[i=>o, [i,i,i]=>o, i, i] => o"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13502
diff changeset
   187
    --{* predicate to relativize the functional @{term formula_rec}*}
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   188
   "is_formula_rec(M,MH,p,z)  ==
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13502
diff changeset
   189
      \<exists>dp[M]. \<exists>i[M]. \<exists>f[M]. finite_ordinal(M,dp) & is_depth(M,p,dp) & 
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13502
diff changeset
   190
             successor(M,dp,i) & fun_apply(M,f,p,z) & is_transrec(M,MH,i,f)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   191
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   192
text{*Unfold @{term formula_rec} to @{term formula_rec_case}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   193
lemma (in M_triv_axioms) formula_rec_eq2:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   194
  "p \<in> formula ==>
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   195
   formula_rec(a,b,c,d,p) = 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   196
   transrec (succ(depth(p)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   197
             \<lambda>x h. Lambda (formula, formula_rec_case(a,b,c,d,h))) ` p"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   198
by (simp add: formula_rec_eq  formula_rec_case_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   199
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   200
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   201
text{*Sufficient conditions to relative the instance of @{term formula_case}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   202
      in @{term formula_rec}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   203
lemma (in M_datatypes) Relativize1_formula_rec_case:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   204
     "[|Relativize2(M, nat, nat, is_a, a);
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   205
        Relativize2(M, nat, nat, is_b, b);
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   206
        Relativize2 (M, formula, formula, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   207
           is_c, \<lambda>u v. c(u, v, h`succ(depth(u))`u, h`succ(depth(v))`v));
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   208
        Relativize1(M, formula, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   209
           is_d, \<lambda>u. d(u, h ` succ(depth(u)) ` u));
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   210
 	M(h) |] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   211
      ==> Relativize1(M, formula,
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   212
                         is_formula_case (M, is_a, is_b, is_c, is_d),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   213
                         formula_rec_case(a, b, c, d, h))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   214
apply (simp (no_asm) add: formula_rec_case_def Relativize1_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   215
apply (simp add: formula_case_abs) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   216
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   217
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   218
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   219
text{*This locale packages the premises of the following theorems,
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   220
      which is the normal purpose of locales.  It doesn't accumulate
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   221
      constraints on the class @{term M}, as in most of this deveopment.*}
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   222
locale Formula_Rec = M_eclose +
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   223
  fixes a and is_a and b and is_b and c and is_c and d and is_d and MH
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   224
  defines
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   225
      "MH(u::i,f,z) ==
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   226
	\<forall>fml[M]. is_formula(M,fml) -->
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   227
             is_lambda
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   228
	 (M, fml, is_formula_case (M, is_a, is_b, is_c(f), is_d(f)), z)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   229
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   230
  assumes a_closed: "[|x\<in>nat; y\<in>nat|] ==> M(a(x,y))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   231
      and a_rel:    "Relativize2(M, nat, nat, is_a, a)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   232
      and b_closed: "[|x\<in>nat; y\<in>nat|] ==> M(b(x,y))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   233
      and b_rel:    "Relativize2(M, nat, nat, is_b, b)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   234
      and c_closed: "[|x \<in> formula; y \<in> formula; M(gx); M(gy)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   235
                     ==> M(c(x, y, gx, gy))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   236
      and c_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   237
         "M(f) ==> 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   238
          Relativize2 (M, formula, formula, is_c(f),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   239
             \<lambda>u v. c(u, v, f ` succ(depth(u)) ` u, f ` succ(depth(v)) ` v))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   240
      and d_closed: "[|x \<in> formula; M(gx)|] ==> M(d(x, gx))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   241
      and d_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   242
         "M(f) ==> 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   243
          Relativize1(M, formula, is_d(f), \<lambda>u. d(u, f ` succ(depth(u)) ` u))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   244
      and fr_replace: "n \<in> nat ==> transrec_replacement(M,MH,n)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   245
      and fr_lam_replace:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   246
           "M(g) ==>
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   247
            strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   248
	      (M, \<lambda>x y. x \<in> formula &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   249
		  y = \<langle>x, formula_rec_case(a,b,c,d,g,x)\<rangle>)";
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   250
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   251
lemma (in Formula_Rec) formula_rec_case_closed:
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   252
    "[|M(g); p \<in> formula|] ==> M(formula_rec_case(a, b, c, d, g, p))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   253
by (simp add: formula_rec_case_def a_closed b_closed c_closed d_closed) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   254
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   255
lemma (in Formula_Rec) formula_rec_lam_closed:
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   256
    "M(g) ==> M(Lambda (formula, formula_rec_case(a,b,c,d,g)))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   257
by (simp add: lam_closed2 fr_lam_replace formula_rec_case_closed)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   258
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   259
lemma (in Formula_Rec) MH_rel2:
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   260
     "relativize2 (M, MH,
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   261
             \<lambda>x h. Lambda (formula, formula_rec_case(a,b,c,d,h)))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   262
apply (simp add: relativize2_def MH_def, clarify) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   263
apply (rule lambda_abs2) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   264
apply (rule fr_lam_replace, assumption)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   265
apply (rule Relativize1_formula_rec_case)  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   266
apply (simp_all add: a_rel b_rel c_rel d_rel formula_rec_case_closed) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   267
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   268
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   269
lemma (in Formula_Rec) fr_transrec_closed:
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   270
    "n \<in> nat
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   271
     ==> M(transrec
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   272
          (n, \<lambda>x h. Lambda(formula, formula_rec_case(a, b, c, d, h))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   273
by (simp add: transrec_closed [OF fr_replace MH_rel2]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   274
              nat_into_M formula_rec_lam_closed) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   275
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   276
text{*The main two results: @{term formula_rec} is absolute for @{term M}.*}
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   277
theorem (in Formula_Rec) formula_rec_closed:
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   278
    "p \<in> formula ==> M(formula_rec(a,b,c,d,p))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   279
by (simp add: formula_rec_eq2 fr_transrec_closed 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   280
              transM [OF _ formula_closed])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   281
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   282
theorem (in Formula_Rec) formula_rec_abs:
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   283
  "[| p \<in> formula; M(z)|] 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   284
   ==> is_formula_rec(M,MH,p,z) <-> z = formula_rec(a,b,c,d,p)" 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   285
by (simp add: is_formula_rec_def formula_rec_eq2 transM [OF _ formula_closed]
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13502
diff changeset
   286
              transrec_abs [OF fr_replace MH_rel2] depth_type
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   287
              fr_transrec_closed formula_rec_lam_closed eq_commute)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   288
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   289
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   290
subsection {*Absoluteness for the Function @{term satisfies}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   291
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   292
constdefs
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   293
  is_depth_apply :: "[i=>o,i,i,i] => o"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   294
   --{*Merely a useful abbreviation for the sequel.*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   295
   "is_depth_apply(M,h,p,z) ==
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   296
    \<exists>dp[M]. \<exists>sdp[M]. \<exists>hsdp[M]. 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   297
	finite_ordinal(M,dp) & is_depth(M,p,dp) & successor(M,dp,sdp) &
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   298
	fun_apply(M,h,sdp,hsdp) & fun_apply(M,hsdp,p,z)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   299
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   300
lemma (in M_datatypes) is_depth_apply_abs [simp]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   301
     "[|M(h); p \<in> formula; M(z)|] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   302
      ==> is_depth_apply(M,h,p,z) <-> z = h ` succ(depth(p)) ` p"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   303
by (simp add: is_depth_apply_def formula_into_M depth_type eq_commute)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   304
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   305
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   306
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   307
text{*There is at present some redundancy between the relativizations in
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   308
 e.g. @{text satisfies_is_a} and those in e.g. @{text Member_replacement}.*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   309
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   310
text{*These constants let us instantiate the parameters @{term a}, @{term b},
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   311
      @{term c}, @{term d}, etc., of the locale @{text Formula_Rec}.*}
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   312
constdefs
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   313
  satisfies_a :: "[i,i,i]=>i"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   314
   "satisfies_a(A) == 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   315
    \<lambda>x y. \<lambda>env \<in> list(A). bool_of_o (nth(x,env) \<in> nth(y,env))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   316
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   317
  satisfies_is_a :: "[i=>o,i,i,i,i]=>o"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   318
   "satisfies_is_a(M,A) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   319
    \<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   320
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   321
		\<lambda>env z. is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   322
                      \<exists>nx[M]. \<exists>ny[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   323
 		       is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & nx \<in> ny, z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   324
                zz)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   325
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   326
  satisfies_b :: "[i,i,i]=>i"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   327
   "satisfies_b(A) ==
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   328
    \<lambda>x y. \<lambda>env \<in> list(A). bool_of_o (nth(x,env) = nth(y,env))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   329
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   330
  satisfies_is_b :: "[i=>o,i,i,i,i]=>o"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   331
   --{*We simplify the formula to have just @{term nx} rather than 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   332
       introducing @{term ny} with  @{term "nx=ny"} *}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   333
   "satisfies_is_b(M,A) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   334
    \<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   335
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   336
                \<lambda>env z. is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   337
                      \<exists>nx[M]. is_nth(M,x,env,nx) & is_nth(M,y,env,nx), z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   338
                zz)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   339
 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   340
  satisfies_c :: "[i,i,i,i,i]=>i"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   341
   "satisfies_c(A) == \<lambda>p q rp rq. \<lambda>env \<in> list(A). not(rp ` env and rq ` env)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   342
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   343
  satisfies_is_c :: "[i=>o,i,i,i,i,i]=>o"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   344
   "satisfies_is_c(M,A,h) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   345
    \<lambda>p q zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   346
             is_lambda(M, lA, \<lambda>env z. \<exists>hp[M]. \<exists>hq[M]. 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   347
		 (\<exists>rp[M]. is_depth_apply(M,h,p,rp) & fun_apply(M,rp,env,hp)) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   348
		 (\<exists>rq[M]. is_depth_apply(M,h,q,rq) & fun_apply(M,rq,env,hq)) & 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   349
                 (\<exists>pq[M]. is_and(M,hp,hq,pq) & is_not(M,pq,z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   350
                zz)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   351
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   352
  satisfies_d :: "[i,i,i]=>i"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   353
   "satisfies_d(A) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   354
    == \<lambda>p rp. \<lambda>env \<in> list(A). bool_of_o (\<forall>x\<in>A. rp ` (Cons(x,env)) = 1)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   355
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   356
  satisfies_is_d :: "[i=>o,i,i,i,i]=>o"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   357
   "satisfies_is_d(M,A,h) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   358
    \<lambda>p zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   359
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   360
                \<lambda>env z. \<exists>rp[M]. is_depth_apply(M,h,p,rp) & 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   361
                    is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   362
                           \<forall>x[M]. \<forall>xenv[M]. \<forall>hp[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   363
                              x\<in>A --> is_Cons(M,x,env,xenv) --> 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   364
                              fun_apply(M,rp,xenv,hp) --> number1(M,hp),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   365
                  z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   366
               zz)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   367
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   368
  satisfies_MH :: "[i=>o,i,i,i,i]=>o"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   369
    --{*The variable @{term u} is unused, but gives @{term satisfies_MH} 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   370
        the correct arity.*}
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   371
   "satisfies_MH == 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   372
    \<lambda>M A u f z. 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   373
         \<forall>fml[M]. is_formula(M,fml) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   374
             is_lambda (M, fml, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   375
               is_formula_case (M, satisfies_is_a(M,A), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   376
                                satisfies_is_b(M,A), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   377
                                satisfies_is_c(M,A,f), satisfies_is_d(M,A,f)),
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   378
               z)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   379
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   380
  is_satisfies :: "[i=>o,i,i,i]=>o"
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13502
diff changeset
   381
   "is_satisfies(M,A) == is_formula_rec (M, satisfies_MH(M,A))"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   382
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   383
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   384
text{*This lemma relates the fragments defined above to the original primitive
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   385
      recursion in @{term satisfies}.
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   386
      Induction is not required: the definitions are directly equal!*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   387
lemma satisfies_eq:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   388
  "satisfies(A,p) = 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   389
   formula_rec (satisfies_a(A), satisfies_b(A), 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   390
                satisfies_c(A), satisfies_d(A), p)"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   391
by (simp add: satisfies_formula_def satisfies_a_def satisfies_b_def 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   392
              satisfies_c_def satisfies_d_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   393
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   394
text{*Further constraints on the class @{term M} in order to prove
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   395
      absoluteness for the constants defined above.  The ultimate goal
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   396
      is the absoluteness of the function @{term satisfies}. *}
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   397
locale M_satisfies = M_eclose +
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   398
 assumes 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   399
   Member_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   400
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   401
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   402
	 (M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   403
              env \<in> list(A) & is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   404
              is_bool_of_o(M, nx \<in> ny, bo) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   405
              pair(M, env, bo, z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   406
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   407
   Equal_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   408
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   409
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   410
	 (M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   411
              env \<in> list(A) & is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   412
              is_bool_of_o(M, nx = ny, bo) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   413
              pair(M, env, bo, z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   414
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   415
   Nand_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   416
    "[|M(A); M(rp); M(rq)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   417
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   418
	 (M, \<lambda>env z. \<exists>rpe[M]. \<exists>rqe[M]. \<exists>andpq[M]. \<exists>notpq[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   419
               fun_apply(M,rp,env,rpe) & fun_apply(M,rq,env,rqe) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   420
               is_and(M,rpe,rqe,andpq) & is_not(M,andpq,notpq) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   421
               env \<in> list(A) & pair(M, env, notpq, z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   422
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   423
  Forall_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   424
   "[|M(A); M(rp)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   425
    ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   426
	(M, \<lambda>env z. \<exists>bo[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   427
	      env \<in> list(A) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   428
	      is_bool_of_o (M, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   429
			    \<forall>a[M]. \<forall>co[M]. \<forall>rpco[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   430
			       a\<in>A --> is_Cons(M,a,env,co) -->
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   431
			       fun_apply(M,rp,co,rpco) --> number1(M, rpco), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   432
                            bo) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   433
	      pair(M,env,bo,z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   434
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   435
  formula_rec_replacement: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   436
      --{*For the @{term transrec}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   437
   "[|n \<in> nat; M(A)|] ==> transrec_replacement(M, satisfies_MH(M,A), n)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   438
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   439
  formula_rec_lambda_replacement:  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   440
      --{*For the @{text "\<lambda>-abstraction"} in the @{term transrec} body*}
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   441
   "[|M(g); M(A)|] ==>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   442
    strong_replacement (M, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   443
       \<lambda>x y. mem_formula(M,x) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   444
             (\<exists>c[M]. is_formula_case(M, satisfies_is_a(M,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   445
                                  satisfies_is_b(M,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   446
                                  satisfies_is_c(M,A,g),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   447
                                  satisfies_is_d(M,A,g), x, c) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   448
             pair(M, x, c, y)))"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   449
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   450
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   451
lemma (in M_satisfies) Member_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   452
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   453
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   454
	 (M, \<lambda>env z. env \<in> list(A) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   455
		     z = \<langle>env, bool_of_o(nth(x, env) \<in> nth(y, env))\<rangle>)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   456
by (insert Member_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   457
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   458
lemma (in M_satisfies) Equal_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   459
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   460
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   461
	 (M, \<lambda>env z. env \<in> list(A) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   462
		     z = \<langle>env, bool_of_o(nth(x, env) = nth(y, env))\<rangle>)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   463
by (insert Equal_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   464
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   465
lemma (in M_satisfies) Nand_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   466
    "[|M(A); M(rp); M(rq)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   467
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   468
	 (M, \<lambda>env z. env \<in> list(A) & z = \<langle>env, not(rp`env and rq`env)\<rangle>)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   469
by (insert Nand_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   470
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   471
lemma (in M_satisfies) Forall_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   472
   "[|M(A); M(rp)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   473
    ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   474
	(M, \<lambda>env z.
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   475
	       env \<in> list(A) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   476
	       z = \<langle>env, bool_of_o (\<forall>a\<in>A. rp ` Cons(a,env) = 1)\<rangle>)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   477
by (insert Forall_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   478
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   479
lemma (in M_satisfies) a_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   480
     "[|M(A); x\<in>nat; y\<in>nat|] ==> M(satisfies_a(A,x,y))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   481
apply (simp add: satisfies_a_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   482
apply (blast intro: lam_closed2 Member_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   483
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   484
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   485
lemma (in M_satisfies) a_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   486
     "M(A) ==> Relativize2(M, nat, nat, satisfies_is_a(M,A), satisfies_a(A))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   487
apply (simp add: Relativize2_def satisfies_is_a_def satisfies_a_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   488
apply (simp add: lambda_abs2 [OF Member_replacement'] Relativize1_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   489
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   490
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   491
lemma (in M_satisfies) b_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   492
     "[|M(A); x\<in>nat; y\<in>nat|] ==> M(satisfies_b(A,x,y))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   493
apply (simp add: satisfies_b_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   494
apply (blast intro: lam_closed2 Equal_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   495
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   496
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   497
lemma (in M_satisfies) b_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   498
     "M(A) ==> Relativize2(M, nat, nat, satisfies_is_b(M,A), satisfies_b(A))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   499
apply (simp add: Relativize2_def satisfies_is_b_def satisfies_b_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   500
apply (simp add: lambda_abs2 [OF Equal_replacement'] Relativize1_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   501
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   502
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   503
lemma (in M_satisfies) c_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   504
     "[|M(A); x \<in> formula; y \<in> formula; M(rx); M(ry)|] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   505
      ==> M(satisfies_c(A,x,y,rx,ry))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   506
apply (simp add: satisfies_c_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   507
apply (rule lam_closed2) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   508
apply (rule Nand_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   509
apply (simp_all add: formula_into_M list_into_M [of _ A])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   510
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   511
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   512
lemma (in M_satisfies) c_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   513
 "[|M(A); M(f)|] ==> 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   514
  Relativize2 (M, formula, formula, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   515
               satisfies_is_c(M,A,f),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   516
	       \<lambda>u v. satisfies_c(A, u, v, f ` succ(depth(u)) ` u, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   517
					  f ` succ(depth(v)) ` v))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   518
apply (simp add: Relativize2_def satisfies_is_c_def satisfies_c_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   519
apply (simp add: lambda_abs2 [OF Nand_replacement' triv_Relativize1] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   520
                 formula_into_M)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   521
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   522
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   523
lemma (in M_satisfies) d_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   524
     "[|M(A); x \<in> formula; M(rx)|] ==> M(satisfies_d(A,x,rx))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   525
apply (simp add: satisfies_d_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   526
apply (rule lam_closed2) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   527
apply (rule Forall_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   528
apply (simp_all add: formula_into_M list_into_M [of _ A])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   529
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   530
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   531
lemma (in M_satisfies) d_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   532
 "[|M(A); M(f)|] ==> 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   533
  Relativize1(M, formula, satisfies_is_d(M,A,f), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   534
     \<lambda>u. satisfies_d(A, u, f ` succ(depth(u)) ` u))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   535
apply (simp del: rall_abs 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   536
            add: Relativize1_def satisfies_is_d_def satisfies_d_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   537
apply (simp add: lambda_abs2 [OF Forall_replacement' triv_Relativize1] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   538
                 formula_into_M)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   539
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   540
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   541
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   542
lemma (in M_satisfies) fr_replace:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   543
      "[|n \<in> nat; M(A)|] ==> transrec_replacement(M,satisfies_MH(M,A),n)" 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   544
by (blast intro: formula_rec_replacement) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   545
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   546
lemma (in M_satisfies) formula_case_satisfies_closed:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   547
 "[|M(g); M(A); x \<in> formula|] ==>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   548
  M(formula_case (satisfies_a(A), satisfies_b(A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   549
       \<lambda>u v. satisfies_c(A, u, v, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   550
                         g ` succ(depth(u)) ` u, g ` succ(depth(v)) ` v),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   551
       \<lambda>u. satisfies_d (A, u, g ` succ(depth(u)) ` u),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   552
       x))"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   553
by (blast intro: formula_case_closed a_closed b_closed c_closed d_closed) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   554
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   555
lemma (in M_satisfies) fr_lam_replace:
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   556
   "[|M(g); M(A)|] ==>
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   557
    strong_replacement (M, \<lambda>x y. x \<in> formula &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   558
            y = \<langle>x, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   559
                 formula_rec_case(satisfies_a(A),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   560
                                  satisfies_b(A),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   561
                                  satisfies_c(A),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   562
                                  satisfies_d(A), g, x)\<rangle>)"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   563
apply (insert formula_rec_lambda_replacement) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   564
apply (simp add: formula_rec_case_def formula_case_satisfies_closed
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   565
                 formula_case_abs [OF a_rel b_rel c_rel d_rel]) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   566
done
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   567
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   568
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   569
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   570
text{*Instantiate locale @{text Formula_Rec} for the 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   571
      Function @{term satisfies}*}
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   572
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   573
lemma (in M_satisfies) Formula_Rec_axioms_M:
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   574
   "M(A) ==>
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   575
    Formula_Rec_axioms(M, satisfies_a(A), satisfies_is_a(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   576
			  satisfies_b(A), satisfies_is_b(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   577
			  satisfies_c(A), satisfies_is_c(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   578
			  satisfies_d(A), satisfies_is_d(M,A))"
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   579
apply (rule Formula_Rec_axioms.intro)
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   580
apply (assumption | 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   581
       rule a_closed a_rel b_closed b_rel c_closed c_rel d_closed d_rel
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   582
       fr_replace [unfolded satisfies_MH_def]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   583
       fr_lam_replace) +
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   584
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   585
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   586
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   587
theorem (in M_satisfies) Formula_Rec_M: 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   588
    "M(A) ==>
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   589
     PROP Formula_Rec(M, satisfies_a(A), satisfies_is_a(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   590
			 satisfies_b(A), satisfies_is_b(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   591
			 satisfies_c(A), satisfies_is_c(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   592
			 satisfies_d(A), satisfies_is_d(M,A))"
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   593
apply (rule Formula_Rec.intro, assumption+)
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   594
apply (erule Formula_Rec_axioms_M) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   595
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   596
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   597
lemmas (in M_satisfies) 
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   598
    satisfies_closed = Formula_Rec.formula_rec_closed [OF Formula_Rec_M]
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   599
and satisfies_abs    = Formula_Rec.formula_rec_abs [OF Formula_Rec_M]
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   600
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   601
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   602
lemma (in M_satisfies) satisfies_closed:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   603
  "[|M(A); p \<in> formula|] ==> M(satisfies(A,p))"
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   604
by (simp add: Formula_Rec.formula_rec_closed [OF Formula_Rec_M]  
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   605
              satisfies_eq) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   606
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   607
lemma (in M_satisfies) satisfies_abs:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   608
  "[|M(A); M(z); p \<in> formula|] 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   609
   ==> is_satisfies(M,A,p,z) <-> z = satisfies(A,p)"
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   610
by (simp only: Formula_Rec.formula_rec_abs [OF Formula_Rec_M]  
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13502
diff changeset
   611
               satisfies_eq is_satisfies_def satisfies_MH_def)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   612
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   613
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   614
subsection{*Internalizations Needed to Instantiate @{text "M_satisfies"}*}
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   615
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   616
subsubsection{*The Operator @{term is_depth_apply}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   617
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   618
(* is_depth_apply(M,h,p,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   619
    \<exists>dp[M]. \<exists>sdp[M]. \<exists>hsdp[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   620
      2        1         0
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   621
	finite_ordinal(M,dp) & is_depth(M,p,dp) & successor(M,dp,sdp) &
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   622
	fun_apply(M,h,sdp,hsdp) & fun_apply(M,hsdp,p,z) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   623
constdefs depth_apply_fm :: "[i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   624
    "depth_apply_fm(h,p,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   625
       Exists(Exists(Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   626
        And(finite_ordinal_fm(2),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   627
         And(depth_fm(p#+3,2),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   628
          And(succ_fm(2,1),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   629
           And(fun_apply_fm(h#+3,1,0), fun_apply_fm(0,p#+3,z#+3))))))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   630
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   631
lemma depth_apply_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   632
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> depth_apply_fm(x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   633
by (simp add: depth_apply_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   634
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   635
lemma sats_depth_apply_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   636
   "[| 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: 13494
diff changeset
   637
    ==> sats(A, depth_apply_fm(x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   638
        is_depth_apply(**A, nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   639
by (simp add: depth_apply_fm_def is_depth_apply_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   640
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   641
lemma depth_apply_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   642
    "[| 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: 13494
diff changeset
   643
        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: 13494
diff changeset
   644
     ==> is_depth_apply(**A, x, y, z) <-> sats(A, depth_apply_fm(i,j,k), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   645
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   646
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   647
lemma depth_apply_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   648
     "REFLECTS[\<lambda>x. is_depth_apply(L,f(x),g(x),h(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   649
               \<lambda>i x. is_depth_apply(**Lset(i),f(x),g(x),h(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   650
apply (simp only: is_depth_apply_def setclass_simps)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   651
apply (intro FOL_reflections function_reflections depth_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   652
             finite_ordinal_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   653
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   654
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   655
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   656
subsubsection{*The Operator @{term satisfies_is_a}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   657
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   658
(* satisfies_is_a(M,A) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   659
    \<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   660
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   661
		\<lambda>env z. is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   662
                      \<exists>nx[M]. \<exists>ny[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   663
 		       is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & nx \<in> ny, z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   664
                zz)  *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   665
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   666
constdefs satisfies_is_a_fm :: "[i,i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   667
 "satisfies_is_a_fm(A,x,y,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   668
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   669
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   670
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   671
         bool_of_o_fm(Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   672
                       Exists(And(nth_fm(x#+6,3,1), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   673
                               And(nth_fm(y#+6,3,0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   674
                                   Member(1,0))))), 0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   675
         0, succ(z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   676
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   677
lemma satisfies_is_a_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   678
     "[| A \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat |]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   679
      ==> satisfies_is_a_fm(A,x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   680
by (simp add: satisfies_is_a_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   681
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   682
lemma sats_satisfies_is_a_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   683
   "[| u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   684
    ==> sats(A, satisfies_is_a_fm(u,x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   685
        satisfies_is_a(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   686
apply (frule_tac x=x in lt_length_in_nat, assumption)  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   687
apply (frule_tac x=y in lt_length_in_nat, assumption)  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   688
apply (simp add: satisfies_is_a_fm_def satisfies_is_a_def sats_lambda_fm 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   689
                 sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   690
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   691
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   692
lemma satisfies_is_a_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   693
  "[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   694
      u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   695
   ==> satisfies_is_a(**A,nu,nx,ny,nz) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   696
       sats(A, satisfies_is_a_fm(u,x,y,z), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   697
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   698
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   699
theorem satisfies_is_a_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   700
     "REFLECTS[\<lambda>x. satisfies_is_a(L,f(x),g(x),h(x),g'(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   701
               \<lambda>i x. satisfies_is_a(**Lset(i),f(x),g(x),h(x),g'(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   702
apply (unfold satisfies_is_a_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   703
apply (intro FOL_reflections is_lambda_reflection bool_of_o_reflection 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   704
             nth_reflection is_list_reflection)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   705
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   706
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   707
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   708
subsubsection{*The Operator @{term satisfies_is_b}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   709
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   710
(* satisfies_is_b(M,A) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   711
    \<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   712
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   713
                \<lambda>env z. is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   714
                      \<exists>nx[M]. is_nth(M,x,env,nx) & is_nth(M,y,env,nx), z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   715
                zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   716
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   717
constdefs satisfies_is_b_fm :: "[i,i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   718
 "satisfies_is_b_fm(A,x,y,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   719
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   720
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   721
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   722
         bool_of_o_fm(Exists(And(nth_fm(x#+5,2,0), nth_fm(y#+5,2,0))), 0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   723
         0, succ(z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   724
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   725
lemma satisfies_is_b_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   726
     "[| A \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat |]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   727
      ==> satisfies_is_b_fm(A,x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   728
by (simp add: satisfies_is_b_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   729
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   730
lemma sats_satisfies_is_b_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   731
   "[| u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   732
    ==> sats(A, satisfies_is_b_fm(u,x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   733
        satisfies_is_b(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   734
apply (frule_tac x=x in lt_length_in_nat, assumption)  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   735
apply (frule_tac x=y in lt_length_in_nat, assumption)  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   736
apply (simp add: satisfies_is_b_fm_def satisfies_is_b_def sats_lambda_fm 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   737
                 sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   738
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   739
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   740
lemma satisfies_is_b_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   741
  "[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   742
      u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   743
   ==> satisfies_is_b(**A,nu,nx,ny,nz) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   744
       sats(A, satisfies_is_b_fm(u,x,y,z), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   745
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   746
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   747
theorem satisfies_is_b_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   748
     "REFLECTS[\<lambda>x. satisfies_is_b(L,f(x),g(x),h(x),g'(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   749
               \<lambda>i x. satisfies_is_b(**Lset(i),f(x),g(x),h(x),g'(x))]"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   750
apply (unfold satisfies_is_b_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   751
apply (intro FOL_reflections is_lambda_reflection bool_of_o_reflection 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   752
             nth_reflection is_list_reflection)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   753
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   754
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   755
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   756
subsubsection{*The Operator @{term satisfies_is_c}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   757
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   758
(* satisfies_is_c(M,A,h) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   759
    \<lambda>p q zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   760
             is_lambda(M, lA, \<lambda>env z. \<exists>hp[M]. \<exists>hq[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   761
		 (\<exists>rp[M]. is_depth_apply(M,h,p,rp) & fun_apply(M,rp,env,hp)) & 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   762
		 (\<exists>rq[M]. is_depth_apply(M,h,q,rq) & fun_apply(M,rq,env,hq)) & 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   763
                 (\<exists>pq[M]. is_and(M,hp,hq,pq) & is_not(M,pq,z)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   764
                zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   765
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   766
constdefs satisfies_is_c_fm :: "[i,i,i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   767
 "satisfies_is_c_fm(A,h,p,q,zz) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   768
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   769
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   770
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   771
         Exists(Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   772
          And(Exists(And(depth_apply_fm(h#+7,p#+7,0), fun_apply_fm(0,4,2))),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   773
          And(Exists(And(depth_apply_fm(h#+7,q#+7,0), fun_apply_fm(0,4,1))),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   774
              Exists(And(and_fm(2,1,0), not_fm(0,3))))))),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   775
         0, succ(zz))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   776
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   777
lemma satisfies_is_c_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   778
     "[| A \<in> nat; h \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat |]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   779
      ==> satisfies_is_c_fm(A,h,x,y,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   780
by (simp add: satisfies_is_c_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   781
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   782
lemma sats_satisfies_is_c_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   783
   "[| u \<in> nat; v \<in> nat; 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: 13494
diff changeset
   784
    ==> sats(A, satisfies_is_c_fm(u,v,x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   785
        satisfies_is_c(**A, nth(u,env), nth(v,env), nth(x,env), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   786
                            nth(y,env), nth(z,env))"  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   787
by (simp add: satisfies_is_c_fm_def satisfies_is_c_def sats_lambda_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   788
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   789
lemma satisfies_is_c_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   790
  "[| nth(u,env) = nu; nth(v,env) = nv; nth(x,env) = nx; nth(y,env) = ny; 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   791
      nth(z,env) = nz;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   792
      u \<in> nat; v \<in> nat; 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: 13494
diff changeset
   793
   ==> satisfies_is_c(**A,nu,nv,nx,ny,nz) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   794
       sats(A, satisfies_is_c_fm(u,v,x,y,z), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   795
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   796
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   797
theorem satisfies_is_c_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   798
     "REFLECTS[\<lambda>x. satisfies_is_c(L,f(x),g(x),h(x),g'(x),h'(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   799
               \<lambda>i x. satisfies_is_c(**Lset(i),f(x),g(x),h(x),g'(x),h'(x))]"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   800
apply (unfold satisfies_is_c_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   801
apply (intro FOL_reflections function_reflections is_lambda_reflection
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   802
             extra_reflections nth_reflection depth_apply_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   803
             is_list_reflection)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   804
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   805
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   806
subsubsection{*The Operator @{term satisfies_is_d}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   807
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   808
(* satisfies_is_d(M,A,h) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   809
    \<lambda>p zz. \<forall>lA[M]. is_list(M,A,lA) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   810
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   811
                \<lambda>env z. \<exists>rp[M]. is_depth_apply(M,h,p,rp) & 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   812
                    is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   813
                           \<forall>x[M]. \<forall>xenv[M]. \<forall>hp[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   814
                              x\<in>A --> is_Cons(M,x,env,xenv) --> 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   815
                              fun_apply(M,rp,xenv,hp) --> number1(M,hp),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   816
                  z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   817
               zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   818
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   819
constdefs satisfies_is_d_fm :: "[i,i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   820
 "satisfies_is_d_fm(A,h,p,zz) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   821
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   822
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   823
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   824
         Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   825
           And(depth_apply_fm(h#+5,p#+5,0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   826
               bool_of_o_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   827
                Forall(Forall(Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   828
                 Implies(Member(2,A#+8),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   829
                  Implies(Cons_fm(2,5,1),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   830
                   Implies(fun_apply_fm(3,1,0), number1_fm(0))))))), 1))),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   831
         0, succ(zz))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   832
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   833
lemma satisfies_is_d_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   834
     "[| A \<in> nat; h \<in> nat; x \<in> nat; z \<in> nat |]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   835
      ==> satisfies_is_d_fm(A,h,x,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   836
by (simp add: satisfies_is_d_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   837
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   838
lemma sats_satisfies_is_d_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   839
   "[| u \<in> nat; 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: 13494
diff changeset
   840
    ==> sats(A, satisfies_is_d_fm(u,x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   841
        satisfies_is_d(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   842
by (simp add: satisfies_is_d_fm_def satisfies_is_d_def sats_lambda_fm
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   843
              sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   844
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   845
lemma satisfies_is_d_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   846
  "[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   847
      u \<in> nat; 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: 13494
diff changeset
   848
   ==> satisfies_is_d(**A,nu,nx,ny,nz) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   849
       sats(A, satisfies_is_d_fm(u,x,y,z), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   850
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   851
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   852
theorem satisfies_is_d_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   853
     "REFLECTS[\<lambda>x. satisfies_is_d(L,f(x),g(x),h(x),g'(x)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   854
               \<lambda>i x. satisfies_is_d(**Lset(i),f(x),g(x),h(x),g'(x))]"
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13504
diff changeset
   855
apply (unfold satisfies_is_d_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   856
apply (intro FOL_reflections function_reflections is_lambda_reflection
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   857
             extra_reflections nth_reflection depth_apply_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   858
             is_list_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   859
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   860
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   861
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   862
subsubsection{*The Operator @{term satisfies_MH}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   863
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   864
(* satisfies_MH == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   865
    \<lambda>M A u f zz. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   866
         \<forall>fml[M]. is_formula(M,fml) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   867
             is_lambda (M, fml, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   868
               is_formula_case (M, satisfies_is_a(M,A), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   869
                                satisfies_is_b(M,A), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   870
                                satisfies_is_c(M,A,f), satisfies_is_d(M,A,f)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   871
               zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   872
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   873
constdefs satisfies_MH_fm :: "[i,i,i,i]=>i"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   874
 "satisfies_MH_fm(A,u,f,zz) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   875
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   876
     Implies(is_formula_fm(0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   877
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   878
         formula_case_fm(satisfies_is_a_fm(A#+7,2,1,0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   879
                         satisfies_is_b_fm(A#+7,2,1,0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   880
                         satisfies_is_c_fm(A#+7,f#+7,2,1,0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   881
                         satisfies_is_d_fm(A#+6,f#+6,1,0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   882
                         1, 0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   883
         0, succ(zz))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   884
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   885
lemma satisfies_MH_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   886
     "[| A \<in> nat; u \<in> nat; x \<in> nat; z \<in> nat |]
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   887
      ==> satisfies_MH_fm(A,u,x,z) \<in> formula"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   888
by (simp add: satisfies_MH_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   889
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   890
lemma sats_satisfies_MH_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   891
   "[| u \<in> nat; 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: 13494
diff changeset
   892
    ==> sats(A, satisfies_MH_fm(u,x,y,z), env) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   893
        satisfies_MH(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   894
by (simp add: satisfies_MH_fm_def satisfies_MH_def sats_lambda_fm
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   895
              sats_formula_case_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   896
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   897
lemma satisfies_MH_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   898
  "[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   899
      u \<in> nat; 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: 13494
diff changeset
   900
   ==> satisfies_MH(**A,nu,nx,ny,nz) <->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   901
       sats(A, satisfies_MH_fm(u,x,y,z), env)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   902
by simp 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   903
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   904
lemmas satisfies_reflections =
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   905
       is_lambda_reflection is_formula_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   906
       is_formula_case_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   907
       satisfies_is_a_reflection satisfies_is_b_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   908
       satisfies_is_c_reflection satisfies_is_d_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   909
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   910
theorem satisfies_MH_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   911
     "REFLECTS[\<lambda>x. satisfies_MH(L,f(x),g(x),h(x),g'(x)),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   912
               \<lambda>i x. satisfies_MH(**Lset(i),f(x),g(x),h(x),g'(x))]"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   913
apply (unfold satisfies_MH_def) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   914
apply (intro FOL_reflections satisfies_reflections)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   915
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   916
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   917
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   918
subsection{*Lemmas for Instantiating the Locale @{text "M_satisfies"}*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   919
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   920
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   921
subsubsection{*The @{term "Member"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   922
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   923
lemma Member_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   924
 "REFLECTS[\<lambda>u. \<exists>v[L]. v \<in> B \<and> (\<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L].
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   925
          v \<in> lstA \<and> is_nth(L,x,v,nx) \<and> is_nth(L,y,v,ny) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   926
          is_bool_of_o(L, nx \<in> ny, bo) \<and> pair(L,v,bo,u)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   927
   \<lambda>i u. \<exists>v \<in> Lset(i). v \<in> B \<and> (\<exists>bo \<in> Lset(i). \<exists>nx \<in> Lset(i). \<exists>ny \<in> Lset(i).
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   928
             v \<in> lstA \<and> is_nth(**Lset(i), x, v, nx) \<and> 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   929
             is_nth(**Lset(i), y, v, ny) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   930
          is_bool_of_o(**Lset(i), nx \<in> ny, bo) \<and> pair(**Lset(i), v, bo, u))]"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   931
by (intro FOL_reflections function_reflections nth_reflection 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   932
          bool_of_o_reflection)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   933
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   934
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   935
lemma Member_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   936
    "[|L(A); x \<in> nat; y \<in> nat|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   937
     ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   938
	 (L, \<lambda>env z. \<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   939
              env \<in> list(A) & is_nth(L,x,env,nx) & is_nth(L,y,env,ny) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   940
              is_bool_of_o(L, nx \<in> ny, bo) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   941
              pair(L, env, bo, z))"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   942
apply (frule list_closed) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   943
apply (rule strong_replacementI) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   944
apply (rule rallI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   945
apply (rename_tac B)  
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   946
apply (rule separation_CollectI) 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13504
diff changeset
   947
apply (rule_tac A="{list(A),B,x,y,z}" in subset_LsetE, blast) 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   948
apply (rule ReflectsE [OF Member_Reflects], assumption)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   949
apply (drule subset_Lset_ltD, assumption) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   950
apply (erule reflection_imp_L_separation)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   951
  apply (simp_all add: lt_Ord2)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   952
apply (simp add: is_nth_def is_wfrec_def is_bool_of_o_def)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   953
apply (rule DPow_LsetI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   954
apply (rename_tac u) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   955
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   956
apply (rule_tac env = "[v,u,list(A),B,x,y,z]" in mem_iff_sats) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   957
apply (rule sep_rules is_nat_case_iff_sats iterates_MH_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   958
            is_recfun_iff_sats hd_iff_sats tl_iff_sats quasinat_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   959
     | simp)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   960
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   961
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   962
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   963
subsubsection{*The @{term "Equal"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   964
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   965
lemma Equal_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   966
 "REFLECTS[\<lambda>u. \<exists>v[L]. v \<in> B \<and> (\<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L].
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   967
          v \<in> lstA \<and> is_nth(L, x, v, nx) \<and> is_nth(L, y, v, ny) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   968
          is_bool_of_o(L, nx = ny, bo) \<and> pair(L, v, bo, u)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   969
   \<lambda>i u. \<exists>v \<in> Lset(i). v \<in> B \<and> (\<exists>bo \<in> Lset(i). \<exists>nx \<in> Lset(i). \<exists>ny \<in> Lset(i).
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   970
             v \<in> lstA \<and> is_nth(**Lset(i), x, v, nx) \<and> 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   971
             is_nth(**Lset(i), y, v, ny) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   972
          is_bool_of_o(**Lset(i), nx = ny, bo) \<and> pair(**Lset(i), v, bo, u))]"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   973
by (intro FOL_reflections function_reflections nth_reflection 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   974
          bool_of_o_reflection)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   975
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   976
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   977
lemma Equal_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   978
    "[|L(A); x \<in> nat; y \<in> nat|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   979
     ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   980
	 (L, \<lambda>env z. \<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   981
              env \<in> list(A) & is_nth(L,x,env,nx) & is_nth(L,y,env,ny) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   982
              is_bool_of_o(L, nx = ny, bo) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   983
              pair(L, env, bo, z))"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   984
apply (frule list_closed) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   985
apply (rule strong_replacementI) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   986
apply (rule rallI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   987
apply (rename_tac B)  
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   988
apply (rule separation_CollectI) 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13504
diff changeset
   989
apply (rule_tac A="{list(A),B,x,y,z}" in subset_LsetE, blast) 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   990
apply (rule ReflectsE [OF Equal_Reflects], assumption)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   991
apply (drule subset_Lset_ltD, assumption) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   992
apply (erule reflection_imp_L_separation)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   993
  apply (simp_all add: lt_Ord2)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   994
apply (simp add: is_nth_def is_wfrec_def is_bool_of_o_def)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   995
apply (rule DPow_LsetI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   996
apply (rename_tac u) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   997
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   998
apply (rule_tac env = "[v,u,list(A),B,x,y,z]" in mem_iff_sats) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   999
apply (rule sep_rules is_nat_case_iff_sats iterates_MH_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1000
            is_recfun_iff_sats hd_iff_sats tl_iff_sats quasinat_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1001
     | simp)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1002
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1003
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1004
subsubsection{*The @{term "Nand"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1005
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1006
lemma Nand_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1007
    "REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1008
	       (\<exists>rpe[L]. \<exists>rqe[L]. \<exists>andpq[L]. \<exists>notpq[L].
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1009
		 fun_apply(L, rp, u, rpe) \<and> fun_apply(L, rq, u, rqe) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1010
		 is_and(L, rpe, rqe, andpq) \<and> is_not(L, andpq, notpq) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1011
		 u \<in> list(A) \<and> pair(L, u, notpq, x)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1012
    \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1013
     (\<exists>rpe \<in> Lset(i). \<exists>rqe \<in> Lset(i). \<exists>andpq \<in> Lset(i). \<exists>notpq \<in> Lset(i).
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1014
       fun_apply(**Lset(i), rp, u, rpe) \<and> fun_apply(**Lset(i), rq, u, rqe) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1015
       is_and(**Lset(i), rpe, rqe, andpq) \<and> is_not(**Lset(i), andpq, notpq) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1016
       u \<in> list(A) \<and> pair(**Lset(i), u, notpq, x))]"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1017
apply (unfold is_and_def is_not_def) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1018
apply (intro FOL_reflections function_reflections)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1019
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1020
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1021
lemma Nand_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1022
    "[|L(A); L(rp); L(rq)|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1023
     ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1024
	 (L, \<lambda>env z. \<exists>rpe[L]. \<exists>rqe[L]. \<exists>andpq[L]. \<exists>notpq[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1025
               fun_apply(L,rp,env,rpe) & fun_apply(L,rq,env,rqe) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1026
               is_and(L,rpe,rqe,andpq) & is_not(L,andpq,notpq) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1027
               env \<in> list(A) & pair(L, env, notpq, z))"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1028
apply (frule list_closed) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1029
apply (rule strong_replacementI) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1030
apply (rule rallI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1031
apply (rename_tac B)  
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1032
apply (rule separation_CollectI) 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13504
diff changeset
  1033
apply (rule_tac A="{list(A),B,rp,rq,z}" in subset_LsetE, blast) 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1034
apply (rule ReflectsE [OF Nand_Reflects], assumption)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1035
apply (drule subset_Lset_ltD, assumption) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1036
apply (erule reflection_imp_L_separation)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1037
  apply (simp_all add: lt_Ord2)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1038
apply (simp add: is_and_def is_not_def)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1039
apply (rule DPow_LsetI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1040
apply (rename_tac v) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1041
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1042
apply (rule_tac env = "[u,v,list(A),B,rp,rq,z]" in mem_iff_sats) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1043
apply (rule sep_rules | simp)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1044
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1045
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1046
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1047
subsubsection{*The @{term "Forall"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1048
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1049
lemma Forall_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1050
 "REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B \<and> (\<exists>bo[L]. u \<in> list(A) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1051
                 is_bool_of_o (L,
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1052
     \<forall>a[L]. \<forall>co[L]. \<forall>rpco[L]. a \<in> A \<longrightarrow>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1053
                is_Cons(L,a,u,co) \<longrightarrow> fun_apply(L,rp,co,rpco) \<longrightarrow> 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1054
                number1(L,rpco),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1055
                           bo) \<and> pair(L,u,bo,x)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1056
 \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> (\<exists>bo \<in> Lset(i). u \<in> list(A) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1057
        is_bool_of_o (**Lset(i),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1058
 \<forall>a \<in> Lset(i). \<forall>co \<in> Lset(i). \<forall>rpco \<in> Lset(i). a \<in> A \<longrightarrow>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1059
	    is_Cons(**Lset(i),a,u,co) \<longrightarrow> fun_apply(**Lset(i),rp,co,rpco) \<longrightarrow> 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1060
	    number1(**Lset(i),rpco),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1061
		       bo) \<and> pair(**Lset(i),u,bo,x))]"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1062
apply (unfold is_bool_of_o_def) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1063
apply (intro FOL_reflections function_reflections Cons_reflection)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1064
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1065
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1066
lemma Forall_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1067
   "[|L(A); L(rp)|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1068
    ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1069
	(L, \<lambda>env z. \<exists>bo[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1070
	      env \<in> list(A) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1071
	      is_bool_of_o (L, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1072
			    \<forall>a[L]. \<forall>co[L]. \<forall>rpco[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1073
			       a\<in>A --> is_Cons(L,a,env,co) -->
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1074
			       fun_apply(L,rp,co,rpco) --> number1(L, rpco), 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1075
                            bo) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1076
	      pair(L,env,bo,z))"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1077
apply (frule list_closed) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1078
apply (rule strong_replacementI) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1079
apply (rule rallI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1080
apply (rename_tac B)  
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1081
apply (rule separation_CollectI) 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13504
diff changeset
  1082
apply (rule_tac A="{A,list(A),B,rp,z}" in subset_LsetE, blast) 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1083
apply (rule ReflectsE [OF Forall_Reflects], assumption)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1084
apply (drule subset_Lset_ltD, assumption) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1085
apply (erule reflection_imp_L_separation)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1086
  apply (simp_all add: lt_Ord2)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1087
apply (simp add: is_bool_of_o_def)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1088
apply (rule DPow_LsetI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1089
apply (rename_tac v) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1090
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1091
apply (rule_tac env = "[u,v,A,list(A),B,rp,z]" in mem_iff_sats)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1092
apply (rule sep_rules Cons_iff_sats | simp)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1093
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1094
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1095
subsubsection{*The @{term "transrec_replacement"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1096
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1097
lemma formula_rec_replacement_Reflects:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1098
 "REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B \<and> (\<exists>y[L]. pair(L, u, y, x) \<and>
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1099
             is_wfrec (L, satisfies_MH(L,A), mesa, u, y)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1100
    \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> (\<exists>y \<in> Lset(i). pair(**Lset(i), u, y, x) \<and>
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1101
             is_wfrec (**Lset(i), satisfies_MH(**Lset(i),A), mesa, u, y))]"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1102
by (intro FOL_reflections function_reflections satisfies_MH_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1103
          is_wfrec_reflection) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1104
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1105
lemma formula_rec_replacement: 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1106
      --{*For the @{term transrec}*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1107
   "[|n \<in> nat; L(A)|] ==> transrec_replacement(L, satisfies_MH(L,A), n)"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1108
apply (subgoal_tac "L(Memrel(eclose({n})))")
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1109
 prefer 2 apply (simp add: nat_into_M) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1110
apply (rule transrec_replacementI) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1111
apply (simp add: nat_into_M) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1112
apply (rule strong_replacementI)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1113
apply (rule rallI)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1114
apply (rename_tac B)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1115
apply (rule separation_CollectI)
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13504
diff changeset
  1116
apply (rule_tac A="{B,A,n,z,Memrel(eclose({n}))}" in subset_LsetE, blast)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1117
apply (rule ReflectsE [OF formula_rec_replacement_Reflects], assumption)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1118
apply (drule subset_Lset_ltD, assumption)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1119
apply (erule reflection_imp_L_separation)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1120
  apply (simp_all add: lt_Ord2 Memrel_closed)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1121
apply (elim conjE)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1122
apply (rule DPow_LsetI)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1123
apply (rename_tac v)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1124
apply (rule bex_iff_sats conj_iff_sats)+
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1125
apply (rule_tac env = "[u,v,A,n,B,Memrel(eclose({n}))]" in mem_iff_sats)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
  1126
apply (rule sep_rules satisfies_MH_iff_sats is_wfrec_iff_sats | simp)+
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1127
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1128
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1129
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1130
subsubsection{*The Lambda Replacement Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1131
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1132
lemma formula_rec_lambda_replacement_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1133
 "REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1134
     mem_formula(L,u) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1135
     (\<exists>c[L].
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1136
	 is_formula_case
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1137
	  (L, satisfies_is_a(L,A), satisfies_is_b(L,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1138
	   satisfies_is_c(L,A,g), satisfies_is_d(L,A,g),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1139
	   u, c) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1140
	 pair(L,u,c,x)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1141
  \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B & mem_formula(**Lset(i),u) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1142
     (\<exists>c \<in> Lset(i).
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1143
	 is_formula_case
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1144
	  (**Lset(i), satisfies_is_a(**Lset(i),A), satisfies_is_b(**Lset(i),A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1145
	   satisfies_is_c(**Lset(i),A,g), satisfies_is_d(**Lset(i),A,g),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1146
	   u, c) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1147
	 pair(**Lset(i),u,c,x))]"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1148
by (intro FOL_reflections function_reflections mem_formula_reflection
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1149
          is_formula_case_reflection satisfies_is_a_reflection
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1150
          satisfies_is_b_reflection satisfies_is_c_reflection
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1151
          satisfies_is_d_reflection)  
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1152
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1153
lemma formula_rec_lambda_replacement: 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1154
      --{*For the @{term transrec}*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1155
   "[|L(g); L(A)|] ==>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1156
    strong_replacement (L, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1157
       \<lambda>x y. mem_formula(L,x) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1158
             (\<exists>c[L]. is_formula_case(L, satisfies_is_a(L,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1159
                                  satisfies_is_b(L,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1160
                                  satisfies_is_c(L,A,g),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1161
                                  satisfies_is_d(L,A,g), x, c) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1162
             pair(L, x, c, y)))" 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1163
apply (rule strong_replacementI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1164
apply (rule rallI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1165
apply (rename_tac B)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1166
apply (rule separation_CollectI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1167
apply (rule_tac A="{B,A,g,z}" in subset_LsetE, blast)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1168
apply (rule ReflectsE [OF formula_rec_lambda_replacement_Reflects], assumption)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1169
apply (drule subset_Lset_ltD, assumption)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1170
apply (erule reflection_imp_L_separation)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1171
  apply (simp_all add: lt_Ord2 Memrel_closed)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1172
apply (elim conjE)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1173
apply (rule DPow_LsetI)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1174
apply (rename_tac v)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1175
apply (rule bex_iff_sats conj_iff_sats)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1176
apply (rule_tac env = "[u,v,A,g,B]" in mem_iff_sats)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1177
apply (rule sep_rules mem_formula_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1178
          formula_case_iff_sats satisfies_is_a_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1179
          satisfies_is_b_iff_sats satisfies_is_c_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1180
          satisfies_is_d_iff_sats | simp)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1181
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1182
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1183
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1184
subsection{*Instantiating @{text M_satisfies}*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1185
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1186
lemma M_satisfies_axioms_L: "M_satisfies_axioms(L)"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1187
  apply (rule M_satisfies_axioms.intro)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1188
       apply (assumption | rule
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1189
	 Member_replacement Equal_replacement 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1190
         Nand_replacement Forall_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1191
         formula_rec_replacement formula_rec_lambda_replacement)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1192
  done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1193
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1194
theorem M_satisfies_L: "PROP M_satisfies(L)"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1195
apply (rule M_satisfies.intro) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1196
     apply (rule M_eclose.axioms [OF M_eclose_L])+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1197
apply (rule M_satisfies_axioms_L) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1198
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1199
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1200
text{*Finally: the point of the whole theory!*}
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1201
lemmas satisfies_closed = M_satisfies.satisfies_closed [OF M_satisfies_L]
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1202
   and satisfies_abs = M_satisfies.satisfies_abs [OF M_satisfies_L]
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1203
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1204
end