src/ZF/Constructible/Satisfies_absolute.thy
author wenzelm
Sat, 18 Aug 2007 17:42:39 +0200
changeset 24327 a207114007c6
parent 23464 bc2563c37b1a
child 32960 69916a850301
permissions -rw-r--r--
removed obsolete ML bindings;
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
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
     2
    ID:  $Id$
13494
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
*)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     5
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
     6
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
     7
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 13807
diff changeset
     8
theory Satisfies_absolute imports Datatype_absolute Rec_Separation begin 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
     9
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    10
13687
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
    11
subsection {*More Internalization*}
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" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    20
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    21
  depth_fm :: "[i,i]=>i" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    22
  "depth_fm(p,n) == 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    23
     Exists(Exists(Exists(
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    24
       And(formula_N_fm(n#+3,1),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    25
         And(Neg(Member(p#+3,1)),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    26
          And(succ_fm(n#+3,2),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    27
           And(formula_N_fm(2,0), Member(p#+3,0))))))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    28
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    29
lemma depth_fm_type [TC]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    30
 "[| x \<in> nat; y \<in> nat |] ==> depth_fm(x,y) \<in> formula"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    31
by (simp add: depth_fm_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    32
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    33
lemma sats_depth_fm [simp]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    34
   "[| x \<in> nat; y < length(env); env \<in> list(A)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    35
    ==> sats(A, depth_fm(x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
    36
        is_depth(##A, nth(x,env), nth(y,env))"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    37
apply (frule_tac x=y in lt_length_in_nat, assumption)  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    38
apply (simp add: depth_fm_def is_depth_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    39
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    40
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    41
lemma depth_iff_sats:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    42
      "[| nth(i,env) = x; nth(j,env) = y; 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    43
          i \<in> nat; j < length(env); env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
    44
       ==> is_depth(##A, x, y) <-> sats(A, depth_fm(i,j), env)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    45
by (simp add: sats_depth_fm)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    46
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    47
theorem depth_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    48
     "REFLECTS[\<lambda>x. is_depth(L, f(x), g(x)),  
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
    49
               \<lambda>i x. is_depth(##Lset(i), f(x), g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13634
diff changeset
    50
apply (simp only: is_depth_def)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    51
apply (intro FOL_reflections function_reflections formula_N_reflection) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    52
done
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
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    56
subsubsection{*The Operator @{term is_formula_case}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    57
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    58
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
    59
      will be enclosed by three quantifiers.*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    60
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    61
(* is_formula_case :: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    62
    "[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
    63
  "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
    64
      (\<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
    65
      (\<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
    66
      (\<forall>x[M]. \<forall>y[M]. x\<in>formula --> y\<in>formula --> 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    67
                     is_Nand(M,x,y,v) --> is_c(x,y,z)) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    68
      (\<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
    69
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    70
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    71
  formula_case_fm :: "[i, i, i, i, i, i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    72
  "formula_case_fm(is_a, is_b, is_c, is_d, v, z) == 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    73
        And(Forall(Forall(Implies(finite_ordinal_fm(1), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    74
                           Implies(finite_ordinal_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    75
                            Implies(Member_fm(1,0,v#+2), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    76
                             Forall(Implies(Equal(0,z#+3), is_a))))))),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    77
        And(Forall(Forall(Implies(finite_ordinal_fm(1), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    78
                           Implies(finite_ordinal_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    79
                            Implies(Equal_fm(1,0,v#+2), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    80
                             Forall(Implies(Equal(0,z#+3), is_b))))))),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    81
        And(Forall(Forall(Implies(mem_formula_fm(1), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    82
                           Implies(mem_formula_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    83
                            Implies(Nand_fm(1,0,v#+2), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    84
                             Forall(Implies(Equal(0,z#+3), is_c))))))),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    85
        Forall(Implies(mem_formula_fm(0), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    86
                       Implies(Forall_fm(0,succ(v)), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    87
                             Forall(Implies(Equal(0,z#+2), is_d))))))))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    88
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    89
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    90
lemma is_formula_case_type [TC]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    91
     "[| 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
    92
         x \<in> nat; y \<in> nat |] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    93
      ==> 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
    94
by (simp add: formula_case_fm_def)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    95
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    96
lemma sats_formula_case_fm:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    97
  assumes is_a_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    98
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
    99
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   100
        ==> 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
   101
  and is_b_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   102
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   103
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   104
        ==> 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
   105
  and is_c_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   106
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   107
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   108
        ==> 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
   109
  and is_d_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   110
      "!!a0 a1. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   111
        [|a0\<in>A; a1\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   112
        ==> ISD(a1, a0) <-> sats(A, is_d, Cons(a0,Cons(a1,env)))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   113
  shows 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   114
      "[|x \<in> nat; y < length(env); env \<in> list(A)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   115
       ==> sats(A, formula_case_fm(is_a,is_b,is_c,is_d,x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   116
           is_formula_case(##A, ISA, ISB, ISC, ISD, nth(x,env), nth(y,env))"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   117
apply (frule_tac x=y in lt_length_in_nat, assumption)  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   118
apply (simp add: formula_case_fm_def is_formula_case_def 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   119
                 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
   120
                 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
   121
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   122
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   123
lemma formula_case_iff_sats:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   124
  assumes is_a_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   125
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   126
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   127
        ==> 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
   128
  and is_b_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   129
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   130
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   131
        ==> 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
   132
  and is_c_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   133
      "!!a0 a1 a2. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   134
        [|a0\<in>A; a1\<in>A; a2\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   135
        ==> 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
   136
  and is_d_iff_sats: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   137
      "!!a0 a1. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   138
        [|a0\<in>A; a1\<in>A|]  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   139
        ==> ISD(a1, a0) <-> sats(A, is_d, Cons(a0,Cons(a1,env)))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   140
  shows 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   141
      "[|nth(i,env) = x; nth(j,env) = y; 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   142
      i \<in> nat; j < length(env); env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   143
       ==> is_formula_case(##A, ISA, ISB, ISC, ISD, x, y) <->
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   144
           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
   145
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
   146
                                       is_c_iff_sats is_d_iff_sats])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   147
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   148
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   149
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
   150
  which is essential for handling free variable references.  Treatment is
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   151
  based on that of @{text is_nat_case_reflection}.*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   152
theorem is_formula_case_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   153
  assumes is_a_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   154
    "!!h f g g'. REFLECTS[\<lambda>x. is_a(L, h(x), f(x), g(x), g'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   155
                     \<lambda>i x. is_a(##Lset(i), h(x), f(x), g(x), g'(x))]"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   156
  and is_b_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   157
    "!!h f g g'. REFLECTS[\<lambda>x. is_b(L, h(x), f(x), g(x), g'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   158
                     \<lambda>i x. is_b(##Lset(i), h(x), f(x), g(x), g'(x))]"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   159
  and is_c_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   160
    "!!h f g g'. REFLECTS[\<lambda>x. is_c(L, h(x), f(x), g(x), g'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   161
                     \<lambda>i x. is_c(##Lset(i), h(x), f(x), g(x), g'(x))]"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   162
  and is_d_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   163
    "!!h f g g'. REFLECTS[\<lambda>x. is_d(L, h(x), f(x), g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   164
                     \<lambda>i x. is_d(##Lset(i), h(x), f(x), g(x))]"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   165
  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)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   166
               \<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))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13634
diff changeset
   167
apply (simp (no_asm_use) only: is_formula_case_def)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   168
apply (intro FOL_reflections function_reflections finite_ordinal_reflection
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   169
         mem_formula_reflection
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   170
         Member_reflection Equal_reflection Nand_reflection Forall_reflection
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   171
         is_a_reflection is_b_reflection is_c_reflection is_d_reflection)
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   172
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   173
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   174
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   175
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   176
subsection {*Absoluteness for the Function @{term satisfies}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   177
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 19931
diff changeset
   178
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   179
  is_depth_apply :: "[i=>o,i,i,i] => o" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   180
   --{*Merely a useful abbreviation for the sequel.*}
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   181
  "is_depth_apply(M,h,p,z) ==
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   182
    \<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
   183
	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
   184
	fun_apply(M,h,sdp,hsdp) & fun_apply(M,hsdp,p,z)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   185
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   186
lemma (in M_datatypes) is_depth_apply_abs [simp]:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   187
     "[|M(h); p \<in> formula; M(z)|] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   188
      ==> is_depth_apply(M,h,p,z) <-> z = h ` succ(depth(p)) ` p"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   189
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
   190
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   191
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   192
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   193
text{*There is at present some redundancy between the relativizations in
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   194
 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
   195
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   196
text{*These constants let us instantiate the parameters @{term a}, @{term b},
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   197
      @{term c}, @{term d}, etc., of the locale @{text Formula_Rec}.*}
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 19931
diff changeset
   198
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   199
  satisfies_a :: "[i,i,i]=>i" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   200
   "satisfies_a(A) == 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   201
    \<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
   202
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   203
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   204
  satisfies_is_a :: "[i=>o,i,i,i,i]=>o" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   205
   "satisfies_is_a(M,A) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   206
    \<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
   207
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   208
		\<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
   209
                      \<exists>nx[M]. \<exists>ny[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   210
 		       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
   211
                zz)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   212
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   213
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   214
  satisfies_b :: "[i,i,i]=>i" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   215
   "satisfies_b(A) ==
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   216
    \<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
   217
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   218
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   219
  satisfies_is_b :: "[i=>o,i,i,i,i]=>o" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   220
   --{*We simplify the formula to have just @{term nx} rather than 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   221
       introducing @{term ny} with  @{term "nx=ny"} *}
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   222
  "satisfies_is_b(M,A) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   223
    \<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
   224
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   225
                \<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
   226
                      \<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
   227
                zz)"
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   228
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   229
definition 
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   230
  satisfies_c :: "[i,i,i,i,i]=>i" where
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   231
   "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
   232
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   233
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   234
  satisfies_is_c :: "[i=>o,i,i,i,i,i]=>o" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   235
   "satisfies_is_c(M,A,h) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   236
    \<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
   237
             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
   238
		 (\<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
   239
		 (\<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
   240
                 (\<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
   241
                zz)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   242
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   243
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   244
  satisfies_d :: "[i,i,i]=>i" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   245
   "satisfies_d(A) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   246
    == \<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
   247
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   248
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   249
  satisfies_is_d :: "[i=>o,i,i,i,i]=>o" where
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   250
   "satisfies_is_d(M,A,h) == 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   251
    \<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
   252
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   253
                \<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
   254
                    is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   255
                           \<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
   256
                              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
   257
                              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
   258
                  z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   259
               zz)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   260
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   261
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   262
  satisfies_MH :: "[i=>o,i,i,i,i]=>o" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   263
    --{*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
   264
        the correct arity.*}
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   265
  "satisfies_MH == 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   266
    \<lambda>M A u f z. 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   267
         \<forall>fml[M]. is_formula(M,fml) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   268
             is_lambda (M, fml, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   269
               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
   270
                                satisfies_is_b(M,A), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   271
                                satisfies_is_c(M,A,f), satisfies_is_d(M,A,f)),
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   272
               z)"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   273
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   274
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   275
  is_satisfies :: "[i=>o,i,i,i]=>o" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   276
  "is_satisfies(M,A) == is_formula_rec (M, satisfies_MH(M,A))"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   277
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   278
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   279
text{*This lemma relates the fragments defined above to the original primitive
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   280
      recursion in @{term satisfies}.
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   281
      Induction is not required: the definitions are directly equal!*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   282
lemma satisfies_eq:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   283
  "satisfies(A,p) = 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   284
   formula_rec (satisfies_a(A), satisfies_b(A), 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   285
                satisfies_c(A), satisfies_d(A), p)"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   286
by (simp add: satisfies_formula_def satisfies_a_def satisfies_b_def 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   287
              satisfies_c_def satisfies_d_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   288
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   289
text{*Further constraints on the class @{term M} in order to prove
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   290
      absoluteness for the constants defined above.  The ultimate goal
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   291
      is the absoluteness of the function @{term satisfies}. *}
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   292
locale M_satisfies = M_eclose +
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   293
 assumes 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   294
   Member_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   295
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   296
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   297
	 (M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   298
              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
   299
              is_bool_of_o(M, nx \<in> ny, bo) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   300
              pair(M, env, bo, z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   301
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   302
   Equal_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   303
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   304
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   305
	 (M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   306
              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
   307
              is_bool_of_o(M, nx = ny, bo) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   308
              pair(M, env, bo, z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   309
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   310
   Nand_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   311
    "[|M(A); M(rp); M(rq)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   312
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   313
	 (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
   314
               fun_apply(M,rp,env,rpe) & fun_apply(M,rq,env,rqe) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   315
               is_and(M,rpe,rqe,andpq) & is_not(M,andpq,notpq) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   316
               env \<in> list(A) & pair(M, env, notpq, z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   317
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   318
  Forall_replacement:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   319
   "[|M(A); M(rp)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   320
    ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   321
	(M, \<lambda>env z. \<exists>bo[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   322
	      env \<in> list(A) & 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   323
	      is_bool_of_o (M, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   324
			    \<forall>a[M]. \<forall>co[M]. \<forall>rpco[M]. 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   325
			       a\<in>A --> is_Cons(M,a,env,co) -->
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   326
			       fun_apply(M,rp,co,rpco) --> number1(M, rpco), 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   327
                            bo) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   328
	      pair(M,env,bo,z))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   329
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   330
  formula_rec_replacement: 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   331
      --{*For the @{term transrec}*}
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   332
   "[|n \<in> nat; M(A)|] ==> transrec_replacement(M, satisfies_MH(M,A), n)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   333
 and
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   334
  formula_rec_lambda_replacement:  
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   335
      --{*For the @{text "\<lambda>-abstraction"} in the @{term transrec} body*}
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   336
   "[|M(g); M(A)|] ==>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   337
    strong_replacement (M, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   338
       \<lambda>x y. mem_formula(M,x) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   339
             (\<exists>c[M]. is_formula_case(M, satisfies_is_a(M,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   340
                                  satisfies_is_b(M,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   341
                                  satisfies_is_c(M,A,g),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   342
                                  satisfies_is_d(M,A,g), x, c) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   343
             pair(M, x, c, y)))"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   344
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   345
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   346
lemma (in M_satisfies) Member_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   347
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   348
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   349
	 (M, \<lambda>env z. env \<in> list(A) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   350
		     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
   351
by (insert Member_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   352
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   353
lemma (in M_satisfies) Equal_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   354
    "[|M(A); x \<in> nat; y \<in> nat|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   355
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   356
	 (M, \<lambda>env z. env \<in> list(A) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   357
		     z = \<langle>env, bool_of_o(nth(x, env) = nth(y, env))\<rangle>)"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   358
by (insert Equal_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   359
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   360
lemma (in M_satisfies) Nand_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   361
    "[|M(A); M(rp); M(rq)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   362
     ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   363
	 (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
   364
by (insert Nand_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   365
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   366
lemma (in M_satisfies) Forall_replacement':
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   367
   "[|M(A); M(rp)|]
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   368
    ==> strong_replacement
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   369
	(M, \<lambda>env z.
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   370
	       env \<in> list(A) &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   371
	       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
   372
by (insert Forall_replacement, simp) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   373
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   374
lemma (in M_satisfies) a_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   375
     "[|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
   376
apply (simp add: satisfies_a_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   377
apply (blast intro: lam_closed2 Member_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   378
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   379
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   380
lemma (in M_satisfies) a_rel:
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   381
     "M(A) ==> Relation2(M, nat, nat, satisfies_is_a(M,A), satisfies_a(A))"
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   382
apply (simp add: Relation2_def satisfies_is_a_def satisfies_a_def)
13702
c7cf8fa66534 Polishing.
paulson
parents: 13687
diff changeset
   383
apply (auto del: iffI intro!: lambda_abs2 simp add: Relation1_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   384
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   385
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   386
lemma (in M_satisfies) b_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   387
     "[|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
   388
apply (simp add: satisfies_b_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   389
apply (blast intro: lam_closed2 Equal_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   390
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   391
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   392
lemma (in M_satisfies) b_rel:
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   393
     "M(A) ==> Relation2(M, nat, nat, satisfies_is_b(M,A), satisfies_b(A))"
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   394
apply (simp add: Relation2_def satisfies_is_b_def satisfies_b_def)
13702
c7cf8fa66534 Polishing.
paulson
parents: 13687
diff changeset
   395
apply (auto del: iffI intro!: lambda_abs2 simp add: Relation1_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   396
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   397
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   398
lemma (in M_satisfies) c_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   399
     "[|M(A); x \<in> formula; y \<in> formula; M(rx); M(ry)|] 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   400
      ==> M(satisfies_c(A,x,y,rx,ry))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   401
apply (simp add: satisfies_c_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   402
apply (rule lam_closed2) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   403
apply (rule Nand_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   404
apply (simp_all add: formula_into_M list_into_M [of _ A])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   405
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   406
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   407
lemma (in M_satisfies) c_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   408
 "[|M(A); M(f)|] ==> 
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   409
  Relation2 (M, formula, formula, 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   410
               satisfies_is_c(M,A,f),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   411
	       \<lambda>u v. satisfies_c(A, u, v, f ` succ(depth(u)) ` u, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   412
					  f ` succ(depth(v)) ` v))"
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   413
apply (simp add: Relation2_def satisfies_is_c_def satisfies_c_def)
13702
c7cf8fa66534 Polishing.
paulson
parents: 13687
diff changeset
   414
apply (auto del: iffI intro!: lambda_abs2 
c7cf8fa66534 Polishing.
paulson
parents: 13687
diff changeset
   415
            simp add: Relation1_def formula_into_M) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   416
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   417
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   418
lemma (in M_satisfies) d_closed:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   419
     "[|M(A); x \<in> formula; M(rx)|] ==> M(satisfies_d(A,x,rx))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   420
apply (simp add: satisfies_d_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   421
apply (rule lam_closed2) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   422
apply (rule Forall_replacement') 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   423
apply (simp_all add: formula_into_M list_into_M [of _ A])
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   424
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   425
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   426
lemma (in M_satisfies) d_rel:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   427
 "[|M(A); M(f)|] ==> 
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   428
  Relation1(M, formula, satisfies_is_d(M,A,f), 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   429
     \<lambda>u. satisfies_d(A, u, f ` succ(depth(u)) ` u))"
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   430
apply (simp del: rall_abs 
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13566
diff changeset
   431
            add: Relation1_def satisfies_is_d_def satisfies_d_def)
13702
c7cf8fa66534 Polishing.
paulson
parents: 13687
diff changeset
   432
apply (auto del: iffI intro!: lambda_abs2 simp add: Relation1_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   433
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   434
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   435
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   436
lemma (in M_satisfies) fr_replace:
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
by (blast intro: formula_rec_replacement) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   439
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   440
lemma (in M_satisfies) formula_case_satisfies_closed:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   441
 "[|M(g); M(A); x \<in> formula|] ==>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   442
  M(formula_case (satisfies_a(A), satisfies_b(A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   443
       \<lambda>u v. satisfies_c(A, u, v, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   444
                         g ` succ(depth(u)) ` u, g ` succ(depth(v)) ` v),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   445
       \<lambda>u. satisfies_d (A, u, g ` succ(depth(u)) ` u),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   446
       x))"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   447
by (blast intro: formula_case_closed a_closed b_closed c_closed d_closed) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   448
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   449
lemma (in M_satisfies) fr_lam_replace:
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   450
   "[|M(g); M(A)|] ==>
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   451
    strong_replacement (M, \<lambda>x y. x \<in> formula &
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   452
            y = \<langle>x, 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   453
                 formula_rec_case(satisfies_a(A),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   454
                                  satisfies_b(A),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   455
                                  satisfies_c(A),
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   456
                                  satisfies_d(A), g, x)\<rangle>)"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   457
apply (insert formula_rec_lambda_replacement) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   458
apply (simp add: formula_rec_case_def formula_case_satisfies_closed
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   459
                 formula_case_abs [OF a_rel b_rel c_rel d_rel]) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   460
done
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   461
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   462
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   463
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   464
text{*Instantiate locale @{text Formula_Rec} for the 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   465
      Function @{term satisfies}*}
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   466
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   467
lemma (in M_satisfies) Formula_Rec_axioms_M:
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   468
   "M(A) ==>
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   469
    Formula_Rec_axioms(M, satisfies_a(A), satisfies_is_a(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   470
			  satisfies_b(A), satisfies_is_b(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   471
			  satisfies_c(A), satisfies_is_c(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   472
			  satisfies_d(A), satisfies_is_d(M,A))"
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   473
apply (rule Formula_Rec_axioms.intro)
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   474
apply (assumption | 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   475
       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
   476
       fr_replace [unfolded satisfies_MH_def]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   477
       fr_lam_replace) +
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   478
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   479
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   480
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   481
theorem (in M_satisfies) Formula_Rec_M: 
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   482
    "M(A) ==>
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   483
     PROP Formula_Rec(M, satisfies_a(A), satisfies_is_a(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   484
			 satisfies_b(A), satisfies_is_b(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   485
			 satisfies_c(A), satisfies_is_c(M,A), 
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   486
			 satisfies_d(A), satisfies_is_d(M,A))"
19931
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 16417
diff changeset
   487
  apply (rule Formula_Rec.intro)
23464
bc2563c37b1a tuned proofs -- avoid implicit prems;
wenzelm
parents: 21404
diff changeset
   488
   apply (rule M_satisfies.axioms, rule M_satisfies_axioms)
19931
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 16417
diff changeset
   489
  apply (erule Formula_Rec_axioms_M) 
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 16417
diff changeset
   490
  done
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   491
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   492
lemmas (in M_satisfies) 
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13505
diff changeset
   493
    satisfies_closed' = Formula_Rec.formula_rec_closed [OF Formula_Rec_M]
007559e981c7 *** empty log message ***
wenzelm
parents: 13505
diff changeset
   494
and satisfies_abs'    = Formula_Rec.formula_rec_abs [OF Formula_Rec_M]
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   495
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   496
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   497
lemma (in M_satisfies) satisfies_closed:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   498
  "[|M(A); p \<in> formula|] ==> M(satisfies(A,p))"
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   499
by (simp add: Formula_Rec.formula_rec_closed [OF Formula_Rec_M]  
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   500
              satisfies_eq) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   501
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   502
lemma (in M_satisfies) satisfies_abs:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   503
  "[|M(A); M(z); p \<in> formula|] 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   504
   ==> is_satisfies(M,A,p,z) <-> z = satisfies(A,p)"
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
   505
by (simp only: Formula_Rec.formula_rec_abs [OF Formula_Rec_M]  
13503
d93f41fe35d2 Relativization and absoluteness for DPow!!
paulson
parents: 13502
diff changeset
   506
               satisfies_eq is_satisfies_def satisfies_MH_def)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   507
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   508
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   509
subsection{*Internalizations Needed to Instantiate @{text "M_satisfies"}*}
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   510
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   511
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
   512
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   513
(* is_depth_apply(M,h,p,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   514
    \<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
   515
      2        1         0
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   516
	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
   517
	fun_apply(M,h,sdp,hsdp) & fun_apply(M,hsdp,p,z) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   518
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   519
  depth_apply_fm :: "[i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   520
    "depth_apply_fm(h,p,z) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   521
       Exists(Exists(Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   522
        And(finite_ordinal_fm(2),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   523
         And(depth_fm(p#+3,2),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   524
          And(succ_fm(2,1),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   525
           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
   526
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   527
lemma depth_apply_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   528
     "[| 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
   529
by (simp add: depth_apply_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   530
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   531
lemma sats_depth_apply_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   532
   "[| 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
   533
    ==> sats(A, depth_apply_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   534
        is_depth_apply(##A, nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   535
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
   536
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   537
lemma depth_apply_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   538
    "[| 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
   539
        i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   540
     ==> is_depth_apply(##A, x, y, z) <-> sats(A, depth_apply_fm(i,j,k), env)"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   541
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   542
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   543
lemma depth_apply_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   544
     "REFLECTS[\<lambda>x. is_depth_apply(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   545
               \<lambda>i x. is_depth_apply(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13634
diff changeset
   546
apply (simp only: is_depth_apply_def)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   547
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
   548
             finite_ordinal_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   549
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   550
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   551
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   552
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
   553
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   554
(* satisfies_is_a(M,A) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   555
    \<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
   556
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   557
		\<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
   558
                      \<exists>nx[M]. \<exists>ny[M]. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   559
 		       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
   560
                zz)  *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   561
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   562
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   563
  satisfies_is_a_fm :: "[i,i,i,i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   564
  "satisfies_is_a_fm(A,x,y,z) ==
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   565
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   566
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   567
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   568
         bool_of_o_fm(Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   569
                       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
   570
                               And(nth_fm(y#+6,3,0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   571
                                   Member(1,0))))), 0), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   572
         0, succ(z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   573
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   574
lemma satisfies_is_a_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   575
     "[| 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
   576
      ==> 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
   577
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
   578
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   579
lemma sats_satisfies_is_a_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   580
   "[| 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
   581
    ==> sats(A, satisfies_is_a_fm(u,x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   582
        satisfies_is_a(##A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   583
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
   584
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
   585
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
   586
                 sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   587
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   588
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   589
lemma satisfies_is_a_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   590
  "[| 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
   591
      u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   592
   ==> satisfies_is_a(##A,nu,nx,ny,nz) <->
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   593
       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
   594
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   595
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   596
theorem satisfies_is_a_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   597
     "REFLECTS[\<lambda>x. satisfies_is_a(L,f(x),g(x),h(x),g'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   598
               \<lambda>i x. satisfies_is_a(##Lset(i),f(x),g(x),h(x),g'(x))]"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   599
apply (unfold satisfies_is_a_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   600
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
   601
             nth_reflection is_list_reflection)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   602
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   603
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   604
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   605
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
   606
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   607
(* satisfies_is_b(M,A) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   608
    \<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
   609
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   610
                \<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
   611
                      \<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
   612
                zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   613
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   614
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   615
  satisfies_is_b_fm :: "[i,i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   616
 "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
   617
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   618
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   619
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   620
         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
   621
         0, succ(z))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   622
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   623
lemma satisfies_is_b_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   624
     "[| 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
   625
      ==> 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
   626
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
   627
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   628
lemma sats_satisfies_is_b_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   629
   "[| 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
   630
    ==> sats(A, satisfies_is_b_fm(u,x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   631
        satisfies_is_b(##A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   632
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
   633
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
   634
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
   635
                 sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   636
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   637
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   638
lemma satisfies_is_b_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   639
  "[| 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
   640
      u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   641
   ==> satisfies_is_b(##A,nu,nx,ny,nz) <->
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   642
       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
   643
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   644
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   645
theorem satisfies_is_b_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   646
     "REFLECTS[\<lambda>x. satisfies_is_b(L,f(x),g(x),h(x),g'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   647
               \<lambda>i x. satisfies_is_b(##Lset(i),f(x),g(x),h(x),g'(x))]"
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   648
apply (unfold satisfies_is_b_def) 
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   649
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
   650
             nth_reflection is_list_reflection)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   651
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   652
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   653
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   654
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
   655
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   656
(* satisfies_is_c(M,A,h) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   657
    \<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
   658
             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
   659
		 (\<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
   660
		 (\<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
   661
                 (\<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
   662
                zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   663
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   664
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   665
  satisfies_is_c_fm :: "[i,i,i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   666
 "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
   667
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   668
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   669
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   670
         Exists(Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   671
          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
   672
          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
   673
              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
   674
         0, succ(zz))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   675
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   676
lemma satisfies_is_c_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   677
     "[| 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
   678
      ==> 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
   679
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
   680
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   681
lemma sats_satisfies_is_c_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   682
   "[| 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
   683
    ==> sats(A, satisfies_is_c_fm(u,v,x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   684
        satisfies_is_c(##A, nth(u,env), nth(v,env), nth(x,env), 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   685
                            nth(y,env), nth(z,env))"  
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   686
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
   687
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   688
lemma satisfies_is_c_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   689
  "[| 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
   690
      nth(z,env) = nz;
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   691
      u \<in> nat; v \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   692
   ==> satisfies_is_c(##A,nu,nv,nx,ny,nz) <->
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   693
       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
   694
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   695
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   696
theorem satisfies_is_c_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   697
     "REFLECTS[\<lambda>x. satisfies_is_c(L,f(x),g(x),h(x),g'(x),h'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   698
               \<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
   699
apply (unfold satisfies_is_c_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   700
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
   701
             extra_reflections nth_reflection depth_apply_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   702
             is_list_reflection)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   703
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   704
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   705
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
   706
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   707
(* satisfies_is_d(M,A,h) == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   708
    \<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
   709
             is_lambda(M, lA, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   710
                \<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
   711
                    is_bool_of_o(M, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   712
                           \<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
   713
                              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
   714
                              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
   715
                  z),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   716
               zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   717
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   718
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   719
  satisfies_is_d_fm :: "[i,i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   720
 "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
   721
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   722
     Implies(is_list_fm(succ(A),0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   723
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   724
         Exists(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   725
           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
   726
               bool_of_o_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   727
                Forall(Forall(Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   728
                 Implies(Member(2,A#+8),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   729
                  Implies(Cons_fm(2,5,1),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   730
                   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
   731
         0, succ(zz))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   732
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   733
lemma satisfies_is_d_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   734
     "[| 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
   735
      ==> 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
   736
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
   737
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   738
lemma sats_satisfies_is_d_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   739
   "[| 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
   740
    ==> sats(A, satisfies_is_d_fm(u,x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   741
        satisfies_is_d(##A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"  
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   742
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
   743
              sats_bool_of_o_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   744
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   745
lemma satisfies_is_d_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   746
  "[| 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
   747
      u \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   748
   ==> satisfies_is_d(##A,nu,nx,ny,nz) <->
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   749
       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
   750
by simp
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   751
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   752
theorem satisfies_is_d_reflection:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   753
     "REFLECTS[\<lambda>x. satisfies_is_d(L,f(x),g(x),h(x),g'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   754
               \<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
   755
apply (unfold satisfies_is_d_def) 
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   756
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
   757
             extra_reflections nth_reflection depth_apply_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   758
             is_list_reflection)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   759
done
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   760
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   761
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   762
subsubsection{*The Operator @{term satisfies_MH}, Internalized*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   763
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   764
(* satisfies_MH == 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   765
    \<lambda>M A u f zz. 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   766
         \<forall>fml[M]. is_formula(M,fml) -->
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   767
             is_lambda (M, fml, 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   768
               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
   769
                                satisfies_is_b(M,A), 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   770
                                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
   771
               zz) *)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   772
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   773
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   774
  satisfies_MH_fm :: "[i,i,i,i]=>i" where
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   775
 "satisfies_MH_fm(A,u,f,zz) ==
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   776
   Forall(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   777
     Implies(is_formula_fm(0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   778
       lambda_fm(
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   779
         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
   780
                         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
   781
                         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
   782
                         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
   783
                         1, 0),
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   784
         0, succ(zz))))"
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   785
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   786
lemma satisfies_MH_type [TC]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   787
     "[| 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
   788
      ==> 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
   789
by (simp add: satisfies_MH_fm_def)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   790
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   791
lemma sats_satisfies_MH_fm [simp]:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   792
   "[| 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
   793
    ==> sats(A, satisfies_MH_fm(u,x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   794
        satisfies_MH(##A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))"  
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   795
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
   796
              sats_formula_case_fm)
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   797
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   798
lemma satisfies_MH_iff_sats:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   799
  "[| 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
   800
      u \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   801
   ==> satisfies_MH(##A,nu,nx,ny,nz) <->
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   802
       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
   803
by simp 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   804
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   805
lemmas satisfies_reflections =
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   806
       is_lambda_reflection is_formula_reflection 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   807
       is_formula_case_reflection
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   808
       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
   809
       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
   810
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   811
theorem satisfies_MH_reflection:
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   812
     "REFLECTS[\<lambda>x. satisfies_MH(L,f(x),g(x),h(x),g'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   813
               \<lambda>i x. satisfies_MH(##Lset(i),f(x),g(x),h(x),g'(x))]"
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   814
apply (unfold satisfies_MH_def) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   815
apply (intro FOL_reflections satisfies_reflections)
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   816
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   817
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   818
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   819
subsection{*Lemmas for Instantiating the Locale @{text "M_satisfies"}*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   820
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   821
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   822
subsubsection{*The @{term "Member"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   823
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   824
lemma Member_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   825
 "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
   826
          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
   827
          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
   828
   \<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).
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   829
             v \<in> lstA \<and> is_nth(##Lset(i), x, v, nx) \<and> 
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   830
             is_nth(##Lset(i), y, v, ny) \<and>
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   831
          is_bool_of_o(##Lset(i), nx \<in> ny, bo) \<and> pair(##Lset(i), v, bo, u))]"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   832
by (intro FOL_reflections function_reflections nth_reflection 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   833
          bool_of_o_reflection)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   834
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   835
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   836
lemma Member_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   837
    "[|L(A); x \<in> nat; y \<in> nat|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   838
     ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   839
	 (L, \<lambda>env z. \<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   840
              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
   841
              is_bool_of_o(L, nx \<in> ny, bo) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   842
              pair(L, env, bo, z))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   843
apply (rule strong_replacementI)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   844
apply (rule_tac u="{list(A),B,x,y}" 
13687
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   845
         in gen_separation_multi [OF Member_Reflects], 
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   846
       auto simp add: nat_into_M list_closed)
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   847
apply (rule_tac env="[list(A),B,x,y]" in DPow_LsetI)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   848
apply (rule sep_rules nth_iff_sats is_bool_of_o_iff_sats | simp)+
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   849
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   850
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   851
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   852
subsubsection{*The @{term "Equal"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   853
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   854
lemma Equal_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   855
 "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
   856
          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
   857
          is_bool_of_o(L, nx = ny, bo) \<and> pair(L, v, bo, u)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   858
   \<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).
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   859
             v \<in> lstA \<and> is_nth(##Lset(i), x, v, nx) \<and> 
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   860
             is_nth(##Lset(i), y, v, ny) \<and>
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   861
          is_bool_of_o(##Lset(i), nx = ny, bo) \<and> pair(##Lset(i), v, bo, u))]"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   862
by (intro FOL_reflections function_reflections nth_reflection 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   863
          bool_of_o_reflection)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   864
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   865
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   866
lemma Equal_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   867
    "[|L(A); x \<in> nat; y \<in> nat|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   868
     ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   869
	 (L, \<lambda>env z. \<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   870
              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
   871
              is_bool_of_o(L, nx = ny, bo) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   872
              pair(L, env, bo, z))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   873
apply (rule strong_replacementI)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   874
apply (rule_tac u="{list(A),B,x,y}" 
13687
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   875
         in gen_separation_multi [OF Equal_Reflects], 
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   876
       auto simp add: nat_into_M list_closed)
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   877
apply (rule_tac env="[list(A),B,x,y]" in DPow_LsetI)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   878
apply (rule sep_rules nth_iff_sats is_bool_of_o_iff_sats | simp)+
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   879
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   880
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   881
subsubsection{*The @{term "Nand"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   882
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   883
lemma Nand_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   884
    "REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   885
	       (\<exists>rpe[L]. \<exists>rqe[L]. \<exists>andpq[L]. \<exists>notpq[L].
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   886
		 fun_apply(L, rp, u, rpe) \<and> fun_apply(L, rq, u, rqe) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   887
		 is_and(L, rpe, rqe, andpq) \<and> is_not(L, andpq, notpq) \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   888
		 u \<in> list(A) \<and> pair(L, u, notpq, x)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   889
    \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   890
     (\<exists>rpe \<in> Lset(i). \<exists>rqe \<in> Lset(i). \<exists>andpq \<in> Lset(i). \<exists>notpq \<in> Lset(i).
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   891
       fun_apply(##Lset(i), rp, u, rpe) \<and> fun_apply(##Lset(i), rq, u, rqe) \<and>
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   892
       is_and(##Lset(i), rpe, rqe, andpq) \<and> is_not(##Lset(i), andpq, notpq) \<and>
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   893
       u \<in> list(A) \<and> pair(##Lset(i), u, notpq, x))]"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   894
apply (unfold is_and_def is_not_def) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   895
apply (intro FOL_reflections function_reflections)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   896
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   897
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   898
lemma Nand_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   899
    "[|L(A); L(rp); L(rq)|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   900
     ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   901
	 (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
   902
               fun_apply(L,rp,env,rpe) & fun_apply(L,rq,env,rqe) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   903
               is_and(L,rpe,rqe,andpq) & is_not(L,andpq,notpq) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   904
               env \<in> list(A) & pair(L, env, notpq, z))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   905
apply (rule strong_replacementI)
13687
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   906
apply (rule_tac u="{list(A),B,rp,rq}" 
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   907
         in gen_separation_multi [OF Nand_Reflects],
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   908
       auto simp add: list_closed)
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   909
apply (rule_tac env="[list(A),B,rp,rq]" in DPow_LsetI)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   910
apply (rule sep_rules is_and_iff_sats is_not_iff_sats | simp)+
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   911
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   912
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   913
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   914
subsubsection{*The @{term "Forall"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   915
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   916
lemma Forall_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   917
 "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
   918
                 is_bool_of_o (L,
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   919
     \<forall>a[L]. \<forall>co[L]. \<forall>rpco[L]. a \<in> A \<longrightarrow>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   920
                is_Cons(L,a,u,co) \<longrightarrow> fun_apply(L,rp,co,rpco) \<longrightarrow> 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   921
                number1(L,rpco),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   922
                           bo) \<and> pair(L,u,bo,x)),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   923
 \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> (\<exists>bo \<in> Lset(i). u \<in> list(A) \<and>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   924
        is_bool_of_o (##Lset(i),
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   925
 \<forall>a \<in> Lset(i). \<forall>co \<in> Lset(i). \<forall>rpco \<in> Lset(i). a \<in> A \<longrightarrow>
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   926
	    is_Cons(##Lset(i),a,u,co) \<longrightarrow> fun_apply(##Lset(i),rp,co,rpco) \<longrightarrow> 
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   927
	    number1(##Lset(i),rpco),
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   928
		       bo) \<and> pair(##Lset(i),u,bo,x))]"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   929
apply (unfold is_bool_of_o_def) 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   930
apply (intro FOL_reflections function_reflections Cons_reflection)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   931
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   932
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   933
lemma Forall_replacement:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   934
   "[|L(A); L(rp)|]
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   935
    ==> strong_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   936
	(L, \<lambda>env z. \<exists>bo[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   937
	      env \<in> list(A) & 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   938
	      is_bool_of_o (L, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   939
			    \<forall>a[L]. \<forall>co[L]. \<forall>rpco[L]. 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   940
			       a\<in>A --> is_Cons(L,a,env,co) -->
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   941
			       fun_apply(L,rp,co,rpco) --> number1(L, rpco), 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   942
                            bo) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   943
	      pair(L,env,bo,z))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   944
apply (rule strong_replacementI)
13687
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   945
apply (rule_tac u="{A,list(A),B,rp}" 
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   946
         in gen_separation_multi [OF Forall_Reflects],
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   947
       auto simp add: list_closed)
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   948
apply (rule_tac env="[A,list(A),B,rp]" in DPow_LsetI)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   949
apply (rule sep_rules is_bool_of_o_iff_sats Cons_iff_sats | simp)+
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   950
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   951
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   952
subsubsection{*The @{term "transrec_replacement"} Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   953
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   954
lemma formula_rec_replacement_Reflects:
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   955
 "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
   956
             is_wfrec (L, satisfies_MH(L,A), mesa, u, y)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   957
    \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> (\<exists>y \<in> Lset(i). pair(##Lset(i), u, y, x) \<and>
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   958
             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
   959
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
   960
          is_wfrec_reflection) 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   961
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   962
lemma formula_rec_replacement: 
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   963
      --{*For the @{term transrec}*}
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   964
   "[|n \<in> nat; L(A)|] ==> transrec_replacement(L, satisfies_MH(L,A), n)"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   965
apply (rule transrec_replacementI, simp add: nat_into_M) 
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   966
apply (rule strong_replacementI)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
   967
apply (rule_tac u="{B,A,n,Memrel(eclose({n}))}"
13687
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   968
         in gen_separation_multi [OF formula_rec_replacement_Reflects],
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   969
       auto simp add: nat_into_M)
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
   970
apply (rule_tac env="[B,A,n,Memrel(eclose({n}))]" in DPow_LsetI)
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13494
diff changeset
   971
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
   972
done
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
   973
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   974
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   975
subsubsection{*The Lambda Replacement Case*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   976
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   977
lemma formula_rec_lambda_replacement_Reflects:
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   978
 "REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   979
     mem_formula(L,u) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   980
     (\<exists>c[L].
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   981
	 is_formula_case
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   982
	  (L, satisfies_is_a(L,A), satisfies_is_b(L,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   983
	   satisfies_is_c(L,A,g), satisfies_is_d(L,A,g),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   984
	   u, c) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   985
	 pair(L,u,c,x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   986
  \<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B & mem_formula(##Lset(i),u) &
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   987
     (\<exists>c \<in> Lset(i).
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   988
	 is_formula_case
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   989
	  (##Lset(i), satisfies_is_a(##Lset(i),A), satisfies_is_b(##Lset(i),A),
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   990
	   satisfies_is_c(##Lset(i),A,g), satisfies_is_d(##Lset(i),A,g),
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   991
	   u, c) &
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13702
diff changeset
   992
	 pair(##Lset(i),u,c,x))]"
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   993
by (intro FOL_reflections function_reflections mem_formula_reflection
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   994
          is_formula_case_reflection satisfies_is_a_reflection
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   995
          satisfies_is_b_reflection satisfies_is_c_reflection
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   996
          satisfies_is_d_reflection)  
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   997
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   998
lemma formula_rec_lambda_replacement: 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
   999
      --{*For the @{term transrec}*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1000
   "[|L(g); L(A)|] ==>
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1001
    strong_replacement (L, 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1002
       \<lambda>x y. mem_formula(L,x) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1003
             (\<exists>c[L]. is_formula_case(L, satisfies_is_a(L,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1004
                                  satisfies_is_b(L,A),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1005
                                  satisfies_is_c(L,A,g),
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1006
                                  satisfies_is_d(L,A,g), x, c) &
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1007
             pair(L, x, c, y)))" 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1008
apply (rule strong_replacementI)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13557
diff changeset
  1009
apply (rule_tac u="{B,A,g}"
13687
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
  1010
         in gen_separation_multi [OF formula_rec_lambda_replacement_Reflects], 
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
  1011
       auto)
22dce9134953 simpler separation/replacement proofs
paulson
parents: 13655
diff changeset
  1012
apply (rule_tac env="[A,g,B]" in DPow_LsetI)
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1013
apply (rule sep_rules mem_formula_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1014
          formula_case_iff_sats satisfies_is_a_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1015
          satisfies_is_b_iff_sats satisfies_is_c_iff_sats
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1016
          satisfies_is_d_iff_sats | simp)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1017
done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1018
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1019
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1020
subsection{*Instantiating @{text M_satisfies}*}
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1021
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1022
lemma M_satisfies_axioms_L: "M_satisfies_axioms(L)"
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1023
  apply (rule M_satisfies_axioms.intro)
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1024
       apply (assumption | rule
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1025
	 Member_replacement Equal_replacement 
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1026
         Nand_replacement Forall_replacement
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1027
         formula_rec_replacement formula_rec_lambda_replacement)+
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1028
  done
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1029
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1030
theorem M_satisfies_L: "PROP M_satisfies(L)"
19931
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 16417
diff changeset
  1031
  apply (rule M_satisfies.intro)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 16417
diff changeset
  1032
   apply (rule M_eclose_L)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 16417
diff changeset
  1033
  apply (rule M_satisfies_axioms_L)
fb32b43e7f80 Restructured locales with predicates: import is now an interpretation.
ballarin
parents: 16417
diff changeset
  1034
  done
13502
da43ebc02f17 Finished absoluteness of "satisfies"!!
paulson
parents: 13496
diff changeset
  1035
13504
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1036
text{*Finally: the point of the whole theory!*}
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1037
lemmas satisfies_closed = M_satisfies.satisfies_closed [OF M_satisfies_L]
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1038
   and satisfies_abs = M_satisfies.satisfies_abs [OF M_satisfies_L]
59066e97b551 Tidying up
paulson
parents: 13503
diff changeset
  1039
13494
1c44289716ae new file Constructible/Satisfies_absolute.thy
paulson
parents:
diff changeset
  1040
end