src/ZF/OrdQuant.thy
author wenzelm
Sun, 21 May 2017 23:41:46 +0200
changeset 65895 744878d72021
parent 61396 ce1b2234cab6
child 69587 53982d5ec0bb
permissions -rw-r--r--
more general workaround for failed sessions (again, see also 2edb89630a80, ed7b5cd3a7f2);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41777
1f7cbe39d425 more precise headers;
wenzelm
parents: 38715
diff changeset
     1
(*  Title:      ZF/OrdQuant.thy
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     2
    Authors:    Krzysztof Grabczewski and L C Paulson
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     3
*)
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     4
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
     5
section \<open>Special quantifiers\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
     6
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 14565
diff changeset
     7
theory OrdQuant imports Ordinal begin
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
     8
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
     9
subsection \<open>Quantifiers and union operator for ordinals\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
    10
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
    11
definition
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    12
  (* Ordinal Quantifiers *)
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
    13
  oall :: "[i, i => o] => o"  where
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    14
    "oall(A, P) == \<forall>x. x<A \<longrightarrow> P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    15
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
    16
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
    17
  oex :: "[i, i => o] => o"  where
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    18
    "oex(A, P)  == \<exists>x. x<A & P(x)"
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    19
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
    20
definition
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    21
  (* Ordinal Union *)
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
    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
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    24
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    25
syntax
35112
ff6f60e6ab85 numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents: 32010
diff changeset
    26
  "_oall"     :: "[idt, i, o] => o"        ("(3\<forall>_<_./ _)" 10)
ff6f60e6ab85 numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents: 32010
diff changeset
    27
  "_oex"      :: "[idt, i, o] => o"        ("(3\<exists>_<_./ _)" 10)
ff6f60e6ab85 numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents: 32010
diff changeset
    28
  "_OUNION"   :: "[idt, i, i] => i"        ("(3\<Union>_<_./ _)" 10)
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    29
translations
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    30
  "\<forall>x<a. P" \<rightleftharpoons> "CONST oall(a, \<lambda>x. P)"
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    31
  "\<exists>x<a. P" \<rightleftharpoons> "CONST oex(a, \<lambda>x. P)"
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    32
  "\<Union>x<a. B" \<rightleftharpoons> "CONST OUnion(a, \<lambda>x. B)"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    33
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    34
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
    35
subsubsection \<open>simplification of the new quantifiers\<close>
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    36
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    37
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
    38
