author | wenzelm |
Tue, 17 Aug 2010 18:04:08 +0200 | |
changeset 38469 | 5c6c5d63f3c3 |
parent 36543 | 0e7fc5bf38de |
child 38715 | 6513ea67d95d |
permissions | -rw-r--r-- |
2469 | 1 |
(* Title: ZF/AC/OrdQuant.thy |
2 |
Authors: Krzysztof Grabczewski and L C Paulson |
|
3 |
*) |
|
4 |
||
13253 | 5 |
header {*Special quantifiers*} |
6 |
||
16417 | 7 |
theory OrdQuant imports Ordinal begin |
2469 | 8 |
|
13253 | 9 |
subsection {*Quantifiers and union operator for ordinals*} |
10 |
||
24893 | 11 |
definition |
2469 | 12 |
(* Ordinal Quantifiers *) |
24893 | 13 |
oall :: "[i, i => o] => o" where |
12620 | 14 |
"oall(A, P) == ALL x. x<A --> P(x)" |
13298 | 15 |
|
24893 | 16 |
definition |
17 |
oex :: "[i, i => o] => o" where |
|
12620 | 18 |
"oex(A, P) == EX x. x<A & P(x)" |
2469 | 19 |
|
24893 | 20 |
definition |
2469 | 21 |
(* Ordinal Union *) |
24893 | 22 |
OUnion :: "[i, i => i] => i" where |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
23 |
"OUnion(i,B) == {z: \<Union>x\<in>i. B(x). Ord(i)}" |
13298 | 24 |
|
2469 | 25 |
syntax |
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
26 |
"_oall" :: "[idt, i, o] => o" ("(3ALL _<_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
27 |
"_oex" :: "[idt, i, o] => o" ("(3EX _<_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
28 |
"_OUNION" :: "[idt, i, i] => i" ("(3UN _<_./ _)" 10) |
2469 | 29 |
|
30 |
translations |
|
24893 | 31 |
"ALL x<a. P" == "CONST oall(a, %x. P)" |
32 |
"EX x<a. P" == "CONST oex(a, %x. P)" |
|
33 |
"UN x<a. B" == "CONST OUnion(a, %x. B)" |
|
2469 | 34 |
|
12114
a8e860c86252
eliminated old "symbols" syntax, use "xsymbols" instead;
wenzelm
parents:
6093
diff
changeset
|
35 |
syntax (xsymbols) |
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
36 |
"_oall" :: "[idt, i, o] => o" ("(3\<forall>_<_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
37 |
"_oex" :: "[idt, i, o] => o" ("(3\<exists>_<_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
38 |
"_OUNION" :: "[idt, i, i] => i" ("(3\<Union>_<_./ _)" 10) |
14565 | 39 |
syntax (HTML output) |
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
40 |
"_oall" :: "[idt, i, o] => o" ("(3\<forall>_<_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
41 |
"_oex" :: "[idt, i, o] => o" ("(3\<exists>_<_./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
42 |
"_OUNION" :: "[idt, i, i] => i" ("(3\<Union>_<_./ _)" 10) |
12620 | 43 |
|
44 |
||
13302 | 45 |
subsubsection {*simplification of the new quantifiers*} |
12825 | 46 |
|
47 |
||
13169 | 48 |
(*MOST IMPORTANT that this is added to the simpset BEFORE Ord_atomize |
13298 | 49 |
is proved. Ord_atomize would convert this rule to |
12825 | 50 |
x < 0 ==> P(x) == True, which causes dire effects!*) |
51 |
lemma [simp]: "(ALL x<0. P(x))" |
|
13298 | 52 |
by (simp add: oall_def) |
12825 | 53 |
|
54 |
lemma [simp]: "~(EX x<0. P(x))" |
|
13298 | 55 |
by (simp add: oex_def) |
12825 | 56 |
|
57 |
lemma [simp]: "(ALL x<succ(i). P(x)) <-> (Ord(i) --> P(i) & (ALL x<i. P(x)))" |
|
13298 | 58 |
apply (simp add: oall_def le_iff) |
59 |
apply (blast intro: lt_Ord2) |
|
12825 | 60 |
done |
61 |
||
62 |
lemma [simp]: "(EX x<succ(i). P(x)) <-> (Ord(i) & (P(i) | (EX x<i. P(x))))" |
|
13298 | 63 |
apply (simp add: oex_def le_iff) |
64 |
apply (blast intro: lt_Ord2) |
|
12825 | 65 |
done |
66 |
||
13302 | 67 |
subsubsection {*Union over ordinals*} |
13118 | 68 |
|
12620 | 69 |
lemma Ord_OUN [intro,simp]: |
13162
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
paulson
parents:
13149
diff
changeset
|
70 |
"[| !!x. x<A ==> Ord(B(x)) |] ==> Ord(\<Union>x<A. B(x))" |
13298 | 71 |
by (simp add: OUnion_def ltI Ord_UN) |
12620 | 72 |
|
73 |
lemma OUN_upper_lt: |
|
13162
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
paulson
parents:
13149
diff
changeset
|
74 |
"[| a<A; i < b(a); Ord(\<Union>x<A. b(x)) |] ==> i < (\<Union>x<A. b(x))" |
12620 | 75 |
by (unfold OUnion_def lt_def, blast ) |
76 |
||
77 |
lemma OUN_upper_le: |
|
13162
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
paulson
parents:
13149
diff
changeset
|
78 |
"[| a<A; i\<le>b(a); Ord(\<Union>x<A. b(x)) |] ==> i \<le> (\<Union>x<A. b(x))" |
12820 | 79 |
apply (unfold OUnion_def, auto) |
12620 | 80 |
apply (rule UN_upper_le ) |
13298 | 81 |
apply (auto simp add: lt_def) |
12620 | 82 |
done |
2469 | 83 |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
84 |
lemma Limit_OUN_eq: "Limit(i) ==> (\<Union>x<i. x) = i" |
12620 | 85 |
by (simp add: OUnion_def Limit_Union_eq Limit_is_Ord) |
86 |
||
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
87 |
(* No < version; consider (\<Union>i\<in>nat.i)=nat *) |
12620 | 88 |
lemma OUN_least: |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
89 |
"(!!x. x<A ==> B(x) \<subseteq> C) ==> (\<Union>x<A. B(x)) \<subseteq> C" |
12620 | 90 |
by (simp add: OUnion_def UN_least ltI) |
91 |
||
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
92 |
(* No < version; consider (\<Union>i\<in>nat.i)=nat *) |
12620 | 93 |
lemma OUN_least_le: |
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
94 |
"[| Ord(i); !!x. x<A ==> b(x) \<le> i |] ==> (\<Union>x<A. b(x)) \<le> i" |
12620 | 95 |
by (simp add: OUnion_def UN_least_le ltI Ord_0_le) |
96 |
||
97 |
lemma le_implies_OUN_le_OUN: |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
98 |
"[| !!x. x<A ==> c(x) \<le> d(x) |] ==> (\<Union>x<A. c(x)) \<le> (\<Union>x<A. d(x))" |
12620 | 99 |
by (blast intro: OUN_least_le OUN_upper_le le_Ord2 Ord_OUN) |
100 |
||
101 |
lemma OUN_UN_eq: |
|
102 |
"(!!x. x:A ==> Ord(B(x))) |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
103 |
==> (\<Union>z < (\<Union>x\<in>A. B(x)). C(z)) = (\<Union>x\<in>A. \<Union>z < B(x). C(z))" |
13298 | 104 |
by (simp add: OUnion_def) |
12620 | 105 |
|
106 |
lemma OUN_Union_eq: |
|
107 |
"(!!x. x:X ==> Ord(x)) |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
108 |
==> (\<Union>z < Union(X). C(z)) = (\<Union>x\<in>X. \<Union>z < x. C(z))" |
13298 | 109 |
by (simp add: OUnion_def) |
12620 | 110 |
|
12763 | 111 |
(*So that rule_format will get rid of ALL x<A...*) |
112 |
lemma atomize_oall [symmetric, rulify]: |
|
113 |
"(!!x. x<A ==> P(x)) == Trueprop (ALL x<A. P(x))" |
|
114 |
by (simp add: oall_def atomize_all atomize_imp) |
|
115 |
||
13302 | 116 |
subsubsection {*universal quantifier for ordinals*} |
13169 | 117 |
|
118 |
lemma oallI [intro!]: |
|
119 |
"[| !!x. x<A ==> P(x) |] ==> ALL x<A. P(x)" |
|
13298 | 120 |
by (simp add: oall_def) |
13169 | 121 |
|
122 |
lemma ospec: "[| ALL x<A. P(x); x<A |] ==> P(x)" |
|
13298 | 123 |
by (simp add: oall_def) |
13169 | 124 |
|
125 |
lemma oallE: |
|
126 |
"[| ALL x<A. P(x); P(x) ==> Q; ~x<A ==> Q |] ==> Q" |
|
13298 | 127 |
by (simp add: oall_def, blast) |
13169 | 128 |
|
129 |
lemma rev_oallE [elim]: |
|
130 |
"[| ALL x<A. P(x); ~x<A ==> Q; P(x) ==> Q |] ==> Q" |
|
13298 | 131 |
by (simp add: oall_def, blast) |
13169 | 132 |
|
133 |
||
134 |
(*Trival rewrite rule; (ALL x<a.P)<->P holds only if a is not 0!*) |
|
135 |
lemma oall_simp [simp]: "(ALL x<a. True) <-> True" |
|
13170 | 136 |
by blast |
13169 | 137 |
|
138 |
(*Congruence rule for rewriting*) |
|
139 |
lemma oall_cong [cong]: |
|
13298 | 140 |
"[| a=a'; !!x. x<a' ==> P(x) <-> P'(x) |] |
13289
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
141 |
==> oall(a, %x. P(x)) <-> oall(a', %x. P'(x))" |
13169 | 142 |
by (simp add: oall_def) |
143 |
||
144 |
||
13302 | 145 |
subsubsection {*existential quantifier for ordinals*} |
13169 | 146 |
|
147 |
lemma oexI [intro]: |
|
148 |
"[| P(x); x<A |] ==> EX x<A. P(x)" |
|
13298 | 149 |
apply (simp add: oex_def, blast) |
13169 | 150 |
done |
151 |
||
152 |
(*Not of the general form for such rules; ~EX has become ALL~ *) |
|
153 |
lemma oexCI: |
|
154 |
"[| ALL x<A. ~P(x) ==> P(a); a<A |] ==> EX x<A. P(x)" |
|
13298 | 155 |
apply (simp add: oex_def, blast) |
13169 | 156 |
done |
157 |
||
158 |
lemma oexE [elim!]: |
|
159 |
"[| EX x<A. P(x); !!x. [| x<A; P(x) |] ==> Q |] ==> Q" |
|
13298 | 160 |
apply (simp add: oex_def, blast) |
13169 | 161 |
done |
162 |
||
163 |
lemma oex_cong [cong]: |
|
13298 | 164 |
"[| a=a'; !!x. x<a' ==> P(x) <-> P'(x) |] |
13289
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
165 |
==> oex(a, %x. P(x)) <-> oex(a', %x. P'(x))" |
13169 | 166 |
apply (simp add: oex_def cong add: conj_cong) |
167 |
done |
|
168 |
||
169 |
||
13302 | 170 |
subsubsection {*Rules for Ordinal-Indexed Unions*} |
13169 | 171 |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
172 |
lemma OUN_I [intro]: "[| a<i; b: B(a) |] ==> b: (\<Union>z<i. B(z))" |
13170 | 173 |
by (unfold OUnion_def lt_def, blast) |
13169 | 174 |
|
175 |
lemma OUN_E [elim!]: |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
176 |
"[| b : (\<Union>z<i. B(z)); !!a.[| b: B(a); a<i |] ==> R |] ==> R" |
13170 | 177 |
apply (unfold OUnion_def lt_def, blast) |
13169 | 178 |
done |
179 |
||
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
180 |
lemma OUN_iff: "b : (\<Union>x<i. B(x)) <-> (EX x<i. b : B(x))" |
13170 | 181 |
by (unfold OUnion_def oex_def lt_def, blast) |
13169 | 182 |
|
183 |
lemma OUN_cong [cong]: |
|
13615
449a70d88b38
Numerous cosmetic changes, prompted by the new simplifier
paulson
parents:
13462
diff
changeset
|
184 |
"[| i=j; !!x. x<j ==> C(x)=D(x) |] ==> (\<Union>x<i. C(x)) = (\<Union>x<j. D(x))" |
13169 | 185 |
by (simp add: OUnion_def lt_def OUN_iff) |
186 |
||
13298 | 187 |
lemma lt_induct: |
13169 | 188 |
"[| i<k; !!x.[| x<k; ALL y<x. P(y) |] ==> P(x) |] ==> P(i)" |
189 |
apply (simp add: lt_def oall_def) |
|
13298 | 190 |
apply (erule conjE) |
191 |
apply (erule Ord_induct, assumption, blast) |
|
13169 | 192 |
done |
193 |
||
13253 | 194 |
|
195 |
subsection {*Quantification over a class*} |
|
196 |
||
24893 | 197 |
definition |
198 |
"rall" :: "[i=>o, i=>o] => o" where |
|
13253 | 199 |
"rall(M, P) == ALL x. M(x) --> P(x)" |
200 |
||
24893 | 201 |
definition |
202 |
"rex" :: "[i=>o, i=>o] => o" where |
|
13253 | 203 |
"rex(M, P) == EX x. M(x) & P(x)" |
204 |
||
205 |
syntax |
|
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
206 |
"_rall" :: "[pttrn, i=>o, o] => o" ("(3ALL _[_]./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
207 |
"_rex" :: "[pttrn, i=>o, o] => o" ("(3EX _[_]./ _)" 10) |
13253 | 208 |
|
209 |
syntax (xsymbols) |
|
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
210 |
"_rall" :: "[pttrn, i=>o, o] => o" ("(3\<forall>_[_]./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
211 |
"_rex" :: "[pttrn, i=>o, o] => o" ("(3\<exists>_[_]./ _)" 10) |
14565 | 212 |
syntax (HTML output) |
35112
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
213 |
"_rall" :: "[pttrn, i=>o, o] => o" ("(3\<forall>_[_]./ _)" 10) |
ff6f60e6ab85
numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents:
32010
diff
changeset
|
214 |
"_rex" :: "[pttrn, i=>o, o] => o" ("(3\<exists>_[_]./ _)" 10) |
13253 | 215 |
|
216 |
translations |
|
24893 | 217 |
"ALL x[M]. P" == "CONST rall(M, %x. P)" |
218 |
"EX x[M]. P" == "CONST rex(M, %x. P)" |
|
13253 | 219 |
|
13298 | 220 |
|
221 |
subsubsection{*Relativized universal quantifier*} |
|
13253 | 222 |
|
223 |
lemma rallI [intro!]: "[| !!x. M(x) ==> P(x) |] ==> ALL x[M]. P(x)" |
|
224 |
by (simp add: rall_def) |
|
225 |
||
226 |
lemma rspec: "[| ALL x[M]. P(x); M(x) |] ==> P(x)" |
|
227 |
by (simp add: rall_def) |
|
228 |
||
229 |
(*Instantiates x first: better for automatic theorem proving?*) |
|
13298 | 230 |
lemma rev_rallE [elim]: |
13253 | 231 |
"[| ALL x[M]. P(x); ~ M(x) ==> Q; P(x) ==> Q |] ==> Q" |
13298 | 232 |
by (simp add: rall_def, blast) |
13253 | 233 |
|
234 |
lemma rallE: "[| ALL x[M]. P(x); P(x) ==> Q; ~ M(x) ==> Q |] ==> Q" |
|
235 |
by blast |
|
236 |
||
237 |
(*Trival rewrite rule; (ALL x[M].P)<->P holds only if A is nonempty!*) |
|
238 |
lemma rall_triv [simp]: "(ALL x[M]. P) <-> ((EX x. M(x)) --> P)" |
|
239 |
by (simp add: rall_def) |
|
240 |
||
241 |
(*Congruence rule for rewriting*) |
|
242 |
lemma rall_cong [cong]: |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13302
diff
changeset
|
243 |
"(!!x. M(x) ==> P(x) <-> P'(x)) ==> (ALL x[M]. P(x)) <-> (ALL x[M]. P'(x))" |
13253 | 244 |
by (simp add: rall_def) |
245 |
||
13298 | 246 |
|
247 |
subsubsection{*Relativized existential quantifier*} |
|
13253 | 248 |
|
249 |
lemma rexI [intro]: "[| P(x); M(x) |] ==> EX x[M]. P(x)" |
|
250 |
by (simp add: rex_def, blast) |
|
251 |
||
252 |
(*The best argument order when there is only one M(x)*) |
|
253 |
lemma rev_rexI: "[| M(x); P(x) |] ==> EX x[M]. P(x)" |
|
254 |
by blast |
|
255 |
||
256 |
(*Not of the general form for such rules; ~EX has become ALL~ *) |
|
257 |
lemma rexCI: "[| ALL x[M]. ~P(x) ==> P(a); M(a) |] ==> EX x[M]. P(x)" |
|
258 |
by blast |
|
259 |
||
260 |
lemma rexE [elim!]: "[| EX x[M]. P(x); !!x. [| M(x); P(x) |] ==> Q |] ==> Q" |
|
261 |
by (simp add: rex_def, blast) |
|
262 |
||
263 |
(*We do not even have (EX x[M]. True) <-> True unless A is nonempty!!*) |
|
264 |
lemma rex_triv [simp]: "(EX x[M]. P) <-> ((EX x. M(x)) & P)" |
|
265 |
by (simp add: rex_def) |
|
266 |
||
267 |
lemma rex_cong [cong]: |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
13302
diff
changeset
|
268 |
"(!!x. M(x) ==> P(x) <-> P'(x)) ==> (EX x[M]. P(x)) <-> (EX x[M]. P'(x))" |
13253 | 269 |
by (simp add: rex_def cong: conj_cong) |
270 |
||
13289
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
271 |
lemma rall_is_ball [simp]: "(\<forall>x[%z. z\<in>A]. P(x)) <-> (\<forall>x\<in>A. P(x))" |
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
272 |
by blast |
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
273 |
|
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
274 |
lemma rex_is_bex [simp]: "(\<exists>x[%z. z\<in>A]. P(x)) <-> (\<exists>x\<in>A. P(x))" |
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
275 |
by blast |
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
276 |
|
13253 | 277 |
lemma atomize_rall: "(!!x. M(x) ==> P(x)) == Trueprop (ALL x[M]. P(x))"; |
278 |
by (simp add: rall_def atomize_all atomize_imp) |
|
279 |
||
280 |
declare atomize_rall [symmetric, rulify] |
|
281 |
||
282 |
lemma rall_simps1: |
|
283 |
"(ALL x[M]. P(x) & Q) <-> (ALL x[M]. P(x)) & ((ALL x[M]. False) | Q)" |
|
284 |
"(ALL x[M]. P(x) | Q) <-> ((ALL x[M]. P(x)) | Q)" |
|
285 |
"(ALL x[M]. P(x) --> Q) <-> ((EX x[M]. P(x)) --> Q)" |
|
13298 | 286 |
"(~(ALL x[M]. P(x))) <-> (EX x[M]. ~P(x))" |
13253 | 287 |
by blast+ |
288 |
||
289 |
lemma rall_simps2: |
|
290 |
"(ALL x[M]. P & Q(x)) <-> ((ALL x[M]. False) | P) & (ALL x[M]. Q(x))" |
|
291 |
"(ALL x[M]. P | Q(x)) <-> (P | (ALL x[M]. Q(x)))" |
|
292 |
"(ALL x[M]. P --> Q(x)) <-> (P --> (ALL x[M]. Q(x)))" |
|
293 |
by blast+ |
|
294 |
||
13289
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
295 |
lemmas rall_simps [simp] = rall_simps1 rall_simps2 |
13253 | 296 |
|
297 |
lemma rall_conj_distrib: |
|
298 |
"(ALL x[M]. P(x) & Q(x)) <-> ((ALL x[M]. P(x)) & (ALL x[M]. Q(x)))" |
|
299 |
by blast |
|
300 |
||
301 |
lemma rex_simps1: |
|
302 |
"(EX x[M]. P(x) & Q) <-> ((EX x[M]. P(x)) & Q)" |
|
303 |
"(EX x[M]. P(x) | Q) <-> (EX x[M]. P(x)) | ((EX x[M]. True) & Q)" |
|
304 |
"(EX x[M]. P(x) --> Q) <-> ((ALL x[M]. P(x)) --> ((EX x[M]. True) & Q))" |
|
305 |
"(~(EX x[M]. P(x))) <-> (ALL x[M]. ~P(x))" |
|
306 |
by blast+ |
|
307 |
||
308 |
lemma rex_simps2: |
|
309 |
"(EX x[M]. P & Q(x)) <-> (P & (EX x[M]. Q(x)))" |
|
310 |
"(EX x[M]. P | Q(x)) <-> ((EX x[M]. True) & P) | (EX x[M]. Q(x))" |
|
311 |
"(EX x[M]. P --> Q(x)) <-> (((ALL x[M]. False) | P) --> (EX x[M]. Q(x)))" |
|
312 |
by blast+ |
|
313 |
||
13289
53e201efdaa2
miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents:
13253
diff
changeset
|
314 |
lemmas rex_simps [simp] = rex_simps1 rex_simps2 |
13253 | 315 |
|
316 |
lemma rex_disj_distrib: |
|
317 |
"(EX x[M]. P(x) | Q(x)) <-> ((EX x[M]. P(x)) | (EX x[M]. Q(x)))" |
|
318 |
by blast |
|
319 |
||
320 |
||
13298 | 321 |
subsubsection{*One-point rule for bounded quantifiers*} |
13253 | 322 |
|
323 |
lemma rex_triv_one_point1 [simp]: "(EX x[M]. x=a) <-> ( M(a))" |
|
324 |
by blast |
|
325 |
||
326 |
lemma rex_triv_one_point2 [simp]: "(EX x[M]. a=x) <-> ( M(a))" |
|
327 |
by blast |
|
328 |
||
329 |
lemma rex_one_point1 [simp]: "(EX x[M]. x=a & P(x)) <-> ( M(a) & P(a))" |
|
330 |
by blast |
|
331 |
||
332 |
lemma rex_one_point2 [simp]: "(EX x[M]. a=x & P(x)) <-> ( M(a) & P(a))" |
|
333 |
by blast |
|
334 |
||
335 |
lemma rall_one_point1 [simp]: "(ALL x[M]. x=a --> P(x)) <-> ( M(a) --> P(a))" |
|
336 |
by blast |
|
337 |
||
338 |
lemma rall_one_point2 [simp]: "(ALL x[M]. a=x --> P(x)) <-> ( M(a) --> P(a))" |
|
339 |
by blast |
|
340 |
||
341 |
||
13298 | 342 |
subsubsection{*Sets as Classes*} |
343 |
||
24893 | 344 |
definition |
345 |
setclass :: "[i,i] => o" ("##_" [40] 40) where |
|
13362 | 346 |
"setclass(A) == %x. x : A" |
13298 | 347 |
|
13362 | 348 |
lemma setclass_iff [simp]: "setclass(A,x) <-> x : A" |
349 |
by (simp add: setclass_def) |
|
13298 | 350 |
|
13807
a28a8fbc76d4
changed ** to ## to avoid conflict with new comment syntax
paulson
parents:
13615
diff
changeset
|
351 |
lemma rall_setclass_is_ball [simp]: "(\<forall>x[##A]. P(x)) <-> (\<forall>x\<in>A. P(x))" |
13298 | 352 |
by auto |
353 |
||
13807
a28a8fbc76d4
changed ** to ## to avoid conflict with new comment syntax
paulson
parents:
13615
diff
changeset
|
354 |
lemma rex_setclass_is_bex [simp]: "(\<exists>x[##A]. P(x)) <-> (\<exists>x\<in>A. P(x))" |
13298 | 355 |
by auto |
356 |
||
357 |
||
13169 | 358 |
ML |
359 |
{* |
|
360 |
val Ord_atomize = |
|
24893 | 361 |
atomize ([("OrdQuant.oall", [@{thm ospec}]),("OrdQuant.rall", [@{thm rspec}])]@ |
13298 | 362 |
ZF_conn_pairs, |
13253 | 363 |
ZF_mem_pairs); |
26339 | 364 |
*} |
365 |
declaration {* fn _ => |
|
36543
0e7fc5bf38de
proper context for mksimps etc. -- via simpset of the running Simplifier;
wenzelm
parents:
35112
diff
changeset
|
366 |
Simplifier.map_ss (fn ss => ss setmksimps (K (map mk_eq o Ord_atomize o gen_all))) |
13169 | 367 |
*} |
368 |
||
13462 | 369 |
text {* Setting up the one-point-rule simproc *} |
13253 | 370 |
|
26480 | 371 |
ML {* |
13462 | 372 |
local |
13253 | 373 |
|
24893 | 374 |
val unfold_rex_tac = unfold_tac [@{thm rex_def}]; |
18324 | 375 |
fun prove_rex_tac ss = unfold_rex_tac ss THEN Quantifier1.prove_one_point_ex_tac; |
13253 | 376 |
val rearrange_bex = Quantifier1.rearrange_bex prove_rex_tac; |
377 |
||
24893 | 378 |
val unfold_rall_tac = unfold_tac [@{thm rall_def}]; |
18324 | 379 |
fun prove_rall_tac ss = unfold_rall_tac ss THEN Quantifier1.prove_one_point_all_tac; |
13253 | 380 |
val rearrange_ball = Quantifier1.rearrange_ball prove_rall_tac; |
381 |
||
382 |
in |
|
383 |
||
32010 | 384 |
val defREX_regroup = Simplifier.simproc @{theory} |
13462 | 385 |
"defined REX" ["EX x[M]. P(x) & Q(x)"] rearrange_bex; |
32010 | 386 |
val defRALL_regroup = Simplifier.simproc @{theory} |
13462 | 387 |
"defined RALL" ["ALL x[M]. P(x) --> Q(x)"] rearrange_ball; |
13253 | 388 |
|
389 |
end; |
|
13462 | 390 |
|
391 |
Addsimprocs [defRALL_regroup,defREX_regroup]; |
|
13253 | 392 |
*} |
393 |
||
2469 | 394 |
end |