13306
|
1 |
header {*The Class L Satisfies the ZF Axioms*}
|
13223
|
2 |
|
13269
|
3 |
theory L_axioms = Formula + Relative + Reflection:
|
13223
|
4 |
|
|
5 |
|
|
6 |
text {* The class L satisfies the premises of locale @{text M_axioms} *}
|
|
7 |
|
|
8 |
lemma transL: "[| y\<in>x; L(x) |] ==> L(y)"
|
|
9 |
apply (insert Transset_Lset)
|
|
10 |
apply (simp add: Transset_def L_def, blast)
|
|
11 |
done
|
|
12 |
|
|
13 |
lemma nonempty: "L(0)"
|
|
14 |
apply (simp add: L_def)
|
|
15 |
apply (blast intro: zero_in_Lset)
|
|
16 |
done
|
|
17 |
|
|
18 |
lemma upair_ax: "upair_ax(L)"
|
|
19 |
apply (simp add: upair_ax_def upair_def, clarify)
|
13299
|
20 |
apply (rule_tac x="{x,y}" in rexI)
|
|
21 |
apply (simp_all add: doubleton_in_L)
|
13223
|
22 |
done
|
|
23 |
|
|
24 |
lemma Union_ax: "Union_ax(L)"
|
|
25 |
apply (simp add: Union_ax_def big_union_def, clarify)
|
13299
|
26 |
apply (rule_tac x="Union(x)" in rexI)
|
|
27 |
apply (simp_all add: Union_in_L, auto)
|
13223
|
28 |
apply (blast intro: transL)
|
|
29 |
done
|
|
30 |
|
|
31 |
lemma power_ax: "power_ax(L)"
|
|
32 |
apply (simp add: power_ax_def powerset_def Relative.subset_def, clarify)
|
13299
|
33 |
apply (rule_tac x="{y \<in> Pow(x). L(y)}" in rexI)
|
|
34 |
apply (simp_all add: LPow_in_L, auto)
|
13223
|
35 |
apply (blast intro: transL)
|
|
36 |
done
|
|
37 |
|
|
38 |
subsubsection{*For L to satisfy Replacement *}
|
|
39 |
|
|
40 |
(*Can't move these to Formula unless the definition of univalent is moved
|
|
41 |
there too!*)
|
|
42 |
|
|
43 |
lemma LReplace_in_Lset:
|
|
44 |
"[|X \<in> Lset(i); univalent(L,X,Q); Ord(i)|]
|
|
45 |
==> \<exists>j. Ord(j) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Lset(j)"
|
|
46 |
apply (rule_tac x="\<Union>y \<in> Replace(X, %x y. Q(x,y) & L(y)). succ(lrank(y))"
|
|
47 |
in exI)
|
|
48 |
apply simp
|
|
49 |
apply clarify
|
|
50 |
apply (rule_tac a="x" in UN_I)
|
|
51 |
apply (simp_all add: Replace_iff univalent_def)
|
|
52 |
apply (blast dest: transL L_I)
|
|
53 |
done
|
|
54 |
|
|
55 |
lemma LReplace_in_L:
|
|
56 |
"[|L(X); univalent(L,X,Q)|]
|
|
57 |
==> \<exists>Y. L(Y) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Y"
|
|
58 |
apply (drule L_D, clarify)
|
|
59 |
apply (drule LReplace_in_Lset, assumption+)
|
|
60 |
apply (blast intro: L_I Lset_in_Lset_succ)
|
|
61 |
done
|
|
62 |
|
|
63 |
lemma replacement: "replacement(L,P)"
|
|
64 |
apply (simp add: replacement_def, clarify)
|
13268
|
65 |
apply (frule LReplace_in_L, assumption+, clarify)
|
13299
|
66 |
apply (rule_tac x=Y in rexI)
|
|
67 |
apply (simp_all add: Replace_iff univalent_def, blast)
|
13223
|
68 |
done
|
|
69 |
|
13291
|
70 |
subsection{*Instantiation of the locale @{text M_triv_axioms}*}
|
|
71 |
|
|
72 |
lemma Lset_mono_le: "mono_le_subset(Lset)"
|
|
73 |
by (simp add: mono_le_subset_def le_imp_subset Lset_mono)
|
|
74 |
|
|
75 |
lemma Lset_cont: "cont_Ord(Lset)"
|
|
76 |
by (simp add: cont_Ord_def Limit_Lset_eq OUnion_def Limit_is_Ord)
|
|
77 |
|
|
78 |
lemmas Pair_in_Lset = Formula.Pair_in_LLimit;
|
|
79 |
|
|
80 |
lemmas L_nat = Ord_in_L [OF Ord_nat];
|
|
81 |
|
|
82 |
ML
|
|
83 |
{*
|
|
84 |
val transL = thm "transL";
|
|
85 |
val nonempty = thm "nonempty";
|
|
86 |
val upair_ax = thm "upair_ax";
|
|
87 |
val Union_ax = thm "Union_ax";
|
|
88 |
val power_ax = thm "power_ax";
|
|
89 |
val replacement = thm "replacement";
|
|
90 |
val L_nat = thm "L_nat";
|
|
91 |
|
|
92 |
fun kill_flex_triv_prems st = Seq.hd ((REPEAT_FIRST assume_tac) st);
|
|
93 |
|
|
94 |
fun trivaxL th =
|
|
95 |
kill_flex_triv_prems
|
|
96 |
([transL, nonempty, upair_ax, Union_ax, power_ax, replacement, L_nat]
|
|
97 |
MRS (inst "M" "L" th));
|
|
98 |
|
|
99 |
bind_thm ("ball_abs", trivaxL (thm "M_triv_axioms.ball_abs"));
|
|
100 |
bind_thm ("rall_abs", trivaxL (thm "M_triv_axioms.rall_abs"));
|
|
101 |
bind_thm ("bex_abs", trivaxL (thm "M_triv_axioms.bex_abs"));
|
|
102 |
bind_thm ("rex_abs", trivaxL (thm "M_triv_axioms.rex_abs"));
|
|
103 |
bind_thm ("ball_iff_equiv", trivaxL (thm "M_triv_axioms.ball_iff_equiv"));
|
|
104 |
bind_thm ("M_equalityI", trivaxL (thm "M_triv_axioms.M_equalityI"));
|
|
105 |
bind_thm ("empty_abs", trivaxL (thm "M_triv_axioms.empty_abs"));
|
|
106 |
bind_thm ("subset_abs", trivaxL (thm "M_triv_axioms.subset_abs"));
|
|
107 |
bind_thm ("upair_abs", trivaxL (thm "M_triv_axioms.upair_abs"));
|
|
108 |
bind_thm ("upair_in_M_iff", trivaxL (thm "M_triv_axioms.upair_in_M_iff"));
|
|
109 |
bind_thm ("singleton_in_M_iff", trivaxL (thm "M_triv_axioms.singleton_in_M_iff"));
|
|
110 |
bind_thm ("pair_abs", trivaxL (thm "M_triv_axioms.pair_abs"));
|
|
111 |
bind_thm ("pair_in_M_iff", trivaxL (thm "M_triv_axioms.pair_in_M_iff"));
|
|
112 |
bind_thm ("pair_components_in_M", trivaxL (thm "M_triv_axioms.pair_components_in_M"));
|
|
113 |
bind_thm ("cartprod_abs", trivaxL (thm "M_triv_axioms.cartprod_abs"));
|
|
114 |
bind_thm ("union_abs", trivaxL (thm "M_triv_axioms.union_abs"));
|
|
115 |
bind_thm ("inter_abs", trivaxL (thm "M_triv_axioms.inter_abs"));
|
|
116 |
bind_thm ("setdiff_abs", trivaxL (thm "M_triv_axioms.setdiff_abs"));
|
|
117 |
bind_thm ("Union_abs", trivaxL (thm "M_triv_axioms.Union_abs"));
|
|
118 |
bind_thm ("Union_closed", trivaxL (thm "M_triv_axioms.Union_closed"));
|
|
119 |
bind_thm ("Un_closed", trivaxL (thm "M_triv_axioms.Un_closed"));
|
|
120 |
bind_thm ("cons_closed", trivaxL (thm "M_triv_axioms.cons_closed"));
|
|
121 |
bind_thm ("successor_abs", trivaxL (thm "M_triv_axioms.successor_abs"));
|
|
122 |
bind_thm ("succ_in_M_iff", trivaxL (thm "M_triv_axioms.succ_in_M_iff"));
|
|
123 |
bind_thm ("separation_closed", trivaxL (thm "M_triv_axioms.separation_closed"));
|
|
124 |
bind_thm ("strong_replacementI", trivaxL (thm "M_triv_axioms.strong_replacementI"));
|
|
125 |
bind_thm ("strong_replacement_closed", trivaxL (thm "M_triv_axioms.strong_replacement_closed"));
|
|
126 |
bind_thm ("RepFun_closed", trivaxL (thm "M_triv_axioms.RepFun_closed"));
|
|
127 |
bind_thm ("lam_closed", trivaxL (thm "M_triv_axioms.lam_closed"));
|
|
128 |
bind_thm ("image_abs", trivaxL (thm "M_triv_axioms.image_abs"));
|
|
129 |
bind_thm ("powerset_Pow", trivaxL (thm "M_triv_axioms.powerset_Pow"));
|
|
130 |
bind_thm ("powerset_imp_subset_Pow", trivaxL (thm "M_triv_axioms.powerset_imp_subset_Pow"));
|
|
131 |
bind_thm ("nat_into_M", trivaxL (thm "M_triv_axioms.nat_into_M"));
|
|
132 |
bind_thm ("nat_case_closed", trivaxL (thm "M_triv_axioms.nat_case_closed"));
|
|
133 |
bind_thm ("Inl_in_M_iff", trivaxL (thm "M_triv_axioms.Inl_in_M_iff"));
|
|
134 |
bind_thm ("Inr_in_M_iff", trivaxL (thm "M_triv_axioms.Inr_in_M_iff"));
|
|
135 |
bind_thm ("lt_closed", trivaxL (thm "M_triv_axioms.lt_closed"));
|
|
136 |
bind_thm ("transitive_set_abs", trivaxL (thm "M_triv_axioms.transitive_set_abs"));
|
|
137 |
bind_thm ("ordinal_abs", trivaxL (thm "M_triv_axioms.ordinal_abs"));
|
|
138 |
bind_thm ("limit_ordinal_abs", trivaxL (thm "M_triv_axioms.limit_ordinal_abs"));
|
|
139 |
bind_thm ("successor_ordinal_abs", trivaxL (thm "M_triv_axioms.successor_ordinal_abs"));
|
|
140 |
bind_thm ("finite_ordinal_abs", trivaxL (thm "M_triv_axioms.finite_ordinal_abs"));
|
|
141 |
bind_thm ("omega_abs", trivaxL (thm "M_triv_axioms.omega_abs"));
|
|
142 |
bind_thm ("number1_abs", trivaxL (thm "M_triv_axioms.number1_abs"));
|
|
143 |
bind_thm ("number1_abs", trivaxL (thm "M_triv_axioms.number1_abs"));
|
|
144 |
bind_thm ("number3_abs", trivaxL (thm "M_triv_axioms.number3_abs"));
|
|
145 |
*}
|
|
146 |
|
|
147 |
declare ball_abs [simp]
|
|
148 |
declare rall_abs [simp]
|
|
149 |
declare bex_abs [simp]
|
|
150 |
declare rex_abs [simp]
|
|
151 |
declare empty_abs [simp]
|
|
152 |
declare subset_abs [simp]
|
|
153 |
declare upair_abs [simp]
|
|
154 |
declare upair_in_M_iff [iff]
|
|
155 |
declare singleton_in_M_iff [iff]
|
|
156 |
declare pair_abs [simp]
|
|
157 |
declare pair_in_M_iff [iff]
|
|
158 |
declare cartprod_abs [simp]
|
|
159 |
declare union_abs [simp]
|
|
160 |
declare inter_abs [simp]
|
|
161 |
declare setdiff_abs [simp]
|
|
162 |
declare Union_abs [simp]
|
|
163 |
declare Union_closed [intro,simp]
|
|
164 |
declare Un_closed [intro,simp]
|
|
165 |
declare cons_closed [intro,simp]
|
|
166 |
declare successor_abs [simp]
|
|
167 |
declare succ_in_M_iff [iff]
|
|
168 |
declare separation_closed [intro,simp]
|
13306
|
169 |
declare strong_replacementI
|
13291
|
170 |
declare strong_replacement_closed [intro,simp]
|
|
171 |
declare RepFun_closed [intro,simp]
|
|
172 |
declare lam_closed [intro,simp]
|
|
173 |
declare image_abs [simp]
|
|
174 |
declare nat_into_M [intro]
|
|
175 |
declare Inl_in_M_iff [iff]
|
|
176 |
declare Inr_in_M_iff [iff]
|
|
177 |
declare transitive_set_abs [simp]
|
|
178 |
declare ordinal_abs [simp]
|
|
179 |
declare limit_ordinal_abs [simp]
|
|
180 |
declare successor_ordinal_abs [simp]
|
|
181 |
declare finite_ordinal_abs [simp]
|
|
182 |
declare omega_abs [simp]
|
|
183 |
declare number1_abs [simp]
|
|
184 |
declare number1_abs [simp]
|
|
185 |
declare number3_abs [simp]
|
|
186 |
|
|
187 |
|
|
188 |
subsection{*Instantiation of the locale @{text reflection}*}
|
|
189 |
|
|
190 |
text{*instances of locale constants*}
|
|
191 |
constdefs
|
|
192 |
L_Reflects :: "[i=>o,i=>o,[i,i]=>o] => o"
|
|
193 |
"L_Reflects(Cl,P,Q) == Closed_Unbounded(Cl) &
|
|
194 |
(\<forall>a. Cl(a) --> (\<forall>x \<in> Lset(a). P(x) <-> Q(a,x)))"
|
|
195 |
|
|
196 |
L_F0 :: "[i=>o,i] => i"
|
|
197 |
"L_F0(P,y) == \<mu>b. (\<exists>z. L(z) \<and> P(<y,z>)) --> (\<exists>z\<in>Lset(b). P(<y,z>))"
|
|
198 |
|
|
199 |
L_FF :: "[i=>o,i] => i"
|
|
200 |
"L_FF(P) == \<lambda>a. \<Union>y\<in>Lset(a). L_F0(P,y)"
|
|
201 |
|
|
202 |
L_ClEx :: "[i=>o,i] => o"
|
|
203 |
"L_ClEx(P) == \<lambda>a. Limit(a) \<and> normalize(L_FF(P),a) = a"
|
|
204 |
|
|
205 |
theorem Triv_reflection [intro]:
|
|
206 |
"L_Reflects(Ord, P, \<lambda>a x. P(x))"
|
|
207 |
by (simp add: L_Reflects_def)
|
|
208 |
|
|
209 |
theorem Not_reflection [intro]:
|
|
210 |
"L_Reflects(Cl,P,Q) ==> L_Reflects(Cl, \<lambda>x. ~P(x), \<lambda>a x. ~Q(a,x))"
|
|
211 |
by (simp add: L_Reflects_def)
|
|
212 |
|
|
213 |
theorem And_reflection [intro]:
|
|
214 |
"[| L_Reflects(Cl,P,Q); L_Reflects(C',P',Q') |]
|
|
215 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> C'(a), \<lambda>x. P(x) \<and> P'(x),
|
|
216 |
\<lambda>a x. Q(a,x) \<and> Q'(a,x))"
|
|
217 |
by (simp add: L_Reflects_def Closed_Unbounded_Int, blast)
|
|
218 |
|
|
219 |
theorem Or_reflection [intro]:
|
|
220 |
"[| L_Reflects(Cl,P,Q); L_Reflects(C',P',Q') |]
|
|
221 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> C'(a), \<lambda>x. P(x) \<or> P'(x),
|
|
222 |
\<lambda>a x. Q(a,x) \<or> Q'(a,x))"
|
|
223 |
by (simp add: L_Reflects_def Closed_Unbounded_Int, blast)
|
|
224 |
|
|
225 |
theorem Imp_reflection [intro]:
|
|
226 |
"[| L_Reflects(Cl,P,Q); L_Reflects(C',P',Q') |]
|
|
227 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> C'(a),
|
|
228 |
\<lambda>x. P(x) --> P'(x),
|
|
229 |
\<lambda>a x. Q(a,x) --> Q'(a,x))"
|
|
230 |
by (simp add: L_Reflects_def Closed_Unbounded_Int, blast)
|
|
231 |
|
|
232 |
theorem Iff_reflection [intro]:
|
|
233 |
"[| L_Reflects(Cl,P,Q); L_Reflects(C',P',Q') |]
|
|
234 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> C'(a),
|
|
235 |
\<lambda>x. P(x) <-> P'(x),
|
|
236 |
\<lambda>a x. Q(a,x) <-> Q'(a,x))"
|
|
237 |
by (simp add: L_Reflects_def Closed_Unbounded_Int, blast)
|
|
238 |
|
|
239 |
|
|
240 |
theorem Ex_reflection [intro]:
|
|
241 |
"L_Reflects(Cl, \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x)))
|
|
242 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> L_ClEx(\<lambda>x. P(fst(x),snd(x)), a),
|
|
243 |
\<lambda>x. \<exists>z. L(z) \<and> P(x,z),
|
|
244 |
\<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z))"
|
|
245 |
apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def)
|
|
246 |
apply (rule reflection.Ex_reflection [OF Lset_mono_le Lset_cont Pair_in_Lset],
|
|
247 |
assumption+)
|
|
248 |
done
|
|
249 |
|
|
250 |
theorem All_reflection [intro]:
|
|
251 |
"L_Reflects(Cl, \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x)))
|
|
252 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> L_ClEx(\<lambda>x. ~P(fst(x),snd(x)), a),
|
|
253 |
\<lambda>x. \<forall>z. L(z) --> P(x,z),
|
|
254 |
\<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z))"
|
|
255 |
apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def)
|
|
256 |
apply (rule reflection.All_reflection [OF Lset_mono_le Lset_cont Pair_in_Lset],
|
|
257 |
assumption+)
|
|
258 |
done
|
|
259 |
|
|
260 |
theorem Rex_reflection [intro]:
|
|
261 |
"L_Reflects(Cl, \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x)))
|
|
262 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> L_ClEx(\<lambda>x. P(fst(x),snd(x)), a),
|
|
263 |
\<lambda>x. \<exists>z[L]. P(x,z),
|
|
264 |
\<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z))"
|
|
265 |
by (unfold rex_def, blast)
|
|
266 |
|
|
267 |
theorem Rall_reflection [intro]:
|
|
268 |
"L_Reflects(Cl, \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x)))
|
|
269 |
==> L_Reflects(\<lambda>a. Cl(a) \<and> L_ClEx(\<lambda>x. ~P(fst(x),snd(x)), a),
|
|
270 |
\<lambda>x. \<forall>z[L]. P(x,z),
|
|
271 |
\<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z))"
|
|
272 |
by (unfold rall_def, blast)
|
|
273 |
|
|
274 |
lemma ReflectsD:
|
|
275 |
"[|L_Reflects(Cl,P,Q); Ord(i)|]
|
|
276 |
==> \<exists>j. i<j & (\<forall>x \<in> Lset(j). P(x) <-> Q(j,x))"
|
|
277 |
apply (simp add: L_Reflects_def Closed_Unbounded_def, clarify)
|
|
278 |
apply (blast dest!: UnboundedD)
|
|
279 |
done
|
|
280 |
|
|
281 |
lemma ReflectsE:
|
|
282 |
"[| L_Reflects(Cl,P,Q); Ord(i);
|
|
283 |
!!j. [|i<j; \<forall>x \<in> Lset(j). P(x) <-> Q(j,x)|] ==> R |]
|
|
284 |
==> R"
|
|
285 |
by (blast dest!: ReflectsD)
|
|
286 |
|
|
287 |
lemma Collect_mem_eq: "{x\<in>A. x\<in>B} = A \<inter> B";
|
|
288 |
by blast
|
|
289 |
|
|
290 |
|
13298
|
291 |
subsection{*Internalized formulas for some relativized ones*}
|
|
292 |
|
13306
|
293 |
lemmas setclass_simps = rall_setclass_is_ball rex_setclass_is_bex
|
|
294 |
|
|
295 |
subsubsection{*Some numbers to help write de Bruijn indices*}
|
|
296 |
|
|
297 |
syntax
|
|
298 |
"3" :: i ("3")
|
|
299 |
"4" :: i ("4")
|
|
300 |
"5" :: i ("5")
|
|
301 |
"6" :: i ("6")
|
|
302 |
"7" :: i ("7")
|
|
303 |
"8" :: i ("8")
|
|
304 |
"9" :: i ("9")
|
|
305 |
|
|
306 |
translations
|
|
307 |
"3" == "succ(2)"
|
|
308 |
"4" == "succ(3)"
|
|
309 |
"5" == "succ(4)"
|
|
310 |
"6" == "succ(5)"
|
|
311 |
"7" == "succ(6)"
|
|
312 |
"8" == "succ(7)"
|
|
313 |
"9" == "succ(8)"
|
|
314 |
|
13298
|
315 |
subsubsection{*Unordered pairs*}
|
|
316 |
|
|
317 |
constdefs upair_fm :: "[i,i,i]=>i"
|
|
318 |
"upair_fm(x,y,z) ==
|
|
319 |
And(Member(x,z),
|
|
320 |
And(Member(y,z),
|
|
321 |
Forall(Implies(Member(0,succ(z)),
|
|
322 |
Or(Equal(0,succ(x)), Equal(0,succ(y)))))))"
|
|
323 |
|
|
324 |
lemma upair_type [TC]:
|
|
325 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> upair_fm(x,y,z) \<in> formula"
|
|
326 |
by (simp add: upair_fm_def)
|
|
327 |
|
|
328 |
lemma arity_upair_fm [simp]:
|
|
329 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
330 |
==> arity(upair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
331 |
by (simp add: upair_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
332 |
|
|
333 |
lemma sats_upair_fm [simp]:
|
|
334 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
335 |
==> sats(A, upair_fm(x,y,z), env) <->
|
|
336 |
upair(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
337 |
by (simp add: upair_fm_def upair_def)
|
|
338 |
|
|
339 |
lemma upair_iff_sats:
|
|
340 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
341 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
342 |
==> upair(**A, x, y, z) <-> sats(A, upair_fm(i,j,k), env)"
|
|
343 |
by (simp add: sats_upair_fm)
|
|
344 |
|
|
345 |
text{*Useful? At least it refers to "real" unordered pairs*}
|
|
346 |
lemma sats_upair_fm2 [simp]:
|
|
347 |
"[| x \<in> nat; y \<in> nat; z < length(env); env \<in> list(A); Transset(A)|]
|
|
348 |
==> sats(A, upair_fm(x,y,z), env) <->
|
|
349 |
nth(z,env) = {nth(x,env), nth(y,env)}"
|
|
350 |
apply (frule lt_length_in_nat, assumption)
|
|
351 |
apply (simp add: upair_fm_def Transset_def, auto)
|
|
352 |
apply (blast intro: nth_type)
|
|
353 |
done
|
|
354 |
|
13306
|
355 |
text{*The @{text simplified} attribute tidies up the reflecting class.*}
|
|
356 |
theorem upair_reflection [simplified,intro]:
|
|
357 |
"L_Reflects(?Cl, \<lambda>x. upair(L,f(x),g(x),h(x)),
|
|
358 |
\<lambda>i x. upair(**Lset(i),f(x),g(x),h(x)))"
|
|
359 |
by (simp add: upair_def, fast)
|
|
360 |
|
13298
|
361 |
subsubsection{*Ordered pairs*}
|
|
362 |
|
|
363 |
constdefs pair_fm :: "[i,i,i]=>i"
|
|
364 |
"pair_fm(x,y,z) ==
|
|
365 |
Exists(And(upair_fm(succ(x),succ(x),0),
|
|
366 |
Exists(And(upair_fm(succ(succ(x)),succ(succ(y)),0),
|
|
367 |
upair_fm(1,0,succ(succ(z)))))))"
|
|
368 |
|
|
369 |
lemma pair_type [TC]:
|
|
370 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> pair_fm(x,y,z) \<in> formula"
|
|
371 |
by (simp add: pair_fm_def)
|
|
372 |
|
|
373 |
lemma arity_pair_fm [simp]:
|
|
374 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
375 |
==> arity(pair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
376 |
by (simp add: pair_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
377 |
|
|
378 |
lemma sats_pair_fm [simp]:
|
|
379 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
380 |
==> sats(A, pair_fm(x,y,z), env) <->
|
|
381 |
pair(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
382 |
by (simp add: pair_fm_def pair_def)
|
|
383 |
|
|
384 |
lemma pair_iff_sats:
|
|
385 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
386 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
387 |
==> pair(**A, x, y, z) <-> sats(A, pair_fm(i,j,k), env)"
|
|
388 |
by (simp add: sats_pair_fm)
|
|
389 |
|
|
390 |
theorem pair_reflection [simplified,intro]:
|
|
391 |
"L_Reflects(?Cl, \<lambda>x. pair(L,f(x),g(x),h(x)),
|
|
392 |
\<lambda>i x. pair(**Lset(i),f(x),g(x),h(x)))"
|
13306
|
393 |
by (simp only: pair_def setclass_simps, fast)
|
|
394 |
|
|
395 |
|
|
396 |
subsubsection{*Binary Unions*}
|
13298
|
397 |
|
13306
|
398 |
constdefs union_fm :: "[i,i,i]=>i"
|
|
399 |
"union_fm(x,y,z) ==
|
|
400 |
Forall(Iff(Member(0,succ(z)),
|
|
401 |
Or(Member(0,succ(x)),Member(0,succ(y)))))"
|
|
402 |
|
|
403 |
lemma union_type [TC]:
|
|
404 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> union_fm(x,y,z) \<in> formula"
|
|
405 |
by (simp add: union_fm_def)
|
|
406 |
|
|
407 |
lemma arity_union_fm [simp]:
|
|
408 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
409 |
==> arity(union_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
410 |
by (simp add: union_fm_def succ_Un_distrib [symmetric] Un_ac)
|
13298
|
411 |
|
13306
|
412 |
lemma sats_union_fm [simp]:
|
|
413 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
414 |
==> sats(A, union_fm(x,y,z), env) <->
|
|
415 |
union(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
416 |
by (simp add: union_fm_def union_def)
|
|
417 |
|
|
418 |
lemma union_iff_sats:
|
|
419 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
420 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
421 |
==> union(**A, x, y, z) <-> sats(A, union_fm(i,j,k), env)"
|
|
422 |
by (simp add: sats_union_fm)
|
13298
|
423 |
|
13306
|
424 |
theorem union_reflection [simplified,intro]:
|
|
425 |
"L_Reflects(?Cl, \<lambda>x. union(L,f(x),g(x),h(x)),
|
|
426 |
\<lambda>i x. union(**Lset(i),f(x),g(x),h(x)))"
|
|
427 |
by (simp add: union_def, fast)
|
|
428 |
|
13298
|
429 |
|
13306
|
430 |
subsubsection{*`Cons' for sets*}
|
|
431 |
|
|
432 |
constdefs cons_fm :: "[i,i,i]=>i"
|
|
433 |
"cons_fm(x,y,z) ==
|
|
434 |
Exists(And(upair_fm(succ(x),succ(x),0),
|
|
435 |
union_fm(0,succ(y),succ(z))))"
|
13298
|
436 |
|
|
437 |
|
13306
|
438 |
lemma cons_type [TC]:
|
|
439 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> cons_fm(x,y,z) \<in> formula"
|
|
440 |
by (simp add: cons_fm_def)
|
|
441 |
|
|
442 |
lemma arity_cons_fm [simp]:
|
|
443 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
444 |
==> arity(cons_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
445 |
by (simp add: cons_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
446 |
|
|
447 |
lemma sats_cons_fm [simp]:
|
|
448 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
449 |
==> sats(A, cons_fm(x,y,z), env) <->
|
|
450 |
is_cons(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
451 |
by (simp add: cons_fm_def is_cons_def)
|
|
452 |
|
|
453 |
lemma cons_iff_sats:
|
|
454 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
455 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
456 |
==> is_cons(**A, x, y, z) <-> sats(A, cons_fm(i,j,k), env)"
|
|
457 |
by simp
|
|
458 |
|
|
459 |
theorem cons_reflection [simplified,intro]:
|
|
460 |
"L_Reflects(?Cl, \<lambda>x. is_cons(L,f(x),g(x),h(x)),
|
|
461 |
\<lambda>i x. is_cons(**Lset(i),f(x),g(x),h(x)))"
|
|
462 |
by (simp only: is_cons_def setclass_simps, fast)
|
13298
|
463 |
|
|
464 |
|
13306
|
465 |
subsubsection{*Function Applications*}
|
|
466 |
|
|
467 |
constdefs fun_apply_fm :: "[i,i,i]=>i"
|
|
468 |
"fun_apply_fm(f,x,y) ==
|
|
469 |
Forall(Iff(Exists(And(Member(0,succ(succ(f))),
|
|
470 |
pair_fm(succ(succ(x)), 1, 0))),
|
|
471 |
Equal(succ(y),0)))"
|
13298
|
472 |
|
13306
|
473 |
lemma fun_apply_type [TC]:
|
|
474 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> fun_apply_fm(x,y,z) \<in> formula"
|
|
475 |
by (simp add: fun_apply_fm_def)
|
|
476 |
|
|
477 |
lemma arity_fun_apply_fm [simp]:
|
|
478 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
479 |
==> arity(fun_apply_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
480 |
by (simp add: fun_apply_fm_def succ_Un_distrib [symmetric] Un_ac)
|
13298
|
481 |
|
13306
|
482 |
lemma sats_fun_apply_fm [simp]:
|
|
483 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
484 |
==> sats(A, fun_apply_fm(x,y,z), env) <->
|
|
485 |
fun_apply(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
486 |
by (simp add: fun_apply_fm_def fun_apply_def)
|
|
487 |
|
|
488 |
lemma fun_apply_iff_sats:
|
|
489 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
490 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
491 |
==> fun_apply(**A, x, y, z) <-> sats(A, fun_apply_fm(i,j,k), env)"
|
|
492 |
by simp
|
|
493 |
|
|
494 |
theorem fun_apply_reflection [simplified,intro]:
|
|
495 |
"L_Reflects(?Cl, \<lambda>x. fun_apply(L,f(x),g(x),h(x)),
|
|
496 |
\<lambda>i x. fun_apply(**Lset(i),f(x),g(x),h(x)))"
|
|
497 |
by (simp only: fun_apply_def setclass_simps, fast)
|
13298
|
498 |
|
|
499 |
|
13306
|
500 |
subsubsection{*Variants of Satisfaction Definitions for Ordinals, etc.*}
|
|
501 |
|
|
502 |
text{*Differs from the one in Formula by using "ordinal" rather than "Ord"*}
|
|
503 |
|
|
504 |
|
|
505 |
lemma sats_subset_fm':
|
|
506 |
"[|x \<in> nat; y \<in> nat; env \<in> list(A)|]
|
|
507 |
==> sats(A, subset_fm(x,y), env) <-> subset(**A, nth(x,env), nth(y,env))"
|
|
508 |
by (simp add: subset_fm_def subset_def)
|
13298
|
509 |
|
13306
|
510 |
theorem subset_reflection [simplified,intro]:
|
|
511 |
"L_Reflects(?Cl, \<lambda>x. subset(L,f(x),g(x)),
|
|
512 |
\<lambda>i x. subset(**Lset(i),f(x),g(x)))"
|
|
513 |
by (simp add: subset_def, fast)
|
|
514 |
|
|
515 |
lemma sats_transset_fm':
|
|
516 |
"[|x \<in> nat; env \<in> list(A)|]
|
|
517 |
==> sats(A, transset_fm(x), env) <-> transitive_set(**A, nth(x,env))"
|
|
518 |
by (simp add: sats_subset_fm' transset_fm_def transitive_set_def)
|
13298
|
519 |
|
13306
|
520 |
theorem transitive_set_reflection [simplified,intro]:
|
|
521 |
"L_Reflects(?Cl, \<lambda>x. transitive_set(L,f(x)),
|
|
522 |
\<lambda>i x. transitive_set(**Lset(i),f(x)))"
|
|
523 |
by (simp only: transitive_set_def setclass_simps, fast)
|
|
524 |
|
|
525 |
lemma sats_ordinal_fm':
|
|
526 |
"[|x \<in> nat; env \<in> list(A)|]
|
|
527 |
==> sats(A, ordinal_fm(x), env) <-> ordinal(**A,nth(x,env))"
|
|
528 |
by (simp add: sats_transset_fm' ordinal_fm_def ordinal_def)
|
|
529 |
|
|
530 |
lemma ordinal_iff_sats:
|
|
531 |
"[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|]
|
|
532 |
==> ordinal(**A, x) <-> sats(A, ordinal_fm(i), env)"
|
|
533 |
by (simp add: sats_ordinal_fm')
|
|
534 |
|
|
535 |
theorem ordinal_reflection [simplified,intro]:
|
|
536 |
"L_Reflects(?Cl, \<lambda>x. ordinal(L,f(x)),
|
|
537 |
\<lambda>i x. ordinal(**Lset(i),f(x)))"
|
|
538 |
by (simp only: ordinal_def setclass_simps, fast)
|
13298
|
539 |
|
|
540 |
|
13306
|
541 |
subsubsection{*Membership Relation*}
|
13298
|
542 |
|
13306
|
543 |
constdefs Memrel_fm :: "[i,i]=>i"
|
|
544 |
"Memrel_fm(A,r) ==
|
|
545 |
Forall(Iff(Member(0,succ(r)),
|
|
546 |
Exists(And(Member(0,succ(succ(A))),
|
|
547 |
Exists(And(Member(0,succ(succ(succ(A)))),
|
|
548 |
And(Member(1,0),
|
|
549 |
pair_fm(1,0,2))))))))"
|
|
550 |
|
|
551 |
lemma Memrel_type [TC]:
|
|
552 |
"[| x \<in> nat; y \<in> nat |] ==> Memrel_fm(x,y) \<in> formula"
|
|
553 |
by (simp add: Memrel_fm_def)
|
13298
|
554 |
|
13306
|
555 |
lemma arity_Memrel_fm [simp]:
|
|
556 |
"[| x \<in> nat; y \<in> nat |]
|
|
557 |
==> arity(Memrel_fm(x,y)) = succ(x) \<union> succ(y)"
|
|
558 |
by (simp add: Memrel_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
559 |
|
|
560 |
lemma sats_Memrel_fm [simp]:
|
|
561 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
|
|
562 |
==> sats(A, Memrel_fm(x,y), env) <->
|
|
563 |
membership(**A, nth(x,env), nth(y,env))"
|
|
564 |
by (simp add: Memrel_fm_def membership_def)
|
13298
|
565 |
|
13306
|
566 |
lemma Memrel_iff_sats:
|
|
567 |
"[| nth(i,env) = x; nth(j,env) = y;
|
|
568 |
i \<in> nat; j \<in> nat; env \<in> list(A)|]
|
|
569 |
==> membership(**A, x, y) <-> sats(A, Memrel_fm(i,j), env)"
|
|
570 |
by simp
|
13304
|
571 |
|
13306
|
572 |
theorem membership_reflection [simplified,intro]:
|
|
573 |
"L_Reflects(?Cl, \<lambda>x. membership(L,f(x),g(x)),
|
|
574 |
\<lambda>i x. membership(**Lset(i),f(x),g(x)))"
|
|
575 |
by (simp only: membership_def setclass_simps, fast)
|
13304
|
576 |
|
|
577 |
|
13306
|
578 |
subsubsection{*Predecessor Set*}
|
13304
|
579 |
|
13306
|
580 |
constdefs pred_set_fm :: "[i,i,i,i]=>i"
|
|
581 |
"pred_set_fm(A,x,r,B) ==
|
|
582 |
Forall(Iff(Member(0,succ(B)),
|
|
583 |
Exists(And(Member(0,succ(succ(r))),
|
|
584 |
And(Member(1,succ(succ(A))),
|
|
585 |
pair_fm(1,succ(succ(x)),0))))))"
|
|
586 |
|
|
587 |
|
|
588 |
lemma pred_set_type [TC]:
|
|
589 |
"[| A \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat |]
|
|
590 |
==> pred_set_fm(A,x,r,B) \<in> formula"
|
|
591 |
by (simp add: pred_set_fm_def)
|
13304
|
592 |
|
13306
|
593 |
lemma arity_pred_set_fm [simp]:
|
|
594 |
"[| A \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat |]
|
|
595 |
==> arity(pred_set_fm(A,x,r,B)) = succ(A) \<union> succ(x) \<union> succ(r) \<union> succ(B)"
|
|
596 |
by (simp add: pred_set_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
597 |
|
|
598 |
lemma sats_pred_set_fm [simp]:
|
|
599 |
"[| U \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat; env \<in> list(A)|]
|
|
600 |
==> sats(A, pred_set_fm(U,x,r,B), env) <->
|
|
601 |
pred_set(**A, nth(U,env), nth(x,env), nth(r,env), nth(B,env))"
|
|
602 |
by (simp add: pred_set_fm_def pred_set_def)
|
|
603 |
|
|
604 |
lemma pred_set_iff_sats:
|
|
605 |
"[| nth(i,env) = U; nth(j,env) = x; nth(k,env) = r; nth(l,env) = B;
|
|
606 |
i \<in> nat; j \<in> nat; k \<in> nat; l \<in> nat; env \<in> list(A)|]
|
|
607 |
==> pred_set(**A,U,x,r,B) <-> sats(A, pred_set_fm(i,j,k,l), env)"
|
|
608 |
by (simp add: sats_pred_set_fm)
|
|
609 |
|
|
610 |
theorem pred_set_reflection [simplified,intro]:
|
|
611 |
"L_Reflects(?Cl, \<lambda>x. pred_set(L,f(x),g(x),h(x),b(x)),
|
|
612 |
\<lambda>i x. pred_set(**Lset(i),f(x),g(x),h(x),b(x)))"
|
|
613 |
by (simp only: pred_set_def setclass_simps, fast)
|
13304
|
614 |
|
|
615 |
|
13298
|
616 |
|
13306
|
617 |
subsubsection{*Domain*}
|
|
618 |
|
|
619 |
(* "is_domain(M,r,z) ==
|
|
620 |
\<forall>x[M]. (x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. pair(M,x,y,w))))" *)
|
|
621 |
constdefs domain_fm :: "[i,i]=>i"
|
|
622 |
"domain_fm(r,z) ==
|
|
623 |
Forall(Iff(Member(0,succ(z)),
|
|
624 |
Exists(And(Member(0,succ(succ(r))),
|
|
625 |
Exists(pair_fm(2,0,1))))))"
|
|
626 |
|
|
627 |
lemma domain_type [TC]:
|
|
628 |
"[| x \<in> nat; y \<in> nat |] ==> domain_fm(x,y) \<in> formula"
|
|
629 |
by (simp add: domain_fm_def)
|
|
630 |
|
|
631 |
lemma arity_domain_fm [simp]:
|
|
632 |
"[| x \<in> nat; y \<in> nat |]
|
|
633 |
==> arity(domain_fm(x,y)) = succ(x) \<union> succ(y)"
|
|
634 |
by (simp add: domain_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
635 |
|
|
636 |
lemma sats_domain_fm [simp]:
|
|
637 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
|
|
638 |
==> sats(A, domain_fm(x,y), env) <->
|
|
639 |
is_domain(**A, nth(x,env), nth(y,env))"
|
|
640 |
by (simp add: domain_fm_def is_domain_def)
|
|
641 |
|
|
642 |
lemma domain_iff_sats:
|
|
643 |
"[| nth(i,env) = x; nth(j,env) = y;
|
|
644 |
i \<in> nat; j \<in> nat; env \<in> list(A)|]
|
|
645 |
==> is_domain(**A, x, y) <-> sats(A, domain_fm(i,j), env)"
|
|
646 |
by simp
|
|
647 |
|
|
648 |
theorem domain_reflection [simplified,intro]:
|
|
649 |
"L_Reflects(?Cl, \<lambda>x. is_domain(L,f(x),g(x)),
|
|
650 |
\<lambda>i x. is_domain(**Lset(i),f(x),g(x)))"
|
|
651 |
by (simp only: is_domain_def setclass_simps, fast)
|
|
652 |
|
|
653 |
|
|
654 |
subsubsection{*Range*}
|
|
655 |
|
|
656 |
(* "is_range(M,r,z) ==
|
|
657 |
\<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. pair(M,x,y,w))))" *)
|
|
658 |
constdefs range_fm :: "[i,i]=>i"
|
|
659 |
"range_fm(r,z) ==
|
|
660 |
Forall(Iff(Member(0,succ(z)),
|
|
661 |
Exists(And(Member(0,succ(succ(r))),
|
|
662 |
Exists(pair_fm(0,2,1))))))"
|
|
663 |
|
|
664 |
lemma range_type [TC]:
|
|
665 |
"[| x \<in> nat; y \<in> nat |] ==> range_fm(x,y) \<in> formula"
|
|
666 |
by (simp add: range_fm_def)
|
|
667 |
|
|
668 |
lemma arity_range_fm [simp]:
|
|
669 |
"[| x \<in> nat; y \<in> nat |]
|
|
670 |
==> arity(range_fm(x,y)) = succ(x) \<union> succ(y)"
|
|
671 |
by (simp add: range_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
672 |
|
|
673 |
lemma sats_range_fm [simp]:
|
|
674 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
|
|
675 |
==> sats(A, range_fm(x,y), env) <->
|
|
676 |
is_range(**A, nth(x,env), nth(y,env))"
|
|
677 |
by (simp add: range_fm_def is_range_def)
|
|
678 |
|
|
679 |
lemma range_iff_sats:
|
|
680 |
"[| nth(i,env) = x; nth(j,env) = y;
|
|
681 |
i \<in> nat; j \<in> nat; env \<in> list(A)|]
|
|
682 |
==> is_range(**A, x, y) <-> sats(A, range_fm(i,j), env)"
|
|
683 |
by simp
|
|
684 |
|
|
685 |
theorem range_reflection [simplified,intro]:
|
|
686 |
"L_Reflects(?Cl, \<lambda>x. is_range(L,f(x),g(x)),
|
|
687 |
\<lambda>i x. is_range(**Lset(i),f(x),g(x)))"
|
|
688 |
by (simp only: is_range_def setclass_simps, fast)
|
|
689 |
|
|
690 |
|
|
691 |
|
|
692 |
|
|
693 |
|
|
694 |
subsubsection{*Image*}
|
|
695 |
|
|
696 |
(* "image(M,r,A,z) ==
|
|
697 |
\<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. x\<in>A & pair(M,x,y,w))))" *)
|
|
698 |
constdefs image_fm :: "[i,i,i]=>i"
|
|
699 |
"image_fm(r,A,z) ==
|
|
700 |
Forall(Iff(Member(0,succ(z)),
|
|
701 |
Exists(And(Member(0,succ(succ(r))),
|
|
702 |
Exists(And(Member(0,succ(succ(succ(A)))),
|
|
703 |
pair_fm(0,2,1)))))))"
|
|
704 |
|
|
705 |
lemma image_type [TC]:
|
|
706 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> image_fm(x,y,z) \<in> formula"
|
|
707 |
by (simp add: image_fm_def)
|
|
708 |
|
|
709 |
lemma arity_image_fm [simp]:
|
|
710 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
711 |
==> arity(image_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
712 |
by (simp add: image_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
713 |
|
|
714 |
lemma sats_image_fm [simp]:
|
|
715 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
716 |
==> sats(A, image_fm(x,y,z), env) <->
|
|
717 |
image(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
718 |
by (simp add: image_fm_def image_def)
|
|
719 |
|
|
720 |
lemma image_iff_sats:
|
|
721 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
722 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
723 |
==> image(**A, x, y, z) <-> sats(A, image_fm(i,j,k), env)"
|
|
724 |
by (simp add: sats_image_fm)
|
|
725 |
|
|
726 |
theorem image_reflection [simplified,intro]:
|
|
727 |
"L_Reflects(?Cl, \<lambda>x. image(L,f(x),g(x),h(x)),
|
|
728 |
\<lambda>i x. image(**Lset(i),f(x),g(x),h(x)))"
|
|
729 |
by (simp only: image_def setclass_simps, fast)
|
|
730 |
|
|
731 |
|
|
732 |
subsubsection{*The Concept of Relation*}
|
|
733 |
|
|
734 |
(* "is_relation(M,r) ==
|
|
735 |
(\<forall>z[M]. z\<in>r --> (\<exists>x[M]. \<exists>y[M]. pair(M,x,y,z)))" *)
|
|
736 |
constdefs relation_fm :: "i=>i"
|
|
737 |
"relation_fm(r) ==
|
|
738 |
Forall(Implies(Member(0,succ(r)), Exists(Exists(pair_fm(1,0,2)))))"
|
|
739 |
|
|
740 |
lemma relation_type [TC]:
|
|
741 |
"[| x \<in> nat |] ==> relation_fm(x) \<in> formula"
|
|
742 |
by (simp add: relation_fm_def)
|
|
743 |
|
|
744 |
lemma arity_relation_fm [simp]:
|
|
745 |
"x \<in> nat ==> arity(relation_fm(x)) = succ(x)"
|
|
746 |
by (simp add: relation_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
747 |
|
|
748 |
lemma sats_relation_fm [simp]:
|
|
749 |
"[| x \<in> nat; env \<in> list(A)|]
|
|
750 |
==> sats(A, relation_fm(x), env) <-> is_relation(**A, nth(x,env))"
|
|
751 |
by (simp add: relation_fm_def is_relation_def)
|
|
752 |
|
|
753 |
lemma relation_iff_sats:
|
|
754 |
"[| nth(i,env) = x; nth(j,env) = y;
|
|
755 |
i \<in> nat; env \<in> list(A)|]
|
|
756 |
==> is_relation(**A, x) <-> sats(A, relation_fm(i), env)"
|
|
757 |
by simp
|
|
758 |
|
|
759 |
theorem is_relation_reflection [simplified,intro]:
|
|
760 |
"L_Reflects(?Cl, \<lambda>x. is_relation(L,f(x)),
|
|
761 |
\<lambda>i x. is_relation(**Lset(i),f(x)))"
|
|
762 |
by (simp only: is_relation_def setclass_simps, fast)
|
|
763 |
|
|
764 |
|
|
765 |
subsubsection{*The Concept of Function*}
|
|
766 |
|
|
767 |
(* "is_function(M,r) ==
|
|
768 |
\<forall>x[M]. \<forall>y[M]. \<forall>y'[M]. \<forall>p[M]. \<forall>p'[M].
|
|
769 |
pair(M,x,y,p) --> pair(M,x,y',p') --> p\<in>r --> p'\<in>r --> y=y'" *)
|
|
770 |
constdefs function_fm :: "i=>i"
|
|
771 |
"function_fm(r) ==
|
|
772 |
Forall(Forall(Forall(Forall(Forall(
|
|
773 |
Implies(pair_fm(4,3,1),
|
|
774 |
Implies(pair_fm(4,2,0),
|
|
775 |
Implies(Member(1,r#+5),
|
|
776 |
Implies(Member(0,r#+5), Equal(3,2))))))))))"
|
|
777 |
|
|
778 |
lemma function_type [TC]:
|
|
779 |
"[| x \<in> nat |] ==> function_fm(x) \<in> formula"
|
|
780 |
by (simp add: function_fm_def)
|
|
781 |
|
|
782 |
lemma arity_function_fm [simp]:
|
|
783 |
"x \<in> nat ==> arity(function_fm(x)) = succ(x)"
|
|
784 |
by (simp add: function_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
785 |
|
|
786 |
lemma sats_function_fm [simp]:
|
|
787 |
"[| x \<in> nat; env \<in> list(A)|]
|
|
788 |
==> sats(A, function_fm(x), env) <-> is_function(**A, nth(x,env))"
|
|
789 |
by (simp add: function_fm_def is_function_def)
|
|
790 |
|
|
791 |
lemma function_iff_sats:
|
|
792 |
"[| nth(i,env) = x; nth(j,env) = y;
|
|
793 |
i \<in> nat; env \<in> list(A)|]
|
|
794 |
==> is_function(**A, x) <-> sats(A, function_fm(i), env)"
|
|
795 |
by simp
|
|
796 |
|
|
797 |
theorem is_function_reflection [simplified,intro]:
|
|
798 |
"L_Reflects(?Cl, \<lambda>x. is_function(L,f(x)),
|
|
799 |
\<lambda>i x. is_function(**Lset(i),f(x)))"
|
|
800 |
by (simp only: is_function_def setclass_simps, fast)
|
13298
|
801 |
|
|
802 |
|
13309
|
803 |
subsubsection{*Typed Functions*}
|
|
804 |
|
|
805 |
(* "typed_function(M,A,B,r) ==
|
|
806 |
is_function(M,r) & is_relation(M,r) & is_domain(M,r,A) &
|
|
807 |
(\<forall>u[M]. u\<in>r --> (\<forall>x[M]. \<forall>y[M]. pair(M,x,y,u) --> y\<in>B))" *)
|
|
808 |
|
|
809 |
constdefs typed_function_fm :: "[i,i,i]=>i"
|
|
810 |
"typed_function_fm(A,B,r) ==
|
|
811 |
And(function_fm(r),
|
|
812 |
And(relation_fm(r),
|
|
813 |
And(domain_fm(r,A),
|
|
814 |
Forall(Implies(Member(0,succ(r)),
|
|
815 |
Forall(Forall(Implies(pair_fm(1,0,2),Member(0,B#+3)))))))))"
|
|
816 |
|
|
817 |
lemma typed_function_type [TC]:
|
|
818 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> typed_function_fm(x,y,z) \<in> formula"
|
|
819 |
by (simp add: typed_function_fm_def)
|
|
820 |
|
|
821 |
lemma arity_typed_function_fm [simp]:
|
|
822 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
823 |
==> arity(typed_function_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
824 |
by (simp add: typed_function_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
825 |
|
|
826 |
lemma sats_typed_function_fm [simp]:
|
|
827 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
828 |
==> sats(A, typed_function_fm(x,y,z), env) <->
|
|
829 |
typed_function(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
830 |
by (simp add: typed_function_fm_def typed_function_def)
|
|
831 |
|
|
832 |
lemma typed_function_iff_sats:
|
|
833 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
834 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
835 |
==> typed_function(**A, x, y, z) <-> sats(A, typed_function_fm(i,j,k), env)"
|
|
836 |
by simp
|
|
837 |
|
|
838 |
theorem typed_function_reflection [simplified,intro]:
|
|
839 |
"L_Reflects(?Cl, \<lambda>x. typed_function(L,f(x),g(x),h(x)),
|
|
840 |
\<lambda>i x. typed_function(**Lset(i),f(x),g(x),h(x)))"
|
|
841 |
by (simp only: typed_function_def setclass_simps, fast)
|
|
842 |
|
|
843 |
|
|
844 |
|
|
845 |
subsubsection{*Injections*}
|
|
846 |
|
|
847 |
(* "injection(M,A,B,f) ==
|
|
848 |
typed_function(M,A,B,f) &
|
|
849 |
(\<forall>x[M]. \<forall>x'[M]. \<forall>y[M]. \<forall>p[M]. \<forall>p'[M].
|
|
850 |
pair(M,x,y,p) --> pair(M,x',y,p') --> p\<in>f --> p'\<in>f --> x=x')" *)
|
|
851 |
constdefs injection_fm :: "[i,i,i]=>i"
|
|
852 |
"injection_fm(A,B,f) ==
|
|
853 |
And(typed_function_fm(A,B,f),
|
|
854 |
Forall(Forall(Forall(Forall(Forall(
|
|
855 |
Implies(pair_fm(4,2,1),
|
|
856 |
Implies(pair_fm(3,2,0),
|
|
857 |
Implies(Member(1,f#+5),
|
|
858 |
Implies(Member(0,f#+5), Equal(4,3)))))))))))"
|
|
859 |
|
|
860 |
|
|
861 |
lemma injection_type [TC]:
|
|
862 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> injection_fm(x,y,z) \<in> formula"
|
|
863 |
by (simp add: injection_fm_def)
|
|
864 |
|
|
865 |
lemma arity_injection_fm [simp]:
|
|
866 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
867 |
==> arity(injection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
868 |
by (simp add: injection_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
869 |
|
|
870 |
lemma sats_injection_fm [simp]:
|
|
871 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
872 |
==> sats(A, injection_fm(x,y,z), env) <->
|
|
873 |
injection(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
874 |
by (simp add: injection_fm_def injection_def)
|
|
875 |
|
|
876 |
lemma injection_iff_sats:
|
|
877 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
878 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
879 |
==> injection(**A, x, y, z) <-> sats(A, injection_fm(i,j,k), env)"
|
|
880 |
by simp
|
|
881 |
|
|
882 |
theorem injection_reflection [simplified,intro]:
|
|
883 |
"L_Reflects(?Cl, \<lambda>x. injection(L,f(x),g(x),h(x)),
|
|
884 |
\<lambda>i x. injection(**Lset(i),f(x),g(x),h(x)))"
|
|
885 |
by (simp only: injection_def setclass_simps, fast)
|
|
886 |
|
|
887 |
|
|
888 |
subsubsection{*Surjections*}
|
|
889 |
|
|
890 |
(* surjection :: "[i=>o,i,i,i] => o"
|
|
891 |
"surjection(M,A,B,f) ==
|
|
892 |
typed_function(M,A,B,f) &
|
|
893 |
(\<forall>y[M]. y\<in>B --> (\<exists>x[M]. x\<in>A & fun_apply(M,f,x,y)))" *)
|
|
894 |
constdefs surjection_fm :: "[i,i,i]=>i"
|
|
895 |
"surjection_fm(A,B,f) ==
|
|
896 |
And(typed_function_fm(A,B,f),
|
|
897 |
Forall(Implies(Member(0,succ(B)),
|
|
898 |
Exists(And(Member(0,succ(succ(A))),
|
|
899 |
fun_apply_fm(succ(succ(f)),0,1))))))"
|
|
900 |
|
|
901 |
lemma surjection_type [TC]:
|
|
902 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> surjection_fm(x,y,z) \<in> formula"
|
|
903 |
by (simp add: surjection_fm_def)
|
|
904 |
|
|
905 |
lemma arity_surjection_fm [simp]:
|
|
906 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
907 |
==> arity(surjection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
908 |
by (simp add: surjection_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
909 |
|
|
910 |
lemma sats_surjection_fm [simp]:
|
|
911 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
912 |
==> sats(A, surjection_fm(x,y,z), env) <->
|
|
913 |
surjection(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
914 |
by (simp add: surjection_fm_def surjection_def)
|
|
915 |
|
|
916 |
lemma surjection_iff_sats:
|
|
917 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
918 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
919 |
==> surjection(**A, x, y, z) <-> sats(A, surjection_fm(i,j,k), env)"
|
|
920 |
by simp
|
|
921 |
|
|
922 |
theorem surjection_reflection [simplified,intro]:
|
|
923 |
"L_Reflects(?Cl, \<lambda>x. surjection(L,f(x),g(x),h(x)),
|
|
924 |
\<lambda>i x. surjection(**Lset(i),f(x),g(x),h(x)))"
|
|
925 |
by (simp only: surjection_def setclass_simps, fast)
|
|
926 |
|
|
927 |
|
|
928 |
|
|
929 |
subsubsection{*Bijections*}
|
|
930 |
|
|
931 |
(* bijection :: "[i=>o,i,i,i] => o"
|
|
932 |
"bijection(M,A,B,f) == injection(M,A,B,f) & surjection(M,A,B,f)" *)
|
|
933 |
constdefs bijection_fm :: "[i,i,i]=>i"
|
|
934 |
"bijection_fm(A,B,f) == And(injection_fm(A,B,f), surjection_fm(A,B,f))"
|
|
935 |
|
|
936 |
lemma bijection_type [TC]:
|
|
937 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> bijection_fm(x,y,z) \<in> formula"
|
|
938 |
by (simp add: bijection_fm_def)
|
|
939 |
|
|
940 |
lemma arity_bijection_fm [simp]:
|
|
941 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |]
|
|
942 |
==> arity(bijection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)"
|
|
943 |
by (simp add: bijection_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
944 |
|
|
945 |
lemma sats_bijection_fm [simp]:
|
|
946 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
|
|
947 |
==> sats(A, bijection_fm(x,y,z), env) <->
|
|
948 |
bijection(**A, nth(x,env), nth(y,env), nth(z,env))"
|
|
949 |
by (simp add: bijection_fm_def bijection_def)
|
|
950 |
|
|
951 |
lemma bijection_iff_sats:
|
|
952 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
|
|
953 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
|
|
954 |
==> bijection(**A, x, y, z) <-> sats(A, bijection_fm(i,j,k), env)"
|
|
955 |
by simp
|
|
956 |
|
|
957 |
theorem bijection_reflection [simplified,intro]:
|
|
958 |
"L_Reflects(?Cl, \<lambda>x. bijection(L,f(x),g(x),h(x)),
|
|
959 |
\<lambda>i x. bijection(**Lset(i),f(x),g(x),h(x)))"
|
|
960 |
by (simp only: bijection_def setclass_simps, fast)
|
|
961 |
|
|
962 |
|
|
963 |
|
|
964 |
subsubsection{*Order-Isomorphisms*}
|
|
965 |
|
|
966 |
(* order_isomorphism :: "[i=>o,i,i,i,i,i] => o"
|
|
967 |
"order_isomorphism(M,A,r,B,s,f) ==
|
|
968 |
bijection(M,A,B,f) &
|
|
969 |
(\<forall>x[M]. x\<in>A --> (\<forall>y[M]. y\<in>A -->
|
|
970 |
(\<forall>p[M]. \<forall>fx[M]. \<forall>fy[M]. \<forall>q[M].
|
|
971 |
pair(M,x,y,p) --> fun_apply(M,f,x,fx) --> fun_apply(M,f,y,fy) -->
|
|
972 |
pair(M,fx,fy,q) --> (p\<in>r <-> q\<in>s))))"
|
|
973 |
*)
|
|
974 |
|
|
975 |
constdefs order_isomorphism_fm :: "[i,i,i,i,i]=>i"
|
|
976 |
"order_isomorphism_fm(A,r,B,s,f) ==
|
|
977 |
And(bijection_fm(A,B,f),
|
|
978 |
Forall(Implies(Member(0,succ(A)),
|
|
979 |
Forall(Implies(Member(0,succ(succ(A))),
|
|
980 |
Forall(Forall(Forall(Forall(
|
|
981 |
Implies(pair_fm(5,4,3),
|
|
982 |
Implies(fun_apply_fm(f#+6,5,2),
|
|
983 |
Implies(fun_apply_fm(f#+6,4,1),
|
|
984 |
Implies(pair_fm(2,1,0),
|
|
985 |
Iff(Member(3,r#+6), Member(0,s#+6)))))))))))))))"
|
|
986 |
|
|
987 |
lemma order_isomorphism_type [TC]:
|
|
988 |
"[| A \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat |]
|
|
989 |
==> order_isomorphism_fm(A,r,B,s,f) \<in> formula"
|
|
990 |
by (simp add: order_isomorphism_fm_def)
|
|
991 |
|
|
992 |
lemma arity_order_isomorphism_fm [simp]:
|
|
993 |
"[| A \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat |]
|
|
994 |
==> arity(order_isomorphism_fm(A,r,B,s,f)) =
|
|
995 |
succ(A) \<union> succ(r) \<union> succ(B) \<union> succ(s) \<union> succ(f)"
|
|
996 |
by (simp add: order_isomorphism_fm_def succ_Un_distrib [symmetric] Un_ac)
|
|
997 |
|
|
998 |
lemma sats_order_isomorphism_fm [simp]:
|
|
999 |
"[| U \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat; env \<in> list(A)|]
|
|
1000 |
==> sats(A, order_isomorphism_fm(U,r,B,s,f), env) <->
|
|
1001 |
order_isomorphism(**A, nth(U,env), nth(r,env), nth(B,env),
|
|
1002 |
nth(s,env), nth(f,env))"
|
|
1003 |
by (simp add: order_isomorphism_fm_def order_isomorphism_def)
|
|
1004 |
|
|
1005 |
lemma order_isomorphism_iff_sats:
|
|
1006 |
"[| nth(i,env) = U; nth(j,env) = r; nth(k,env) = B; nth(j',env) = s;
|
|
1007 |
nth(k',env) = f;
|
|
1008 |
i \<in> nat; j \<in> nat; k \<in> nat; j' \<in> nat; k' \<in> nat; env \<in> list(A)|]
|
|
1009 |
==> order_isomorphism(**A,U,r,B,s,f) <->
|
|
1010 |
sats(A, order_isomorphism_fm(i,j,k,j',k'), env)"
|
|
1011 |
by simp
|
|
1012 |
|
|
1013 |
theorem order_isomorphism_reflection [simplified,intro]:
|
|
1014 |
"L_Reflects(?Cl, \<lambda>x. order_isomorphism(L,f(x),g(x),h(x),g'(x),h'(x)),
|
|
1015 |
\<lambda>i x. order_isomorphism(**Lset(i),f(x),g(x),h(x),g'(x),h'(x)))"
|
|
1016 |
by (simp only: order_isomorphism_def setclass_simps, fast)
|
|
1017 |
|
|
1018 |
|
13223
|
1019 |
end
|