src/ZF/Constructible/Relative.thy
author paulson
Tue, 01 Oct 2002 13:26:10 +0200
changeset 13615 449a70d88b38
parent 13611 2edf034c902a
child 13628 87482b5e3f2e
permissions -rw-r--r--
Numerous cosmetic changes, prompted by the new simplifier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
     1
(*  Title:      ZF/Constructible/Relative.thy
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
     2
    ID:         $Id$
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
     4
    Copyright   2002  University of Cambridge
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
     5
*)
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
     6
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
     7
header {*Relativization and Absoluteness*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
     8
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
     9
theory Relative = Main:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    10
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    11
subsection{* Relativized versions of standard set-theoretic concepts *}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    12
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    13
constdefs
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    14
  empty :: "[i=>o,i] => o"
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
    15
    "empty(M,z) == \<forall>x[M]. x \<notin> z"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    16
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    17
  subset :: "[i=>o,i,i] => o"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
    18
    "subset(M,A,B) == \<forall>x[M]. x\<in>A --> x \<in> B"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    19
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    20
  upair :: "[i=>o,i,i,i] => o"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
    21
    "upair(M,a,b,z) == a \<in> z & b \<in> z & (\<forall>x[M]. x\<in>z --> x = a | x = b)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    22
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    23
  pair :: "[i=>o,i,i,i] => o"
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
    24
    "pair(M,a,b,z) == \<exists>x[M]. upair(M,a,a,x) & 
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
    25
                          (\<exists>y[M]. upair(M,a,b,y) & upair(M,x,y,z))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    26
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
    27
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
    28
  union :: "[i=>o,i,i,i] => o"
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
    29
    "union(M,a,b,z) == \<forall>x[M]. x \<in> z <-> x \<in> a | x \<in> b"
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
    30
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
    31
  is_cons :: "[i=>o,i,i,i] => o"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
    32
    "is_cons(M,a,b,z) == \<exists>x[M]. upair(M,a,a,x) & union(M,x,b,z)"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
    33
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    34
  successor :: "[i=>o,i,i] => o"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
    35
    "successor(M,a,z) == is_cons(M,a,a,z)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    36
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
    37
  number1 :: "[i=>o,i] => o"
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
    38
    "number1(M,a) == \<exists>x[M]. empty(M,x) & successor(M,x,a)"
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
    39
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
    40
  number2 :: "[i=>o,i] => o"
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
    41
    "number2(M,a) == \<exists>x[M]. number1(M,x) & successor(M,x,a)"
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
    42
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
    43
  number3 :: "[i=>o,i] => o"
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
    44
    "number3(M,a) == \<exists>x[M]. number2(M,x) & successor(M,x,a)"
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
    45
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    46
  powerset :: "[i=>o,i,i] => o"
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
    47
    "powerset(M,A,z) == \<forall>x[M]. x \<in> z <-> subset(M,x,A)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    48
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
    49
  is_Collect :: "[i=>o,i,i=>o,i] => o"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
    50
    "is_Collect(M,A,P,z) == \<forall>x[M]. x \<in> z <-> x \<in> A & P(x)"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
    51
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
    52
  is_Replace :: "[i=>o,i,[i,i]=>o,i] => o"
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
    53
    "is_Replace(M,A,P,z) == \<forall>u[M]. u \<in> z <-> (\<exists>x[M]. x\<in>A & P(x,u))"
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
    54
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    55
  inter :: "[i=>o,i,i,i] => o"
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
    56
    "inter(M,a,b,z) == \<forall>x[M]. x \<in> z <-> x \<in> a & x \<in> b"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    57
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    58
  setdiff :: "[i=>o,i,i,i] => o"
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
    59
    "setdiff(M,a,b,z) == \<forall>x[M]. x \<in> z <-> x \<in> a & x \<notin> b"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    60
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    61
  big_union :: "[i=>o,i,i] => o"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
    62
    "big_union(M,A,z) == \<forall>x[M]. x \<in> z <-> (\<exists>y[M]. y\<in>A & x \<in> y)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    63
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    64
  big_inter :: "[i=>o,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    65
    "big_inter(M,A,z) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    66
             (A=0 --> z=0) &
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
    67
	     (A\<noteq>0 --> (\<forall>x[M]. x \<in> z <-> (\<forall>y[M]. y\<in>A --> x \<in> y)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    68
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    69
  cartprod :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    70
    "cartprod(M,A,B,z) == 
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
    71
	\<forall>u[M]. u \<in> z <-> (\<exists>x[M]. x\<in>A & (\<exists>y[M]. y\<in>B & pair(M,x,y,u)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    72
13350
paulson
parents: 13348
diff changeset
    73
  is_sum :: "[i=>o,i,i,i] => o"
paulson
parents: 13348
diff changeset
    74
    "is_sum(M,A,B,Z) == 
paulson
parents: 13348
diff changeset
    75
       \<exists>A0[M]. \<exists>n1[M]. \<exists>s1[M]. \<exists>B1[M]. 
paulson
parents: 13348
diff changeset
    76
       number1(M,n1) & cartprod(M,n1,A,A0) & upair(M,n1,n1,s1) &
paulson
parents: 13348
diff changeset
    77
       cartprod(M,s1,B,B1) & union(M,A0,B1,Z)"
paulson
parents: 13348
diff changeset
    78
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
    79
  is_Inl :: "[i=>o,i,i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
    80
    "is_Inl(M,a,z) == \<exists>zero[M]. empty(M,zero) & pair(M,zero,a,z)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
    81
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
    82
  is_Inr :: "[i=>o,i,i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
    83
    "is_Inr(M,a,z) == \<exists>n1[M]. number1(M,n1) & pair(M,n1,a,z)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
    84
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    85
  is_converse :: "[i=>o,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    86
    "is_converse(M,r,z) == 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
    87
	\<forall>x[M]. x \<in> z <-> 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
    88
             (\<exists>w[M]. w\<in>r & (\<exists>u[M]. \<exists>v[M]. pair(M,u,v,w) & pair(M,v,u,x)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    89
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    90
  pre_image :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    91
    "pre_image(M,r,A,z) == 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
    92
	\<forall>x[M]. x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. y\<in>A & pair(M,x,y,w)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    93
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    94
  is_domain :: "[i=>o,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    95
    "is_domain(M,r,z) == 
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
    96
	\<forall>x[M]. x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. pair(M,x,y,w)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    97
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    98
  image :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    99
    "image(M,r,A,z) == 
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   100
        \<forall>y[M]. y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. x\<in>A & pair(M,x,y,w)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   101
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   102
  is_range :: "[i=>o,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   103
    --{*the cleaner 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   104
      @{term "\<exists>r'[M]. is_converse(M,r,r') & is_domain(M,r',z)"}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   105
      unfortunately needs an instance of separation in order to prove 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   106
        @{term "M(converse(r))"}.*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   107
    "is_range(M,r,z) == 
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   108
	\<forall>y[M]. y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. pair(M,x,y,w)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   109
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
   110
  is_field :: "[i=>o,i,i] => o"
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
   111
    "is_field(M,r,z) == 
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   112
	\<exists>dr[M]. \<exists>rr[M]. is_domain(M,r,dr) & is_range(M,r,rr) & 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   113
                        union(M,dr,rr,z)"
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
   114
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   115
  is_relation :: "[i=>o,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   116
    "is_relation(M,r) == 
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
   117
        (\<forall>z[M]. z\<in>r --> (\<exists>x[M]. \<exists>y[M]. pair(M,x,y,z)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   118
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   119
  is_function :: "[i=>o,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   120
    "is_function(M,r) == 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   121
	\<forall>x[M]. \<forall>y[M]. \<forall>y'[M]. \<forall>p[M]. \<forall>p'[M]. 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   122
           pair(M,x,y,p) --> pair(M,x,y',p') --> p\<in>r --> p'\<in>r --> y=y'"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   123
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   124
  fun_apply :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   125
    "fun_apply(M,f,x,y) == 
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
   126
        (\<exists>xs[M]. \<exists>fxs[M]. 
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
   127
         upair(M,x,x,xs) & image(M,f,xs,fxs) & big_union(M,fxs,y))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   128
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   129
  typed_function :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   130
    "typed_function(M,A,B,r) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   131
        is_function(M,r) & is_relation(M,r) & is_domain(M,r,A) &
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   132
        (\<forall>u[M]. u\<in>r --> (\<forall>x[M]. \<forall>y[M]. pair(M,x,y,u) --> y\<in>B))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   133
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   134
  is_funspace :: "[i=>o,i,i,i] => o"
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   135
    "is_funspace(M,A,B,F) == 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   136
        \<forall>f[M]. f \<in> F <-> typed_function(M,A,B,f)"
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   137
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
   138
  composition :: "[i=>o,i,i,i] => o"
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
   139
    "composition(M,r,s,t) == 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   140
        \<forall>p[M]. p \<in> t <-> 
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   141
               (\<exists>x[M]. \<exists>y[M]. \<exists>z[M]. \<exists>xy[M]. \<exists>yz[M]. 
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   142
                pair(M,x,z,p) & pair(M,x,y,xy) & pair(M,y,z,yz) & 
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   143
                xy \<in> s & yz \<in> r)"
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
   144
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   145
  injection :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   146
    "injection(M,A,B,f) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   147
	typed_function(M,A,B,f) &
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   148
        (\<forall>x[M]. \<forall>x'[M]. \<forall>y[M]. \<forall>p[M]. \<forall>p'[M]. 
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   149
          pair(M,x,y,p) --> pair(M,x',y,p') --> p\<in>f --> p'\<in>f --> x=x')"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   150
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   151
  surjection :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   152
    "surjection(M,A,B,f) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   153
        typed_function(M,A,B,f) &
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   154
        (\<forall>y[M]. y\<in>B --> (\<exists>x[M]. x\<in>A & fun_apply(M,f,x,y)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   155
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   156
  bijection :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   157
    "bijection(M,A,B,f) == injection(M,A,B,f) & surjection(M,A,B,f)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   158
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   159
  restriction :: "[i=>o,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   160
    "restriction(M,r,A,z) == 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   161
	\<forall>x[M]. x \<in> z <-> (x \<in> r & (\<exists>u[M]. u\<in>A & (\<exists>v[M]. pair(M,u,v,x))))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   162
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   163
  transitive_set :: "[i=>o,i] => o"
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   164
    "transitive_set(M,a) == \<forall>x[M]. x\<in>a --> subset(M,x,a)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   165
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   166
  ordinal :: "[i=>o,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   167
     --{*an ordinal is a transitive set of transitive sets*}
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   168
    "ordinal(M,a) == transitive_set(M,a) & (\<forall>x[M]. x\<in>a --> transitive_set(M,x))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   169
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   170
  limit_ordinal :: "[i=>o,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   171
    --{*a limit ordinal is a non-empty, successor-closed ordinal*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   172
    "limit_ordinal(M,a) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   173
	ordinal(M,a) & ~ empty(M,a) & 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   174
        (\<forall>x[M]. x\<in>a --> (\<exists>y[M]. y\<in>a & successor(M,x,y)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   175
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   176
  successor_ordinal :: "[i=>o,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   177
    --{*a successor ordinal is any ordinal that is neither empty nor limit*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   178
    "successor_ordinal(M,a) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   179
	ordinal(M,a) & ~ empty(M,a) & ~ limit_ordinal(M,a)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   180
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   181
  finite_ordinal :: "[i=>o,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   182
    --{*an ordinal is finite if neither it nor any of its elements are limit*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   183
    "finite_ordinal(M,a) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   184
	ordinal(M,a) & ~ limit_ordinal(M,a) & 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   185
        (\<forall>x[M]. x\<in>a --> ~ limit_ordinal(M,x))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   186
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   187
  omega :: "[i=>o,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   188
    --{*omega is a limit ordinal none of whose elements are limit*}
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   189
    "omega(M,a) == limit_ordinal(M,a) & (\<forall>x[M]. x\<in>a --> ~ limit_ordinal(M,x))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   190
13350
paulson
parents: 13348
diff changeset
   191
  is_quasinat :: "[i=>o,i] => o"
paulson
parents: 13348
diff changeset
   192
    "is_quasinat(M,z) == empty(M,z) | (\<exists>m[M]. successor(M,m,z))"
paulson
parents: 13348
diff changeset
   193
paulson
parents: 13348
diff changeset
   194
  is_nat_case :: "[i=>o, i, [i,i]=>o, i, i] => o"
paulson
parents: 13348
diff changeset
   195
    "is_nat_case(M, a, is_b, k, z) == 
paulson
parents: 13348
diff changeset
   196
       (empty(M,k) --> z=a) &
paulson
parents: 13348
diff changeset
   197
       (\<forall>m[M]. successor(M,m,k) --> is_b(m,z)) &
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
   198
       (is_quasinat(M,k) | empty(M,z))"
13350
paulson
parents: 13348
diff changeset
   199
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   200
  relativize1 :: "[i=>o, [i,i]=>o, i=>i] => o"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   201
    "relativize1(M,is_f,f) == \<forall>x[M]. \<forall>y[M]. is_f(x,y) <-> y = f(x)"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   202
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   203
  Relativize1 :: "[i=>o, i, [i,i]=>o, i=>i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   204
    --{*as above, but typed*}
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   205
    "Relativize1(M,A,is_f,f) == 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   206
        \<forall>x[M]. \<forall>y[M]. x\<in>A --> is_f(x,y) <-> y = f(x)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   207
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   208
  relativize2 :: "[i=>o, [i,i,i]=>o, [i,i]=>i] => o"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   209
    "relativize2(M,is_f,f) == \<forall>x[M]. \<forall>y[M]. \<forall>z[M]. is_f(x,y,z) <-> z = f(x,y)"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   210
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   211
  Relativize2 :: "[i=>o, i, i, [i,i,i]=>o, [i,i]=>i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   212
    "Relativize2(M,A,B,is_f,f) ==
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   213
        \<forall>x[M]. \<forall>y[M]. \<forall>z[M]. x\<in>A --> y\<in>B --> is_f(x,y,z) <-> z = f(x,y)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   214
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   215
  relativize3 :: "[i=>o, [i,i,i,i]=>o, [i,i,i]=>i] => o"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   216
    "relativize3(M,is_f,f) == 
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   217
       \<forall>x[M]. \<forall>y[M]. \<forall>z[M]. \<forall>u[M]. is_f(x,y,z,u) <-> u = f(x,y,z)"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   218
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   219
  Relativize3 :: "[i=>o, i, i, i, [i,i,i,i]=>o, [i,i,i]=>i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   220
    "Relativize3(M,A,B,C,is_f,f) == 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   221
       \<forall>x[M]. \<forall>y[M]. \<forall>z[M]. \<forall>u[M]. 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   222
         x\<in>A --> y\<in>B --> z\<in>C --> is_f(x,y,z,u) <-> u = f(x,y,z)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   223
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   224
  relativize4 :: "[i=>o, [i,i,i,i,i]=>o, [i,i,i,i]=>i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   225
    "relativize4(M,is_f,f) == 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   226
       \<forall>u[M]. \<forall>x[M]. \<forall>y[M]. \<forall>z[M]. \<forall>a[M]. is_f(u,x,y,z,a) <-> a = f(u,x,y,z)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   227
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   228
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   229
text{*Useful when absoluteness reasoning has replaced the predicates by terms*}
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   230
lemma triv_Relativize1:
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   231
     "Relativize1(M, A, \<lambda>x y. y = f(x), f)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   232
by (simp add: Relativize1_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   233
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   234
lemma triv_Relativize2:
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   235
     "Relativize2(M, A, B, \<lambda>x y a. a = f(x,y), f)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   236
by (simp add: Relativize2_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   237
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   238
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   239
subsection {*The relativized ZF axioms*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   240
constdefs
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   241
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   242
  extensionality :: "(i=>o) => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   243
    "extensionality(M) == 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   244
	\<forall>x[M]. \<forall>y[M]. (\<forall>z[M]. z \<in> x <-> z \<in> y) --> x=y"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   245
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   246
  separation :: "[i=>o, i=>o] => o"
13563
paulson
parents: 13543
diff changeset
   247
    --{*The formula @{text P} should only involve parameters
paulson
parents: 13543
diff changeset
   248
        belonging to @{text M}.  But we can't prove separation as a scheme
paulson
parents: 13543
diff changeset
   249
        anyway.  Every instance that we need must individually be assumed
paulson
parents: 13543
diff changeset
   250
        and later proved.*}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   251
    "separation(M,P) == 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   252
	\<forall>z[M]. \<exists>y[M]. \<forall>x[M]. x \<in> y <-> x \<in> z & P(x)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   253
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   254
  upair_ax :: "(i=>o) => o"
13563
paulson
parents: 13543
diff changeset
   255
    "upair_ax(M) == \<forall>x[M]. \<forall>y[M]. \<exists>z[M]. upair(M,x,y,z)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   256
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   257
  Union_ax :: "(i=>o) => o"
13514
cc3bbaf1b8d3 tweaked
paulson
parents: 13505
diff changeset
   258
    "Union_ax(M) == \<forall>x[M]. \<exists>z[M]. big_union(M,x,z)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   259
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   260
  power_ax :: "(i=>o) => o"
13514
cc3bbaf1b8d3 tweaked
paulson
parents: 13505
diff changeset
   261
    "power_ax(M) == \<forall>x[M]. \<exists>z[M]. powerset(M,x,z)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   262
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   263
  univalent :: "[i=>o, i, [i,i]=>o] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   264
    "univalent(M,A,P) == 
13563
paulson
parents: 13543
diff changeset
   265
	(\<forall>x[M]. x\<in>A --> (\<forall>y[M]. \<forall>z[M]. P(x,y) & P(x,z) --> y=z))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   266
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   267
  replacement :: "[i=>o, [i,i]=>o] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   268
    "replacement(M,P) == 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   269
      \<forall>A[M]. univalent(M,A,P) -->
13514
cc3bbaf1b8d3 tweaked
paulson
parents: 13505
diff changeset
   270
      (\<exists>Y[M]. \<forall>b[M]. (\<exists>x[M]. x\<in>A & P(x,b)) --> b \<in> Y)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   271
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   272
  strong_replacement :: "[i=>o, [i,i]=>o] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   273
    "strong_replacement(M,P) == 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   274
      \<forall>A[M]. univalent(M,A,P) -->
13514
cc3bbaf1b8d3 tweaked
paulson
parents: 13505
diff changeset
   275
      (\<exists>Y[M]. \<forall>b[M]. b \<in> Y <-> (\<exists>x[M]. x\<in>A & P(x,b)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   276
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   277
  foundation_ax :: "(i=>o) => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   278
    "foundation_ax(M) == 
13563
paulson
parents: 13543
diff changeset
   279
	\<forall>x[M]. (\<exists>y[M]. y\<in>x) --> (\<exists>y[M]. y\<in>x & ~(\<exists>z[M]. z\<in>x & z \<in> y))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   280
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   281
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   282
subsection{*A trivial consistency proof for $V_\omega$ *}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   283
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   284
text{*We prove that $V_\omega$ 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   285
      (or @{text univ} in Isabelle) satisfies some ZF axioms.
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   286
     Kunen, Theorem IV 3.13, page 123.*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   287
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   288
lemma univ0_downwards_mem: "[| y \<in> x; x \<in> univ(0) |] ==> y \<in> univ(0)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   289
apply (insert Transset_univ [OF Transset_0])  
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   290
apply (simp add: Transset_def, blast) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   291
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   292
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   293
lemma univ0_Ball_abs [simp]: 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   294
     "A \<in> univ(0) ==> (\<forall>x\<in>A. x \<in> univ(0) --> P(x)) <-> (\<forall>x\<in>A. P(x))" 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   295
by (blast intro: univ0_downwards_mem) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   296
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   297
lemma univ0_Bex_abs [simp]: 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   298
     "A \<in> univ(0) ==> (\<exists>x\<in>A. x \<in> univ(0) & P(x)) <-> (\<exists>x\<in>A. P(x))" 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   299
by (blast intro: univ0_downwards_mem) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   300
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   301
text{*Congruence rule for separation: can assume the variable is in @{text M}*}
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
   302
lemma separation_cong [cong]:
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   303
     "(!!x. M(x) ==> P(x) <-> P'(x)) 
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   304
      ==> separation(M, %x. P(x)) <-> separation(M, %x. P'(x))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   305
by (simp add: separation_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   306
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
   307
lemma univalent_cong [cong]:
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   308
     "[| A=A'; !!x y. [| x\<in>A; M(x); M(y) |] ==> P(x,y) <-> P'(x,y) |] 
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   309
      ==> univalent(M, A, %x y. P(x,y)) <-> univalent(M, A', %x y. P'(x,y))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   310
by (simp add: univalent_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   311
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   312
lemma univalent_triv [intro,simp]:
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   313
     "univalent(M, A, \<lambda>x y. y = f(x))"
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   314
by (simp add: univalent_def) 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   315
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   316
lemma univalent_conjI2 [intro,simp]:
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   317
     "univalent(M,A,Q) ==> univalent(M, A, \<lambda>x y. P(x,y) & Q(x,y))"
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   318
by (simp add: univalent_def, blast) 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   319
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   320
text{*Congruence rule for replacement*}
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
   321
lemma strong_replacement_cong [cong]:
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   322
     "[| !!x y. [| M(x); M(y) |] ==> P(x,y) <-> P'(x,y) |] 
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   323
      ==> strong_replacement(M, %x y. P(x,y)) <-> 
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   324
          strong_replacement(M, %x y. P'(x,y))" 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   325
by (simp add: strong_replacement_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   326
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   327
text{*The extensionality axiom*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   328
lemma "extensionality(\<lambda>x. x \<in> univ(0))"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   329
apply (simp add: extensionality_def)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   330
apply (blast intro: univ0_downwards_mem) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   331
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   332
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   333
text{*The separation axiom requires some lemmas*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   334
lemma Collect_in_Vfrom:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   335
     "[| X \<in> Vfrom(A,j);  Transset(A) |] ==> Collect(X,P) \<in> Vfrom(A, succ(j))"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   336
apply (drule Transset_Vfrom)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   337
apply (rule subset_mem_Vfrom)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   338
apply (unfold Transset_def, blast)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   339
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   340
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   341
lemma Collect_in_VLimit:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   342
     "[| X \<in> Vfrom(A,i);  Limit(i);  Transset(A) |] 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   343
      ==> Collect(X,P) \<in> Vfrom(A,i)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   344
apply (rule Limit_VfromE, assumption+)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   345
apply (blast intro: Limit_has_succ VfromI Collect_in_Vfrom)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   346
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   347
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   348
lemma Collect_in_univ:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   349
     "[| X \<in> univ(A);  Transset(A) |] ==> Collect(X,P) \<in> univ(A)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   350
by (simp add: univ_def Collect_in_VLimit Limit_nat)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   351
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   352
lemma "separation(\<lambda>x. x \<in> univ(0), P)"
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   353
apply (simp add: separation_def, clarify) 
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   354
apply (rule_tac x = "Collect(z,P)" in bexI) 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   355
apply (blast intro: Collect_in_univ Transset_0)+
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   356
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   357
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   358
text{*Unordered pairing axiom*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   359
lemma "upair_ax(\<lambda>x. x \<in> univ(0))"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   360
apply (simp add: upair_ax_def upair_def)  
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   361
apply (blast intro: doubleton_in_univ) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   362
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   363
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   364
text{*Union axiom*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   365
lemma "Union_ax(\<lambda>x. x \<in> univ(0))"  
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   366
apply (simp add: Union_ax_def big_union_def, clarify) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   367
apply (rule_tac x="\<Union>x" in bexI)  
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   368
 apply (blast intro: univ0_downwards_mem)
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   369
apply (blast intro: Union_in_univ Transset_0) 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   370
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   371
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   372
text{*Powerset axiom*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   373
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   374
lemma Pow_in_univ:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   375
     "[| X \<in> univ(A);  Transset(A) |] ==> Pow(X) \<in> univ(A)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   376
apply (simp add: univ_def Pow_in_VLimit Limit_nat)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   377
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   378
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   379
lemma "power_ax(\<lambda>x. x \<in> univ(0))"  
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   380
apply (simp add: power_ax_def powerset_def subset_def, clarify) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   381
apply (rule_tac x="Pow(x)" in bexI)
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   382
 apply (blast intro: univ0_downwards_mem)
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   383
apply (blast intro: Pow_in_univ Transset_0) 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   384
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   385
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   386
text{*Foundation axiom*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   387
lemma "foundation_ax(\<lambda>x. x \<in> univ(0))"  
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   388
apply (simp add: foundation_ax_def, clarify)
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   389
apply (cut_tac A=x in foundation) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   390
apply (blast intro: univ0_downwards_mem)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   391
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   392
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   393
lemma "replacement(\<lambda>x. x \<in> univ(0), P)"  
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   394
apply (simp add: replacement_def, clarify) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   395
oops
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   396
text{*no idea: maybe prove by induction on the rank of A?*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   397
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   398
text{*Still missing: Replacement, Choice*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   399
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   400
subsection{*lemmas needed to reduce some set constructions to instances
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   401
      of Separation*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   402
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   403
lemma image_iff_Collect: "r `` A = {y \<in> Union(Union(r)). \<exists>p\<in>r. \<exists>x\<in>A. p=<x,y>}"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   404
apply (rule equalityI, auto) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   405
apply (simp add: Pair_def, blast) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   406
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   407
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   408
lemma vimage_iff_Collect:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   409
     "r -`` A = {x \<in> Union(Union(r)). \<exists>p\<in>r. \<exists>y\<in>A. p=<x,y>}"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   410
apply (rule equalityI, auto) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   411
apply (simp add: Pair_def, blast) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   412
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   413
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   414
text{*These two lemmas lets us prove @{text domain_closed} and 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   415
      @{text range_closed} without new instances of separation*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   416
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   417
lemma domain_eq_vimage: "domain(r) = r -`` Union(Union(r))"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   418
apply (rule equalityI, auto)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   419
apply (rule vimageI, assumption)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   420
apply (simp add: Pair_def, blast) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   421
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   422
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   423
lemma range_eq_image: "range(r) = r `` Union(Union(r))"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   424
apply (rule equalityI, auto)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   425
apply (rule imageI, assumption)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   426
apply (simp add: Pair_def, blast) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   427
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   428
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   429
lemma replacementD:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   430
    "[| replacement(M,P); M(A);  univalent(M,A,P) |]
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   431
     ==> \<exists>Y[M]. (\<forall>b[M]. ((\<exists>x[M]. x\<in>A & P(x,b)) --> b \<in> Y))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   432
by (simp add: replacement_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   433
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   434
lemma strong_replacementD:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   435
    "[| strong_replacement(M,P); M(A);  univalent(M,A,P) |]
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   436
     ==> \<exists>Y[M]. (\<forall>b[M]. (b \<in> Y <-> (\<exists>x[M]. x\<in>A & P(x,b))))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   437
by (simp add: strong_replacement_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   438
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   439
lemma separationD:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   440
    "[| separation(M,P); M(z) |] ==> \<exists>y[M]. \<forall>x[M]. x \<in> y <-> x \<in> z & P(x)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   441
by (simp add: separation_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   442
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   443
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   444
text{*More constants, for order types*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   445
constdefs
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   446
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   447
  order_isomorphism :: "[i=>o,i,i,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   448
    "order_isomorphism(M,A,r,B,s,f) == 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   449
        bijection(M,A,B,f) & 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   450
        (\<forall>x[M]. x\<in>A --> (\<forall>y[M]. y\<in>A -->
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   451
          (\<forall>p[M]. \<forall>fx[M]. \<forall>fy[M]. \<forall>q[M].
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   452
            pair(M,x,y,p) --> fun_apply(M,f,x,fx) --> fun_apply(M,f,y,fy) --> 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   453
            pair(M,fx,fy,q) --> (p\<in>r <-> q\<in>s))))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   454
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   455
  pred_set :: "[i=>o,i,i,i,i] => o"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   456
    "pred_set(M,A,x,r,B) == 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   457
	\<forall>y[M]. y \<in> B <-> (\<exists>p[M]. p\<in>r & y \<in> A & pair(M,y,x,p))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   458
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   459
  membership :: "[i=>o,i,i] => o" --{*membership relation*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   460
    "membership(M,A,r) == 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   461
	\<forall>p[M]. p \<in> r <-> (\<exists>x[M]. x\<in>A & (\<exists>y[M]. y\<in>A & x\<in>y & pair(M,x,y,p)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   462
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   463
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   464
subsection{*Introducing a Transitive Class Model*}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   465
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   466
text{*The class M is assumed to be transitive and to satisfy some
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   467
      relativized ZF axioms*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   468
locale M_trivial =
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   469
  fixes M
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   470
  assumes transM:           "[| y\<in>x; M(x) |] ==> M(y)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   471
      and nonempty [simp]:  "M(0)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   472
      and upair_ax:	    "upair_ax(M)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   473
      and Union_ax:	    "Union_ax(M)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   474
      and power_ax:         "power_ax(M)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   475
      and replacement:      "replacement(M,P)"
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   476
      and M_nat [iff]:      "M(nat)"           (*i.e. the axiom of infinity*)
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   477
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   478
lemma (in M_trivial) rall_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   479
     "M(A) ==> (\<forall>x[M]. x\<in>A --> P(x)) <-> (\<forall>x\<in>A. P(x))" 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   480
by (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   481
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   482
lemma (in M_trivial) rex_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   483
     "M(A) ==> (\<exists>x[M]. x\<in>A & P(x)) <-> (\<exists>x\<in>A. P(x))" 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   484
by (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   485
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   486
lemma (in M_trivial) ball_iff_equiv: 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   487
     "M(A) ==> (\<forall>x[M]. (x\<in>A <-> P(x))) <-> 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   488
               (\<forall>x\<in>A. P(x)) & (\<forall>x. P(x) --> M(x) --> x\<in>A)" 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   489
by (blast intro: transM)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   490
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   491
text{*Simplifies proofs of equalities when there's an iff-equality
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   492
      available for rewriting, universally quantified over M. *}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   493
lemma (in M_trivial) M_equalityI: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   494
     "[| !!x. M(x) ==> x\<in>A <-> x\<in>B; M(A); M(B) |] ==> A=B"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   495
by (blast intro!: equalityI dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   496
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   497
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   498
subsubsection{*Trivial Absoluteness Proofs: Empty Set, Pairs, etc.*}
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   499
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   500
lemma (in M_trivial) empty_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   501
     "M(z) ==> empty(M,z) <-> z=0"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   502
apply (simp add: empty_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   503
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   504
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   505
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   506
lemma (in M_trivial) subset_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   507
     "M(A) ==> subset(M,A,B) <-> A \<subseteq> B"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   508
apply (simp add: subset_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   509
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   510
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   511
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   512
lemma (in M_trivial) upair_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   513
     "M(z) ==> upair(M,a,b,z) <-> z={a,b}"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   514
apply (simp add: upair_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   515
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   516
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   517
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   518
lemma (in M_trivial) upair_in_M_iff [iff]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   519
     "M({a,b}) <-> M(a) & M(b)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   520
apply (insert upair_ax, simp add: upair_ax_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   521
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   522
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   523
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   524
lemma (in M_trivial) singleton_in_M_iff [iff]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   525
     "M({a}) <-> M(a)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   526
by (insert upair_in_M_iff [of a a], simp) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   527
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   528
lemma (in M_trivial) pair_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   529
     "M(z) ==> pair(M,a,b,z) <-> z=<a,b>"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   530
apply (simp add: pair_def ZF.Pair_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   531
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   532
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   533
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   534
lemma (in M_trivial) pair_in_M_iff [iff]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   535
     "M(<a,b>) <-> M(a) & M(b)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   536
by (simp add: ZF.Pair_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   537
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   538
lemma (in M_trivial) pair_components_in_M:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   539
     "[| <x,y> \<in> A; M(A) |] ==> M(x) & M(y)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   540
apply (simp add: Pair_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   541
apply (blast dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   542
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   543
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   544
lemma (in M_trivial) cartprod_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   545
     "[| M(A); M(B); M(z) |] ==> cartprod(M,A,B,z) <-> z = A*B"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   546
apply (simp add: cartprod_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   547
apply (rule iffI) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   548
 apply (blast intro!: equalityI intro: transM dest!: rspec) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   549
apply (blast dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   550
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   551
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   552
subsubsection{*Absoluteness for Unions and Intersections*}
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   553
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   554
lemma (in M_trivial) union_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   555
     "[| M(a); M(b); M(z) |] ==> union(M,a,b,z) <-> z = a Un b"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   556
apply (simp add: union_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   557
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   558
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   559
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   560
lemma (in M_trivial) inter_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   561
     "[| M(a); M(b); M(z) |] ==> inter(M,a,b,z) <-> z = a Int b"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   562
apply (simp add: inter_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   563
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   564
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   565
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   566
lemma (in M_trivial) setdiff_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   567
     "[| M(a); M(b); M(z) |] ==> setdiff(M,a,b,z) <-> z = a-b"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   568
apply (simp add: setdiff_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   569
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   570
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   571
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   572
lemma (in M_trivial) Union_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   573
     "[| M(A); M(z) |] ==> big_union(M,A,z) <-> z = Union(A)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   574
apply (simp add: big_union_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   575
apply (blast intro!: equalityI dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   576
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   577
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   578
lemma (in M_trivial) Union_closed [intro,simp]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   579
     "M(A) ==> M(Union(A))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   580
by (insert Union_ax, simp add: Union_ax_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   581
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   582
lemma (in M_trivial) Un_closed [intro,simp]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   583
     "[| M(A); M(B) |] ==> M(A Un B)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   584
by (simp only: Un_eq_Union, blast) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   585
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   586
lemma (in M_trivial) cons_closed [intro,simp]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   587
     "[| M(a); M(A) |] ==> M(cons(a,A))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   588
by (subst cons_eq [symmetric], blast) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   589
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   590
lemma (in M_trivial) cons_abs [simp]: 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   591
     "[| M(b); M(z) |] ==> is_cons(M,a,b,z) <-> z = cons(a,b)"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   592
by (simp add: is_cons_def, blast intro: transM)  
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   593
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   594
lemma (in M_trivial) successor_abs [simp]: 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   595
     "[| M(a); M(z) |] ==> successor(M,a,z) <-> z = succ(a)"
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   596
by (simp add: successor_def, blast)  
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   597
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   598
lemma (in M_trivial) succ_in_M_iff [iff]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   599
     "M(succ(a)) <-> M(a)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   600
apply (simp add: succ_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   601
apply (blast intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   602
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   603
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   604
subsubsection{*Absoluteness for Separation and Replacement*}
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   605
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   606
lemma (in M_trivial) separation_closed [intro,simp]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   607
     "[| separation(M,P); M(A) |] ==> M(Collect(A,P))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   608
apply (insert separation, simp add: separation_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   609
apply (drule rspec, assumption, clarify) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   610
apply (subgoal_tac "y = Collect(A,P)", blast)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   611
apply (blast dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   612
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   613
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   614
lemma separation_iff:
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   615
     "separation(M,P) <-> (\<forall>z[M]. \<exists>y[M]. is_Collect(M,z,P,y))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   616
by (simp add: separation_def is_Collect_def) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   617
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   618
lemma (in M_trivial) Collect_abs [simp]: 
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   619
     "[| M(A); M(z) |] ==> is_Collect(M,A,P,z) <-> z = Collect(A,P)"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   620
apply (simp add: is_Collect_def)
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   621
apply (blast intro!: equalityI dest: transM)
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   622
done
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   623
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   624
text{*Probably the premise and conclusion are equivalent*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   625
lemma (in M_trivial) strong_replacementI [rule_format]:
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   626
    "[| \<forall>A[M]. separation(M, %u. \<exists>x[M]. x\<in>A & P(x,u)) |]
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   627
     ==> strong_replacement(M,P)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   628
apply (simp add: strong_replacement_def, clarify) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   629
apply (frule replacementD [OF replacement], assumption, clarify) 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   630
apply (drule_tac x=A in rspec, clarify)  
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   631
apply (drule_tac z=Y in separationD, assumption, clarify) 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   632
apply (rule_tac x=y in rexI) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   633
apply (blast dest: transM)+
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   634
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   635
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   636
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   637
subsubsection{*The Operator @{term is_Replace}*}
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   638
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   639
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   640
lemma is_Replace_cong [cong]:
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   641
     "[| A=A'; 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   642
         !!x y. [| M(x); M(y) |] ==> P(x,y) <-> P'(x,y);
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   643
         z=z' |] 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   644
      ==> is_Replace(M, A, %x y. P(x,y), z) <-> 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   645
          is_Replace(M, A', %x y. P'(x,y), z')" 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   646
by (simp add: is_Replace_def) 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   647
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   648
lemma (in M_trivial) univalent_Replace_iff: 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   649
     "[| M(A); univalent(M,A,P);
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   650
         !!x y. [| x\<in>A; P(x,y) |] ==> M(y) |] 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   651
      ==> u \<in> Replace(A,P) <-> (\<exists>x. x\<in>A & P(x,u))"
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   652
apply (simp add: Replace_iff univalent_def) 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   653
apply (blast dest: transM)
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   654
done
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   655
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   656
(*The last premise expresses that P takes M to M*)
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   657
lemma (in M_trivial) strong_replacement_closed [intro,simp]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   658
     "[| strong_replacement(M,P); M(A); univalent(M,A,P); 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   659
         !!x y. [| x\<in>A; P(x,y) |] ==> M(y) |] ==> M(Replace(A,P))"
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   660
apply (simp add: strong_replacement_def) 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   661
apply (drule_tac x=A in rspec, safe) 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   662
apply (subgoal_tac "Replace(A,P) = Y")
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   663
 apply simp 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   664
apply (rule equality_iffI)
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   665
apply (simp add: univalent_Replace_iff)
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   666
apply (blast dest: transM) 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   667
done
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   668
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   669
lemma (in M_trivial) Replace_abs: 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   670
     "[| M(A); M(z); univalent(M,A,P); strong_replacement(M, P);
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   671
         !!x y. [| x\<in>A; P(x,y) |] ==> M(y)  |] 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   672
      ==> is_Replace(M,A,P,z) <-> z = Replace(A,P)"
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   673
apply (simp add: is_Replace_def)
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   674
apply (rule iffI) 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   675
apply (rule M_equalityI) 
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
   676
apply (simp_all add: univalent_Replace_iff, blast, blast) 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   677
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   678
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   679
(*The first premise can't simply be assumed as a schema.
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   680
  It is essential to take care when asserting instances of Replacement.
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   681
  Let K be a nonconstructible subset of nat and define
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   682
  f(x) = x if x:K and f(x)=0 otherwise.  Then RepFun(nat,f) = cons(0,K), a 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   683
  nonconstructible set.  So we cannot assume that M(X) implies M(RepFun(X,f))
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   684
  even for f : M -> M.
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   685
*)
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   686
lemma (in M_trivial) RepFun_closed:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   687
     "[| strong_replacement(M, \<lambda>x y. y = f(x)); M(A); \<forall>x\<in>A. M(f(x)) |]
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   688
      ==> M(RepFun(A,f))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   689
apply (simp add: RepFun_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   690
apply (rule strong_replacement_closed) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   691
apply (auto dest: transM  simp add: univalent_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   692
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   693
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   694
lemma Replace_conj_eq: "{y . x \<in> A, x\<in>A & y=f(x)} = {y . x\<in>A, y=f(x)}"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   695
by simp
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   696
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   697
text{*Better than @{text RepFun_closed} when having the formula @{term "x\<in>A"}
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   698
      makes relativization easier.*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   699
lemma (in M_trivial) RepFun_closed2:
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   700
     "[| strong_replacement(M, \<lambda>x y. x\<in>A & y = f(x)); M(A); \<forall>x\<in>A. M(f(x)) |]
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   701
      ==> M(RepFun(A, %x. f(x)))"
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   702
apply (simp add: RepFun_def)
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   703
apply (frule strong_replacement_closed, assumption)
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   704
apply (auto dest: transM  simp add: Replace_conj_eq univalent_def) 
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   705
done
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   706
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   707
subsubsection {*Absoluteness for @{term Lambda}*}
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   708
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   709
constdefs
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   710
 is_lambda :: "[i=>o, i, [i,i]=>o, i] => o"
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   711
    "is_lambda(M, A, is_b, z) == 
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   712
       \<forall>p[M]. p \<in> z <->
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   713
        (\<exists>u[M]. \<exists>v[M]. u\<in>A & pair(M,u,v,p) & is_b(u,v))"
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   714
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   715
lemma (in M_trivial) lam_closed:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   716
     "[| strong_replacement(M, \<lambda>x y. y = <x,b(x)>); M(A); \<forall>x\<in>A. M(b(x)) |]
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   717
      ==> M(\<lambda>x\<in>A. b(x))"
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   718
by (simp add: lam_def, blast intro: RepFun_closed dest: transM) 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   719
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   720
text{*Better than @{text lam_closed}: has the formula @{term "x\<in>A"}*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   721
lemma (in M_trivial) lam_closed2:
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   722
  "[|strong_replacement(M, \<lambda>x y. x\<in>A & y = \<langle>x, b(x)\<rangle>);
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   723
     M(A); \<forall>m[M]. m\<in>A --> M(b(m))|] ==> M(Lambda(A,b))"
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   724
apply (simp add: lam_def)
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   725
apply (blast intro: RepFun_closed2 dest: transM)  
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   726
done
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   727
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   728
lemma (in M_trivial) lambda_abs2 [simp]: 
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   729
     "[| strong_replacement(M, \<lambda>x y. x\<in>A & y = \<langle>x, b(x)\<rangle>);
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   730
         Relativize1(M,A,is_b,b); M(A); \<forall>m[M]. m\<in>A --> M(b(m)); M(z) |] 
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   731
      ==> is_lambda(M,A,is_b,z) <-> z = Lambda(A,b)"
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   732
apply (simp add: Relativize1_def is_lambda_def)
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   733
apply (rule iffI)
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   734
 prefer 2 apply (simp add: lam_def) 
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   735
apply (rule M_equalityI)
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   736
  apply (simp add: lam_def) 
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   737
 apply (simp add: lam_closed2)+
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   738
done
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   739
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   740
lemma is_lambda_cong [cong]:
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   741
     "[| A=A';  z=z'; 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   742
         !!x y. [| x\<in>A; M(x); M(y) |] ==> is_b(x,y) <-> is_b'(x,y) |] 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   743
      ==> is_lambda(M, A, %x y. is_b(x,y), z) <-> 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   744
          is_lambda(M, A', %x y. is_b'(x,y), z')" 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   745
by (simp add: is_lambda_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
   746
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   747
lemma (in M_trivial) image_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   748
     "[| M(r); M(A); M(z) |] ==> image(M,r,A,z) <-> z = r``A"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   749
apply (simp add: image_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   750
apply (rule iffI) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   751
 apply (blast intro!: equalityI dest: transM, blast) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   752
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   753
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   754
text{*What about @{text Pow_abs}?  Powerset is NOT absolute!
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   755
      This result is one direction of absoluteness.*}
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   756
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   757
lemma (in M_trivial) powerset_Pow: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   758
     "powerset(M, x, Pow(x))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   759
by (simp add: powerset_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   760
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   761
text{*But we can't prove that the powerset in @{text M} includes the
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   762
      real powerset.*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   763
lemma (in M_trivial) powerset_imp_subset_Pow: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   764
     "[| powerset(M,x,y); M(y) |] ==> y <= Pow(x)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   765
apply (simp add: powerset_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   766
apply (blast dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   767
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   768
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   769
subsubsection{*Absoluteness for the Natural Numbers*}
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   770
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   771
lemma (in M_trivial) nat_into_M [intro]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   772
     "n \<in> nat ==> M(n)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   773
by (induct n rule: nat_induct, simp_all)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   774
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   775
lemma (in M_trivial) nat_case_closed [intro,simp]:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   776
  "[|M(k); M(a); \<forall>m[M]. M(b(m))|] ==> M(nat_case(a,b,k))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   777
apply (case_tac "k=0", simp) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   778
apply (case_tac "\<exists>m. k = succ(m)", force)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   779
apply (simp add: nat_case_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   780
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   781
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   782
lemma (in M_trivial) quasinat_abs [simp]: 
13350
paulson
parents: 13348
diff changeset
   783
     "M(z) ==> is_quasinat(M,z) <-> quasinat(z)"
paulson
parents: 13348
diff changeset
   784
by (auto simp add: is_quasinat_def quasinat_def)
paulson
parents: 13348
diff changeset
   785
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   786
lemma (in M_trivial) nat_case_abs [simp]: 
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   787
     "[| relativize1(M,is_b,b); M(k); M(z) |] 
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   788
      ==> is_nat_case(M,a,is_b,k,z) <-> z = nat_case(a,b,k)"
13350
paulson
parents: 13348
diff changeset
   789
apply (case_tac "quasinat(k)") 
paulson
parents: 13348
diff changeset
   790
 prefer 2 
paulson
parents: 13348
diff changeset
   791
 apply (simp add: is_nat_case_def non_nat_case) 
paulson
parents: 13348
diff changeset
   792
 apply (force simp add: quasinat_def) 
paulson
parents: 13348
diff changeset
   793
apply (simp add: quasinat_def is_nat_case_def)
paulson
parents: 13348
diff changeset
   794
apply (elim disjE exE) 
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
   795
 apply (simp_all add: relativize1_def) 
13350
paulson
parents: 13348
diff changeset
   796
done
paulson
parents: 13348
diff changeset
   797
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
   798
(*NOT for the simplifier.  The assumption M(z') is apparently necessary, but 
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
   799
  causes the error "Failed congruence proof!"  It may be better to replace
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13353
diff changeset
   800
  is_nat_case by nat_case before attempting congruence reasoning.*)
13434
78b93a667c01 better sats rules for higher-order operators
paulson
parents: 13428
diff changeset
   801
lemma is_nat_case_cong:
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
   802
     "[| a = a'; k = k';  z = z';  M(z');
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
   803
       !!x y. [| M(x); M(y) |] ==> is_b(x,y) <-> is_b'(x,y) |]
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
   804
      ==> is_nat_case(M, a, is_b, k, z) <-> is_nat_case(M, a', is_b', k', z')"
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
   805
by (simp add: is_nat_case_def) 
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
   806
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   807
13418
7c0ba9dba978 tweaks, aiming towards relativization of "satisfies"
paulson
parents: 13397
diff changeset
   808
subsection{*Absoluteness for Ordinals*}
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   809
text{*These results constitute Theorem IV 5.1 of Kunen (page 126).*}
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   810
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   811
lemma (in M_trivial) lt_closed:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   812
     "[| j<i; M(i) |] ==> M(j)" 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   813
by (blast dest: ltD intro: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   814
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   815
lemma (in M_trivial) transitive_set_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   816
     "M(a) ==> transitive_set(M,a) <-> Transset(a)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   817
by (simp add: transitive_set_def Transset_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   818
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   819
lemma (in M_trivial) ordinal_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   820
     "M(a) ==> ordinal(M,a) <-> Ord(a)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   821
by (simp add: ordinal_def Ord_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   822
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   823
lemma (in M_trivial) limit_ordinal_abs [simp]: 
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents: 13535
diff changeset
   824
     "M(a) ==> limit_ordinal(M,a) <-> Limit(a)" 
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents: 13535
diff changeset
   825
apply (unfold Limit_def limit_ordinal_def) 
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents: 13535
diff changeset
   826
apply (simp add: Ord_0_lt_iff) 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   827
apply (simp add: lt_def, blast) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   828
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   829
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   830
lemma (in M_trivial) successor_ordinal_abs [simp]: 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   831
     "M(a) ==> successor_ordinal(M,a) <-> Ord(a) & (\<exists>b[M]. a = succ(b))"
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   832
apply (simp add: successor_ordinal_def, safe)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   833
apply (drule Ord_cases_disj, auto) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   834
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   835
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   836
lemma finite_Ord_is_nat:
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   837
      "[| Ord(a); ~ Limit(a); \<forall>x\<in>a. ~ Limit(x) |] ==> a \<in> nat"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   838
by (induct a rule: trans_induct3, simp_all)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   839
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   840
lemma naturals_not_limit: "a \<in> nat ==> ~ Limit(a)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   841
by (induct a rule: nat_induct, auto)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   842
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   843
lemma (in M_trivial) finite_ordinal_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   844
     "M(a) ==> finite_ordinal(M,a) <-> a \<in> nat"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   845
apply (simp add: finite_ordinal_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   846
apply (blast intro: finite_Ord_is_nat intro: nat_into_Ord 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   847
             dest: Ord_trans naturals_not_limit)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   848
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   849
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   850
lemma Limit_non_Limit_implies_nat:
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   851
     "[| Limit(a); \<forall>x\<in>a. ~ Limit(x) |] ==> a = nat"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   852
apply (rule le_anti_sym) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   853
apply (rule all_lt_imp_le, blast, blast intro: Limit_is_Ord)  
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   854
 apply (simp add: lt_def)  
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   855
 apply (blast intro: Ord_in_Ord Ord_trans finite_Ord_is_nat) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   856
apply (erule nat_le_Limit)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   857
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   858
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   859
lemma (in M_trivial) omega_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   860
     "M(a) ==> omega(M,a) <-> a = nat"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   861
apply (simp add: omega_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   862
apply (blast intro: Limit_non_Limit_implies_nat dest: naturals_not_limit)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   863
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   864
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   865
lemma (in M_trivial) number1_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   866
     "M(a) ==> number1(M,a) <-> a = 1"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   867
by (simp add: number1_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   868
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   869
lemma (in M_trivial) number2_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   870
     "M(a) ==> number2(M,a) <-> a = succ(1)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   871
by (simp add: number2_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   872
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   873
lemma (in M_trivial) number3_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   874
     "M(a) ==> number3(M,a) <-> a = succ(succ(1))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   875
by (simp add: number3_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   876
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   877
text{*Kunen continued to 20...*}
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   878
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   879
(*Could not get this to work.  The \<lambda>x\<in>nat is essential because everything 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   880
  but the recursion variable must stay unchanged.  But then the recursion
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   881
  equations only hold for x\<in>nat (or in some other set) and not for the 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   882
  whole of the class M.
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   883
  consts
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   884
    natnumber_aux :: "[i=>o,i] => i"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   885
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   886
  primrec
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   887
      "natnumber_aux(M,0) = (\<lambda>x\<in>nat. if empty(M,x) then 1 else 0)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   888
      "natnumber_aux(M,succ(n)) = 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   889
	   (\<lambda>x\<in>nat. if (\<exists>y[M]. natnumber_aux(M,n)`y=1 & successor(M,y,x)) 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   890
		     then 1 else 0)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   891
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   892
  constdefs
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   893
    natnumber :: "[i=>o,i,i] => o"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   894
      "natnumber(M,n,x) == natnumber_aux(M,n)`x = 1"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   895
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   896
  lemma (in M_trivial) [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   897
       "natnumber(M,0,x) == x=0"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   898
*)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   899
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   900
subsection{*Some instances of separation and strong replacement*}
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   901
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   902
locale M_basic = M_trivial +
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
   903
assumes Inter_separation:
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   904
     "M(A) ==> separation(M, \<lambda>x. \<forall>y[M]. y\<in>A --> x\<in>y)"
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   905
  and Diff_separation:
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
   906
     "M(B) ==> separation(M, \<lambda>x. x \<notin> B)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   907
  and cartprod_separation:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   908
     "[| M(A); M(B) |] 
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
   909
      ==> separation(M, \<lambda>z. \<exists>x[M]. x\<in>A & (\<exists>y[M]. y\<in>B & pair(M,x,y,z)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   910
  and image_separation:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   911
     "[| M(A); M(r) |] 
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   912
      ==> separation(M, \<lambda>y. \<exists>p[M]. p\<in>r & (\<exists>x[M]. x\<in>A & pair(M,x,y,p)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   913
  and converse_separation:
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
   914
     "M(r) ==> separation(M, 
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
   915
         \<lambda>z. \<exists>p[M]. p\<in>r & (\<exists>x[M]. \<exists>y[M]. pair(M,x,y,p) & pair(M,y,x,z)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   916
  and restrict_separation:
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   917
     "M(A) ==> separation(M, \<lambda>z. \<exists>x[M]. x\<in>A & (\<exists>y[M]. pair(M,x,y,z)))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   918
  and comp_separation:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   919
     "[| M(r); M(s) |]
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   920
      ==> separation(M, \<lambda>xz. \<exists>x[M]. \<exists>y[M]. \<exists>z[M]. \<exists>xy[M]. \<exists>yz[M]. 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   921
		  pair(M,x,z,xz) & pair(M,x,y,xy) & pair(M,y,z,yz) & 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   922
                  xy\<in>s & yz\<in>r)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   923
  and pred_separation:
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
   924
     "[| M(r); M(x) |] ==> separation(M, \<lambda>y. \<exists>p[M]. p\<in>r & pair(M,y,x,p))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   925
  and Memrel_separation:
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13290
diff changeset
   926
     "separation(M, \<lambda>z. \<exists>x[M]. \<exists>y[M]. pair(M,x,y,z) & x \<in> y)"
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   927
  and funspace_succ_replacement:
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
   928
     "M(n) ==> 
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   929
      strong_replacement(M, \<lambda>p z. \<exists>f[M]. \<exists>b[M]. \<exists>nb[M]. \<exists>cnbf[M]. 
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   930
                pair(M,f,b,p) & pair(M,n,b,nb) & is_cons(M,nb,f,cnbf) &
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   931
                upair(M,cnbf,cnbf,z))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   932
  and well_ord_iso_separation:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   933
     "[| M(A); M(f); M(r) |] 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   934
      ==> separation (M, \<lambda>x. x\<in>A --> (\<exists>y[M]. (\<exists>p[M]. 
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
   935
		     fun_apply(M,f,x,y) & pair(M,y,x,p) & p \<in> r)))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   936
  and obase_separation:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   937
     --{*part of the order type formalization*}
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   938
     "[| M(A); M(r) |] 
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   939
      ==> separation(M, \<lambda>a. \<exists>x[M]. \<exists>g[M]. \<exists>mx[M]. \<exists>par[M]. 
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   940
	     ordinal(M,x) & membership(M,x,mx) & pred_set(M,A,a,r,par) &
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   941
	     order_isomorphism(M,par,r,x,mx,g))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   942
  and obase_equals_separation:
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   943
     "[| M(A); M(r) |] 
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13306
diff changeset
   944
      ==> separation (M, \<lambda>x. x\<in>A --> ~(\<exists>y[M]. \<exists>g[M]. 
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13306
diff changeset
   945
			      ordinal(M,y) & (\<exists>my[M]. \<exists>pxr[M]. 
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13306
diff changeset
   946
			      membership(M,y,my) & pred_set(M,A,x,r,pxr) &
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13306
diff changeset
   947
			      order_isomorphism(M,pxr,r,y,my,g))))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   948
  and omap_replacement:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   949
     "[| M(A); M(r) |] 
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   950
      ==> strong_replacement(M,
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   951
             \<lambda>a z. \<exists>x[M]. \<exists>g[M]. \<exists>mx[M]. \<exists>par[M]. 
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   952
	     ordinal(M,x) & pair(M,a,x,z) & membership(M,x,mx) & 
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
   953
	     pred_set(M,A,a,r,par) & order_isomorphism(M,par,r,x,mx,g))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   954
  and is_recfun_separation:
13319
23de7b3af453 More Separation proofs
paulson
parents: 13316
diff changeset
   955
     --{*for well-founded recursion*}
23de7b3af453 More Separation proofs
paulson
parents: 13316
diff changeset
   956
     "[| M(r); M(f); M(g); M(a); M(b) |] 
23de7b3af453 More Separation proofs
paulson
parents: 13316
diff changeset
   957
     ==> separation(M, 
23de7b3af453 More Separation proofs
paulson
parents: 13316
diff changeset
   958
            \<lambda>x. \<exists>xa[M]. \<exists>xb[M]. 
23de7b3af453 More Separation proofs
paulson
parents: 13316
diff changeset
   959
                pair(M,x,a,xa) & xa \<in> r & pair(M,x,b,xb) & xb \<in> r & 
23de7b3af453 More Separation proofs
paulson
parents: 13316
diff changeset
   960
                (\<exists>fx[M]. \<exists>gx[M]. fun_apply(M,f,x,fx) & fun_apply(M,g,x,gx) & 
23de7b3af453 More Separation proofs
paulson
parents: 13316
diff changeset
   961
                                   fx \<noteq> gx))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   962
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   963
lemma (in M_basic) cartprod_iff_lemma:
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
   964
     "[| M(C);  \<forall>u[M]. u \<in> C <-> (\<exists>x\<in>A. \<exists>y\<in>B. u = {{x}, {x,y}}); 
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
   965
         powerset(M, A \<union> B, p1); powerset(M, p1, p2);  M(p2) |]
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   966
       ==> C = {u \<in> p2 . \<exists>x\<in>A. \<exists>y\<in>B. u = {{x}, {x,y}}}"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   967
apply (simp add: powerset_def) 
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
   968
apply (rule equalityI, clarify, simp)
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
   969
 apply (frule transM, assumption) 
13611
2edf034c902a Adapted to new simplifier.
berghofe
parents: 13564
diff changeset
   970
 apply (frule transM, assumption, simp (no_asm_simp))
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   971
 apply blast 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   972
apply clarify
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   973
apply (frule transM, assumption, force) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   974
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   975
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   976
lemma (in M_basic) cartprod_iff:
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   977
     "[| M(A); M(B); M(C) |] 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   978
      ==> cartprod(M,A,B,C) <-> 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   979
          (\<exists>p1 p2. M(p1) & M(p2) & powerset(M,A Un B,p1) & powerset(M,p1,p2) &
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   980
                   C = {z \<in> p2. \<exists>x\<in>A. \<exists>y\<in>B. z = <x,y>})"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   981
apply (simp add: Pair_def cartprod_def, safe)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   982
defer 1 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   983
  apply (simp add: powerset_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   984
 apply blast 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   985
txt{*Final, difficult case: the left-to-right direction of the theorem.*}
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   986
apply (insert power_ax, simp add: power_ax_def) 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   987
apply (frule_tac x="A Un B" and P="\<lambda>x. rex(M,?Q(x))" in rspec) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   988
apply (blast, clarify) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   989
apply (drule_tac x=z and P="\<lambda>x. rex(M,?Q(x))" in rspec)
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   990
apply assumption
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   991
apply (blast intro: cartprod_iff_lemma) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   992
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   993
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   994
lemma (in M_basic) cartprod_closed_lemma:
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   995
     "[| M(A); M(B) |] ==> \<exists>C[M]. cartprod(M,A,B,C)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   996
apply (simp del: cartprod_abs add: cartprod_iff)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
   997
apply (insert power_ax, simp add: power_ax_def) 
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   998
apply (frule_tac x="A Un B" and P="\<lambda>x. rex(M,?Q(x))" in rspec) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
   999
apply (blast, clarify) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
  1000
apply (drule_tac x=z and P="\<lambda>x. rex(M,?Q(x))" in rspec) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
  1001
apply (blast, clarify)
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
  1002
apply (intro rexI exI conjI) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
  1003
prefer 5 apply (rule refl) 
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
  1004
prefer 3 apply assumption
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
  1005
prefer 3 apply assumption
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1006
apply (insert cartprod_separation [of A B], auto)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1007
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1008
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1009
text{*All the lemmas above are necessary because Powerset is not absolute.
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1010
      I should have used Replacement instead!*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1011
lemma (in M_basic) cartprod_closed [intro,simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1012
     "[| M(A); M(B) |] ==> M(A*B)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1013
by (frule cartprod_closed_lemma, assumption, force)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1014
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1015
lemma (in M_basic) sum_closed [intro,simp]: 
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1016
     "[| M(A); M(B) |] ==> M(A+B)"
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1017
by (simp add: sum_def)
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1018
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1019
lemma (in M_basic) sum_abs [simp]:
13350
paulson
parents: 13348
diff changeset
  1020
     "[| M(A); M(B); M(Z) |] ==> is_sum(M,A,B,Z) <-> (Z = A+B)"
paulson
parents: 13348
diff changeset
  1021
by (simp add: is_sum_def sum_def singleton_0 nat_into_M)
paulson
parents: 13348
diff changeset
  1022
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1023
lemma (in M_trivial) Inl_in_M_iff [iff]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1024
     "M(Inl(a)) <-> M(a)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1025
by (simp add: Inl_def) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1026
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1027
lemma (in M_trivial) Inl_abs [simp]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1028
     "M(Z) ==> is_Inl(M,a,Z) <-> (Z = Inl(a))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1029
by (simp add: is_Inl_def Inl_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1030
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1031
lemma (in M_trivial) Inr_in_M_iff [iff]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1032
     "M(Inr(a)) <-> M(a)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1033
by (simp add: Inr_def) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1034
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1035
lemma (in M_trivial) Inr_abs [simp]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1036
     "M(Z) ==> is_Inr(M,a,Z) <-> (Z = Inr(a))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1037
by (simp add: is_Inr_def Inr_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1038
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1039
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1040
subsubsection {*converse of a relation*}
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1041
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1042
lemma (in M_basic) M_converse_iff:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1043
     "M(r) ==> 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1044
      converse(r) = 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1045
      {z \<in> Union(Union(r)) * Union(Union(r)). 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1046
       \<exists>p\<in>r. \<exists>x[M]. \<exists>y[M]. p = \<langle>x,y\<rangle> & z = \<langle>y,x\<rangle>}"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1047
apply (rule equalityI)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1048
 prefer 2 apply (blast dest: transM, clarify, simp) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1049
apply (simp add: Pair_def) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1050
apply (blast dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1051
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1052
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1053
lemma (in M_basic) converse_closed [intro,simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1054
     "M(r) ==> M(converse(r))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1055
apply (simp add: M_converse_iff)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1056
apply (insert converse_separation [of r], simp)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1057
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1058
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1059
lemma (in M_basic) converse_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1060
     "[| M(r); M(z) |] ==> is_converse(M,r,z) <-> z = converse(r)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1061
apply (simp add: is_converse_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1062
apply (rule iffI)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1063
 prefer 2 apply blast 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1064
apply (rule M_equalityI)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1065
  apply simp
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1066
  apply (blast dest: transM)+
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1067
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1068
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1069
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1070
subsubsection {*image, preimage, domain, range*}
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1071
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1072
lemma (in M_basic) image_closed [intro,simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1073
     "[| M(A); M(r) |] ==> M(r``A)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1074
apply (simp add: image_iff_Collect)
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1075
apply (insert image_separation [of A r], simp) 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1076
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1077
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1078
lemma (in M_basic) vimage_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1079
     "[| M(r); M(A); M(z) |] ==> pre_image(M,r,A,z) <-> z = r-``A"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1080
apply (simp add: pre_image_def)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1081
apply (rule iffI) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1082
 apply (blast intro!: equalityI dest: transM, blast) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1083
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1084
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1085
lemma (in M_basic) vimage_closed [intro,simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1086
     "[| M(A); M(r) |] ==> M(r-``A)"
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1087
by (simp add: vimage_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1088
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1089
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1090
subsubsection{*Domain, range and field*}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1091
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1092
lemma (in M_basic) domain_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1093
     "[| M(r); M(z) |] ==> is_domain(M,r,z) <-> z = domain(r)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1094
apply (simp add: is_domain_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1095
apply (blast intro!: equalityI dest: transM) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1096
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1097
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1098
lemma (in M_basic) domain_closed [intro,simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1099
     "M(r) ==> M(domain(r))"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1100
apply (simp add: domain_eq_vimage)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1101
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1102
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1103
lemma (in M_basic) range_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1104
     "[| M(r); M(z) |] ==> is_range(M,r,z) <-> z = range(r)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1105
apply (simp add: is_range_def)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1106
apply (blast intro!: equalityI dest: transM)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1107
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1108
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1109
lemma (in M_basic) range_closed [intro,simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1110
     "M(r) ==> M(range(r))"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1111
apply (simp add: range_eq_image)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1112
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1113
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1114
lemma (in M_basic) field_abs [simp]: 
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1115
     "[| M(r); M(z) |] ==> is_field(M,r,z) <-> z = field(r)"
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1116
by (simp add: domain_closed range_closed is_field_def field_def)
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1117
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1118
lemma (in M_basic) field_closed [intro,simp]: 
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1119
     "M(r) ==> M(field(r))"
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1120
by (simp add: domain_closed range_closed Un_closed field_def) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1121
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1122
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1123
subsubsection{*Relations, functions and application*}
13254
5146ccaedf42 class quantifiers (some)
paulson
parents: 13251
diff changeset
  1124
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1125
lemma (in M_basic) relation_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1126
     "M(r) ==> is_relation(M,r) <-> relation(r)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1127
apply (simp add: is_relation_def relation_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1128
apply (blast dest!: bspec dest: pair_components_in_M)+
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1129
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1130
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1131
lemma (in M_basic) function_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1132
     "M(r) ==> is_function(M,r) <-> function(r)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1133
apply (simp add: is_function_def function_def, safe) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1134
   apply (frule transM, assumption) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1135
  apply (blast dest: pair_components_in_M)+
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1136
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1137
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1138
lemma (in M_basic) apply_closed [intro,simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1139
     "[|M(f); M(a)|] ==> M(f`a)"
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1140
by (simp add: apply_def)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1141
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1142
lemma (in M_basic) apply_abs [simp]: 
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
  1143
     "[| M(f); M(x); M(y) |] ==> fun_apply(M,f,x,y) <-> f`x = y"
13353
1800e7134d2e towards relativization of "iterates" and "wfrec"
paulson
parents: 13352
diff changeset
  1144
apply (simp add: fun_apply_def apply_def, blast) 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1145
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1146
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1147
lemma (in M_basic) typed_function_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1148
     "[| M(A); M(f) |] ==> typed_function(M,A,B,f) <-> f \<in> A -> B"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1149
apply (auto simp add: typed_function_def relation_def Pi_iff) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1150
apply (blast dest: pair_components_in_M)+
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1151
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1152
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1153
lemma (in M_basic) injection_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1154
     "[| M(A); M(f) |] ==> injection(M,A,B,f) <-> f \<in> inj(A,B)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1155
apply (simp add: injection_def apply_iff inj_def apply_closed)
13247
e3c289f0724b towards absoluteness of wfrec-defined functions
paulson
parents: 13245
diff changeset
  1156
apply (blast dest: transM [of _ A]) 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1157
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1158
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1159
lemma (in M_basic) surjection_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1160
     "[| M(A); M(B); M(f) |] ==> surjection(M,A,B,f) <-> f \<in> surj(A,B)"
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13350
diff changeset
  1161
by (simp add: surjection_def surj_def)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1162
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1163
lemma (in M_basic) bijection_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1164
     "[| M(A); M(B); M(f) |] ==> bijection(M,A,B,f) <-> f \<in> bij(A,B)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1165
by (simp add: bijection_def bij_def)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1166
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1167
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1168
subsubsection{*Composition of relations*}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1169
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1170
lemma (in M_basic) M_comp_iff:
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1171
     "[| M(r); M(s) |] 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1172
      ==> r O s = 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1173
          {xz \<in> domain(s) * range(r).  
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1174
            \<exists>x[M]. \<exists>y[M]. \<exists>z[M]. xz = \<langle>x,z\<rangle> & \<langle>x,y\<rangle> \<in> s & \<langle>y,z\<rangle> \<in> r}"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1175
apply (simp add: comp_def)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1176
apply (rule equalityI) 
13247
e3c289f0724b towards absoluteness of wfrec-defined functions
paulson
parents: 13245
diff changeset
  1177
 apply clarify 
e3c289f0724b towards absoluteness of wfrec-defined functions
paulson
parents: 13245
diff changeset
  1178
 apply simp 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1179
 apply  (blast dest:  transM)+
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1180
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1181
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1182
lemma (in M_basic) comp_closed [intro,simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1183
     "[| M(r); M(s) |] ==> M(r O s)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1184
apply (simp add: M_comp_iff)
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1185
apply (insert comp_separation [of r s], simp) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1186
done
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1187
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1188
lemma (in M_basic) composition_abs [simp]: 
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1189
     "[| M(r); M(s); M(t) |] 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1190
      ==> composition(M,r,s,t) <-> t = r O s"
13247
e3c289f0724b towards absoluteness of wfrec-defined functions
paulson
parents: 13245
diff changeset
  1191
apply safe
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1192
 txt{*Proving @{term "composition(M, r, s, r O s)"}*}
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1193
 prefer 2 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1194
 apply (simp add: composition_def comp_def)
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1195
 apply (blast dest: transM) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1196
txt{*Opposite implication*}
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1197
apply (rule M_equalityI)
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1198
  apply (simp add: composition_def comp_def)
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1199
  apply (blast del: allE dest: transM)+
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1200
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1201
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1202
text{*no longer needed*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1203
lemma (in M_basic) restriction_is_function: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1204
     "[| restriction(M,f,A,z); function(f); M(f); M(A); M(z) |] 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1205
      ==> function(z)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1206
apply (simp add: restriction_def ball_iff_equiv) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1207
apply (unfold function_def, blast) 
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13268
diff changeset
  1208
done
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13268
diff changeset
  1209
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1210
lemma (in M_basic) restriction_abs [simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1211
     "[| M(f); M(A); M(z) |] 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1212
      ==> restriction(M,f,A,z) <-> z = restrict(f,A)"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1213
apply (simp add: ball_iff_equiv restriction_def restrict_def)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1214
apply (blast intro!: equalityI dest: transM) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1215
done
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1216
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1217
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1218
lemma (in M_basic) M_restrict_iff:
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1219
     "M(r) ==> restrict(r,A) = {z \<in> r . \<exists>x\<in>A. \<exists>y[M]. z = \<langle>x, y\<rangle>}"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1220
by (simp add: restrict_def, blast dest: transM)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1221
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1222
lemma (in M_basic) restrict_closed [intro,simp]: 
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1223
     "[| M(A); M(r) |] ==> M(restrict(r,A))"
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1224
apply (simp add: M_restrict_iff)
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1225
apply (insert restrict_separation [of A], simp) 
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1226
done
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1227
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1228
lemma (in M_basic) Inter_abs [simp]: 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1229
     "[| M(A); M(z) |] ==> big_inter(M,A,z) <-> z = Inter(A)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1230
apply (simp add: big_inter_def Inter_def) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1231
apply (blast intro!: equalityI dest: transM) 
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1232
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1233
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1234
lemma (in M_basic) Inter_closed [intro,simp]:
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1235
     "M(A) ==> M(Inter(A))"
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1236
by (insert Inter_separation, simp add: Inter_def)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1237
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1238
lemma (in M_basic) Int_closed [intro,simp]:
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1239
     "[| M(A); M(B) |] ==> M(A Int B)"
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1240
apply (subgoal_tac "M({A,B})")
13247
e3c289f0724b towards absoluteness of wfrec-defined functions
paulson
parents: 13245
diff changeset
  1241
apply (frule Inter_closed, force+) 
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1242
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1243
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1244
lemma (in M_basic) Diff_closed [intro,simp]:
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1245
     "[|M(A); M(B)|] ==> M(A-B)"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1246
by (insert Diff_separation, simp add: Diff_def)
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1247
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1248
subsubsection{*Some Facts About Separation Axioms*}
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1249
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1250
lemma (in M_basic) separation_conj:
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1251
     "[|separation(M,P); separation(M,Q)|] ==> separation(M, \<lambda>z. P(z) & Q(z))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1252
by (simp del: separation_closed
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1253
         add: separation_iff Collect_Int_Collect_eq [symmetric]) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1254
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1255
(*???equalities*)
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1256
lemma Collect_Un_Collect_eq:
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1257
     "Collect(A,P) Un Collect(A,Q) = Collect(A, %x. P(x) | Q(x))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1258
by blast
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1259
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1260
lemma Diff_Collect_eq:
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1261
     "A - Collect(A,P) = Collect(A, %x. ~ P(x))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1262
by blast
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1263
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1264
lemma (in M_trivial) Collect_rall_eq:
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1265
     "M(Y) ==> Collect(A, %x. \<forall>y[M]. y\<in>Y --> P(x,y)) = 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1266
               (if Y=0 then A else (\<Inter>y \<in> Y. {x \<in> A. P(x,y)}))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1267
apply simp 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1268
apply (blast intro!: equalityI dest: transM) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1269
done
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1270
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1271
lemma (in M_basic) separation_disj:
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1272
     "[|separation(M,P); separation(M,Q)|] ==> separation(M, \<lambda>z. P(z) | Q(z))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1273
by (simp del: separation_closed
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1274
         add: separation_iff Collect_Un_Collect_eq [symmetric]) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1275
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1276
lemma (in M_basic) separation_neg:
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1277
     "separation(M,P) ==> separation(M, \<lambda>z. ~P(z))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1278
by (simp del: separation_closed
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1279
         add: separation_iff Diff_Collect_eq [symmetric]) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1280
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1281
lemma (in M_basic) separation_imp:
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1282
     "[|separation(M,P); separation(M,Q)|] 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1283
      ==> separation(M, \<lambda>z. P(z) --> Q(z))"
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1284
by (simp add: separation_neg separation_disj not_disj_iff_imp [symmetric]) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1285
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1286
text{*This result is a hint of how little can be done without the Reflection 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1287
  Theorem.  The quantifier has to be bounded by a set.  We also need another
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1288
  instance of Separation!*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1289
lemma (in M_basic) separation_rall:
13436
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1290
     "[|M(Y); \<forall>y[M]. separation(M, \<lambda>x. P(x,y)); 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1291
        \<forall>z[M]. strong_replacement(M, \<lambda>x y. y = {u \<in> z . P(u,x)})|]
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1292
      ==> separation(M, \<lambda>x. \<forall>y[M]. y\<in>Y --> P(x,y))" 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1293
apply (simp del: separation_closed rall_abs
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1294
         add: separation_iff Collect_rall_eq) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1295
apply (blast intro!: Inter_closed RepFun_closed dest: transM) 
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1296
done
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1297
8fd1d803a3d3 tweaks involving Separation
paulson
parents: 13434
diff changeset
  1298
13290
28ce81eff3de separation of M_axioms into M_triv_axioms and M_axioms
paulson
parents: 13269
diff changeset
  1299
subsubsection{*Functions and function space*}
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1300
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1301
text{*M contains all finite functions*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1302
lemma (in M_basic) finite_fun_closed_lemma [rule_format]: 
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1303
     "[| n \<in> nat; M(A) |] ==> \<forall>f \<in> n -> A. M(f)"
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1304
apply (induct_tac n, simp)
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1305
apply (rule ballI)  
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1306
apply (simp add: succ_def) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1307
apply (frule fun_cons_restrict_eq)
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1308
apply (erule ssubst) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1309
apply (subgoal_tac "M(f`x) & restrict(f,x) \<in> x -> A") 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1310
 apply (simp add: cons_closed nat_into_M apply_closed) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1311
apply (blast intro: apply_funtype transM restrict_type2) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1312
done
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1313
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1314
lemma (in M_basic) finite_fun_closed [rule_format]: 
13245
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1315
     "[| f \<in> n -> A; n \<in> nat; M(A) |] ==> M(f)"
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1316
by (blast intro: finite_fun_closed_lemma) 
714f7a423a15 development and tweaks
paulson
parents: 13223
diff changeset
  1317
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1318
text{*The assumption @{term "M(A->B)"} is unusual, but essential: in 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1319
all but trivial cases, A->B cannot be expected to belong to @{term M}.*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1320
lemma (in M_basic) is_funspace_abs [simp]:
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1321
     "[|M(A); M(B); M(F); M(A->B)|] ==> is_funspace(M,A,B,F) <-> F = A->B";
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1322
apply (simp add: is_funspace_def)
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1323
apply (rule iffI)
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1324
 prefer 2 apply blast 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1325
apply (rule M_equalityI)
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1326
  apply simp_all
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1327
done
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1328
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1329
lemma (in M_basic) succ_fun_eq2:
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1330
     "[|M(B); M(n->B)|] ==>
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1331
      succ(n) -> B = 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1332
      \<Union>{z. p \<in> (n->B)*B, \<exists>f[M]. \<exists>b[M]. p = <f,b> & z = {cons(<n,b>, f)}}"
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1333
apply (simp add: succ_fun_eq)
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1334
apply (blast dest: transM)  
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1335
done
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1336
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1337
lemma (in M_basic) funspace_succ:
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1338
     "[|M(n); M(B); M(n->B) |] ==> M(succ(n) -> B)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13299
diff changeset
  1339
apply (insert funspace_succ_replacement [of n], simp) 
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1340
apply (force simp add: succ_fun_eq2 univalent_def) 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1341
done
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1342
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1343
text{*@{term M} contains all finite function spaces.  Needed to prove the
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1344
absoluteness of transitive closure.*}
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1345
lemma (in M_basic) finite_funspace_closed [intro,simp]:
13268
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1346
     "[|n\<in>nat; M(B)|] ==> M(n->B)"
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1347
apply (induct_tac n, simp)
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1348
apply (simp add: funspace_succ nat_into_M) 
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1349
done
240509babf00 more use of relativized quantifiers
paulson
parents: 13254
diff changeset
  1350
13350
paulson
parents: 13348
diff changeset
  1351
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1352
subsection{*Relativization and Absoluteness for Boolean Operators*}
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1353
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1354
constdefs
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1355
  is_bool_of_o :: "[i=>o, o, i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1356
   "is_bool_of_o(M,P,z) == (P & number1(M,z)) | (~P & empty(M,z))"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1357
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1358
  is_not :: "[i=>o, i, i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1359
   "is_not(M,a,z) == (number1(M,a)  & empty(M,z)) | 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1360
                     (~number1(M,a) & number1(M,z))"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1361
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1362
  is_and :: "[i=>o, i, i, i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1363
   "is_and(M,a,b,z) == (number1(M,a)  & z=b) | 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1364
                       (~number1(M,a) & empty(M,z))"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1365
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1366
  is_or :: "[i=>o, i, i, i] => o"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1367
   "is_or(M,a,b,z) == (number1(M,a)  & number1(M,z)) | 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1368
                      (~number1(M,a) & z=b)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1369
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1370
lemma (in M_trivial) bool_of_o_abs [simp]: 
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1371
     "M(z) ==> is_bool_of_o(M,P,z) <-> z = bool_of_o(P)" 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1372
by (simp add: is_bool_of_o_def bool_of_o_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1373
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1374
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1375
lemma (in M_trivial) not_abs [simp]: 
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1376
     "[| M(a); M(z)|] ==> is_not(M,a,z) <-> z = not(a)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1377
by (simp add: Bool.not_def cond_def is_not_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1378
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1379
lemma (in M_trivial) and_abs [simp]: 
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1380
     "[| M(a); M(b); M(z)|] ==> is_and(M,a,b,z) <-> z = a and b"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1381
by (simp add: Bool.and_def cond_def is_and_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1382
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1383
lemma (in M_trivial) or_abs [simp]: 
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1384
     "[| M(a); M(b); M(z)|] ==> is_or(M,a,b,z) <-> z = a or b"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1385
by (simp add: Bool.or_def cond_def is_or_def)
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1386
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1387
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1388
lemma (in M_trivial) bool_of_o_closed [intro,simp]:
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1389
     "M(bool_of_o(P))"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1390
by (simp add: bool_of_o_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1391
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1392
lemma (in M_trivial) and_closed [intro,simp]:
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1393
     "[| M(p); M(q) |] ==> M(p and q)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1394
by (simp add: and_def cond_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1395
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1396
lemma (in M_trivial) or_closed [intro,simp]:
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1397
     "[| M(p); M(q) |] ==> M(p or q)"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1398
by (simp add: or_def cond_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1399
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1400
lemma (in M_trivial) not_closed [intro,simp]:
13423
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1401
     "M(p) ==> M(not(p))"
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1402
by (simp add: Bool.not_def cond_def) 
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1403
7ec771711c09 More lemmas, working towards relativization of "satisfies"
paulson
parents: 13418
diff changeset
  1404
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1405
subsection{*Relativization and Absoluteness for List Operators*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1406
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1407
constdefs
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1408
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1409
  is_Nil :: "[i=>o, i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1410
     --{* because @{term "[] \<equiv> Inl(0)"}*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1411
    "is_Nil(M,xs) == \<exists>zero[M]. empty(M,zero) & is_Inl(M,zero,xs)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1412
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1413
  is_Cons :: "[i=>o,i,i,i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1414
     --{* because @{term "Cons(a, l) \<equiv> Inr(\<langle>a,l\<rangle>)"}*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1415
    "is_Cons(M,a,l,Z) == \<exists>p[M]. pair(M,a,l,p) & is_Inr(M,p,Z)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1416
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1417
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1418
lemma (in M_trivial) Nil_in_M [intro,simp]: "M(Nil)"
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1419
by (simp add: Nil_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1420
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1421
lemma (in M_trivial) Nil_abs [simp]: "M(Z) ==> is_Nil(M,Z) <-> (Z = Nil)"
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1422
by (simp add: is_Nil_def Nil_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1423
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1424
lemma (in M_trivial) Cons_in_M_iff [iff]: "M(Cons(a,l)) <-> M(a) & M(l)"
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1425
by (simp add: Cons_def) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1426
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1427
lemma (in M_trivial) Cons_abs [simp]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1428
     "[|M(a); M(l); M(Z)|] ==> is_Cons(M,a,l,Z) <-> (Z = Cons(a,l))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1429
by (simp add: is_Cons_def Cons_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1430
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1431
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1432
constdefs
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1433
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1434
  quasilist :: "i => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1435
    "quasilist(xs) == xs=Nil | (\<exists>x l. xs = Cons(x,l))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1436
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1437
  is_quasilist :: "[i=>o,i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1438
    "is_quasilist(M,z) == is_Nil(M,z) | (\<exists>x[M]. \<exists>l[M]. is_Cons(M,x,l,z))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1439
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1440
  list_case' :: "[i, [i,i]=>i, i] => i"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1441
    --{*A version of @{term list_case} that's always defined.*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1442
    "list_case'(a,b,xs) == 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1443
       if quasilist(xs) then list_case(a,b,xs) else 0"  
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1444
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1445
  is_list_case :: "[i=>o, i, [i,i,i]=>o, i, i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1446
    --{*Returns 0 for non-lists*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1447
    "is_list_case(M, a, is_b, xs, z) == 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1448
       (is_Nil(M,xs) --> z=a) &
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1449
       (\<forall>x[M]. \<forall>l[M]. is_Cons(M,x,l,xs) --> is_b(x,l,z)) &
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1450
       (is_quasilist(M,xs) | empty(M,z))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1451
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1452
  hd' :: "i => i"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1453
    --{*A version of @{term hd} that's always defined.*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1454
    "hd'(xs) == if quasilist(xs) then hd(xs) else 0"  
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1455
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1456
  tl' :: "i => i"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1457
    --{*A version of @{term tl} that's always defined.*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1458
    "tl'(xs) == if quasilist(xs) then tl(xs) else 0"  
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1459
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1460
  is_hd :: "[i=>o,i,i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1461
     --{* @{term "hd([]) = 0"} no constraints if not a list.
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1462
          Avoiding implication prevents the simplifier's looping.*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1463
    "is_hd(M,xs,H) == 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1464
       (is_Nil(M,xs) --> empty(M,H)) &
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1465
       (\<forall>x[M]. \<forall>l[M]. ~ is_Cons(M,x,l,xs) | H=x) &
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1466
       (is_quasilist(M,xs) | empty(M,H))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1467
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1468
  is_tl :: "[i=>o,i,i] => o"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1469
     --{* @{term "tl([]) = []"}; see comments about @{term is_hd}*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1470
    "is_tl(M,xs,T) == 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1471
       (is_Nil(M,xs) --> T=xs) &
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1472
       (\<forall>x[M]. \<forall>l[M]. ~ is_Cons(M,x,l,xs) | T=l) &
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1473
       (is_quasilist(M,xs) | empty(M,T))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1474
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1475
subsubsection{*@{term quasilist}: For Case-Splitting with @{term list_case'}*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1476
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1477
lemma [iff]: "quasilist(Nil)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1478
by (simp add: quasilist_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1479
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1480
lemma [iff]: "quasilist(Cons(x,l))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1481
by (simp add: quasilist_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1482
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1483
lemma list_imp_quasilist: "l \<in> list(A) ==> quasilist(l)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1484
by (erule list.cases, simp_all)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1485
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1486
subsubsection{*@{term list_case'}, the Modified Version of @{term list_case}*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1487
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1488
lemma list_case'_Nil [simp]: "list_case'(a,b,Nil) = a"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1489
by (simp add: list_case'_def quasilist_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1490
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1491
lemma list_case'_Cons [simp]: "list_case'(a,b,Cons(x,l)) = b(x,l)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1492
by (simp add: list_case'_def quasilist_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1493
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1494
lemma non_list_case: "~ quasilist(x) ==> list_case'(a,b,x) = 0" 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1495
by (simp add: quasilist_def list_case'_def) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1496
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1497
lemma list_case'_eq_list_case [simp]:
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1498
     "xs \<in> list(A) ==>list_case'(a,b,xs) = list_case(a,b,xs)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1499
by (erule list.cases, simp_all)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1500
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1501
lemma (in M_basic) list_case'_closed [intro,simp]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1502
  "[|M(k); M(a); \<forall>x[M]. \<forall>y[M]. M(b(x,y))|] ==> M(list_case'(a,b,k))"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1503
apply (case_tac "quasilist(k)") 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1504
 apply (simp add: quasilist_def, force) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1505
apply (simp add: non_list_case) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1506
done
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1507
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1508
lemma (in M_trivial) quasilist_abs [simp]: 
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1509
     "M(z) ==> is_quasilist(M,z) <-> quasilist(z)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1510
by (auto simp add: is_quasilist_def quasilist_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1511
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1512
lemma (in M_trivial) list_case_abs [simp]: 
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1513
     "[| relativize2(M,is_b,b); M(k); M(z) |] 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1514
      ==> is_list_case(M,a,is_b,k,z) <-> z = list_case'(a,b,k)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1515
apply (case_tac "quasilist(k)") 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1516
 prefer 2 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1517
 apply (simp add: is_list_case_def non_list_case) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1518
 apply (force simp add: quasilist_def) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1519
apply (simp add: quasilist_def is_list_case_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1520
apply (elim disjE exE) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1521
 apply (simp_all add: relativize2_def) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1522
done
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1523
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1524
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1525
subsubsection{*The Modified Operators @{term hd'} and @{term tl'}*}
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1526
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1527
lemma (in M_trivial) is_hd_Nil: "is_hd(M,[],Z) <-> empty(M,Z)"
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
  1528
by (simp add: is_hd_def)
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1529
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1530
lemma (in M_trivial) is_hd_Cons:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1531
     "[|M(a); M(l)|] ==> is_hd(M,Cons(a,l),Z) <-> Z = a"
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
  1532
by (force simp add: is_hd_def) 
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1533
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1534
lemma (in M_trivial) hd_abs [simp]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1535
     "[|M(x); M(y)|] ==> is_hd(M,x,y) <-> y = hd'(x)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1536
apply (simp add: hd'_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1537
apply (intro impI conjI)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1538
 prefer 2 apply (force simp add: is_hd_def) 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
  1539
apply (simp add: quasilist_def is_hd_def)
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1540
apply (elim disjE exE, auto)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1541
done 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1542
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1543
lemma (in M_trivial) is_tl_Nil: "is_tl(M,[],Z) <-> Z = []"
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
  1544
by (simp add: is_tl_def)
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1545
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1546
lemma (in M_trivial) is_tl_Cons:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1547
     "[|M(a); M(l)|] ==> is_tl(M,Cons(a,l),Z) <-> Z = l"
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
  1548
by (force simp add: is_tl_def) 
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1549
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1550
lemma (in M_trivial) tl_abs [simp]:
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1551
     "[|M(x); M(y)|] ==> is_tl(M,x,y) <-> y = tl'(x)"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1552
apply (simp add: tl'_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1553
apply (intro impI conjI)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1554
 prefer 2 apply (force simp add: is_tl_def) 
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13436
diff changeset
  1555
apply (simp add: quasilist_def is_tl_def)
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1556
apply (elim disjE exE, auto)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1557
done 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1558
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1559
lemma (in M_trivial) relativize1_tl: "relativize1(M, is_tl(M), tl')"  
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1560
by (simp add: relativize1_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1561
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1562
lemma hd'_Nil: "hd'([]) = 0"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1563
by (simp add: hd'_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1564
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1565
lemma hd'_Cons: "hd'(Cons(a,l)) = a"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1566
by (simp add: hd'_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1567
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1568
lemma tl'_Nil: "tl'([]) = []"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1569
by (simp add: tl'_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1570
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1571
lemma tl'_Cons: "tl'(Cons(a,l)) = l"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1572
by (simp add: tl'_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1573
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1574
lemma iterates_tl_Nil: "n \<in> nat ==> tl'^n ([]) = []"
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1575
apply (induct_tac n) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1576
apply (simp_all add: tl'_Nil) 
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1577
done
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1578
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
  1579
lemma (in M_basic) tl'_closed: "M(x) ==> M(tl'(x))"
13397
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1580
apply (simp add: tl'_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1581
apply (force simp add: quasilist_def)
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1582
done
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1583
6e5f4d911435 Absoluteness of the function "nth"
paulson
parents: 13382
diff changeset
  1584
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1585
end