src/ZF/Constructible/L_axioms.thy
changeset 13298 b4f370679c65
parent 13291 a73ab154f75c
child 13299 3a932abf97e8
     1.1 --- a/src/ZF/Constructible/L_axioms.thy	Thu Jul 04 16:48:21 2002 +0200
     1.2 +++ b/src/ZF/Constructible/L_axioms.thy	Thu Jul 04 16:59:54 2002 +0200
     1.3 @@ -288,30 +288,344 @@
     1.4  by blast
     1.5  
     1.6  
     1.7 +subsection{*Internalized formulas for some relativized ones*}
     1.8 +
     1.9 +subsubsection{*Unordered pairs*}
    1.10 +
    1.11 +constdefs upair_fm :: "[i,i,i]=>i"
    1.12 +    "upair_fm(x,y,z) == 
    1.13 +       And(Member(x,z), 
    1.14 +           And(Member(y,z),
    1.15 +               Forall(Implies(Member(0,succ(z)), 
    1.16 +                              Or(Equal(0,succ(x)), Equal(0,succ(y)))))))"
    1.17 +
    1.18 +lemma upair_type [TC]:
    1.19 +     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> upair_fm(x,y,z) \<in> formula"
    1.20 +by (simp add: upair_fm_def) 
    1.21 +
    1.22 +lemma arity_upair_fm [simp]:
    1.23 +     "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
    1.24 +      ==> arity(upair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
    1.25 +by (simp add: upair_fm_def succ_Un_distrib [symmetric] Un_ac) 
    1.26 +
    1.27 +lemma sats_upair_fm [simp]:
    1.28 +   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
    1.29 +    ==> sats(A, upair_fm(x,y,z), env) <-> 
    1.30 +            upair(**A, nth(x,env), nth(y,env), nth(z,env))"
    1.31 +by (simp add: upair_fm_def upair_def)
    1.32 +
    1.33 +lemma upair_iff_sats:
    1.34 +      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
    1.35 +          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
    1.36 +       ==> upair(**A, x, y, z) <-> sats(A, upair_fm(i,j,k), env)"
    1.37 +by (simp add: sats_upair_fm)
    1.38 +
    1.39 +text{*Useful? At least it refers to "real" unordered pairs*}
    1.40 +lemma sats_upair_fm2 [simp]:
    1.41 +   "[| x \<in> nat; y \<in> nat; z < length(env); env \<in> list(A); Transset(A)|]
    1.42 +    ==> sats(A, upair_fm(x,y,z), env) <-> 
    1.43 +        nth(z,env) = {nth(x,env), nth(y,env)}"
    1.44 +apply (frule lt_length_in_nat, assumption)  
    1.45 +apply (simp add: upair_fm_def Transset_def, auto) 
    1.46 +apply (blast intro: nth_type) 
    1.47 +done
    1.48 +
    1.49 +subsubsection{*Ordered pairs*}
    1.50 +
    1.51 +constdefs pair_fm :: "[i,i,i]=>i"
    1.52 +    "pair_fm(x,y,z) == 
    1.53 +       Exists(And(upair_fm(succ(x),succ(x),0),
    1.54 +              Exists(And(upair_fm(succ(succ(x)),succ(succ(y)),0),
    1.55 +                         upair_fm(1,0,succ(succ(z)))))))"
    1.56 +
    1.57 +lemma pair_type [TC]:
    1.58 +     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> pair_fm(x,y,z) \<in> formula"
    1.59 +by (simp add: pair_fm_def) 
    1.60 +
    1.61 +lemma arity_pair_fm [simp]:
    1.62 +     "[| x \<in> nat; y \<in> nat; z \<in> nat |] 
    1.63 +      ==> arity(pair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
    1.64 +by (simp add: pair_fm_def succ_Un_distrib [symmetric] Un_ac) 
    1.65 +
    1.66 +lemma sats_pair_fm [simp]:
    1.67 +   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
    1.68 +    ==> sats(A, pair_fm(x,y,z), env) <-> 
    1.69 +        pair(**A, nth(x,env), nth(y,env), nth(z,env))"
    1.70 +by (simp add: pair_fm_def pair_def)
    1.71 +
    1.72 +lemma pair_iff_sats:
    1.73 +      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; 
    1.74 +          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
    1.75 +       ==> pair(**A, x, y, z) <-> sats(A, pair_fm(i,j,k), env)"
    1.76 +by (simp add: sats_pair_fm)
    1.77 +
    1.78 +
    1.79 +
    1.80 +subsection{*Proving instances of Separation using Reflection!*}
    1.81 +
    1.82 +text{*Helps us solve for de Bruijn indices!*}
    1.83 +lemma nth_ConsI: "[|nth(n,l) = x; n \<in> nat|] ==> nth(succ(n), Cons(a,l)) = x"
    1.84 +by simp
    1.85 +
    1.86 +
    1.87 +lemma Collect_conj_in_DPow:
    1.88 +     "[| {x\<in>A. P(x)} \<in> DPow(A);  {x\<in>A. Q(x)} \<in> DPow(A) |] 
    1.89 +      ==> {x\<in>A. P(x) & Q(x)} \<in> DPow(A)"
    1.90 +by (simp add: Int_in_DPow Collect_Int_Collect_eq [symmetric]) 
    1.91 +
    1.92 +lemma Collect_conj_in_DPow_Lset:
    1.93 +     "[|z \<in> Lset(j); {x \<in> Lset(j). P(x)} \<in> DPow(Lset(j))|]
    1.94 +      ==> {x \<in> Lset(j). x \<in> z & P(x)} \<in> DPow(Lset(j))"
    1.95 +apply (frule mem_Lset_imp_subset_Lset)
    1.96 +apply (simp add: Collect_conj_in_DPow Collect_mem_eq 
    1.97 +                 subset_Int_iff2 elem_subset_in_DPow)
    1.98 +done
    1.99 +
   1.100 +lemma separation_CollectI:
   1.101 +     "(\<And>z. L(z) ==> L({x \<in> z . P(x)})) ==> separation(L, \<lambda>x. P(x))"
   1.102 +apply (unfold separation_def, clarify) 
   1.103 +apply (rule_tac x="{x\<in>z. P(x)}" in rexI) 
   1.104 +apply simp_all
   1.105 +done
   1.106 +
   1.107 +text{*Reduces the original comprehension to the reflected one*}
   1.108 +lemma reflection_imp_L_separation:
   1.109 +      "[| \<forall>x\<in>Lset(j). P(x) <-> Q(x);
   1.110 +          {x \<in> Lset(j) . Q(x)} \<in> DPow(Lset(j)); 
   1.111 +          Ord(j);  z \<in> Lset(j)|] ==> L({x \<in> z . P(x)})"
   1.112 +apply (rule_tac i = "succ(j)" in L_I)
   1.113 + prefer 2 apply simp
   1.114 +apply (subgoal_tac "{x \<in> z. P(x)} = {x \<in> Lset(j). x \<in> z & (Q(x))}")
   1.115 + prefer 2
   1.116 + apply (blast dest: mem_Lset_imp_subset_Lset) 
   1.117 +apply (simp add: Lset_succ Collect_conj_in_DPow_Lset)
   1.118 +done
   1.119 +
   1.120 +
   1.121 +subsubsection{*Separation for Intersection*}
   1.122 +
   1.123 +lemma Inter_Reflects:
   1.124 +     "L_Reflects(?Cl, \<lambda>x. \<forall>y[L]. y\<in>A --> x \<in> y, 
   1.125 +               \<lambda>i x. \<forall>y\<in>Lset(i). y\<in>A --> x \<in> y)"
   1.126 +by fast
   1.127 +
   1.128 +lemma Inter_separation:
   1.129 +     "L(A) ==> separation(L, \<lambda>x. \<forall>y[L]. y\<in>A --> x\<in>y)"
   1.130 +apply (rule separation_CollectI) 
   1.131 +apply (rule_tac A="{A,z}" in subset_LsetE, blast ) 
   1.132 +apply (rule ReflectsE [OF Inter_Reflects], assumption)
   1.133 +apply (drule subset_Lset_ltD, assumption) 
   1.134 +apply (erule reflection_imp_L_separation)
   1.135 +  apply (simp_all add: lt_Ord2, clarify)
   1.136 +apply (rule DPowI2) 
   1.137 +apply (rule ball_iff_sats) 
   1.138 +apply (rule imp_iff_sats)
   1.139 +apply (rule_tac [2] i=1 and j=0 and env="[y,x,A]" in mem_iff_sats)
   1.140 +apply (rule_tac i=0 and j=2 in mem_iff_sats)
   1.141 +apply (simp_all add: succ_Un_distrib [symmetric])
   1.142 +done
   1.143 +
   1.144 +subsubsection{*Separation for Cartesian Product*}
   1.145 +
   1.146 +text{*The @{text simplified} attribute tidies up the reflecting class.*}
   1.147 +theorem upair_reflection [simplified,intro]:
   1.148 +     "L_Reflects(?Cl, \<lambda>x. upair(L,f(x),g(x),h(x)), 
   1.149 +                    \<lambda>i x. upair(**Lset(i),f(x),g(x),h(x)))" 
   1.150 +by (simp add: upair_def, fast) 
   1.151 +
   1.152 +theorem pair_reflection [simplified,intro]:
   1.153 +     "L_Reflects(?Cl, \<lambda>x. pair(L,f(x),g(x),h(x)), 
   1.154 +                    \<lambda>i x. pair(**Lset(i),f(x),g(x),h(x)))"
   1.155 +by (simp only: pair_def rex_setclass_is_bex, fast) 
   1.156 +
   1.157 +lemma cartprod_Reflects [simplified]:
   1.158 +     "L_Reflects(?Cl, \<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. y\<in>B & pair(L,x,y,z)),
   1.159 +                \<lambda>i z. \<exists>x\<in>Lset(i). x\<in>A & (\<exists>y\<in>Lset(i). y\<in>B & 
   1.160 +                               pair(**Lset(i),x,y,z)))"
   1.161 +by fast
   1.162 +
   1.163 +lemma cartprod_separation:
   1.164 +     "[| L(A); L(B) |] 
   1.165 +      ==> separation(L, \<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. y\<in>B & pair(L,x,y,z)))"
   1.166 +apply (rule separation_CollectI) 
   1.167 +apply (rule_tac A="{A,B,z}" in subset_LsetE, blast ) 
   1.168 +apply (rule ReflectsE [OF cartprod_Reflects], assumption)
   1.169 +apply (drule subset_Lset_ltD, assumption) 
   1.170 +apply (erule reflection_imp_L_separation)
   1.171 +  apply (simp_all add: lt_Ord2, clarify) 
   1.172 +apply (rule DPowI2)
   1.173 +apply (rename_tac u)  
   1.174 +apply (rule bex_iff_sats) 
   1.175 +apply (rule conj_iff_sats)
   1.176 +apply (rule_tac i=0 and j=2 and env="[x,u,A,B]" in mem_iff_sats, simp_all)
   1.177 +apply (rule bex_iff_sats) 
   1.178 +apply (rule conj_iff_sats)
   1.179 +apply (rule mem_iff_sats)
   1.180 +apply (blast intro: nth_0 nth_ConsI) 
   1.181 +apply (blast intro: nth_0 nth_ConsI, simp_all)
   1.182 +apply (rule_tac i=1 and j=0 and k=2 in pair_iff_sats)
   1.183 +apply (simp_all add: succ_Un_distrib [symmetric])
   1.184 +done
   1.185 +
   1.186 +subsubsection{*Separation for Image*}
   1.187 +
   1.188 +text{*No @{text simplified} here: it simplifies the occurrence of 
   1.189 +      the predicate @{term pair}!*}
   1.190 +lemma image_Reflects:
   1.191 +     "L_Reflects(?Cl, \<lambda>y. \<exists>p[L]. p\<in>r & (\<exists>x[L]. x\<in>A & pair(L,x,y,p)),
   1.192 +           \<lambda>i y. \<exists>p\<in>Lset(i). p\<in>r & (\<exists>x\<in>Lset(i). x\<in>A & pair(**Lset(i),x,y,p)))"
   1.193 +by fast
   1.194 +
   1.195 +
   1.196 +lemma image_separation:
   1.197 +     "[| L(A); L(r) |] 
   1.198 +      ==> separation(L, \<lambda>y. \<exists>p[L]. p\<in>r & (\<exists>x[L]. x\<in>A & pair(L,x,y,p)))"
   1.199 +apply (rule separation_CollectI) 
   1.200 +apply (rule_tac A="{A,r,z}" in subset_LsetE, blast ) 
   1.201 +apply (rule ReflectsE [OF image_Reflects], assumption)
   1.202 +apply (drule subset_Lset_ltD, assumption) 
   1.203 +apply (erule reflection_imp_L_separation)
   1.204 +  apply (simp_all add: lt_Ord2, clarify)
   1.205 +apply (rule DPowI2)
   1.206 +apply (rule bex_iff_sats) 
   1.207 +apply (rule conj_iff_sats)
   1.208 +apply (rule_tac env="[p,y,A,r]" in mem_iff_sats)
   1.209 +apply (blast intro: nth_0 nth_ConsI) 
   1.210 +apply (blast intro: nth_0 nth_ConsI, simp_all)
   1.211 +apply (rule bex_iff_sats) 
   1.212 +apply (rule conj_iff_sats)
   1.213 +apply (rule mem_iff_sats)
   1.214 +apply (blast intro: nth_0 nth_ConsI) 
   1.215 +apply (blast intro: nth_0 nth_ConsI, simp_all)
   1.216 +apply (rule pair_iff_sats)
   1.217 +apply (blast intro: nth_0 nth_ConsI) 
   1.218 +apply (blast intro: nth_0 nth_ConsI) 
   1.219 +apply (blast intro: nth_0 nth_ConsI)
   1.220 +apply (simp_all add: succ_Un_distrib [symmetric])
   1.221 +done
   1.222 +
   1.223 +
   1.224 +subsubsection{*Separation for Converse*}
   1.225 +
   1.226 +lemma converse_Reflects:
   1.227 +     "L_Reflects(?Cl, 
   1.228 +        \<lambda>z. \<exists>p[L]. p\<in>r & (\<exists>x[L]. \<exists>y[L]. pair(L,x,y,p) & pair(L,y,x,z)),
   1.229 +     \<lambda>i z. \<exists>p\<in>Lset(i). p\<in>r & (\<exists>x\<in>Lset(i). \<exists>y\<in>Lset(i). 
   1.230 +                     pair(**Lset(i),x,y,p) & pair(**Lset(i),y,x,z)))"
   1.231 +by fast
   1.232 +
   1.233 +lemma converse_separation:
   1.234 +     "L(r) ==> separation(L, 
   1.235 +         \<lambda>z. \<exists>p[L]. p\<in>r & (\<exists>x[L]. \<exists>y[L]. pair(L,x,y,p) & pair(L,y,x,z)))"
   1.236 +apply (rule separation_CollectI) 
   1.237 +apply (rule_tac A="{r,z}" in subset_LsetE, blast ) 
   1.238 +apply (rule ReflectsE [OF converse_Reflects], assumption)
   1.239 +apply (drule subset_Lset_ltD, assumption) 
   1.240 +apply (erule reflection_imp_L_separation)
   1.241 +  apply (simp_all add: lt_Ord2, clarify)
   1.242 +apply (rule DPowI2)
   1.243 +apply (rename_tac u) 
   1.244 +apply (rule bex_iff_sats) 
   1.245 +apply (rule conj_iff_sats)
   1.246 +apply (rule_tac i=0 and j="2" and env="[p,u,r]" in mem_iff_sats, simp_all)
   1.247 +apply (rule bex_iff_sats) 
   1.248 +apply (rule bex_iff_sats) 
   1.249 +apply (rule conj_iff_sats)
   1.250 +apply (rule_tac i=1 and j=0 and k=2 in pair_iff_sats, simp_all)
   1.251 +apply (rule pair_iff_sats)
   1.252 +apply (blast intro: nth_0 nth_ConsI) 
   1.253 +apply (blast intro: nth_0 nth_ConsI) 
   1.254 +apply (blast intro: nth_0 nth_ConsI)
   1.255 +apply (simp_all add: succ_Un_distrib [symmetric])
   1.256 +done
   1.257 +
   1.258 +
   1.259 +subsubsection{*Separation for Restriction*}
   1.260 +
   1.261 +lemma restrict_Reflects:
   1.262 +     "L_Reflects(?Cl, \<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. pair(L,x,y,z)),
   1.263 +        \<lambda>i z. \<exists>x\<in>Lset(i). x\<in>A & (\<exists>y\<in>Lset(i). pair(**Lset(i),x,y,z)))"
   1.264 +by fast
   1.265 +
   1.266 +lemma restrict_separation:
   1.267 +   "L(A) ==> separation(L, \<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. pair(L,x,y,z)))"
   1.268 +apply (rule separation_CollectI) 
   1.269 +apply (rule_tac A="{A,z}" in subset_LsetE, blast ) 
   1.270 +apply (rule ReflectsE [OF restrict_Reflects], assumption)
   1.271 +apply (drule subset_Lset_ltD, assumption) 
   1.272 +apply (erule reflection_imp_L_separation)
   1.273 +  apply (simp_all add: lt_Ord2, clarify)
   1.274 +apply (rule DPowI2)
   1.275 +apply (rename_tac u) 
   1.276 +apply (rule bex_iff_sats) 
   1.277 +apply (rule conj_iff_sats)
   1.278 +apply (rule_tac i=0 and j="2" and env="[x,u,A]" in mem_iff_sats, simp_all)
   1.279 +apply (rule bex_iff_sats) 
   1.280 +apply (rule_tac i=1 and j=0 and k=2 in pair_iff_sats)
   1.281 +apply (simp_all add: succ_Un_distrib [symmetric])
   1.282 +done
   1.283 +
   1.284 +
   1.285 +subsubsection{*Separation for Composition*}
   1.286 +
   1.287 +lemma comp_Reflects:
   1.288 +     "L_Reflects(?Cl, \<lambda>xz. \<exists>x[L]. \<exists>y[L]. \<exists>z[L]. \<exists>xy[L]. \<exists>yz[L]. 
   1.289 +		  pair(L,x,z,xz) & pair(L,x,y,xy) & pair(L,y,z,yz) & 
   1.290 +                  xy\<in>s & yz\<in>r,
   1.291 +        \<lambda>i xz. \<exists>x\<in>Lset(i). \<exists>y\<in>Lset(i). \<exists>z\<in>Lset(i). \<exists>xy\<in>Lset(i). \<exists>yz\<in>Lset(i). 
   1.292 +		  pair(**Lset(i),x,z,xz) & pair(**Lset(i),x,y,xy) & 
   1.293 +                  pair(**Lset(i),y,z,yz) & xy\<in>s & yz\<in>r)"
   1.294 +by fast
   1.295 +
   1.296 +lemma comp_separation:
   1.297 +     "[| L(r); L(s) |]
   1.298 +      ==> separation(L, \<lambda>xz. \<exists>x[L]. \<exists>y[L]. \<exists>z[L]. \<exists>xy[L]. \<exists>yz[L]. 
   1.299 +		  pair(L,x,z,xz) & pair(L,x,y,xy) & pair(L,y,z,yz) & 
   1.300 +                  xy\<in>s & yz\<in>r)"
   1.301 +apply (rule separation_CollectI) 
   1.302 +apply (rule_tac A="{r,s,z}" in subset_LsetE, blast ) 
   1.303 +apply (rule ReflectsE [OF comp_Reflects], assumption)
   1.304 +apply (drule subset_Lset_ltD, assumption) 
   1.305 +apply (erule reflection_imp_L_separation)
   1.306 +  apply (simp_all add: lt_Ord2, clarify)
   1.307 +apply (rule DPowI2)
   1.308 +apply (rename_tac u) 
   1.309 +apply (rule bex_iff_sats)+
   1.310 +apply (rename_tac x y z)  
   1.311 +apply (rule conj_iff_sats)
   1.312 +apply (rule_tac env="[z,y,x,u,r,s]" in pair_iff_sats)
   1.313 +apply (blast intro: nth_0 nth_ConsI) 
   1.314 +apply (blast intro: nth_0 nth_ConsI) 
   1.315 +apply (blast intro: nth_0 nth_ConsI, simp_all)
   1.316 +apply (rule bex_iff_sats) 
   1.317 +apply (rule conj_iff_sats)
   1.318 +apply (rule pair_iff_sats)
   1.319 +apply (blast intro: nth_0 nth_ConsI) 
   1.320 +apply (blast intro: nth_0 nth_ConsI) 
   1.321 +apply (blast intro: nth_0 nth_ConsI, simp_all)
   1.322 +apply (rule bex_iff_sats) 
   1.323 +apply (rule conj_iff_sats)
   1.324 +apply (rule pair_iff_sats)
   1.325 +apply (blast intro: nth_0 nth_ConsI) 
   1.326 +apply (blast intro: nth_0 nth_ConsI) 
   1.327 +apply (blast intro: nth_0 nth_ConsI, simp_all) 
   1.328 +apply (rule conj_iff_sats)
   1.329 +apply (rule mem_iff_sats) 
   1.330 +apply (blast intro: nth_0 nth_ConsI) 
   1.331 +apply (blast intro: nth_0 nth_ConsI, simp) 
   1.332 +apply (rule mem_iff_sats) 
   1.333 +apply (blast intro: nth_0 nth_ConsI) 
   1.334 +apply (blast intro: nth_0 nth_ConsI)
   1.335 +apply (simp_all add: succ_Un_distrib [symmetric])
   1.336 +done
   1.337 +
   1.338 +
   1.339 +
   1.340 +
   1.341  end
   1.342  
   1.343  (*
   1.344  
   1.345 -  and cartprod_separation:
   1.346 -     "[| L(A); L(B) |] 
   1.347 -      ==> separation(L, \<lambda>z. \<exists>x\<in>A. \<exists>y\<in>B. L(x) & L(y) & pair(L,x,y,z))"
   1.348 -  and image_separation:
   1.349 -     "[| L(A); L(r) |] 
   1.350 -      ==> separation(L, \<lambda>y. \<exists>p\<in>r. L(p) & (\<exists>x\<in>A. L(x) & pair(L,x,y,p)))"
   1.351 -  and vimage_separation:
   1.352 -     "[| L(A); L(r) |] 
   1.353 -      ==> separation(L, \<lambda>x. \<exists>p\<in>r. L(p) & (\<exists>y\<in>A. L(x) & pair(L,x,y,p)))"
   1.354 -  and converse_separation:
   1.355 -     "L(r) ==> separation(L, \<lambda>z. \<exists>p\<in>r. L(p) & (\<exists>x y. L(x) & L(y) & 
   1.356 -				     pair(L,x,y,p) & pair(L,y,x,z)))"
   1.357 -  and restrict_separation:
   1.358 -     "L(A) 
   1.359 -      ==> separation(L, \<lambda>z. \<exists>x\<in>A. L(x) & (\<exists>y. L(y) & pair(L,x,y,z)))"
   1.360 -  and comp_separation:
   1.361 -     "[| L(r); L(s) |]
   1.362 -      ==> separation(L, \<lambda>xz. \<exists>x y z. L(x) & L(y) & L(z) &
   1.363 -			   (\<exists>xy\<in>s. \<exists>yz\<in>r. L(xy) & L(yz) & 
   1.364 -		  pair(L,x,z,xz) & pair(L,x,y,xy) & pair(L,y,z,yz)))"
   1.365    and pred_separation:
   1.366       "[| L(r); L(x) |] ==> separation(L, \<lambda>y. \<exists>p\<in>r. L(p) & pair(L,y,x,p))"
   1.367    and Memrel_separation: