author | paulson |
Tue, 10 Sep 2002 16:51:31 +0200 | |
changeset 13564 | 1500a2e48d44 |
parent 13563 | 7d6c9817c432 |
child 13566 | 52a419210d5c |
permissions | -rw-r--r-- |
13505 | 1 |
(* Title: ZF/Constructible/L_axioms.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 2002 University of Cambridge |
|
5 |
*) |
|
13429 | 6 |
|
7 |
header {* The ZF Axioms (Except Separation) in L *} |
|
13223 | 8 |
|
13314 | 9 |
theory L_axioms = Formula + Relative + Reflection + MetaExists: |
13223 | 10 |
|
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
11 |
text {* The class L satisfies the premises of locale @{text M_trivial} *} |
13223 | 12 |
|
13 |
lemma transL: "[| y\<in>x; L(x) |] ==> L(y)" |
|
13429 | 14 |
apply (insert Transset_Lset) |
15 |
apply (simp add: Transset_def L_def, blast) |
|
13223 | 16 |
done |
17 |
||
18 |
lemma nonempty: "L(0)" |
|
13429 | 19 |
apply (simp add: L_def) |
20 |
apply (blast intro: zero_in_Lset) |
|
13223 | 21 |
done |
22 |
||
13563 | 23 |
theorem upair_ax: "upair_ax(L)" |
13223 | 24 |
apply (simp add: upair_ax_def upair_def, clarify) |
13429 | 25 |
apply (rule_tac x="{x,y}" in rexI) |
26 |
apply (simp_all add: doubleton_in_L) |
|
13223 | 27 |
done |
28 |
||
13563 | 29 |
theorem Union_ax: "Union_ax(L)" |
13223 | 30 |
apply (simp add: Union_ax_def big_union_def, clarify) |
13429 | 31 |
apply (rule_tac x="Union(x)" in rexI) |
32 |
apply (simp_all add: Union_in_L, auto) |
|
33 |
apply (blast intro: transL) |
|
13223 | 34 |
done |
35 |
||
13563 | 36 |
theorem power_ax: "power_ax(L)" |
13223 | 37 |
apply (simp add: power_ax_def powerset_def Relative.subset_def, clarify) |
13429 | 38 |
apply (rule_tac x="{y \<in> Pow(x). L(y)}" in rexI) |
13299 | 39 |
apply (simp_all add: LPow_in_L, auto) |
13429 | 40 |
apply (blast intro: transL) |
13223 | 41 |
done |
42 |
||
13563 | 43 |
text{*We don't actually need @{term L} to satisfy the foundation axiom.*} |
44 |
theorem foundation_ax: "foundation_ax(L)" |
|
45 |
apply (simp add: foundation_ax_def) |
|
46 |
apply (rule rallI) |
|
47 |
apply (cut_tac A=x in foundation) |
|
48 |
apply (blast intro: transL) |
|
49 |
done |
|
50 |
||
13506 | 51 |
subsection{*For L to satisfy Replacement *} |
13223 | 52 |
|
53 |
(*Can't move these to Formula unless the definition of univalent is moved |
|
54 |
there too!*) |
|
55 |
||
56 |
lemma LReplace_in_Lset: |
|
13429 | 57 |
"[|X \<in> Lset(i); univalent(L,X,Q); Ord(i)|] |
13223 | 58 |
==> \<exists>j. Ord(j) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Lset(j)" |
13429 | 59 |
apply (rule_tac x="\<Union>y \<in> Replace(X, %x y. Q(x,y) & L(y)). succ(lrank(y))" |
13223 | 60 |
in exI) |
61 |
apply simp |
|
13429 | 62 |
apply clarify |
63 |
apply (rule_tac a=x in UN_I) |
|
64 |
apply (simp_all add: Replace_iff univalent_def) |
|
65 |
apply (blast dest: transL L_I) |
|
13223 | 66 |
done |
67 |
||
13429 | 68 |
lemma LReplace_in_L: |
69 |
"[|L(X); univalent(L,X,Q)|] |
|
13223 | 70 |
==> \<exists>Y. L(Y) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Y" |
13429 | 71 |
apply (drule L_D, clarify) |
13223 | 72 |
apply (drule LReplace_in_Lset, assumption+) |
73 |
apply (blast intro: L_I Lset_in_Lset_succ) |
|
74 |
done |
|
75 |
||
13563 | 76 |
theorem replacement: "replacement(L,P)" |
13223 | 77 |
apply (simp add: replacement_def, clarify) |
13429 | 78 |
apply (frule LReplace_in_L, assumption+, clarify) |
79 |
apply (rule_tac x=Y in rexI) |
|
80 |
apply (simp_all add: Replace_iff univalent_def, blast) |
|
13223 | 81 |
done |
82 |
||
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
83 |
subsection{*Instantiating the locale @{text M_trivial}*} |
13363 | 84 |
text{*No instances of Separation yet.*} |
13291 | 85 |
|
86 |
lemma Lset_mono_le: "mono_le_subset(Lset)" |
|
13429 | 87 |
by (simp add: mono_le_subset_def le_imp_subset Lset_mono) |
13291 | 88 |
|
89 |
lemma Lset_cont: "cont_Ord(Lset)" |
|
13429 | 90 |
by (simp add: cont_Ord_def Limit_Lset_eq OUnion_def Limit_is_Ord) |
13291 | 91 |
|
13428 | 92 |
lemmas Pair_in_Lset = Formula.Pair_in_LLimit |
13291 | 93 |
|
13428 | 94 |
lemmas L_nat = Ord_in_L [OF Ord_nat] |
13291 | 95 |
|
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
96 |
theorem M_trivial_L: "PROP M_trivial(L)" |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
97 |
apply (rule M_trivial.intro) |
13428 | 98 |
apply (erule (1) transL) |
99 |
apply (rule nonempty) |
|
100 |
apply (rule upair_ax) |
|
101 |
apply (rule Union_ax) |
|
102 |
apply (rule power_ax) |
|
103 |
apply (rule replacement) |
|
104 |
apply (rule L_nat) |
|
105 |
done |
|
13291 | 106 |
|
13564
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
107 |
lemmas rall_abs = M_trivial.rall_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
108 |
and rex_abs = M_trivial.rex_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
109 |
and ball_iff_equiv = M_trivial.ball_iff_equiv [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
110 |
and M_equalityI = M_trivial.M_equalityI [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
111 |
and empty_abs = M_trivial.empty_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
112 |
and subset_abs = M_trivial.subset_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
113 |
and upair_abs = M_trivial.upair_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
114 |
and upair_in_M_iff = M_trivial.upair_in_M_iff [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
115 |
and singleton_in_M_iff = M_trivial.singleton_in_M_iff [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
116 |
and pair_abs = M_trivial.pair_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
117 |
and pair_in_M_iff = M_trivial.pair_in_M_iff [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
118 |
and pair_components_in_M = M_trivial.pair_components_in_M [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
119 |
and cartprod_abs = M_trivial.cartprod_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
120 |
and union_abs = M_trivial.union_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
121 |
and inter_abs = M_trivial.inter_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
122 |
and setdiff_abs = M_trivial.setdiff_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
123 |
and Union_abs = M_trivial.Union_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
124 |
and Union_closed = M_trivial.Union_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
125 |
and Un_closed = M_trivial.Un_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
126 |
and cons_closed = M_trivial.cons_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
127 |
and successor_abs = M_trivial.successor_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
128 |
and succ_in_M_iff = M_trivial.succ_in_M_iff [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
129 |
and separation_closed = M_trivial.separation_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
130 |
and strong_replacementI = M_trivial.strong_replacementI [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
131 |
and strong_replacement_closed = M_trivial.strong_replacement_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
132 |
and RepFun_closed = M_trivial.RepFun_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
133 |
and lam_closed = M_trivial.lam_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
134 |
and image_abs = M_trivial.image_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
135 |
and powerset_Pow = M_trivial.powerset_Pow [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
136 |
and powerset_imp_subset_Pow = M_trivial.powerset_imp_subset_Pow [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
137 |
and nat_into_M = M_trivial.nat_into_M [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
138 |
and nat_case_closed = M_trivial.nat_case_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
139 |
and Inl_in_M_iff = M_trivial.Inl_in_M_iff [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
140 |
and Inr_in_M_iff = M_trivial.Inr_in_M_iff [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
141 |
and lt_closed = M_trivial.lt_closed [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
142 |
and transitive_set_abs = M_trivial.transitive_set_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
143 |
and ordinal_abs = M_trivial.ordinal_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
144 |
and limit_ordinal_abs = M_trivial.limit_ordinal_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
145 |
and successor_ordinal_abs = M_trivial.successor_ordinal_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
146 |
and finite_ordinal_abs = M_trivial.finite_ordinal_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
147 |
and omega_abs = M_trivial.omega_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
148 |
and number1_abs = M_trivial.number1_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
149 |
and number2_abs = M_trivial.number2_abs [OF M_trivial_L] |
1500a2e48d44
renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents:
13563
diff
changeset
|
150 |
and number3_abs = M_trivial.number3_abs [OF M_trivial_L] |
13429 | 151 |
|
152 |
declare rall_abs [simp] |
|
153 |
declare rex_abs [simp] |
|
154 |
declare empty_abs [simp] |
|
155 |
declare subset_abs [simp] |
|
156 |
declare upair_abs [simp] |
|
157 |
declare upair_in_M_iff [iff] |
|
158 |
declare singleton_in_M_iff [iff] |
|
159 |
declare pair_abs [simp] |
|
160 |
declare pair_in_M_iff [iff] |
|
161 |
declare cartprod_abs [simp] |
|
162 |
declare union_abs [simp] |
|
163 |
declare inter_abs [simp] |
|
164 |
declare setdiff_abs [simp] |
|
165 |
declare Union_abs [simp] |
|
166 |
declare Union_closed [intro, simp] |
|
167 |
declare Un_closed [intro, simp] |
|
168 |
declare cons_closed [intro, simp] |
|
169 |
declare successor_abs [simp] |
|
170 |
declare succ_in_M_iff [iff] |
|
171 |
declare separation_closed [intro, simp] |
|
172 |
declare strong_replacementI |
|
173 |
declare strong_replacement_closed [intro, simp] |
|
174 |
declare RepFun_closed [intro, simp] |
|
175 |
declare lam_closed [intro, simp] |
|
176 |
declare image_abs [simp] |
|
177 |
declare nat_into_M [intro] |
|
178 |
declare Inl_in_M_iff [iff] |
|
179 |
declare Inr_in_M_iff [iff] |
|
180 |
declare transitive_set_abs [simp] |
|
181 |
declare ordinal_abs [simp] |
|
182 |
declare limit_ordinal_abs [simp] |
|
183 |
declare successor_ordinal_abs [simp] |
|
184 |
declare finite_ordinal_abs [simp] |
|
185 |
declare omega_abs [simp] |
|
186 |
declare number1_abs [simp] |
|
187 |
declare number2_abs [simp] |
|
188 |
declare number3_abs [simp] |
|
13291 | 189 |
|
190 |
||
191 |
subsection{*Instantiation of the locale @{text reflection}*} |
|
192 |
||
193 |
text{*instances of locale constants*} |
|
194 |
constdefs |
|
195 |
L_F0 :: "[i=>o,i] => i" |
|
196 |
"L_F0(P,y) == \<mu>b. (\<exists>z. L(z) \<and> P(<y,z>)) --> (\<exists>z\<in>Lset(b). P(<y,z>))" |
|
197 |
||
198 |
L_FF :: "[i=>o,i] => i" |
|
199 |
"L_FF(P) == \<lambda>a. \<Union>y\<in>Lset(a). L_F0(P,y)" |
|
200 |
||
201 |
L_ClEx :: "[i=>o,i] => o" |
|
202 |
"L_ClEx(P) == \<lambda>a. Limit(a) \<and> normalize(L_FF(P),a) = a" |
|
203 |
||
204 |
||
13314 | 205 |
text{*We must use the meta-existential quantifier; otherwise the reflection |
13429 | 206 |
terms become enormous!*} |
13314 | 207 |
constdefs |
208 |
L_Reflects :: "[i=>o,[i,i]=>o] => prop" ("(3REFLECTS/ [_,/ _])") |
|
209 |
"REFLECTS[P,Q] == (??Cl. Closed_Unbounded(Cl) & |
|
210 |
(\<forall>a. Cl(a) --> (\<forall>x \<in> Lset(a). P(x) <-> Q(a,x))))" |
|
13291 | 211 |
|
212 |
||
13314 | 213 |
theorem Triv_reflection: |
214 |
"REFLECTS[P, \<lambda>a x. P(x)]" |
|
13429 | 215 |
apply (simp add: L_Reflects_def) |
216 |
apply (rule meta_exI) |
|
217 |
apply (rule Closed_Unbounded_Ord) |
|
13314 | 218 |
done |
219 |
||
220 |
theorem Not_reflection: |
|
221 |
"REFLECTS[P,Q] ==> REFLECTS[\<lambda>x. ~P(x), \<lambda>a x. ~Q(a,x)]" |
|
13429 | 222 |
apply (unfold L_Reflects_def) |
223 |
apply (erule meta_exE) |
|
224 |
apply (rule_tac x=Cl in meta_exI, simp) |
|
13314 | 225 |
done |
226 |
||
227 |
theorem And_reflection: |
|
13429 | 228 |
"[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] |
13314 | 229 |
==> REFLECTS[\<lambda>x. P(x) \<and> P'(x), \<lambda>a x. Q(a,x) \<and> Q'(a,x)]" |
13429 | 230 |
apply (unfold L_Reflects_def) |
231 |
apply (elim meta_exE) |
|
232 |
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) |
|
233 |
apply (simp add: Closed_Unbounded_Int, blast) |
|
13314 | 234 |
done |
235 |
||
236 |
theorem Or_reflection: |
|
13429 | 237 |
"[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] |
13314 | 238 |
==> REFLECTS[\<lambda>x. P(x) \<or> P'(x), \<lambda>a x. Q(a,x) \<or> Q'(a,x)]" |
13429 | 239 |
apply (unfold L_Reflects_def) |
240 |
apply (elim meta_exE) |
|
241 |
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) |
|
242 |
apply (simp add: Closed_Unbounded_Int, blast) |
|
13314 | 243 |
done |
244 |
||
245 |
theorem Imp_reflection: |
|
13429 | 246 |
"[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] |
13314 | 247 |
==> REFLECTS[\<lambda>x. P(x) --> P'(x), \<lambda>a x. Q(a,x) --> Q'(a,x)]" |
13429 | 248 |
apply (unfold L_Reflects_def) |
249 |
apply (elim meta_exE) |
|
250 |
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) |
|
251 |
apply (simp add: Closed_Unbounded_Int, blast) |
|
13314 | 252 |
done |
253 |
||
254 |
theorem Iff_reflection: |
|
13429 | 255 |
"[| REFLECTS[P,Q]; REFLECTS[P',Q'] |] |
13314 | 256 |
==> REFLECTS[\<lambda>x. P(x) <-> P'(x), \<lambda>a x. Q(a,x) <-> Q'(a,x)]" |
13429 | 257 |
apply (unfold L_Reflects_def) |
258 |
apply (elim meta_exE) |
|
259 |
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI) |
|
260 |
apply (simp add: Closed_Unbounded_Int, blast) |
|
13314 | 261 |
done |
262 |
||
263 |
||
13434 | 264 |
lemma reflection_Lset: "reflection(Lset)" |
265 |
apply (blast intro: reflection.intro Lset_mono_le Lset_cont Pair_in_Lset) + |
|
266 |
done |
|
267 |
||
13314 | 268 |
theorem Ex_reflection: |
269 |
"REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))] |
|
270 |
==> REFLECTS[\<lambda>x. \<exists>z. L(z) \<and> P(x,z), \<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z)]" |
|
13429 | 271 |
apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def) |
272 |
apply (elim meta_exE) |
|
13314 | 273 |
apply (rule meta_exI) |
13434 | 274 |
apply (erule reflection.Ex_reflection [OF reflection_Lset]) |
13291 | 275 |
done |
276 |
||
13314 | 277 |
theorem All_reflection: |
278 |
"REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))] |
|
13429 | 279 |
==> REFLECTS[\<lambda>x. \<forall>z. L(z) --> P(x,z), \<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z)]" |
280 |
apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def) |
|
281 |
apply (elim meta_exE) |
|
13314 | 282 |
apply (rule meta_exI) |
13434 | 283 |
apply (erule reflection.All_reflection [OF reflection_Lset]) |
13291 | 284 |
done |
285 |
||
13314 | 286 |
theorem Rex_reflection: |
287 |
"REFLECTS[ \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))] |
|
288 |
==> REFLECTS[\<lambda>x. \<exists>z[L]. P(x,z), \<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z)]" |
|
13429 | 289 |
apply (unfold rex_def) |
13314 | 290 |
apply (intro And_reflection Ex_reflection, assumption) |
291 |
done |
|
13291 | 292 |
|
13314 | 293 |
theorem Rall_reflection: |
294 |
"REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))] |
|
13429 | 295 |
==> REFLECTS[\<lambda>x. \<forall>z[L]. P(x,z), \<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z)]" |
296 |
apply (unfold rall_def) |
|
13314 | 297 |
apply (intro Imp_reflection All_reflection, assumption) |
298 |
done |
|
299 |
||
13440 | 300 |
text{*This version handles an alternative form of the bounded quantifier |
301 |
in the second argument of @{text REFLECTS}.*} |
|
302 |
theorem Rex_reflection': |
|
303 |
"REFLECTS[ \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))] |
|
304 |
==> REFLECTS[\<lambda>x. \<exists>z[L]. P(x,z), \<lambda>a x. \<exists>z[**Lset(a)]. Q(a,x,z)]" |
|
305 |
apply (unfold setclass_def rex_def) |
|
306 |
apply (erule Rex_reflection [unfolded rex_def Bex_def]) |
|
307 |
done |
|
308 |
||
309 |
text{*As above.*} |
|
310 |
theorem Rall_reflection': |
|
311 |
"REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))] |
|
312 |
==> REFLECTS[\<lambda>x. \<forall>z[L]. P(x,z), \<lambda>a x. \<forall>z[**Lset(a)]. Q(a,x,z)]" |
|
313 |
apply (unfold setclass_def rall_def) |
|
314 |
apply (erule Rall_reflection [unfolded rall_def Ball_def]) |
|
315 |
done |
|
316 |
||
13429 | 317 |
lemmas FOL_reflections = |
13314 | 318 |
Triv_reflection Not_reflection And_reflection Or_reflection |
319 |
Imp_reflection Iff_reflection Ex_reflection All_reflection |
|
13440 | 320 |
Rex_reflection Rall_reflection Rex_reflection' Rall_reflection' |
13291 | 321 |
|
322 |
lemma ReflectsD: |
|
13429 | 323 |
"[|REFLECTS[P,Q]; Ord(i)|] |
13291 | 324 |
==> \<exists>j. i<j & (\<forall>x \<in> Lset(j). P(x) <-> Q(j,x))" |
13429 | 325 |
apply (unfold L_Reflects_def Closed_Unbounded_def) |
326 |
apply (elim meta_exE, clarify) |
|
327 |
apply (blast dest!: UnboundedD) |
|
13291 | 328 |
done |
329 |
||
330 |
lemma ReflectsE: |
|
13314 | 331 |
"[| REFLECTS[P,Q]; Ord(i); |
13291 | 332 |
!!j. [|i<j; \<forall>x \<in> Lset(j). P(x) <-> Q(j,x)|] ==> R |] |
333 |
==> R" |
|
13429 | 334 |
apply (drule ReflectsD, assumption, blast) |
13314 | 335 |
done |
13291 | 336 |
|
13428 | 337 |
lemma Collect_mem_eq: "{x\<in>A. x\<in>B} = A \<inter> B" |
13291 | 338 |
by blast |
339 |
||
340 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
341 |
subsection{*Internalized Formulas for some Set-Theoretic Concepts*} |
13298 | 342 |
|
13306 | 343 |
lemmas setclass_simps = rall_setclass_is_ball rex_setclass_is_bex |
344 |
||
345 |
subsubsection{*Some numbers to help write de Bruijn indices*} |
|
346 |
||
347 |
syntax |
|
348 |
"3" :: i ("3") |
|
349 |
"4" :: i ("4") |
|
350 |
"5" :: i ("5") |
|
351 |
"6" :: i ("6") |
|
352 |
"7" :: i ("7") |
|
353 |
"8" :: i ("8") |
|
354 |
"9" :: i ("9") |
|
355 |
||
356 |
translations |
|
357 |
"3" == "succ(2)" |
|
358 |
"4" == "succ(3)" |
|
359 |
"5" == "succ(4)" |
|
360 |
"6" == "succ(5)" |
|
361 |
"7" == "succ(6)" |
|
362 |
"8" == "succ(7)" |
|
363 |
"9" == "succ(8)" |
|
364 |
||
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
365 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
366 |
subsubsection{*The Empty Set, Internalized*} |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
367 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
368 |
constdefs empty_fm :: "i=>i" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
369 |
"empty_fm(x) == Forall(Neg(Member(0,succ(x))))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
370 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
371 |
lemma empty_type [TC]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
372 |
"x \<in> nat ==> empty_fm(x) \<in> formula" |
13429 | 373 |
by (simp add: empty_fm_def) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
374 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
375 |
lemma arity_empty_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
376 |
"x \<in> nat ==> arity(empty_fm(x)) = succ(x)" |
13429 | 377 |
by (simp add: empty_fm_def succ_Un_distrib [symmetric] Un_ac) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
378 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
379 |
lemma sats_empty_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
380 |
"[| x \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
381 |
==> sats(A, empty_fm(x), env) <-> empty(**A, nth(x,env))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
382 |
by (simp add: empty_fm_def empty_def) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
383 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
384 |
lemma empty_iff_sats: |
13429 | 385 |
"[| nth(i,env) = x; nth(j,env) = y; |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
386 |
i \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
387 |
==> empty(**A, x) <-> sats(A, empty_fm(i), env)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
388 |
by simp |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
389 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
390 |
theorem empty_reflection: |
13429 | 391 |
"REFLECTS[\<lambda>x. empty(L,f(x)), |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
392 |
\<lambda>i x. empty(**Lset(i),f(x))]" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
393 |
apply (simp only: empty_def setclass_simps) |
13429 | 394 |
apply (intro FOL_reflections) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
395 |
done |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
396 |
|
13385
31df66ca0780
Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents:
13363
diff
changeset
|
397 |
text{*Not used. But maybe useful?*} |
31df66ca0780
Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents:
13363
diff
changeset
|
398 |
lemma Transset_sats_empty_fm_eq_0: |
31df66ca0780
Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents:
13363
diff
changeset
|
399 |
"[| n \<in> nat; env \<in> list(A); Transset(A)|] |
31df66ca0780
Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents:
13363
diff
changeset
|
400 |
==> sats(A, empty_fm(n), env) <-> nth(n,env) = 0" |
31df66ca0780
Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents:
13363
diff
changeset
|
401 |
apply (simp add: empty_fm_def empty_def Transset_def, auto) |
13429 | 402 |
apply (case_tac "n < length(env)") |
403 |
apply (frule nth_type, assumption+, blast) |
|
404 |
apply (simp_all add: not_lt_iff_le nth_eq_0) |
|
13385
31df66ca0780
Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents:
13363
diff
changeset
|
405 |
done |
31df66ca0780
Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents:
13363
diff
changeset
|
406 |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
407 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
408 |
subsubsection{*Unordered Pairs, Internalized*} |
13298 | 409 |
|
410 |
constdefs upair_fm :: "[i,i,i]=>i" |
|
13429 | 411 |
"upair_fm(x,y,z) == |
412 |
And(Member(x,z), |
|
13298 | 413 |
And(Member(y,z), |
13429 | 414 |
Forall(Implies(Member(0,succ(z)), |
13298 | 415 |
Or(Equal(0,succ(x)), Equal(0,succ(y)))))))" |
416 |
||
417 |
lemma upair_type [TC]: |
|
418 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> upair_fm(x,y,z) \<in> formula" |
|
13429 | 419 |
by (simp add: upair_fm_def) |
13298 | 420 |
|
421 |
lemma arity_upair_fm [simp]: |
|
13429 | 422 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13298 | 423 |
==> arity(upair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 424 |
by (simp add: upair_fm_def succ_Un_distrib [symmetric] Un_ac) |
13298 | 425 |
|
426 |
lemma sats_upair_fm [simp]: |
|
427 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 428 |
==> sats(A, upair_fm(x,y,z), env) <-> |
13298 | 429 |
upair(**A, nth(x,env), nth(y,env), nth(z,env))" |
430 |
by (simp add: upair_fm_def upair_def) |
|
431 |
||
432 |
lemma upair_iff_sats: |
|
13429 | 433 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13298 | 434 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
435 |
==> upair(**A, x, y, z) <-> sats(A, upair_fm(i,j,k), env)" |
|
436 |
by (simp add: sats_upair_fm) |
|
437 |
||
438 |
text{*Useful? At least it refers to "real" unordered pairs*} |
|
439 |
lemma sats_upair_fm2 [simp]: |
|
440 |
"[| x \<in> nat; y \<in> nat; z < length(env); env \<in> list(A); Transset(A)|] |
|
13429 | 441 |
==> sats(A, upair_fm(x,y,z), env) <-> |
13298 | 442 |
nth(z,env) = {nth(x,env), nth(y,env)}" |
13429 | 443 |
apply (frule lt_length_in_nat, assumption) |
444 |
apply (simp add: upair_fm_def Transset_def, auto) |
|
445 |
apply (blast intro: nth_type) |
|
13298 | 446 |
done |
447 |
||
13314 | 448 |
theorem upair_reflection: |
13429 | 449 |
"REFLECTS[\<lambda>x. upair(L,f(x),g(x),h(x)), |
450 |
\<lambda>i x. upair(**Lset(i),f(x),g(x),h(x))]" |
|
13314 | 451 |
apply (simp add: upair_def) |
13429 | 452 |
apply (intro FOL_reflections) |
13314 | 453 |
done |
13306 | 454 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
455 |
subsubsection{*Ordered pairs, Internalized*} |
13298 | 456 |
|
457 |
constdefs pair_fm :: "[i,i,i]=>i" |
|
13429 | 458 |
"pair_fm(x,y,z) == |
13298 | 459 |
Exists(And(upair_fm(succ(x),succ(x),0), |
460 |
Exists(And(upair_fm(succ(succ(x)),succ(succ(y)),0), |
|
461 |
upair_fm(1,0,succ(succ(z)))))))" |
|
462 |
||
463 |
lemma pair_type [TC]: |
|
464 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> pair_fm(x,y,z) \<in> formula" |
|
13429 | 465 |
by (simp add: pair_fm_def) |
13298 | 466 |
|
467 |
lemma arity_pair_fm [simp]: |
|
13429 | 468 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13298 | 469 |
==> arity(pair_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 470 |
by (simp add: pair_fm_def succ_Un_distrib [symmetric] Un_ac) |
13298 | 471 |
|
472 |
lemma sats_pair_fm [simp]: |
|
473 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 474 |
==> sats(A, pair_fm(x,y,z), env) <-> |
13298 | 475 |
pair(**A, nth(x,env), nth(y,env), nth(z,env))" |
476 |
by (simp add: pair_fm_def pair_def) |
|
477 |
||
478 |
lemma pair_iff_sats: |
|
13429 | 479 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13298 | 480 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
481 |
==> pair(**A, x, y, z) <-> sats(A, pair_fm(i,j,k), env)" |
|
482 |
by (simp add: sats_pair_fm) |
|
483 |
||
13314 | 484 |
theorem pair_reflection: |
13429 | 485 |
"REFLECTS[\<lambda>x. pair(L,f(x),g(x),h(x)), |
13314 | 486 |
\<lambda>i x. pair(**Lset(i),f(x),g(x),h(x))]" |
487 |
apply (simp only: pair_def setclass_simps) |
|
13429 | 488 |
apply (intro FOL_reflections upair_reflection) |
13314 | 489 |
done |
13306 | 490 |
|
491 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
492 |
subsubsection{*Binary Unions, Internalized*} |
13298 | 493 |
|
13306 | 494 |
constdefs union_fm :: "[i,i,i]=>i" |
13429 | 495 |
"union_fm(x,y,z) == |
13306 | 496 |
Forall(Iff(Member(0,succ(z)), |
497 |
Or(Member(0,succ(x)),Member(0,succ(y)))))" |
|
498 |
||
499 |
lemma union_type [TC]: |
|
500 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> union_fm(x,y,z) \<in> formula" |
|
13429 | 501 |
by (simp add: union_fm_def) |
13306 | 502 |
|
503 |
lemma arity_union_fm [simp]: |
|
13429 | 504 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13306 | 505 |
==> arity(union_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 506 |
by (simp add: union_fm_def succ_Un_distrib [symmetric] Un_ac) |
13298 | 507 |
|
13306 | 508 |
lemma sats_union_fm [simp]: |
509 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 510 |
==> sats(A, union_fm(x,y,z), env) <-> |
13306 | 511 |
union(**A, nth(x,env), nth(y,env), nth(z,env))" |
512 |
by (simp add: union_fm_def union_def) |
|
513 |
||
514 |
lemma union_iff_sats: |
|
13429 | 515 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13306 | 516 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
517 |
==> union(**A, x, y, z) <-> sats(A, union_fm(i,j,k), env)" |
|
518 |
by (simp add: sats_union_fm) |
|
13298 | 519 |
|
13314 | 520 |
theorem union_reflection: |
13429 | 521 |
"REFLECTS[\<lambda>x. union(L,f(x),g(x),h(x)), |
13314 | 522 |
\<lambda>i x. union(**Lset(i),f(x),g(x),h(x))]" |
523 |
apply (simp only: union_def setclass_simps) |
|
13429 | 524 |
apply (intro FOL_reflections) |
13314 | 525 |
done |
13306 | 526 |
|
13298 | 527 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
528 |
subsubsection{*Set ``Cons,'' Internalized*} |
13306 | 529 |
|
530 |
constdefs cons_fm :: "[i,i,i]=>i" |
|
13429 | 531 |
"cons_fm(x,y,z) == |
13306 | 532 |
Exists(And(upair_fm(succ(x),succ(x),0), |
533 |
union_fm(0,succ(y),succ(z))))" |
|
13298 | 534 |
|
535 |
||
13306 | 536 |
lemma cons_type [TC]: |
537 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> cons_fm(x,y,z) \<in> formula" |
|
13429 | 538 |
by (simp add: cons_fm_def) |
13306 | 539 |
|
540 |
lemma arity_cons_fm [simp]: |
|
13429 | 541 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13306 | 542 |
==> arity(cons_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 543 |
by (simp add: cons_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 544 |
|
545 |
lemma sats_cons_fm [simp]: |
|
546 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 547 |
==> sats(A, cons_fm(x,y,z), env) <-> |
13306 | 548 |
is_cons(**A, nth(x,env), nth(y,env), nth(z,env))" |
549 |
by (simp add: cons_fm_def is_cons_def) |
|
550 |
||
551 |
lemma cons_iff_sats: |
|
13429 | 552 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13306 | 553 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
554 |
==> is_cons(**A, x, y, z) <-> sats(A, cons_fm(i,j,k), env)" |
|
555 |
by simp |
|
556 |
||
13314 | 557 |
theorem cons_reflection: |
13429 | 558 |
"REFLECTS[\<lambda>x. is_cons(L,f(x),g(x),h(x)), |
13314 | 559 |
\<lambda>i x. is_cons(**Lset(i),f(x),g(x),h(x))]" |
560 |
apply (simp only: is_cons_def setclass_simps) |
|
13429 | 561 |
apply (intro FOL_reflections upair_reflection union_reflection) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
562 |
done |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
563 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
564 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
565 |
subsubsection{*Successor Function, Internalized*} |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
566 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
567 |
constdefs succ_fm :: "[i,i]=>i" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
568 |
"succ_fm(x,y) == cons_fm(x,x,y)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
569 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
570 |
lemma succ_type [TC]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
571 |
"[| x \<in> nat; y \<in> nat |] ==> succ_fm(x,y) \<in> formula" |
13429 | 572 |
by (simp add: succ_fm_def) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
573 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
574 |
lemma arity_succ_fm [simp]: |
13429 | 575 |
"[| x \<in> nat; y \<in> nat |] |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
576 |
==> arity(succ_fm(x,y)) = succ(x) \<union> succ(y)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
577 |
by (simp add: succ_fm_def) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
578 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
579 |
lemma sats_succ_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
580 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
13429 | 581 |
==> sats(A, succ_fm(x,y), env) <-> |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
582 |
successor(**A, nth(x,env), nth(y,env))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
583 |
by (simp add: succ_fm_def successor_def) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
584 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
585 |
lemma successor_iff_sats: |
13429 | 586 |
"[| nth(i,env) = x; nth(j,env) = y; |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
587 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
588 |
==> successor(**A, x, y) <-> sats(A, succ_fm(i,j), env)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
589 |
by simp |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
590 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
591 |
theorem successor_reflection: |
13429 | 592 |
"REFLECTS[\<lambda>x. successor(L,f(x),g(x)), |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
593 |
\<lambda>i x. successor(**Lset(i),f(x),g(x))]" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
594 |
apply (simp only: successor_def setclass_simps) |
13429 | 595 |
apply (intro cons_reflection) |
13314 | 596 |
done |
13298 | 597 |
|
598 |
||
13363 | 599 |
subsubsection{*The Number 1, Internalized*} |
600 |
||
601 |
(* "number1(M,a) == (\<exists>x[M]. empty(M,x) & successor(M,x,a))" *) |
|
602 |
constdefs number1_fm :: "i=>i" |
|
603 |
"number1_fm(a) == Exists(And(empty_fm(0), succ_fm(0,succ(a))))" |
|
604 |
||
605 |
lemma number1_type [TC]: |
|
606 |
"x \<in> nat ==> number1_fm(x) \<in> formula" |
|
13429 | 607 |
by (simp add: number1_fm_def) |
13363 | 608 |
|
609 |
lemma arity_number1_fm [simp]: |
|
610 |
"x \<in> nat ==> arity(number1_fm(x)) = succ(x)" |
|
13429 | 611 |
by (simp add: number1_fm_def succ_Un_distrib [symmetric] Un_ac) |
13363 | 612 |
|
613 |
lemma sats_number1_fm [simp]: |
|
614 |
"[| x \<in> nat; env \<in> list(A)|] |
|
615 |
==> sats(A, number1_fm(x), env) <-> number1(**A, nth(x,env))" |
|
616 |
by (simp add: number1_fm_def number1_def) |
|
617 |
||
618 |
lemma number1_iff_sats: |
|
13429 | 619 |
"[| nth(i,env) = x; nth(j,env) = y; |
13363 | 620 |
i \<in> nat; env \<in> list(A)|] |
621 |
==> number1(**A, x) <-> sats(A, number1_fm(i), env)" |
|
622 |
by simp |
|
623 |
||
624 |
theorem number1_reflection: |
|
13429 | 625 |
"REFLECTS[\<lambda>x. number1(L,f(x)), |
13363 | 626 |
\<lambda>i x. number1(**Lset(i),f(x))]" |
627 |
apply (simp only: number1_def setclass_simps) |
|
628 |
apply (intro FOL_reflections empty_reflection successor_reflection) |
|
629 |
done |
|
630 |
||
631 |
||
13352 | 632 |
subsubsection{*Big Union, Internalized*} |
13306 | 633 |
|
13352 | 634 |
(* "big_union(M,A,z) == \<forall>x[M]. x \<in> z <-> (\<exists>y[M]. y\<in>A & x \<in> y)" *) |
635 |
constdefs big_union_fm :: "[i,i]=>i" |
|
13429 | 636 |
"big_union_fm(A,z) == |
13352 | 637 |
Forall(Iff(Member(0,succ(z)), |
638 |
Exists(And(Member(0,succ(succ(A))), Member(1,0)))))" |
|
13298 | 639 |
|
13352 | 640 |
lemma big_union_type [TC]: |
641 |
"[| x \<in> nat; y \<in> nat |] ==> big_union_fm(x,y) \<in> formula" |
|
13429 | 642 |
by (simp add: big_union_fm_def) |
13306 | 643 |
|
13352 | 644 |
lemma arity_big_union_fm [simp]: |
13429 | 645 |
"[| x \<in> nat; y \<in> nat |] |
13352 | 646 |
==> arity(big_union_fm(x,y)) = succ(x) \<union> succ(y)" |
647 |
by (simp add: big_union_fm_def succ_Un_distrib [symmetric] Un_ac) |
|
13298 | 648 |
|
13352 | 649 |
lemma sats_big_union_fm [simp]: |
650 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
|
13429 | 651 |
==> sats(A, big_union_fm(x,y), env) <-> |
13352 | 652 |
big_union(**A, nth(x,env), nth(y,env))" |
653 |
by (simp add: big_union_fm_def big_union_def) |
|
13306 | 654 |
|
13352 | 655 |
lemma big_union_iff_sats: |
13429 | 656 |
"[| nth(i,env) = x; nth(j,env) = y; |
13352 | 657 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
658 |
==> big_union(**A, x, y) <-> sats(A, big_union_fm(i,j), env)" |
|
13306 | 659 |
by simp |
660 |
||
13352 | 661 |
theorem big_union_reflection: |
13429 | 662 |
"REFLECTS[\<lambda>x. big_union(L,f(x),g(x)), |
13352 | 663 |
\<lambda>i x. big_union(**Lset(i),f(x),g(x))]" |
664 |
apply (simp only: big_union_def setclass_simps) |
|
13429 | 665 |
apply (intro FOL_reflections) |
13314 | 666 |
done |
13298 | 667 |
|
668 |
||
13306 | 669 |
subsubsection{*Variants of Satisfaction Definitions for Ordinals, etc.*} |
670 |
||
671 |
text{*Differs from the one in Formula by using "ordinal" rather than "Ord"*} |
|
672 |
||
673 |
||
674 |
lemma sats_subset_fm': |
|
675 |
"[|x \<in> nat; y \<in> nat; env \<in> list(A)|] |
|
13429 | 676 |
==> sats(A, subset_fm(x,y), env) <-> subset(**A, nth(x,env), nth(y,env))" |
677 |
by (simp add: subset_fm_def Relative.subset_def) |
|
13298 | 678 |
|
13314 | 679 |
theorem subset_reflection: |
13429 | 680 |
"REFLECTS[\<lambda>x. subset(L,f(x),g(x)), |
681 |
\<lambda>i x. subset(**Lset(i),f(x),g(x))]" |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
682 |
apply (simp only: Relative.subset_def setclass_simps) |
13429 | 683 |
apply (intro FOL_reflections) |
13314 | 684 |
done |
13306 | 685 |
|
686 |
lemma sats_transset_fm': |
|
687 |
"[|x \<in> nat; env \<in> list(A)|] |
|
688 |
==> sats(A, transset_fm(x), env) <-> transitive_set(**A, nth(x,env))" |
|
13429 | 689 |
by (simp add: sats_subset_fm' transset_fm_def transitive_set_def) |
13298 | 690 |
|
13314 | 691 |
theorem transitive_set_reflection: |
692 |
"REFLECTS[\<lambda>x. transitive_set(L,f(x)), |
|
693 |
\<lambda>i x. transitive_set(**Lset(i),f(x))]" |
|
694 |
apply (simp only: transitive_set_def setclass_simps) |
|
13429 | 695 |
apply (intro FOL_reflections subset_reflection) |
13314 | 696 |
done |
13306 | 697 |
|
698 |
lemma sats_ordinal_fm': |
|
699 |
"[|x \<in> nat; env \<in> list(A)|] |
|
700 |
==> sats(A, ordinal_fm(x), env) <-> ordinal(**A,nth(x,env))" |
|
701 |
by (simp add: sats_transset_fm' ordinal_fm_def ordinal_def) |
|
702 |
||
703 |
lemma ordinal_iff_sats: |
|
704 |
"[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|] |
|
705 |
==> ordinal(**A, x) <-> sats(A, ordinal_fm(i), env)" |
|
706 |
by (simp add: sats_ordinal_fm') |
|
707 |
||
13314 | 708 |
theorem ordinal_reflection: |
709 |
"REFLECTS[\<lambda>x. ordinal(L,f(x)), \<lambda>i x. ordinal(**Lset(i),f(x))]" |
|
710 |
apply (simp only: ordinal_def setclass_simps) |
|
13429 | 711 |
apply (intro FOL_reflections transitive_set_reflection) |
13314 | 712 |
done |
13298 | 713 |
|
714 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
715 |
subsubsection{*Membership Relation, Internalized*} |
13298 | 716 |
|
13306 | 717 |
constdefs Memrel_fm :: "[i,i]=>i" |
13429 | 718 |
"Memrel_fm(A,r) == |
13306 | 719 |
Forall(Iff(Member(0,succ(r)), |
720 |
Exists(And(Member(0,succ(succ(A))), |
|
721 |
Exists(And(Member(0,succ(succ(succ(A)))), |
|
722 |
And(Member(1,0), |
|
723 |
pair_fm(1,0,2))))))))" |
|
724 |
||
725 |
lemma Memrel_type [TC]: |
|
726 |
"[| x \<in> nat; y \<in> nat |] ==> Memrel_fm(x,y) \<in> formula" |
|
13429 | 727 |
by (simp add: Memrel_fm_def) |
13298 | 728 |
|
13306 | 729 |
lemma arity_Memrel_fm [simp]: |
13429 | 730 |
"[| x \<in> nat; y \<in> nat |] |
13306 | 731 |
==> arity(Memrel_fm(x,y)) = succ(x) \<union> succ(y)" |
13429 | 732 |
by (simp add: Memrel_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 733 |
|
734 |
lemma sats_Memrel_fm [simp]: |
|
735 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
|
13429 | 736 |
==> sats(A, Memrel_fm(x,y), env) <-> |
13306 | 737 |
membership(**A, nth(x,env), nth(y,env))" |
738 |
by (simp add: Memrel_fm_def membership_def) |
|
13298 | 739 |
|
13306 | 740 |
lemma Memrel_iff_sats: |
13429 | 741 |
"[| nth(i,env) = x; nth(j,env) = y; |
13306 | 742 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
743 |
==> membership(**A, x, y) <-> sats(A, Memrel_fm(i,j), env)" |
|
744 |
by simp |
|
13304 | 745 |
|
13314 | 746 |
theorem membership_reflection: |
13429 | 747 |
"REFLECTS[\<lambda>x. membership(L,f(x),g(x)), |
13314 | 748 |
\<lambda>i x. membership(**Lset(i),f(x),g(x))]" |
749 |
apply (simp only: membership_def setclass_simps) |
|
13429 | 750 |
apply (intro FOL_reflections pair_reflection) |
13314 | 751 |
done |
13304 | 752 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
753 |
subsubsection{*Predecessor Set, Internalized*} |
13304 | 754 |
|
13306 | 755 |
constdefs pred_set_fm :: "[i,i,i,i]=>i" |
13429 | 756 |
"pred_set_fm(A,x,r,B) == |
13306 | 757 |
Forall(Iff(Member(0,succ(B)), |
758 |
Exists(And(Member(0,succ(succ(r))), |
|
759 |
And(Member(1,succ(succ(A))), |
|
760 |
pair_fm(1,succ(succ(x)),0))))))" |
|
761 |
||
762 |
||
763 |
lemma pred_set_type [TC]: |
|
13429 | 764 |
"[| A \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat |] |
13306 | 765 |
==> pred_set_fm(A,x,r,B) \<in> formula" |
13429 | 766 |
by (simp add: pred_set_fm_def) |
13304 | 767 |
|
13306 | 768 |
lemma arity_pred_set_fm [simp]: |
13429 | 769 |
"[| A \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat |] |
13306 | 770 |
==> arity(pred_set_fm(A,x,r,B)) = succ(A) \<union> succ(x) \<union> succ(r) \<union> succ(B)" |
13429 | 771 |
by (simp add: pred_set_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 772 |
|
773 |
lemma sats_pred_set_fm [simp]: |
|
774 |
"[| U \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat; env \<in> list(A)|] |
|
13429 | 775 |
==> sats(A, pred_set_fm(U,x,r,B), env) <-> |
13306 | 776 |
pred_set(**A, nth(U,env), nth(x,env), nth(r,env), nth(B,env))" |
777 |
by (simp add: pred_set_fm_def pred_set_def) |
|
778 |
||
779 |
lemma pred_set_iff_sats: |
|
13429 | 780 |
"[| nth(i,env) = U; nth(j,env) = x; nth(k,env) = r; nth(l,env) = B; |
13306 | 781 |
i \<in> nat; j \<in> nat; k \<in> nat; l \<in> nat; env \<in> list(A)|] |
782 |
==> pred_set(**A,U,x,r,B) <-> sats(A, pred_set_fm(i,j,k,l), env)" |
|
783 |
by (simp add: sats_pred_set_fm) |
|
784 |
||
13314 | 785 |
theorem pred_set_reflection: |
13429 | 786 |
"REFLECTS[\<lambda>x. pred_set(L,f(x),g(x),h(x),b(x)), |
787 |
\<lambda>i x. pred_set(**Lset(i),f(x),g(x),h(x),b(x))]" |
|
13314 | 788 |
apply (simp only: pred_set_def setclass_simps) |
13429 | 789 |
apply (intro FOL_reflections pair_reflection) |
13314 | 790 |
done |
13304 | 791 |
|
792 |
||
13298 | 793 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
794 |
subsubsection{*Domain of a Relation, Internalized*} |
13306 | 795 |
|
13429 | 796 |
(* "is_domain(M,r,z) == |
797 |
\<forall>x[M]. (x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. pair(M,x,y,w))))" *) |
|
13306 | 798 |
constdefs domain_fm :: "[i,i]=>i" |
13429 | 799 |
"domain_fm(r,z) == |
13306 | 800 |
Forall(Iff(Member(0,succ(z)), |
801 |
Exists(And(Member(0,succ(succ(r))), |
|
802 |
Exists(pair_fm(2,0,1))))))" |
|
803 |
||
804 |
lemma domain_type [TC]: |
|
805 |
"[| x \<in> nat; y \<in> nat |] ==> domain_fm(x,y) \<in> formula" |
|
13429 | 806 |
by (simp add: domain_fm_def) |
13306 | 807 |
|
808 |
lemma arity_domain_fm [simp]: |
|
13429 | 809 |
"[| x \<in> nat; y \<in> nat |] |
13306 | 810 |
==> arity(domain_fm(x,y)) = succ(x) \<union> succ(y)" |
13429 | 811 |
by (simp add: domain_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 812 |
|
813 |
lemma sats_domain_fm [simp]: |
|
814 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
|
13429 | 815 |
==> sats(A, domain_fm(x,y), env) <-> |
13306 | 816 |
is_domain(**A, nth(x,env), nth(y,env))" |
817 |
by (simp add: domain_fm_def is_domain_def) |
|
818 |
||
819 |
lemma domain_iff_sats: |
|
13429 | 820 |
"[| nth(i,env) = x; nth(j,env) = y; |
13306 | 821 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
822 |
==> is_domain(**A, x, y) <-> sats(A, domain_fm(i,j), env)" |
|
823 |
by simp |
|
824 |
||
13314 | 825 |
theorem domain_reflection: |
13429 | 826 |
"REFLECTS[\<lambda>x. is_domain(L,f(x),g(x)), |
13314 | 827 |
\<lambda>i x. is_domain(**Lset(i),f(x),g(x))]" |
828 |
apply (simp only: is_domain_def setclass_simps) |
|
13429 | 829 |
apply (intro FOL_reflections pair_reflection) |
13314 | 830 |
done |
13306 | 831 |
|
832 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
833 |
subsubsection{*Range of a Relation, Internalized*} |
13306 | 834 |
|
13429 | 835 |
(* "is_range(M,r,z) == |
836 |
\<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. pair(M,x,y,w))))" *) |
|
13306 | 837 |
constdefs range_fm :: "[i,i]=>i" |
13429 | 838 |
"range_fm(r,z) == |
13306 | 839 |
Forall(Iff(Member(0,succ(z)), |
840 |
Exists(And(Member(0,succ(succ(r))), |
|
841 |
Exists(pair_fm(0,2,1))))))" |
|
842 |
||
843 |
lemma range_type [TC]: |
|
844 |
"[| x \<in> nat; y \<in> nat |] ==> range_fm(x,y) \<in> formula" |
|
13429 | 845 |
by (simp add: range_fm_def) |
13306 | 846 |
|
847 |
lemma arity_range_fm [simp]: |
|
13429 | 848 |
"[| x \<in> nat; y \<in> nat |] |
13306 | 849 |
==> arity(range_fm(x,y)) = succ(x) \<union> succ(y)" |
13429 | 850 |
by (simp add: range_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 851 |
|
852 |
lemma sats_range_fm [simp]: |
|
853 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
|
13429 | 854 |
==> sats(A, range_fm(x,y), env) <-> |
13306 | 855 |
is_range(**A, nth(x,env), nth(y,env))" |
856 |
by (simp add: range_fm_def is_range_def) |
|
857 |
||
858 |
lemma range_iff_sats: |
|
13429 | 859 |
"[| nth(i,env) = x; nth(j,env) = y; |
13306 | 860 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
861 |
==> is_range(**A, x, y) <-> sats(A, range_fm(i,j), env)" |
|
862 |
by simp |
|
863 |
||
13314 | 864 |
theorem range_reflection: |
13429 | 865 |
"REFLECTS[\<lambda>x. is_range(L,f(x),g(x)), |
13314 | 866 |
\<lambda>i x. is_range(**Lset(i),f(x),g(x))]" |
867 |
apply (simp only: is_range_def setclass_simps) |
|
13429 | 868 |
apply (intro FOL_reflections pair_reflection) |
13314 | 869 |
done |
13306 | 870 |
|
13429 | 871 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
872 |
subsubsection{*Field of a Relation, Internalized*} |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
873 |
|
13429 | 874 |
(* "is_field(M,r,z) == |
875 |
\<exists>dr[M]. is_domain(M,r,dr) & |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
876 |
(\<exists>rr[M]. is_range(M,r,rr) & union(M,dr,rr,z))" *) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
877 |
constdefs field_fm :: "[i,i]=>i" |
13429 | 878 |
"field_fm(r,z) == |
879 |
Exists(And(domain_fm(succ(r),0), |
|
880 |
Exists(And(range_fm(succ(succ(r)),0), |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
881 |
union_fm(1,0,succ(succ(z)))))))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
882 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
883 |
lemma field_type [TC]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
884 |
"[| x \<in> nat; y \<in> nat |] ==> field_fm(x,y) \<in> formula" |
13429 | 885 |
by (simp add: field_fm_def) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
886 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
887 |
lemma arity_field_fm [simp]: |
13429 | 888 |
"[| x \<in> nat; y \<in> nat |] |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
889 |
==> arity(field_fm(x,y)) = succ(x) \<union> succ(y)" |
13429 | 890 |
by (simp add: field_fm_def succ_Un_distrib [symmetric] Un_ac) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
891 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
892 |
lemma sats_field_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
893 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
13429 | 894 |
==> sats(A, field_fm(x,y), env) <-> |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
895 |
is_field(**A, nth(x,env), nth(y,env))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
896 |
by (simp add: field_fm_def is_field_def) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
897 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
898 |
lemma field_iff_sats: |
13429 | 899 |
"[| nth(i,env) = x; nth(j,env) = y; |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
900 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
901 |
==> is_field(**A, x, y) <-> sats(A, field_fm(i,j), env)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
902 |
by simp |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
903 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
904 |
theorem field_reflection: |
13429 | 905 |
"REFLECTS[\<lambda>x. is_field(L,f(x),g(x)), |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
906 |
\<lambda>i x. is_field(**Lset(i),f(x),g(x))]" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
907 |
apply (simp only: is_field_def setclass_simps) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
908 |
apply (intro FOL_reflections domain_reflection range_reflection |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
909 |
union_reflection) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
910 |
done |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
911 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
912 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
913 |
subsubsection{*Image under a Relation, Internalized*} |
13306 | 914 |
|
13429 | 915 |
(* "image(M,r,A,z) == |
13306 | 916 |
\<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. x\<in>A & pair(M,x,y,w))))" *) |
917 |
constdefs image_fm :: "[i,i,i]=>i" |
|
13429 | 918 |
"image_fm(r,A,z) == |
13306 | 919 |
Forall(Iff(Member(0,succ(z)), |
920 |
Exists(And(Member(0,succ(succ(r))), |
|
921 |
Exists(And(Member(0,succ(succ(succ(A)))), |
|
13429 | 922 |
pair_fm(0,2,1)))))))" |
13306 | 923 |
|
924 |
lemma image_type [TC]: |
|
925 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> image_fm(x,y,z) \<in> formula" |
|
13429 | 926 |
by (simp add: image_fm_def) |
13306 | 927 |
|
928 |
lemma arity_image_fm [simp]: |
|
13429 | 929 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13306 | 930 |
==> arity(image_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 931 |
by (simp add: image_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 932 |
|
933 |
lemma sats_image_fm [simp]: |
|
934 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 935 |
==> sats(A, image_fm(x,y,z), env) <-> |
13306 | 936 |
image(**A, nth(x,env), nth(y,env), nth(z,env))" |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
937 |
by (simp add: image_fm_def Relative.image_def) |
13306 | 938 |
|
939 |
lemma image_iff_sats: |
|
13429 | 940 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13306 | 941 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
942 |
==> image(**A, x, y, z) <-> sats(A, image_fm(i,j,k), env)" |
|
943 |
by (simp add: sats_image_fm) |
|
944 |
||
13314 | 945 |
theorem image_reflection: |
13429 | 946 |
"REFLECTS[\<lambda>x. image(L,f(x),g(x),h(x)), |
13314 | 947 |
\<lambda>i x. image(**Lset(i),f(x),g(x),h(x))]" |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
948 |
apply (simp only: Relative.image_def setclass_simps) |
13429 | 949 |
apply (intro FOL_reflections pair_reflection) |
13314 | 950 |
done |
13306 | 951 |
|
952 |
||
13348 | 953 |
subsubsection{*Pre-Image under a Relation, Internalized*} |
954 |
||
13429 | 955 |
(* "pre_image(M,r,A,z) == |
956 |
\<forall>x[M]. x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. y\<in>A & pair(M,x,y,w)))" *) |
|
13348 | 957 |
constdefs pre_image_fm :: "[i,i,i]=>i" |
13429 | 958 |
"pre_image_fm(r,A,z) == |
13348 | 959 |
Forall(Iff(Member(0,succ(z)), |
960 |
Exists(And(Member(0,succ(succ(r))), |
|
961 |
Exists(And(Member(0,succ(succ(succ(A)))), |
|
13429 | 962 |
pair_fm(2,0,1)))))))" |
13348 | 963 |
|
964 |
lemma pre_image_type [TC]: |
|
965 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> pre_image_fm(x,y,z) \<in> formula" |
|
13429 | 966 |
by (simp add: pre_image_fm_def) |
13348 | 967 |
|
968 |
lemma arity_pre_image_fm [simp]: |
|
13429 | 969 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13348 | 970 |
==> arity(pre_image_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 971 |
by (simp add: pre_image_fm_def succ_Un_distrib [symmetric] Un_ac) |
13348 | 972 |
|
973 |
lemma sats_pre_image_fm [simp]: |
|
974 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 975 |
==> sats(A, pre_image_fm(x,y,z), env) <-> |
13348 | 976 |
pre_image(**A, nth(x,env), nth(y,env), nth(z,env))" |
977 |
by (simp add: pre_image_fm_def Relative.pre_image_def) |
|
978 |
||
979 |
lemma pre_image_iff_sats: |
|
13429 | 980 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13348 | 981 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
982 |
==> pre_image(**A, x, y, z) <-> sats(A, pre_image_fm(i,j,k), env)" |
|
983 |
by (simp add: sats_pre_image_fm) |
|
984 |
||
985 |
theorem pre_image_reflection: |
|
13429 | 986 |
"REFLECTS[\<lambda>x. pre_image(L,f(x),g(x),h(x)), |
13348 | 987 |
\<lambda>i x. pre_image(**Lset(i),f(x),g(x),h(x))]" |
988 |
apply (simp only: Relative.pre_image_def setclass_simps) |
|
13429 | 989 |
apply (intro FOL_reflections pair_reflection) |
13348 | 990 |
done |
991 |
||
992 |
||
13352 | 993 |
subsubsection{*Function Application, Internalized*} |
994 |
||
13429 | 995 |
(* "fun_apply(M,f,x,y) == |
996 |
(\<exists>xs[M]. \<exists>fxs[M]. |
|
13352 | 997 |
upair(M,x,x,xs) & image(M,f,xs,fxs) & big_union(M,fxs,y))" *) |
998 |
constdefs fun_apply_fm :: "[i,i,i]=>i" |
|
13429 | 999 |
"fun_apply_fm(f,x,y) == |
13352 | 1000 |
Exists(Exists(And(upair_fm(succ(succ(x)), succ(succ(x)), 1), |
13429 | 1001 |
And(image_fm(succ(succ(f)), 1, 0), |
13352 | 1002 |
big_union_fm(0,succ(succ(y)))))))" |
1003 |
||
1004 |
lemma fun_apply_type [TC]: |
|
1005 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> fun_apply_fm(x,y,z) \<in> formula" |
|
13429 | 1006 |
by (simp add: fun_apply_fm_def) |
13352 | 1007 |
|
1008 |
lemma arity_fun_apply_fm [simp]: |
|
13429 | 1009 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13352 | 1010 |
==> arity(fun_apply_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 1011 |
by (simp add: fun_apply_fm_def succ_Un_distrib [symmetric] Un_ac) |
13352 | 1012 |
|
1013 |
lemma sats_fun_apply_fm [simp]: |
|
1014 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 1015 |
==> sats(A, fun_apply_fm(x,y,z), env) <-> |
13352 | 1016 |
fun_apply(**A, nth(x,env), nth(y,env), nth(z,env))" |
1017 |
by (simp add: fun_apply_fm_def fun_apply_def) |
|
1018 |
||
1019 |
lemma fun_apply_iff_sats: |
|
13429 | 1020 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13352 | 1021 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
1022 |
==> fun_apply(**A, x, y, z) <-> sats(A, fun_apply_fm(i,j,k), env)" |
|
1023 |
by simp |
|
1024 |
||
1025 |
theorem fun_apply_reflection: |
|
13429 | 1026 |
"REFLECTS[\<lambda>x. fun_apply(L,f(x),g(x),h(x)), |
1027 |
\<lambda>i x. fun_apply(**Lset(i),f(x),g(x),h(x))]" |
|
13352 | 1028 |
apply (simp only: fun_apply_def setclass_simps) |
1029 |
apply (intro FOL_reflections upair_reflection image_reflection |
|
13429 | 1030 |
big_union_reflection) |
13352 | 1031 |
done |
1032 |
||
1033 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1034 |
subsubsection{*The Concept of Relation, Internalized*} |
13306 | 1035 |
|
13429 | 1036 |
(* "is_relation(M,r) == |
13306 | 1037 |
(\<forall>z[M]. z\<in>r --> (\<exists>x[M]. \<exists>y[M]. pair(M,x,y,z)))" *) |
1038 |
constdefs relation_fm :: "i=>i" |
|
13429 | 1039 |
"relation_fm(r) == |
13306 | 1040 |
Forall(Implies(Member(0,succ(r)), Exists(Exists(pair_fm(1,0,2)))))" |
1041 |
||
1042 |
lemma relation_type [TC]: |
|
1043 |
"[| x \<in> nat |] ==> relation_fm(x) \<in> formula" |
|
13429 | 1044 |
by (simp add: relation_fm_def) |
13306 | 1045 |
|
1046 |
lemma arity_relation_fm [simp]: |
|
1047 |
"x \<in> nat ==> arity(relation_fm(x)) = succ(x)" |
|
13429 | 1048 |
by (simp add: relation_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 1049 |
|
1050 |
lemma sats_relation_fm [simp]: |
|
1051 |
"[| x \<in> nat; env \<in> list(A)|] |
|
1052 |
==> sats(A, relation_fm(x), env) <-> is_relation(**A, nth(x,env))" |
|
1053 |
by (simp add: relation_fm_def is_relation_def) |
|
1054 |
||
1055 |
lemma relation_iff_sats: |
|
13429 | 1056 |
"[| nth(i,env) = x; nth(j,env) = y; |
13306 | 1057 |
i \<in> nat; env \<in> list(A)|] |
1058 |
==> is_relation(**A, x) <-> sats(A, relation_fm(i), env)" |
|
1059 |
by simp |
|
1060 |
||
13314 | 1061 |
theorem is_relation_reflection: |
13429 | 1062 |
"REFLECTS[\<lambda>x. is_relation(L,f(x)), |
13314 | 1063 |
\<lambda>i x. is_relation(**Lset(i),f(x))]" |
1064 |
apply (simp only: is_relation_def setclass_simps) |
|
13429 | 1065 |
apply (intro FOL_reflections pair_reflection) |
13314 | 1066 |
done |
13306 | 1067 |
|
1068 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1069 |
subsubsection{*The Concept of Function, Internalized*} |
13306 | 1070 |
|
13429 | 1071 |
(* "is_function(M,r) == |
1072 |
\<forall>x[M]. \<forall>y[M]. \<forall>y'[M]. \<forall>p[M]. \<forall>p'[M]. |
|
13306 | 1073 |
pair(M,x,y,p) --> pair(M,x,y',p') --> p\<in>r --> p'\<in>r --> y=y'" *) |
1074 |
constdefs function_fm :: "i=>i" |
|
13429 | 1075 |
"function_fm(r) == |
13306 | 1076 |
Forall(Forall(Forall(Forall(Forall( |
1077 |
Implies(pair_fm(4,3,1), |
|
1078 |
Implies(pair_fm(4,2,0), |
|
1079 |
Implies(Member(1,r#+5), |
|
1080 |
Implies(Member(0,r#+5), Equal(3,2))))))))))" |
|
1081 |
||
1082 |
lemma function_type [TC]: |
|
1083 |
"[| x \<in> nat |] ==> function_fm(x) \<in> formula" |
|
13429 | 1084 |
by (simp add: function_fm_def) |
13306 | 1085 |
|
1086 |
lemma arity_function_fm [simp]: |
|
1087 |
"x \<in> nat ==> arity(function_fm(x)) = succ(x)" |
|
13429 | 1088 |
by (simp add: function_fm_def succ_Un_distrib [symmetric] Un_ac) |
13306 | 1089 |
|
1090 |
lemma sats_function_fm [simp]: |
|
1091 |
"[| x \<in> nat; env \<in> list(A)|] |
|
1092 |
==> sats(A, function_fm(x), env) <-> is_function(**A, nth(x,env))" |
|
1093 |
by (simp add: function_fm_def is_function_def) |
|
1094 |
||
13505 | 1095 |
lemma is_function_iff_sats: |
13429 | 1096 |
"[| nth(i,env) = x; nth(j,env) = y; |
13306 | 1097 |
i \<in> nat; env \<in> list(A)|] |
1098 |
==> is_function(**A, x) <-> sats(A, function_fm(i), env)" |
|
1099 |
by simp |
|
1100 |
||
13314 | 1101 |
theorem is_function_reflection: |
13429 | 1102 |
"REFLECTS[\<lambda>x. is_function(L,f(x)), |
13314 | 1103 |
\<lambda>i x. is_function(**Lset(i),f(x))]" |
1104 |
apply (simp only: is_function_def setclass_simps) |
|
13429 | 1105 |
apply (intro FOL_reflections pair_reflection) |
13314 | 1106 |
done |
13298 | 1107 |
|
1108 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1109 |
subsubsection{*Typed Functions, Internalized*} |
13309 | 1110 |
|
13429 | 1111 |
(* "typed_function(M,A,B,r) == |
13309 | 1112 |
is_function(M,r) & is_relation(M,r) & is_domain(M,r,A) & |
1113 |
(\<forall>u[M]. u\<in>r --> (\<forall>x[M]. \<forall>y[M]. pair(M,x,y,u) --> y\<in>B))" *) |
|
1114 |
||
1115 |
constdefs typed_function_fm :: "[i,i,i]=>i" |
|
13429 | 1116 |
"typed_function_fm(A,B,r) == |
13309 | 1117 |
And(function_fm(r), |
1118 |
And(relation_fm(r), |
|
1119 |
And(domain_fm(r,A), |
|
1120 |
Forall(Implies(Member(0,succ(r)), |
|
1121 |
Forall(Forall(Implies(pair_fm(1,0,2),Member(0,B#+3)))))))))" |
|
1122 |
||
1123 |
lemma typed_function_type [TC]: |
|
1124 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> typed_function_fm(x,y,z) \<in> formula" |
|
13429 | 1125 |
by (simp add: typed_function_fm_def) |
13309 | 1126 |
|
1127 |
lemma arity_typed_function_fm [simp]: |
|
13429 | 1128 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13309 | 1129 |
==> arity(typed_function_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 1130 |
by (simp add: typed_function_fm_def succ_Un_distrib [symmetric] Un_ac) |
13309 | 1131 |
|
1132 |
lemma sats_typed_function_fm [simp]: |
|
1133 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 1134 |
==> sats(A, typed_function_fm(x,y,z), env) <-> |
13309 | 1135 |
typed_function(**A, nth(x,env), nth(y,env), nth(z,env))" |
1136 |
by (simp add: typed_function_fm_def typed_function_def) |
|
1137 |
||
1138 |
lemma typed_function_iff_sats: |
|
13429 | 1139 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13309 | 1140 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
1141 |
==> typed_function(**A, x, y, z) <-> sats(A, typed_function_fm(i,j,k), env)" |
|
1142 |
by simp |
|
1143 |
||
13429 | 1144 |
lemmas function_reflections = |
13363 | 1145 |
empty_reflection number1_reflection |
13429 | 1146 |
upair_reflection pair_reflection union_reflection |
1147 |
big_union_reflection cons_reflection successor_reflection |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1148 |
fun_apply_reflection subset_reflection |
13429 | 1149 |
transitive_set_reflection membership_reflection |
1150 |
pred_set_reflection domain_reflection range_reflection field_reflection |
|
13348 | 1151 |
image_reflection pre_image_reflection |
13429 | 1152 |
is_relation_reflection is_function_reflection |
13309 | 1153 |
|
13429 | 1154 |
lemmas function_iff_sats = |
1155 |
empty_iff_sats number1_iff_sats |
|
1156 |
upair_iff_sats pair_iff_sats union_iff_sats |
|
13505 | 1157 |
big_union_iff_sats cons_iff_sats successor_iff_sats |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1158 |
fun_apply_iff_sats Memrel_iff_sats |
13429 | 1159 |
pred_set_iff_sats domain_iff_sats range_iff_sats field_iff_sats |
1160 |
image_iff_sats pre_image_iff_sats |
|
13505 | 1161 |
relation_iff_sats is_function_iff_sats |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1162 |
|
13309 | 1163 |
|
13314 | 1164 |
theorem typed_function_reflection: |
13429 | 1165 |
"REFLECTS[\<lambda>x. typed_function(L,f(x),g(x),h(x)), |
13314 | 1166 |
\<lambda>i x. typed_function(**Lset(i),f(x),g(x),h(x))]" |
1167 |
apply (simp only: typed_function_def setclass_simps) |
|
13429 | 1168 |
apply (intro FOL_reflections function_reflections) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1169 |
done |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1170 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1171 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1172 |
subsubsection{*Composition of Relations, Internalized*} |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1173 |
|
13429 | 1174 |
(* "composition(M,r,s,t) == |
1175 |
\<forall>p[M]. p \<in> t <-> |
|
1176 |
(\<exists>x[M]. \<exists>y[M]. \<exists>z[M]. \<exists>xy[M]. \<exists>yz[M]. |
|
1177 |
pair(M,x,z,p) & pair(M,x,y,xy) & pair(M,y,z,yz) & |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1178 |
xy \<in> s & yz \<in> r)" *) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1179 |
constdefs composition_fm :: "[i,i,i]=>i" |
13429 | 1180 |
"composition_fm(r,s,t) == |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1181 |
Forall(Iff(Member(0,succ(t)), |
13429 | 1182 |
Exists(Exists(Exists(Exists(Exists( |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1183 |
And(pair_fm(4,2,5), |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1184 |
And(pair_fm(4,3,1), |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1185 |
And(pair_fm(3,2,0), |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1186 |
And(Member(1,s#+6), Member(0,r#+6))))))))))))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1187 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1188 |
lemma composition_type [TC]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1189 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> composition_fm(x,y,z) \<in> formula" |
13429 | 1190 |
by (simp add: composition_fm_def) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1191 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1192 |
lemma arity_composition_fm [simp]: |
13429 | 1193 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1194 |
==> arity(composition_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 1195 |
by (simp add: composition_fm_def succ_Un_distrib [symmetric] Un_ac) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1196 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1197 |
lemma sats_composition_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1198 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
13429 | 1199 |
==> sats(A, composition_fm(x,y,z), env) <-> |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1200 |
composition(**A, nth(x,env), nth(y,env), nth(z,env))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1201 |
by (simp add: composition_fm_def composition_def) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1202 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1203 |
lemma composition_iff_sats: |
13429 | 1204 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1205 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1206 |
==> composition(**A, x, y, z) <-> sats(A, composition_fm(i,j,k), env)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1207 |
by simp |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1208 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1209 |
theorem composition_reflection: |
13429 | 1210 |
"REFLECTS[\<lambda>x. composition(L,f(x),g(x),h(x)), |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1211 |
\<lambda>i x. composition(**Lset(i),f(x),g(x),h(x))]" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1212 |
apply (simp only: composition_def setclass_simps) |
13429 | 1213 |
apply (intro FOL_reflections pair_reflection) |
13314 | 1214 |
done |
1215 |
||
13309 | 1216 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1217 |
subsubsection{*Injections, Internalized*} |
13309 | 1218 |
|
13429 | 1219 |
(* "injection(M,A,B,f) == |
1220 |
typed_function(M,A,B,f) & |
|
1221 |
(\<forall>x[M]. \<forall>x'[M]. \<forall>y[M]. \<forall>p[M]. \<forall>p'[M]. |
|
13309 | 1222 |
pair(M,x,y,p) --> pair(M,x',y,p') --> p\<in>f --> p'\<in>f --> x=x')" *) |
1223 |
constdefs injection_fm :: "[i,i,i]=>i" |
|
13429 | 1224 |
"injection_fm(A,B,f) == |
13309 | 1225 |
And(typed_function_fm(A,B,f), |
1226 |
Forall(Forall(Forall(Forall(Forall( |
|
1227 |
Implies(pair_fm(4,2,1), |
|
1228 |
Implies(pair_fm(3,2,0), |
|
1229 |
Implies(Member(1,f#+5), |
|
1230 |
Implies(Member(0,f#+5), Equal(4,3)))))))))))" |
|
1231 |
||
1232 |
||
1233 |
lemma injection_type [TC]: |
|
1234 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> injection_fm(x,y,z) \<in> formula" |
|
13429 | 1235 |
by (simp add: injection_fm_def) |
13309 | 1236 |
|
1237 |
lemma arity_injection_fm [simp]: |
|
13429 | 1238 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13309 | 1239 |
==> arity(injection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 1240 |
by (simp add: injection_fm_def succ_Un_distrib [symmetric] Un_ac) |
13309 | 1241 |
|
1242 |
lemma sats_injection_fm [simp]: |
|
1243 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 1244 |
==> sats(A, injection_fm(x,y,z), env) <-> |
13309 | 1245 |
injection(**A, nth(x,env), nth(y,env), nth(z,env))" |
1246 |
by (simp add: injection_fm_def injection_def) |
|
1247 |
||
1248 |
lemma injection_iff_sats: |
|
13429 | 1249 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13309 | 1250 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
1251 |
==> injection(**A, x, y, z) <-> sats(A, injection_fm(i,j,k), env)" |
|
1252 |
by simp |
|
1253 |
||
13314 | 1254 |
theorem injection_reflection: |
13429 | 1255 |
"REFLECTS[\<lambda>x. injection(L,f(x),g(x),h(x)), |
13314 | 1256 |
\<lambda>i x. injection(**Lset(i),f(x),g(x),h(x))]" |
1257 |
apply (simp only: injection_def setclass_simps) |
|
13429 | 1258 |
apply (intro FOL_reflections function_reflections typed_function_reflection) |
13314 | 1259 |
done |
13309 | 1260 |
|
1261 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1262 |
subsubsection{*Surjections, Internalized*} |
13309 | 1263 |
|
1264 |
(* surjection :: "[i=>o,i,i,i] => o" |
|
13429 | 1265 |
"surjection(M,A,B,f) == |
13309 | 1266 |
typed_function(M,A,B,f) & |
1267 |
(\<forall>y[M]. y\<in>B --> (\<exists>x[M]. x\<in>A & fun_apply(M,f,x,y)))" *) |
|
1268 |
constdefs surjection_fm :: "[i,i,i]=>i" |
|
13429 | 1269 |
"surjection_fm(A,B,f) == |
13309 | 1270 |
And(typed_function_fm(A,B,f), |
1271 |
Forall(Implies(Member(0,succ(B)), |
|
1272 |
Exists(And(Member(0,succ(succ(A))), |
|
1273 |
fun_apply_fm(succ(succ(f)),0,1))))))" |
|
1274 |
||
1275 |
lemma surjection_type [TC]: |
|
1276 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> surjection_fm(x,y,z) \<in> formula" |
|
13429 | 1277 |
by (simp add: surjection_fm_def) |
13309 | 1278 |
|
1279 |
lemma arity_surjection_fm [simp]: |
|
13429 | 1280 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13309 | 1281 |
==> arity(surjection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 1282 |
by (simp add: surjection_fm_def succ_Un_distrib [symmetric] Un_ac) |
13309 | 1283 |
|
1284 |
lemma sats_surjection_fm [simp]: |
|
1285 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 1286 |
==> sats(A, surjection_fm(x,y,z), env) <-> |
13309 | 1287 |
surjection(**A, nth(x,env), nth(y,env), nth(z,env))" |
1288 |
by (simp add: surjection_fm_def surjection_def) |
|
1289 |
||
1290 |
lemma surjection_iff_sats: |
|
13429 | 1291 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13309 | 1292 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
1293 |
==> surjection(**A, x, y, z) <-> sats(A, surjection_fm(i,j,k), env)" |
|
1294 |
by simp |
|
1295 |
||
13314 | 1296 |
theorem surjection_reflection: |
13429 | 1297 |
"REFLECTS[\<lambda>x. surjection(L,f(x),g(x),h(x)), |
13314 | 1298 |
\<lambda>i x. surjection(**Lset(i),f(x),g(x),h(x))]" |
1299 |
apply (simp only: surjection_def setclass_simps) |
|
13429 | 1300 |
apply (intro FOL_reflections function_reflections typed_function_reflection) |
13314 | 1301 |
done |
13309 | 1302 |
|
1303 |
||
1304 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1305 |
subsubsection{*Bijections, Internalized*} |
13309 | 1306 |
|
1307 |
(* bijection :: "[i=>o,i,i,i] => o" |
|
1308 |
"bijection(M,A,B,f) == injection(M,A,B,f) & surjection(M,A,B,f)" *) |
|
1309 |
constdefs bijection_fm :: "[i,i,i]=>i" |
|
1310 |
"bijection_fm(A,B,f) == And(injection_fm(A,B,f), surjection_fm(A,B,f))" |
|
1311 |
||
1312 |
lemma bijection_type [TC]: |
|
1313 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> bijection_fm(x,y,z) \<in> formula" |
|
13429 | 1314 |
by (simp add: bijection_fm_def) |
13309 | 1315 |
|
1316 |
lemma arity_bijection_fm [simp]: |
|
13429 | 1317 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13309 | 1318 |
==> arity(bijection_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 1319 |
by (simp add: bijection_fm_def succ_Un_distrib [symmetric] Un_ac) |
13309 | 1320 |
|
1321 |
lemma sats_bijection_fm [simp]: |
|
1322 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 1323 |
==> sats(A, bijection_fm(x,y,z), env) <-> |
13309 | 1324 |
bijection(**A, nth(x,env), nth(y,env), nth(z,env))" |
1325 |
by (simp add: bijection_fm_def bijection_def) |
|
1326 |
||
1327 |
lemma bijection_iff_sats: |
|
13429 | 1328 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13309 | 1329 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
1330 |
==> bijection(**A, x, y, z) <-> sats(A, bijection_fm(i,j,k), env)" |
|
1331 |
by simp |
|
1332 |
||
13314 | 1333 |
theorem bijection_reflection: |
13429 | 1334 |
"REFLECTS[\<lambda>x. bijection(L,f(x),g(x),h(x)), |
13314 | 1335 |
\<lambda>i x. bijection(**Lset(i),f(x),g(x),h(x))]" |
1336 |
apply (simp only: bijection_def setclass_simps) |
|
13429 | 1337 |
apply (intro And_reflection injection_reflection surjection_reflection) |
13314 | 1338 |
done |
13309 | 1339 |
|
1340 |
||
13348 | 1341 |
subsubsection{*Restriction of a Relation, Internalized*} |
1342 |
||
1343 |
||
13429 | 1344 |
(* "restriction(M,r,A,z) == |
1345 |
\<forall>x[M]. x \<in> z <-> (x \<in> r & (\<exists>u[M]. u\<in>A & (\<exists>v[M]. pair(M,u,v,x))))" *) |
|
13348 | 1346 |
constdefs restriction_fm :: "[i,i,i]=>i" |
13429 | 1347 |
"restriction_fm(r,A,z) == |
13348 | 1348 |
Forall(Iff(Member(0,succ(z)), |
1349 |
And(Member(0,succ(r)), |
|
1350 |
Exists(And(Member(0,succ(succ(A))), |
|
1351 |
Exists(pair_fm(1,0,2)))))))" |
|
1352 |
||
1353 |
lemma restriction_type [TC]: |
|
1354 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> restriction_fm(x,y,z) \<in> formula" |
|
13429 | 1355 |
by (simp add: restriction_fm_def) |
13348 | 1356 |
|
1357 |
lemma arity_restriction_fm [simp]: |
|
13429 | 1358 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] |
13348 | 1359 |
==> arity(restriction_fm(x,y,z)) = succ(x) \<union> succ(y) \<union> succ(z)" |
13429 | 1360 |
by (simp add: restriction_fm_def succ_Un_distrib [symmetric] Un_ac) |
13348 | 1361 |
|
1362 |
lemma sats_restriction_fm [simp]: |
|
1363 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
|
13429 | 1364 |
==> sats(A, restriction_fm(x,y,z), env) <-> |
13348 | 1365 |
restriction(**A, nth(x,env), nth(y,env), nth(z,env))" |
1366 |
by (simp add: restriction_fm_def restriction_def) |
|
1367 |
||
1368 |
lemma restriction_iff_sats: |
|
13429 | 1369 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
13348 | 1370 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
1371 |
==> restriction(**A, x, y, z) <-> sats(A, restriction_fm(i,j,k), env)" |
|
1372 |
by simp |
|
1373 |
||
1374 |
theorem restriction_reflection: |
|
13429 | 1375 |
"REFLECTS[\<lambda>x. restriction(L,f(x),g(x),h(x)), |
13348 | 1376 |
\<lambda>i x. restriction(**Lset(i),f(x),g(x),h(x))]" |
1377 |
apply (simp only: restriction_def setclass_simps) |
|
13429 | 1378 |
apply (intro FOL_reflections pair_reflection) |
13348 | 1379 |
done |
1380 |
||
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1381 |
subsubsection{*Order-Isomorphisms, Internalized*} |
13309 | 1382 |
|
1383 |
(* order_isomorphism :: "[i=>o,i,i,i,i,i] => o" |
|
13429 | 1384 |
"order_isomorphism(M,A,r,B,s,f) == |
1385 |
bijection(M,A,B,f) & |
|
13309 | 1386 |
(\<forall>x[M]. x\<in>A --> (\<forall>y[M]. y\<in>A --> |
1387 |
(\<forall>p[M]. \<forall>fx[M]. \<forall>fy[M]. \<forall>q[M]. |
|
13429 | 1388 |
pair(M,x,y,p) --> fun_apply(M,f,x,fx) --> fun_apply(M,f,y,fy) --> |
13309 | 1389 |
pair(M,fx,fy,q) --> (p\<in>r <-> q\<in>s))))" |
1390 |
*) |
|
1391 |
||
1392 |
constdefs order_isomorphism_fm :: "[i,i,i,i,i]=>i" |
|
13429 | 1393 |
"order_isomorphism_fm(A,r,B,s,f) == |
1394 |
And(bijection_fm(A,B,f), |
|
13309 | 1395 |
Forall(Implies(Member(0,succ(A)), |
1396 |
Forall(Implies(Member(0,succ(succ(A))), |
|
1397 |
Forall(Forall(Forall(Forall( |
|
1398 |
Implies(pair_fm(5,4,3), |
|
1399 |
Implies(fun_apply_fm(f#+6,5,2), |
|
1400 |
Implies(fun_apply_fm(f#+6,4,1), |
|
13429 | 1401 |
Implies(pair_fm(2,1,0), |
13309 | 1402 |
Iff(Member(3,r#+6), Member(0,s#+6)))))))))))))))" |
1403 |
||
1404 |
lemma order_isomorphism_type [TC]: |
|
13429 | 1405 |
"[| A \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat |] |
13309 | 1406 |
==> order_isomorphism_fm(A,r,B,s,f) \<in> formula" |
13429 | 1407 |
by (simp add: order_isomorphism_fm_def) |
13309 | 1408 |
|
1409 |
lemma arity_order_isomorphism_fm [simp]: |
|
13429 | 1410 |
"[| A \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat |] |
1411 |
==> arity(order_isomorphism_fm(A,r,B,s,f)) = |
|
1412 |
succ(A) \<union> succ(r) \<union> succ(B) \<union> succ(s) \<union> succ(f)" |
|
1413 |
by (simp add: order_isomorphism_fm_def succ_Un_distrib [symmetric] Un_ac) |
|
13309 | 1414 |
|
1415 |
lemma sats_order_isomorphism_fm [simp]: |
|
1416 |
"[| U \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat; env \<in> list(A)|] |
|
13429 | 1417 |
==> sats(A, order_isomorphism_fm(U,r,B,s,f), env) <-> |
1418 |
order_isomorphism(**A, nth(U,env), nth(r,env), nth(B,env), |
|
13309 | 1419 |
nth(s,env), nth(f,env))" |
1420 |
by (simp add: order_isomorphism_fm_def order_isomorphism_def) |
|
1421 |
||
1422 |
lemma order_isomorphism_iff_sats: |
|
13429 | 1423 |
"[| nth(i,env) = U; nth(j,env) = r; nth(k,env) = B; nth(j',env) = s; |
1424 |
nth(k',env) = f; |
|
13309 | 1425 |
i \<in> nat; j \<in> nat; k \<in> nat; j' \<in> nat; k' \<in> nat; env \<in> list(A)|] |
13429 | 1426 |
==> order_isomorphism(**A,U,r,B,s,f) <-> |
1427 |
sats(A, order_isomorphism_fm(i,j,k,j',k'), env)" |
|
13309 | 1428 |
by simp |
1429 |
||
13314 | 1430 |
theorem order_isomorphism_reflection: |
13429 | 1431 |
"REFLECTS[\<lambda>x. order_isomorphism(L,f(x),g(x),h(x),g'(x),h'(x)), |
13314 | 1432 |
\<lambda>i x. order_isomorphism(**Lset(i),f(x),g(x),h(x),g'(x),h'(x))]" |
1433 |
apply (simp only: order_isomorphism_def setclass_simps) |
|
13429 | 1434 |
apply (intro FOL_reflections function_reflections bijection_reflection) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1435 |
done |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1436 |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13323
diff
changeset
|
1437 |
subsubsection{*Limit Ordinals, Internalized*} |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1438 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1439 |
text{*A limit ordinal is a non-empty, successor-closed ordinal*} |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1440 |
|
13429 | 1441 |
(* "limit_ordinal(M,a) == |
1442 |
ordinal(M,a) & ~ empty(M,a) & |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1443 |
(\<forall>x[M]. x\<in>a --> (\<exists>y[M]. y\<in>a & successor(M,x,y)))" *) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1444 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1445 |
constdefs limit_ordinal_fm :: "i=>i" |
13429 | 1446 |
"limit_ordinal_fm(x) == |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1447 |
And(ordinal_fm(x), |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1448 |
And(Neg(empty_fm(x)), |
13429 | 1449 |
Forall(Implies(Member(0,succ(x)), |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1450 |
Exists(And(Member(0,succ(succ(x))), |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1451 |
succ_fm(1,0)))))))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1452 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1453 |
lemma limit_ordinal_type [TC]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1454 |
"x \<in> nat ==> limit_ordinal_fm(x) \<in> formula" |
13429 | 1455 |
by (simp add: limit_ordinal_fm_def) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1456 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1457 |
lemma arity_limit_ordinal_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1458 |
"x \<in> nat ==> arity(limit_ordinal_fm(x)) = succ(x)" |
13429 | 1459 |
by (simp add: limit_ordinal_fm_def succ_Un_distrib [symmetric] Un_ac) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1460 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1461 |
lemma sats_limit_ordinal_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1462 |
"[| x \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1463 |
==> sats(A, limit_ordinal_fm(x), env) <-> limit_ordinal(**A, nth(x,env))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1464 |
by (simp add: limit_ordinal_fm_def limit_ordinal_def sats_ordinal_fm') |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1465 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1466 |
lemma limit_ordinal_iff_sats: |
13429 | 1467 |
"[| nth(i,env) = x; nth(j,env) = y; |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1468 |
i \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1469 |
==> limit_ordinal(**A, x) <-> sats(A, limit_ordinal_fm(i), env)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1470 |
by simp |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1471 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1472 |
theorem limit_ordinal_reflection: |
13429 | 1473 |
"REFLECTS[\<lambda>x. limit_ordinal(L,f(x)), |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1474 |
\<lambda>i x. limit_ordinal(**Lset(i),f(x))]" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1475 |
apply (simp only: limit_ordinal_def setclass_simps) |
13429 | 1476 |
apply (intro FOL_reflections ordinal_reflection |
1477 |
empty_reflection successor_reflection) |
|
13314 | 1478 |
done |
13309 | 1479 |
|
13493
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1480 |
subsubsection{*Finite Ordinals: The Predicate ``Is A Natural Number''*} |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1481 |
|
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1482 |
(* "finite_ordinal(M,a) == |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1483 |
ordinal(M,a) & ~ limit_ordinal(M,a) & |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1484 |
(\<forall>x[M]. x\<in>a --> ~ limit_ordinal(M,x))" *) |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1485 |
constdefs finite_ordinal_fm :: "i=>i" |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1486 |
"finite_ordinal_fm(x) == |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1487 |
And(ordinal_fm(x), |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1488 |
And(Neg(limit_ordinal_fm(x)), |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1489 |
Forall(Implies(Member(0,succ(x)), |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1490 |
Neg(limit_ordinal_fm(0))))))" |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1491 |
|
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1492 |
lemma finite_ordinal_type [TC]: |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1493 |
"x \<in> nat ==> finite_ordinal_fm(x) \<in> formula" |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1494 |
by (simp add: finite_ordinal_fm_def) |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1495 |
|
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1496 |
lemma sats_finite_ordinal_fm [simp]: |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1497 |
"[| x \<in> nat; env \<in> list(A)|] |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1498 |
==> sats(A, finite_ordinal_fm(x), env) <-> finite_ordinal(**A, nth(x,env))" |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1499 |
by (simp add: finite_ordinal_fm_def sats_ordinal_fm' finite_ordinal_def) |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1500 |
|
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1501 |
lemma finite_ordinal_iff_sats: |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1502 |
"[| nth(i,env) = x; nth(j,env) = y; |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1503 |
i \<in> nat; env \<in> list(A)|] |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1504 |
==> finite_ordinal(**A, x) <-> sats(A, finite_ordinal_fm(i), env)" |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1505 |
by simp |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1506 |
|
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1507 |
theorem finite_ordinal_reflection: |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1508 |
"REFLECTS[\<lambda>x. finite_ordinal(L,f(x)), |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1509 |
\<lambda>i x. finite_ordinal(**Lset(i),f(x))]" |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1510 |
apply (simp only: finite_ordinal_def setclass_simps) |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1511 |
apply (intro FOL_reflections ordinal_reflection limit_ordinal_reflection) |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1512 |
done |
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1513 |
|
5aa68c051725
Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents:
13440
diff
changeset
|
1514 |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1515 |
subsubsection{*Omega: The Set of Natural Numbers*} |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1516 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1517 |
(* omega(M,a) == limit_ordinal(M,a) & (\<forall>x[M]. x\<in>a --> ~ limit_ordinal(M,x)) *) |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1518 |
constdefs omega_fm :: "i=>i" |
13429 | 1519 |
"omega_fm(x) == |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1520 |
And(limit_ordinal_fm(x), |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1521 |
Forall(Implies(Member(0,succ(x)), |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1522 |
Neg(limit_ordinal_fm(0)))))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1523 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1524 |
lemma omega_type [TC]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1525 |
"x \<in> nat ==> omega_fm(x) \<in> formula" |
13429 | 1526 |
by (simp add: omega_fm_def) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1527 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1528 |
lemma arity_omega_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1529 |
"x \<in> nat ==> arity(omega_fm(x)) = succ(x)" |
13429 | 1530 |
by (simp add: omega_fm_def succ_Un_distrib [symmetric] Un_ac) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1531 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1532 |
lemma sats_omega_fm [simp]: |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1533 |
"[| x \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1534 |
==> sats(A, omega_fm(x), env) <-> omega(**A, nth(x,env))" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1535 |
by (simp add: omega_fm_def omega_def) |
13316 | 1536 |
|
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1537 |
lemma omega_iff_sats: |
13429 | 1538 |
"[| nth(i,env) = x; nth(j,env) = y; |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1539 |
i \<in> nat; env \<in> list(A)|] |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1540 |
==> omega(**A, x) <-> sats(A, omega_fm(i), env)" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1541 |
by simp |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1542 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1543 |
theorem omega_reflection: |
13429 | 1544 |
"REFLECTS[\<lambda>x. omega(L,f(x)), |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1545 |
\<lambda>i x. omega(**Lset(i),f(x))]" |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1546 |
apply (simp only: omega_def setclass_simps) |
13429 | 1547 |
apply (intro FOL_reflections limit_ordinal_reflection) |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1548 |
done |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1549 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1550 |
|
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1551 |
lemmas fun_plus_reflections = |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1552 |
typed_function_reflection composition_reflection |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1553 |
injection_reflection surjection_reflection |
13348 | 1554 |
bijection_reflection restriction_reflection |
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13493
diff
changeset
|
1555 |
order_isomorphism_reflection finite_ordinal_reflection |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1556 |
ordinal_reflection limit_ordinal_reflection omega_reflection |
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1557 |
|
13429 | 1558 |
lemmas fun_plus_iff_sats = |
1559 |
typed_function_iff_sats composition_iff_sats |
|
1560 |
injection_iff_sats surjection_iff_sats |
|
1561 |
bijection_iff_sats restriction_iff_sats |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13493
diff
changeset
|
1562 |
order_isomorphism_iff_sats finite_ordinal_iff_sats |
13323
2c287f50c9f3
More relativization, reflection and proofs of separation
paulson
parents:
13316
diff
changeset
|
1563 |
ordinal_iff_sats limit_ordinal_iff_sats omega_iff_sats |
13316 | 1564 |
|
13223 | 1565 |
end |