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