(*MOST IMPORTANT that this is added to the simpset BEFORE Ord_atomize
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    39
  is proved.  Ord_atomize would convert this rule to
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    40
    x < 0 ==> P(x) == True, which causes dire effects!*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    41
lemma [simp]: "(\<forall>x<0. P(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    42
by (simp add: oall_def)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    43
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    44
lemma [simp]: "~(\<exists>x<0. P(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    45
by (simp add: oex_def)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    46
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    47
lemma [simp]: "(\<forall>x<succ(i). P(x)) <-> (Ord(i) \<longrightarrow> P(i) & (\<forall>x<i. P(x)))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    48
apply (simp add: oall_def le_iff)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    49
apply (blast intro: lt_Ord2)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    50
done
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    51
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    52
lemma [simp]: "(\<exists>x<succ(i). P(x)) <-> (Ord(i) & (P(i) | (\<exists>x<i. P(x))))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    53
apply (simp add: oex_def le_iff)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    54
apply (blast intro: lt_Ord2)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    55
done
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    56
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
    57
subsubsection \<open>Union over ordinals\<close>
13118
336b0bcbd27c new lemmas
paulson
parents: 12825
diff changeset
    58
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    59
lemma Ord_OUN [intro,simp]:
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13149
diff changeset
    60
     "[| !!x. x<A ==> Ord(B(x)) |] ==> Ord(\<Union>x<A. B(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    61
by (simp add: OUnion_def ltI Ord_UN)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    62
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    63
lemma OUN_upper_lt:
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13149
diff changeset
    64
     "[| a<A;  i < b(a);  Ord(\<Union>x<A. b(x)) |] ==> i < (\<Union>x<A. b(x))"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    65
by (unfold OUnion_def lt_def, blast )
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    66
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    67
lemma OUN_upper_le:
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13149
diff changeset
    68
     "[| a<A;  i\<le>b(a);  Ord(\<Union>x<A. b(x)) |] ==> i \<le> (\<Union>x<A. b(x))"
12820
02e2ff3e4d37 lexical tidying
paulson
parents: 12763
diff changeset
    69
apply (unfold OUnion_def, auto)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    70
apply (rule UN_upper_le )
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    71
apply (auto simp add: lt_def)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    72
done
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    73
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13462
diff changeset
    74
lemma Limit_OUN_eq: "Limit(i) ==> (\<Union>x<i. x) = i"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    75
by (simp add: OUnion_def Limit_Union_eq Limit_is_Ord)
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    76
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    77
(* No < version of this theorem: consider that @{term"(\<Union>i\<in>nat.i)=nat"}! *)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    78
lemma OUN_least:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13462
diff changeset
    79
     "(!!x. x<A ==> B(x) \<subseteq> C) ==> (\<Union>x<A. B(x)) \<subseteq> C"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    80
by (simp add: OUnion_def UN_least ltI)
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    81
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    82
lemma OUN_least_le:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13462
diff changeset
    83
     "[| Ord(i);  !!x. x<A ==> b(x) \<le> i |] ==> (\<Union>x<A. b(x)) \<le> i"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    84
by (simp add: OUnion_def UN_least_le ltI Ord_0_le)
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    85
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    86
lemma le_implies_OUN_le_OUN:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13462
diff changeset
    87
     "[| !!x. x<A ==> c(x) \<le> d(x) |] ==> (\<Union>x<A. c(x)) \<le> (\<Union>x<A. d(x))"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    88
by (blast intro: OUN_least_le OUN_upper_le le_Ord2 Ord_OUN)
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    89
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    90
lemma OUN_UN_eq:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46820
diff changeset
    91
     "(!!x. x \<in> A ==> Ord(B(x)))
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13462
diff changeset
    92
      ==> (\<Union>z < (\<Union>x\<in>A. B(x)). C(z)) = (\<Union>x\<in>A. \<Union>z < B(x). C(z))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    93
by (simp add: OUnion_def)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    94
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    95
lemma OUN_Union_eq:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46820
diff changeset
    96
     "(!!x. x \<in> X ==> Ord(x))
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    97
      ==> (\<Union>z < \<Union>(X). C(z)) = (\<Union>x\<in>X. \<Union>z < x. C(z))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    98
by (simp add: OUnion_def)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    99
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   100
(*So that rule_format will get rid of this quantifier...*)
12763
6cecd9dfd53f now [rule_format] knows about ospec
paulson
parents: 12667
diff changeset
   101
lemma atomize_oall [symmetric, rulify]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   102
     "(!!x. x<A ==> P(x)) == Trueprop (\<forall>x<A. P(x))"
12763
6cecd9dfd53f now [rule_format] knows about ospec
paulson
parents: 12667
diff changeset
   103
by (simp add: oall_def atomize_all atomize_imp)
6cecd9dfd53f now [rule_format] knows about ospec
paulson
parents: 12667
diff changeset
   104
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   105
subsubsection \<open>universal quantifier for ordinals\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   106
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   107
lemma oallI [intro!]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   108
    "[| !!x. x<A ==> P(x) |] ==> \<forall>x<A. P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   109
by (simp add: oall_def)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   110
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   111
lemma ospec: "[| \<forall>x<A. P(x);  x<A |] ==> P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   112
by (simp add: oall_def)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   113
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   114
lemma oallE:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   115
    "[| \<forall>x<A. P(x);  P(x) ==> Q;  ~x<A ==> Q |] ==> Q"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   116
by (simp add: oall_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   117
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   118
lemma rev_oallE [elim]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   119
    "[| \<forall>x<A. P(x);  ~x<A ==> Q;  P(x) ==> Q |] ==> Q"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   120
by (simp add: oall_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   121
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   122
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   123
(*Trival rewrite rule.  @{term"(\<forall>x<a.P)<->P"} holds only if a is not 0!*)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   124
lemma oall_simp [simp]: "(\<forall>x<a. True) <-> True"
13170
paulson
parents: 13169
diff changeset
   125
by blast
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   126
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   127
(*Congruence rule for rewriting*)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   128
lemma oall_cong [cong]:
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   129
    "[| a=a';  !!x. x<a' ==> P(x) <-> P'(x) |]
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   130
     ==> oall(a, %x. P(x)) <-> oall(a', %x. P'(x))"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   131
by (simp add: oall_def)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   132
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   133
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   134
subsubsection \<open>existential quantifier for ordinals\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   135
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   136
lemma oexI [intro]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   137
    "[| P(x);  x<A |] ==> \<exists>x<A. P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   138
apply (simp add: oex_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   139
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   140
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   141
(*Not of the general form for such rules... *)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   142
lemma oexCI:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   143
   "[| \<forall>x<A. ~P(x) ==> P(a);  a<A |] ==> \<exists>x<A. P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   144
apply (simp add: oex_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   145
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   146
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   147
lemma oexE [elim!]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   148
    "[| \<exists>x<A. P(x);  !!x. [| x<A; P(x) |] ==> Q |] ==> Q"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   149
apply (simp add: oex_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   150
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   151
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   152
lemma oex_cong [cong]:
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   153
    "[| a=a';  !!x. x<a' ==> P(x) <-> P'(x) |]
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   154
     ==> oex(a, %x. P(x)) <-> oex(a', %x. P'(x))"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   155
apply (simp add: oex_def cong add: conj_cong)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   156
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   157
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   158
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   159
subsubsection \<open>Rules for Ordinal-Indexed Unions\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   160
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46820
diff changeset
   161
lemma OUN_I [intro]: "[| a<i;  b \<in> B(a) |] ==> b: (\<Union>z<i. B(z))"
13170
paulson
parents: 13169
diff changeset
   162
by (unfold OUnion_def lt_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   163
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   164
lemma OUN_E [elim!]:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46820
diff changeset
   165
    "[| b \<in> (\<Union>z<i. B(z));  !!a.[| b \<in> B(a);  a<i |] ==> R |] ==> R"
13170
paulson
parents: 13169
diff changeset
   166
apply (unfold OUnion_def lt_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   167
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   168
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   169
lemma OUN_iff: "b \<in> (\<Union>x<i. B(x)) <-> (\<exists>x<i. b \<in> B(x))"
13170
paulson
parents: 13169
diff changeset
   170
by (unfold OUnion_def oex_def lt_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   171
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   172
lemma OUN_cong [cong]:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13462
diff changeset
   173
    "[| i=j;  !!x. x<j ==> C(x)=D(x) |] ==> (\<Union>x<i. C(x)) = (\<Union>x<j. D(x))"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   174
by (simp add: OUnion_def lt_def OUN_iff)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   175
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   176
lemma lt_induct:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   177
    "[| i<k;  !!x.[| x<k;  \<forall>y<x. P(y) |] ==> P(x) |]  ==>  P(i)"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   178
apply (simp add: lt_def oall_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   179
apply (erule conjE)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   180
apply (erule Ord_induct, assumption, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   181
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   182
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   183
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   184
subsection \<open>Quantification over a class\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   185
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   186
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   187
  "rall"     :: "[i=>o, i=>o] => o"  where
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   188
    "rall(M, P) == \<forall>x. M(x) \<longrightarrow> P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   189
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   190
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   191
  "rex"      :: "[i=>o, i=>o] => o"  where
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   192
    "rex(M, P) == \<exists>x. M(x) & P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   193
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   194
syntax
35112
ff6f60e6ab85 numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents: 32010
diff changeset
   195
  "_rall"     :: "[pttrn, i=>o, o] => o"        ("(3\<forall>_[_]./ _)" 10)
ff6f60e6ab85 numeral syntax: clarify parse trees vs. actual terms;
wenzelm
parents: 32010
diff changeset
   196
  "_rex"      :: "[pttrn, i=>o, o] => o"        ("(3\<exists>_[_]./ _)" 10)
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   197
translations
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   198
  "\<forall>x[M]. P" \<rightleftharpoons> "CONST rall(M, \<lambda>x. P)"
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   199
  "\<exists>x[M]. P" \<rightleftharpoons> "CONST rex(M, \<lambda>x. P)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   200
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   201
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   202
subsubsection\<open>Relativized universal quantifier\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   203
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   204
lemma rallI [intro!]: "[| !!x. M(x) ==> P(x) |] ==> \<forall>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   205
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   206
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   207
lemma rspec: "[| \<forall>x[M]. P(x); M(x) |] ==> P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   208
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   209
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   210
(*Instantiates x first: better for automatic theorem proving?*)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   211
lemma rev_rallE [elim]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   212
    "[| \<forall>x[M]. P(x);  ~ M(x) ==> Q;  P(x) ==> Q |] ==> Q"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   213
by (simp add: rall_def, blast)
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   214
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   215
lemma rallE: "[| \<forall>x[M]. P(x);  P(x) ==> Q;  ~ M(x) ==> Q |] ==> Q"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   216
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   217
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   218
(*Trival rewrite rule;   (\<forall>x[M].P)<->P holds only if A is nonempty!*)
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   219
lemma rall_triv [simp]: "(\<forall>x[M]. P) \<longleftrightarrow> ((\<exists>x. M(x)) \<longrightarrow> P)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   220
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   221
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   222
(*Congruence rule for rewriting*)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   223
lemma rall_cong [cong]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   224
    "(!!x. M(x) ==> P(x) <-> P'(x)) ==> (\<forall>x[M]. P(x)) <-> (\<forall>x[M]. P'(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   225
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   226
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   227
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   228
subsubsection\<open>Relativized existential quantifier\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   229
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   230
lemma rexI [intro]: "[| P(x); M(x) |] ==> \<exists>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   231
by (simp add: rex_def, blast)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   232
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   233
(*The best argument order when there is only one M(x)*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   234
lemma rev_rexI: "[| M(x);  P(x) |] ==> \<exists>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   235
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   236
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   237
(*Not of the general form for such rules... *)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   238
lemma rexCI: "[| \<forall>x[M]. ~P(x) ==> P(a); M(a) |] ==> \<exists>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   239
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   240
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   241
lemma rexE [elim!]: "[| \<exists>x[M]. P(x);  !!x. [| M(x); P(x) |] ==> Q |] ==> Q"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   242
by (simp add: rex_def, blast)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   243
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   244
(*We do not even have (\<exists>x[M]. True) <-> True unless A is nonempty!!*)
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   245
lemma rex_triv [simp]: "(\<exists>x[M]. P) \<longleftrightarrow> ((\<exists>x. M(x)) \<and> P)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   246
by (simp add: rex_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   247
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   248
lemma rex_cong [cong]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   249
    "(!!x. M(x) ==> P(x) <-> P'(x)) ==> (\<exists>x[M]. P(x)) <-> (\<exists>x[M]. P'(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   250
by (simp add: rex_def cong: conj_cong)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   251
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   252
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
   253
by blast
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   254
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   255
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
   256
by blast
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   257
58860
fee7cfa69c50 eliminated spurious semicolons;
wenzelm
parents: 56250
diff changeset
   258
lemma atomize_rall: "(!!x. M(x) ==> P(x)) == Trueprop (\<forall>x[M]. P(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   259
by (simp add: rall_def atomize_all atomize_imp)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   260
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   261
declare atomize_rall [symmetric, rulify]
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   262
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   263
lemma rall_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   264
     "(\<forall>x[M]. P(x) & Q)   <-> (\<forall>x[M]. P(x)) & ((\<forall>x[M]. False) | Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   265
     "(\<forall>x[M]. P(x) | Q)   <-> ((\<forall>x[M]. P(x)) | Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   266
     "(\<forall>x[M]. P(x) \<longrightarrow> Q) <-> ((\<exists>x[M]. P(x)) \<longrightarrow> Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   267
     "(~(\<forall>x[M]. P(x))) <-> (\<exists>x[M]. ~P(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   268
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   269
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   270
lemma rall_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   271
     "(\<forall>x[M]. P & Q(x))   <-> ((\<forall>x[M]. False) | P) & (\<forall>x[M]. Q(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   272
     "(\<forall>x[M]. P | Q(x))   <-> (P | (\<forall>x[M]. Q(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   273
     "(\<forall>x[M]. P \<longrightarrow> Q(x)) <-> (P \<longrightarrow> (\<forall>x[M]. Q(x)))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   274
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   275
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   276
lemmas rall_simps [simp] = rall_simps1 rall_simps2
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   277
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   278
lemma rall_conj_distrib:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   279
    "(\<forall>x[M]. P(x) & Q(x)) <-> ((\<forall>x[M]. P(x)) & (\<forall>x[M]. Q(x)))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   280
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   281
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   282
lemma rex_simps1:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   283
     "(\<exists>x[M]. P(x) & Q) <-> ((\<exists>x[M]. P(x)) & Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   284
     "(\<exists>x[M]. P(x) | Q) <-> (\<exists>x[M]. P(x)) | ((\<exists>x[M]. True) & Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   285
     "(\<exists>x[M]. P(x) \<longrightarrow> Q) <-> ((\<forall>x[M]. P(x)) \<longrightarrow> ((\<exists>x[M]. True) & Q))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   286
     "(~(\<exists>x[M]. P(x))) <-> (\<forall>x[M]. ~P(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   287
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   288
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   289
lemma rex_simps2:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   290
     "(\<exists>x[M]. P & Q(x)) <-> (P & (\<exists>x[M]. Q(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   291
     "(\<exists>x[M]. P | Q(x)) <-> ((\<exists>x[M]. True) & P) | (\<exists>x[M]. Q(x))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   292
     "(\<exists>x[M]. P \<longrightarrow> Q(x)) <-> (((\<forall>x[M]. False) | P) \<longrightarrow> (\<exists>x[M]. Q(x)))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   293
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   294
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   295
lemmas rex_simps [simp] = rex_simps1 rex_simps2
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   296
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   297
lemma rex_disj_distrib:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   298
    "(\<exists>x[M]. P(x) | Q(x)) <-> ((\<exists>x[M]. P(x)) | (\<exists>x[M]. Q(x)))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   299
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   300
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   301
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   302
subsubsection\<open>One-point rule for bounded quantifiers\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   303
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   304
lemma rex_triv_one_point1 [simp]: "(\<exists>x[M]. x=a) <-> ( M(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   305
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   306
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   307
lemma rex_triv_one_point2 [simp]: "(\<exists>x[M]. a=x) <-> ( M(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   308
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   309
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   310
lemma rex_one_point1 [simp]: "(\<exists>x[M]. x=a & P(x)) <-> ( M(a) & P(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   311
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   312
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   313
lemma rex_one_point2 [simp]: "(\<exists>x[M]. a=x & P(x)) <-> ( M(a) & P(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   314
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   315
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   316
lemma rall_one_point1 [simp]: "(\<forall>x[M]. x=a \<longrightarrow> P(x)) <-> ( M(a) \<longrightarrow> P(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   317
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   318
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   319
lemma rall_one_point2 [simp]: "(\<forall>x[M]. a=x \<longrightarrow> P(x)) <-> ( M(a) \<longrightarrow> P(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   320
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   321
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   322
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   323
subsubsection\<open>Sets as Classes\<close>
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   324
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   325
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   326
  setclass :: "[i,i] => o"       ("##_" [40] 40)  where
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   327
   "setclass(A) == %x. x \<in> A"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   328
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   329
lemma setclass_iff [simp]: "setclass(A,x) <-> x \<in> A"
13362
cd7f9ea58338 tweaked definition of setclass
paulson
parents: 13339
diff changeset
   330
by (simp add: setclass_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   331
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13615
diff changeset
   332
lemma rall_setclass_is_ball [simp]: "(\<forall>x[##A]. P(x)) <-> (\<forall>x\<in>A. P(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   333
by auto
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   334
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13615
diff changeset
   335
lemma rex_setclass_is_bex [simp]: "(\<exists>x[##A]. P(x)) <-> (\<exists>x\<in>A. P(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   336
by auto
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   337
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   338
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   339
ML
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   340
\<open>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   341
val Ord_atomize =
56250
2c9f841f36b8 more antiquotations;
wenzelm
parents: 54998
diff changeset
   342
  atomize ([(@{const_name oall}, @{thms ospec}), (@{const_name rall}, @{thms rspec})] @
2c9f841f36b8 more antiquotations;
wenzelm
parents: 54998
diff changeset
   343
    ZF_conn_pairs, ZF_mem_pairs);
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   344
\<close>
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   345
declaration \<open>fn _ =>
59647
c6f413b660cf clarified Drule.gen_all: observe context more carefully;
wenzelm
parents: 59498
diff changeset
   346
  Simplifier.map_ss (Simplifier.set_mksimps (fn ctxt =>
60822
4f58f3662e7d more explicit context;
wenzelm
parents: 60770
diff changeset
   347
    map mk_eq o Ord_atomize o Variable.gen_all ctxt))
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   348
\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   349
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   350
text \<open>Setting up the one-point-rule simproc\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   351
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   352
simproc_setup defined_rex ("\<exists>x[M]. P(x) & Q(x)") = \<open>
54998
8601434fa334 tuned signature;
wenzelm
parents: 51717
diff changeset
   353
  fn _ => Quantifier1.rearrange_bex
8601434fa334 tuned signature;
wenzelm
parents: 51717
diff changeset
   354
    (fn ctxt =>
8601434fa334 tuned signature;
wenzelm
parents: 51717
diff changeset
   355
      unfold_tac ctxt @{thms rex_def} THEN
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58871
diff changeset
   356
      Quantifier1.prove_one_point_ex_tac ctxt)
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   357
\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   358
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   359
simproc_setup defined_rall ("\<forall>x[M]. P(x) \<longrightarrow> Q(x)") = \<open>
54998
8601434fa334 tuned signature;
wenzelm
parents: 51717
diff changeset
   360
  fn _ => Quantifier1.rearrange_ball
8601434fa334 tuned signature;
wenzelm
parents: 51717
diff changeset
   361
    (fn ctxt =>
8601434fa334 tuned signature;
wenzelm
parents: 51717
diff changeset
   362
      unfold_tac ctxt @{thms rall_def} THEN
59498
50b60f501b05 proper context for resolve_tac, eresolve_tac, dresolve_tac, forward_tac etc.;
wenzelm
parents: 58871
diff changeset
   363
      Quantifier1.prove_one_point_all_tac ctxt)
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   364
\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   365
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
   366
end