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