author | wenzelm |
Sun, 10 Dec 2023 12:54:31 +0100 | |
changeset 79230 | f3e7822deb1c |
parent 76214 | 0c18df79b1c8 |
permissions | -rw-r--r-- |
13437
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
1 |
(* Title: ZF/Constructible/Separation.thy |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
2 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
3 |
*) |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
4 |
|
60770 | 5 |
section\<open>Early Instances of Separation and Strong Replacement\<close> |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
6 |
|
16417 | 7 |
theory Separation imports L_axioms WF_absolute begin |
13306 | 8 |
|
61798 | 9 |
text\<open>This theory proves all instances needed for locale \<open>M_basic\<close>\<close> |
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13324
diff
changeset
|
10 |
|
60770 | 11 |
text\<open>Helps us solve for de Bruijn indices!\<close> |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
12 |
lemma nth_ConsI: "\<lbrakk>nth(n,l) = x; n \<in> nat\<rbrakk> \<Longrightarrow> nth(succ(n), Cons(a,l)) = x" |
13306 | 13 |
by simp |
14 |
||
13316 | 15 |
lemmas nth_rules = nth_0 nth_ConsI nat_0I nat_succI |
13428 | 16 |
lemmas sep_rules = nth_0 nth_ConsI FOL_iff_sats function_iff_sats |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
17 |
fun_plus_iff_sats |
13306 | 18 |
|
19 |
lemma Collect_conj_in_DPow: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
20 |
"\<lbrakk>{x\<in>A. P(x)} \<in> DPow(A); {x\<in>A. Q(x)} \<in> DPow(A)\<rbrakk> |
76214 | 21 |
\<Longrightarrow> {x\<in>A. P(x) \<and> Q(x)} \<in> DPow(A)" |
13428 | 22 |
by (simp add: Int_in_DPow Collect_Int_Collect_eq [symmetric]) |
13306 | 23 |
|
24 |
lemma Collect_conj_in_DPow_Lset: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
25 |
"\<lbrakk>z \<in> Lset(j); {x \<in> Lset(j). P(x)} \<in> DPow(Lset(j))\<rbrakk> |
76214 | 26 |
\<Longrightarrow> {x \<in> Lset(j). x \<in> z \<and> P(x)} \<in> DPow(Lset(j))" |
13306 | 27 |
apply (frule mem_Lset_imp_subset_Lset) |
13428 | 28 |
apply (simp add: Collect_conj_in_DPow Collect_mem_eq |
13306 | 29 |
subset_Int_iff2 elem_subset_in_DPow) |
30 |
done |
|
31 |
||
32 |
lemma separation_CollectI: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
33 |
"(\<And>z. L(z) \<Longrightarrow> L({x \<in> z . P(x)})) \<Longrightarrow> separation(L, \<lambda>x. P(x))" |
13428 | 34 |
apply (unfold separation_def, clarify) |
35 |
apply (rule_tac x="{x\<in>z. P(x)}" in rexI) |
|
13306 | 36 |
apply simp_all |
37 |
done |
|
38 |
||
60770 | 39 |
text\<open>Reduces the original comprehension to the reflected one\<close> |
13306 | 40 |
lemma reflection_imp_L_separation: |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
41 |
"\<lbrakk>\<forall>x\<in>Lset(j). P(x) \<longleftrightarrow> Q(x); |
13428 | 42 |
{x \<in> Lset(j) . Q(x)} \<in> DPow(Lset(j)); |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
43 |
Ord(j); z \<in> Lset(j)\<rbrakk> \<Longrightarrow> L({x \<in> z . P(x)})" |
13306 | 44 |
apply (rule_tac i = "succ(j)" in L_I) |
45 |
prefer 2 apply simp |
|
76214 | 46 |
apply (subgoal_tac "{x \<in> z. P(x)} = {x \<in> Lset(j). x \<in> z \<and> (Q(x))}") |
13306 | 47 |
prefer 2 |
13428 | 48 |
apply (blast dest: mem_Lset_imp_subset_Lset) |
13306 | 49 |
apply (simp add: Lset_succ Collect_conj_in_DPow_Lset) |
50 |
done |
|
51 |
||
60770 | 52 |
text\<open>Encapsulates the standard proof script for proving instances of |
53 |
Separation.\<close> |
|
13566 | 54 |
lemma gen_separation: |
55 |
assumes reflection: "REFLECTS [P,Q]" |
|
56 |
and Lu: "L(u)" |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
57 |
and collI: "\<And>j. u \<in> Lset(j) |
13566 | 58 |
\<Longrightarrow> Collect(Lset(j), Q(j)) \<in> DPow(Lset(j))" |
59 |
shows "separation(L,P)" |
|
60 |
apply (rule separation_CollectI) |
|
61 |
apply (rule_tac A="{u,z}" in subset_LsetE, blast intro: Lu) |
|
62 |
apply (rule ReflectsE [OF reflection], assumption) |
|
63 |
apply (drule subset_Lset_ltD, assumption) |
|
64 |
apply (erule reflection_imp_L_separation) |
|
65 |
apply (simp_all add: lt_Ord2, clarify) |
|
13691 | 66 |
apply (rule collI, assumption) |
13687 | 67 |
done |
68 |
||
69593 | 69 |
text\<open>As above, but typically \<^term>\<open>u\<close> is a finite enumeration such as |
70 |
\<^term>\<open>{a,b}\<close>; thus the new subgoal gets the assumption |
|
71 |
\<^term>\<open>{a,b} \<subseteq> Lset(i)\<close>, which is logically equivalent to |
|
72 |
\<^term>\<open>a \<in> Lset(i)\<close> and \<^term>\<open>b \<in> Lset(i)\<close>.\<close> |
|
13687 | 73 |
lemma gen_separation_multi: |
74 |
assumes reflection: "REFLECTS [P,Q]" |
|
75 |
and Lu: "L(u)" |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
76 |
and collI: "\<And>j. u \<subseteq> Lset(j) |
13687 | 77 |
\<Longrightarrow> Collect(Lset(j), Q(j)) \<in> DPow(Lset(j))" |
78 |
shows "separation(L,P)" |
|
79 |
apply (rule gen_separation [OF reflection Lu]) |
|
80 |
apply (drule mem_Lset_imp_subset_Lset) |
|
81 |
apply (erule collI) |
|
13566 | 82 |
done |
83 |
||
13306 | 84 |
|
60770 | 85 |
subsection\<open>Separation for Intersection\<close> |
13306 | 86 |
|
87 |
lemma Inter_Reflects: |
|
46823 | 88 |
"REFLECTS[\<lambda>x. \<forall>y[L]. y\<in>A \<longrightarrow> x \<in> y, |
89 |
\<lambda>i x. \<forall>y\<in>Lset(i). y\<in>A \<longrightarrow> x \<in> y]" |
|
13428 | 90 |
by (intro FOL_reflections) |
13306 | 91 |
|
92 |
lemma Inter_separation: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
93 |
"L(A) \<Longrightarrow> separation(L, \<lambda>x. \<forall>y[L]. y\<in>A \<longrightarrow> x\<in>y)" |
13566 | 94 |
apply (rule gen_separation [OF Inter_Reflects], simp) |
13428 | 95 |
apply (rule DPow_LsetI) |
60770 | 96 |
txt\<open>I leave this one example of a manual proof. The tedium of manually |
69593 | 97 |
instantiating \<^term>\<open>i\<close>, \<^term>\<open>j\<close> and \<^term>\<open>env\<close> is obvious.\<close> |
13428 | 98 |
apply (rule ball_iff_sats) |
13306 | 99 |
apply (rule imp_iff_sats) |
100 |
apply (rule_tac [2] i=1 and j=0 and env="[y,x,A]" in mem_iff_sats) |
|
101 |
apply (rule_tac i=0 and j=2 in mem_iff_sats) |
|
102 |
apply (simp_all add: succ_Un_distrib [symmetric]) |
|
103 |
done |
|
104 |
||
60770 | 105 |
subsection\<open>Separation for Set Difference\<close> |
13437
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
106 |
|
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
107 |
lemma Diff_Reflects: |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
108 |
"REFLECTS[\<lambda>x. x \<notin> B, \<lambda>i x. x \<notin> B]" |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
109 |
by (intro FOL_reflections) |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
110 |
|
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
111 |
lemma Diff_separation: |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
112 |
"L(B) \<Longrightarrow> separation(L, \<lambda>x. x \<notin> B)" |
13566 | 113 |
apply (rule gen_separation [OF Diff_Reflects], simp) |
13687 | 114 |
apply (rule_tac env="[B]" in DPow_LsetI) |
13437
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
115 |
apply (rule sep_rules | simp)+ |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
116 |
done |
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
117 |
|
60770 | 118 |
subsection\<open>Separation for Cartesian Product\<close> |
13306 | 119 |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
120 |
lemma cartprod_Reflects: |
76214 | 121 |
"REFLECTS[\<lambda>z. \<exists>x[L]. x\<in>A \<and> (\<exists>y[L]. y\<in>B \<and> pair(L,x,y,z)), |
122 |
\<lambda>i z. \<exists>x\<in>Lset(i). x\<in>A \<and> (\<exists>y\<in>Lset(i). y\<in>B \<and> |
|
13807
a28a8fbc76d4
changed ** to ## to avoid conflict with new comment syntax
paulson
parents:
13691
diff
changeset
|
123 |
pair(##Lset(i),x,y,z))]" |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
124 |
by (intro FOL_reflections function_reflections) |
13306 | 125 |
|
126 |
lemma cartprod_separation: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
127 |
"\<lbrakk>L(A); L(B)\<rbrakk> |
76214 | 128 |
\<Longrightarrow> separation(L, \<lambda>z. \<exists>x[L]. x\<in>A \<and> (\<exists>y[L]. y\<in>B \<and> pair(L,x,y,z)))" |
13687 | 129 |
apply (rule gen_separation_multi [OF cartprod_Reflects, of "{A,B}"], auto) |
130 |
apply (rule_tac env="[A,B]" in DPow_LsetI) |
|
13316 | 131 |
apply (rule sep_rules | simp)+ |
13306 | 132 |
done |
133 |
||
60770 | 134 |
subsection\<open>Separation for Image\<close> |
13306 | 135 |
|
136 |
lemma image_Reflects: |
|
76214 | 137 |
"REFLECTS[\<lambda>y. \<exists>p[L]. p\<in>r \<and> (\<exists>x[L]. x\<in>A \<and> pair(L,x,y,p)), |
138 |
\<lambda>i y. \<exists>p\<in>Lset(i). p\<in>r \<and> (\<exists>x\<in>Lset(i). x\<in>A \<and> pair(##Lset(i),x,y,p))]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
139 |
by (intro FOL_reflections function_reflections) |
13306 | 140 |
|
141 |
lemma image_separation: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
142 |
"\<lbrakk>L(A); L(r)\<rbrakk> |
76214 | 143 |
\<Longrightarrow> separation(L, \<lambda>y. \<exists>p[L]. p\<in>r \<and> (\<exists>x[L]. x\<in>A \<and> pair(L,x,y,p)))" |
13687 | 144 |
apply (rule gen_separation_multi [OF image_Reflects, of "{A,r}"], auto) |
145 |
apply (rule_tac env="[A,r]" in DPow_LsetI) |
|
13316 | 146 |
apply (rule sep_rules | simp)+ |
13306 | 147 |
done |
148 |
||
149 |
||
60770 | 150 |
subsection\<open>Separation for Converse\<close> |
13306 | 151 |
|
152 |
lemma converse_Reflects: |
|
76214 | 153 |
"REFLECTS[\<lambda>z. \<exists>p[L]. p\<in>r \<and> (\<exists>x[L]. \<exists>y[L]. pair(L,x,y,p) \<and> pair(L,y,x,z)), |
154 |
\<lambda>i z. \<exists>p\<in>Lset(i). p\<in>r \<and> (\<exists>x\<in>Lset(i). \<exists>y\<in>Lset(i). |
|
155 |
pair(##Lset(i),x,y,p) \<and> pair(##Lset(i),y,x,z))]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
156 |
by (intro FOL_reflections function_reflections) |
13306 | 157 |
|
158 |
lemma converse_separation: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
159 |
"L(r) \<Longrightarrow> separation(L, |
76214 | 160 |
\<lambda>z. \<exists>p[L]. p\<in>r \<and> (\<exists>x[L]. \<exists>y[L]. pair(L,x,y,p) \<and> pair(L,y,x,z)))" |
13566 | 161 |
apply (rule gen_separation [OF converse_Reflects], simp) |
13687 | 162 |
apply (rule_tac env="[r]" in DPow_LsetI) |
13316 | 163 |
apply (rule sep_rules | simp)+ |
13306 | 164 |
done |
165 |
||
166 |
||
60770 | 167 |
subsection\<open>Separation for Restriction\<close> |
13306 | 168 |
|
169 |
lemma restrict_Reflects: |
|
76214 | 170 |
"REFLECTS[\<lambda>z. \<exists>x[L]. x\<in>A \<and> (\<exists>y[L]. pair(L,x,y,z)), |
171 |
\<lambda>i z. \<exists>x\<in>Lset(i). x\<in>A \<and> (\<exists>y\<in>Lset(i). pair(##Lset(i),x,y,z))]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
172 |
by (intro FOL_reflections function_reflections) |
13306 | 173 |
|
174 |
lemma restrict_separation: |
|
76214 | 175 |
"L(A) \<Longrightarrow> separation(L, \<lambda>z. \<exists>x[L]. x\<in>A \<and> (\<exists>y[L]. pair(L,x,y,z)))" |
13566 | 176 |
apply (rule gen_separation [OF restrict_Reflects], simp) |
13687 | 177 |
apply (rule_tac env="[A]" in DPow_LsetI) |
13316 | 178 |
apply (rule sep_rules | simp)+ |
13306 | 179 |
done |
180 |
||
181 |
||
60770 | 182 |
subsection\<open>Separation for Composition\<close> |
13306 | 183 |
|
184 |
lemma comp_Reflects: |
|
13428 | 185 |
"REFLECTS[\<lambda>xz. \<exists>x[L]. \<exists>y[L]. \<exists>z[L]. \<exists>xy[L]. \<exists>yz[L]. |
76214 | 186 |
pair(L,x,z,xz) \<and> pair(L,x,y,xy) \<and> pair(L,y,z,yz) \<and> |
187 |
xy\<in>s \<and> yz\<in>r, |
|
13428 | 188 |
\<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). |
76214 | 189 |
pair(##Lset(i),x,z,xz) \<and> pair(##Lset(i),x,y,xy) \<and> |
190 |
pair(##Lset(i),y,z,yz) \<and> xy\<in>s \<and> yz\<in>r]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
191 |
by (intro FOL_reflections function_reflections) |
13306 | 192 |
|
193 |
lemma comp_separation: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
194 |
"\<lbrakk>L(r); L(s)\<rbrakk> |
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
195 |
\<Longrightarrow> separation(L, \<lambda>xz. \<exists>x[L]. \<exists>y[L]. \<exists>z[L]. \<exists>xy[L]. \<exists>yz[L]. |
76214 | 196 |
pair(L,x,z,xz) \<and> pair(L,x,y,xy) \<and> pair(L,y,z,yz) \<and> |
197 |
xy\<in>s \<and> yz\<in>r)" |
|
13687 | 198 |
apply (rule gen_separation_multi [OF comp_Reflects, of "{r,s}"], auto) |
60770 | 199 |
txt\<open>Subgoals after applying general ``separation'' rule: |
200 |
@{subgoals[display,indent=0,margin=65]}\<close> |
|
13687 | 201 |
apply (rule_tac env="[r,s]" in DPow_LsetI) |
60770 | 202 |
txt\<open>Subgoals ready for automatic synthesis of a formula: |
203 |
@{subgoals[display,indent=0,margin=65]}\<close> |
|
13316 | 204 |
apply (rule sep_rules | simp)+ |
13306 | 205 |
done |
206 |
||
13687 | 207 |
|
60770 | 208 |
subsection\<open>Separation for Predecessors in an Order\<close> |
13306 | 209 |
|
210 |
lemma pred_Reflects: |
|
76214 | 211 |
"REFLECTS[\<lambda>y. \<exists>p[L]. p\<in>r \<and> pair(L,y,x,p), |
212 |
\<lambda>i y. \<exists>p \<in> Lset(i). p\<in>r \<and> pair(##Lset(i),y,x,p)]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
213 |
by (intro FOL_reflections function_reflections) |
13306 | 214 |
|
215 |
lemma pred_separation: |
|
76214 | 216 |
"\<lbrakk>L(r); L(x)\<rbrakk> \<Longrightarrow> separation(L, \<lambda>y. \<exists>p[L]. p\<in>r \<and> pair(L,y,x,p))" |
13687 | 217 |
apply (rule gen_separation_multi [OF pred_Reflects, of "{r,x}"], auto) |
218 |
apply (rule_tac env="[r,x]" in DPow_LsetI) |
|
13316 | 219 |
apply (rule sep_rules | simp)+ |
13306 | 220 |
done |
221 |
||
222 |
||
60770 | 223 |
subsection\<open>Separation for the Membership Relation\<close> |
13306 | 224 |
|
225 |
lemma Memrel_Reflects: |
|
76214 | 226 |
"REFLECTS[\<lambda>z. \<exists>x[L]. \<exists>y[L]. pair(L,x,y,z) \<and> x \<in> y, |
227 |
\<lambda>i z. \<exists>x \<in> Lset(i). \<exists>y \<in> Lset(i). pair(##Lset(i),x,y,z) \<and> x \<in> y]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
228 |
by (intro FOL_reflections function_reflections) |
13306 | 229 |
|
230 |
lemma Memrel_separation: |
|
76214 | 231 |
"separation(L, \<lambda>z. \<exists>x[L]. \<exists>y[L]. pair(L,x,y,z) \<and> x \<in> y)" |
13566 | 232 |
apply (rule gen_separation [OF Memrel_Reflects nonempty]) |
13687 | 233 |
apply (rule_tac env="[]" in DPow_LsetI) |
13316 | 234 |
apply (rule sep_rules | simp)+ |
13306 | 235 |
done |
236 |
||
237 |
||
60770 | 238 |
subsection\<open>Replacement for FunSpace\<close> |
13428 | 239 |
|
13306 | 240 |
lemma funspace_succ_Reflects: |
76214 | 241 |
"REFLECTS[\<lambda>z. \<exists>p[L]. p\<in>A \<and> (\<exists>f[L]. \<exists>b[L]. \<exists>nb[L]. \<exists>cnbf[L]. |
242 |
pair(L,f,b,p) \<and> pair(L,n,b,nb) \<and> is_cons(L,nb,f,cnbf) \<and> |
|
13428 | 243 |
upair(L,cnbf,cnbf,z)), |
76214 | 244 |
\<lambda>i z. \<exists>p \<in> Lset(i). p\<in>A \<and> (\<exists>f \<in> Lset(i). \<exists>b \<in> Lset(i). |
13428 | 245 |
\<exists>nb \<in> Lset(i). \<exists>cnbf \<in> Lset(i). |
76214 | 246 |
pair(##Lset(i),f,b,p) \<and> pair(##Lset(i),n,b,nb) \<and> |
247 |
is_cons(##Lset(i),nb,f,cnbf) \<and> upair(##Lset(i),cnbf,cnbf,z))]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
248 |
by (intro FOL_reflections function_reflections) |
13306 | 249 |
|
250 |
lemma funspace_succ_replacement: |
|
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
251 |
"L(n) \<Longrightarrow> |
13428 | 252 |
strong_replacement(L, \<lambda>p z. \<exists>f[L]. \<exists>b[L]. \<exists>nb[L]. \<exists>cnbf[L]. |
76214 | 253 |
pair(L,f,b,p) \<and> pair(L,n,b,nb) \<and> is_cons(L,nb,f,cnbf) \<and> |
13306 | 254 |
upair(L,cnbf,cnbf,z))" |
13428 | 255 |
apply (rule strong_replacementI) |
13687 | 256 |
apply (rule_tac u="{n,B}" in gen_separation_multi [OF funspace_succ_Reflects], |
257 |
auto) |
|
258 |
apply (rule_tac env="[n,B]" in DPow_LsetI) |
|
13316 | 259 |
apply (rule sep_rules | simp)+ |
13306 | 260 |
done |
261 |
||
262 |
||
69593 | 263 |
subsection\<open>Separation for a Theorem about \<^term>\<open>is_recfun\<close>\<close> |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
264 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
265 |
lemma is_recfun_reflects: |
13428 | 266 |
"REFLECTS[\<lambda>x. \<exists>xa[L]. \<exists>xb[L]. |
76214 | 267 |
pair(L,x,a,xa) \<and> xa \<in> r \<and> pair(L,x,b,xb) \<and> xb \<in> r \<and> |
268 |
(\<exists>fx[L]. \<exists>gx[L]. fun_apply(L,f,x,fx) \<and> fun_apply(L,g,x,gx) \<and> |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
269 |
fx \<noteq> gx), |
13428 | 270 |
\<lambda>i x. \<exists>xa \<in> Lset(i). \<exists>xb \<in> Lset(i). |
76214 | 271 |
pair(##Lset(i),x,a,xa) \<and> xa \<in> r \<and> pair(##Lset(i),x,b,xb) \<and> xb \<in> r \<and> |
272 |
(\<exists>fx \<in> Lset(i). \<exists>gx \<in> Lset(i). fun_apply(##Lset(i),f,x,fx) \<and> |
|
273 |
fun_apply(##Lset(i),g,x,gx) \<and> fx \<noteq> gx)]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
274 |
by (intro FOL_reflections function_reflections fun_plus_reflections) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
275 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
276 |
lemma is_recfun_separation: |
67443
3abf6a722518
standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents:
61798
diff
changeset
|
277 |
\<comment> \<open>for well-founded recursion\<close> |
76213
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
278 |
"\<lbrakk>L(r); L(f); L(g); L(a); L(b)\<rbrakk> |
e44d86131648
Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents:
71568
diff
changeset
|
279 |
\<Longrightarrow> separation(L, |
13428 | 280 |
\<lambda>x. \<exists>xa[L]. \<exists>xb[L]. |
76214 | 281 |
pair(L,x,a,xa) \<and> xa \<in> r \<and> pair(L,x,b,xb) \<and> xb \<in> r \<and> |
282 |
(\<exists>fx[L]. \<exists>gx[L]. fun_apply(L,f,x,fx) \<and> fun_apply(L,g,x,gx) \<and> |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
283 |
fx \<noteq> gx))" |
13687 | 284 |
apply (rule gen_separation_multi [OF is_recfun_reflects, of "{r,f,g,a,b}"], |
285 |
auto) |
|
286 |
apply (rule_tac env="[r,f,g,a,b]" in DPow_LsetI) |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
287 |
apply (rule sep_rules | simp)+ |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
288 |
done |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
289 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
290 |
|
61798 | 291 |
subsection\<open>Instantiating the locale \<open>M_basic\<close>\<close> |
60770 | 292 |
text\<open>Separation (and Strong Replacement) for basic set-theoretic constructions |
293 |
such as intersection, Cartesian Product and image.\<close> |
|
13363 | 294 |
|
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13505
diff
changeset
|
295 |
lemma M_basic_axioms_L: "M_basic_axioms(L)" |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13505
diff
changeset
|
296 |
apply (rule M_basic_axioms.intro) |
13437
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
297 |
apply (assumption | rule |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
30729
diff
changeset
|
298 |
Inter_separation Diff_separation cartprod_separation image_separation |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
30729
diff
changeset
|
299 |
converse_separation restrict_separation |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
30729
diff
changeset
|
300 |
comp_separation pred_separation Memrel_separation |
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
301 |
funspace_succ_replacement is_recfun_separation power_ax)+ |
13428 | 302 |
done |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
303 |
|
71417
89d05db6dd1f
Simplified, generalised version of Constructible due to E. Gunther, M. Pagano and P. Sánchez Terraf
paulson <lp15@cam.ac.uk>
parents:
69593
diff
changeset
|
304 |
theorem M_basic_L: " M_basic(L)" |
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13505
diff
changeset
|
305 |
by (rule M_basic.intro [OF M_trivial_L M_basic_axioms_L]) |
13437
01b3fc0cc1b8
separate "axioms" proofs: more flexible for locale reasoning
paulson
parents:
13429
diff
changeset
|
306 |
|
71568
1005c50b2750
prefer strict qualification (default for 'interpretation', see 461ee3e49ad3) as proposed by Pedro Sánchez Terraf;
wenzelm
parents:
71417
diff
changeset
|
307 |
interpretation L: M_basic L by (rule M_basic_L) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
308 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13319
diff
changeset
|
309 |
|
13306 | 310 |
end |