src/ZF/OrdQuant.thy
author wenzelm
Fri, 01 Nov 2024 18:55:47 +0100
changeset 81305 e85b5f7f9b16
parent 81125 ec121999a9cb
permissions -rw-r--r--
support incremental isabelle.select-structure --- like select-block, but based on selection instead of caret;
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 *)
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
    13
  oall :: "[i, i \<Rightarrow> o] \<Rightarrow> o"  where
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    14
    "oall(A, P) \<equiv> \<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
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
    17
  oex :: "[i, i \<Rightarrow> o] \<Rightarrow> o"  where
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
    18
    "oex(A, P)  \<equiv> \<exists>x. x<A \<and> 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 *)
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
    22
  OUnion :: "[i, i \<Rightarrow> i] \<Rightarrow> i"  where
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    23
    "OUnion(i,B) \<equiv> {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
80917
2a77bc3b4eac more inner syntax markup: minor object-logics;
wenzelm
parents: 80761
diff changeset
    26
  "_oall"     :: "[idt, i, o] \<Rightarrow> o"  (\<open>(\<open>indent=3 notation=\<open>binder \<forall><\<close>\<close>\<forall>_<_./ _)\<close> 10)
2a77bc3b4eac more inner syntax markup: minor object-logics;
wenzelm
parents: 80761
diff changeset
    27
  "_oex"      :: "[idt, i, o] \<Rightarrow> o"  (\<open>(\<open>indent=3 notation=\<open>binder \<exists><\<close>\<close>\<exists>_<_./ _)\<close> 10)
2a77bc3b4eac more inner syntax markup: minor object-logics;
wenzelm
parents: 80761
diff changeset
    28
  "_OUNION"   :: "[idt, i, i] \<Rightarrow> i"  (\<open>(\<open>indent=3 notation=\<open>binder \<Union><\<close>\<close>\<Union>_<_./ _)\<close> 10)
80761
bc936d3d8b45 tuned, following be8c0e039a5e;
wenzelm
parents: 80754
diff changeset
    29
syntax_consts
bc936d3d8b45 tuned, following be8c0e039a5e;
wenzelm
parents: 80754
diff changeset
    30
  "_oall" \<rightleftharpoons> oall and
bc936d3d8b45 tuned, following be8c0e039a5e;
wenzelm
parents: 80754
diff changeset
    31
  "_oex" \<rightleftharpoons> oex and
bc936d3d8b45 tuned, following be8c0e039a5e;
wenzelm
parents: 80754
diff changeset
    32
  "_OUNION" \<rightleftharpoons> OUnion
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    33
translations
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    34
  "\<forall>x<a. P" \<rightleftharpoons> "CONST oall(a, \<lambda>x. P)"
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    35
  "\<exists>x<a. P" \<rightleftharpoons> "CONST oex(a, \<lambda>x. P)"
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
    36
  "\<Union>x<a. B" \<rightleftharpoons> "CONST OUnion(a, \<lambda>x. B)"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    37
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    38
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
    39
subsubsection \<open>simplification of the new quantifiers\<close>
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    40
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    41
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
    42
(*MOST IMPORTANT that this is added to the simpset BEFORE Ord_atomize
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    43
  is proved.  Ord_atomize would convert this rule to
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    44
    x < 0 \<Longrightarrow> P(x) \<equiv> True, which causes dire effects!*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    45
lemma [simp]: "(\<forall>x<0. P(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    46
by (simp add: oall_def)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    47
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    48
lemma [simp]: "\<not>(\<exists>x<0. P(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    49
by (simp add: oex_def)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    50
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
    51
lemma [simp]: "(\<forall>x<succ(i). P(x)) <-> (Ord(i) \<longrightarrow> P(i) \<and> (\<forall>x<i. P(x)))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    52
apply (simp add: oall_def le_iff)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    53
apply (blast intro: lt_Ord2)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    54
done
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    55
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
    56
lemma [simp]: "(\<exists>x<succ(i). P(x)) <-> (Ord(i) \<and> (P(i) | (\<exists>x<i. P(x))))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    57
apply (simp add: oex_def le_iff)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    58
apply (blast intro: lt_Ord2)
12825
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    59
done
f1f7964ed05c new simprules and classical rules
paulson
parents: 12820
diff changeset
    60
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
    61
subsubsection \<open>Union over ordinals\<close>
13118
336b0bcbd27c new lemmas
paulson
parents: 12825
diff changeset
    62
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    63
lemma Ord_OUN [intro,simp]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    64
     "\<lbrakk>\<And>x. x<A \<Longrightarrow> Ord(B(x))\<rbrakk> \<Longrightarrow> Ord(\<Union>x<A. B(x))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    65
by (simp add: OUnion_def ltI Ord_UN)
12620
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_lt:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    68
     "\<lbrakk>a<A;  i < b(a);  Ord(\<Union>x<A. b(x))\<rbrakk> \<Longrightarrow> i < (\<Union>x<A. b(x))"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    69
by (unfold OUnion_def lt_def, blast )
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    70
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    71
lemma OUN_upper_le:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    72
     "\<lbrakk>a<A;  i\<le>b(a);  Ord(\<Union>x<A. b(x))\<rbrakk> \<Longrightarrow> i \<le> (\<Union>x<A. b(x))"
12820
02e2ff3e4d37 lexical tidying
paulson
parents: 12763
diff changeset
    73
apply (unfold OUnion_def, auto)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    74
apply (rule UN_upper_le )
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
    75
apply (auto simp add: lt_def)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    76
done
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
    77
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    78
lemma Limit_OUN_eq: "Limit(i) \<Longrightarrow> (\<Union>x<i. x) = i"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    79
by (simp add: OUnion_def Limit_Union_eq Limit_is_Ord)
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    80
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
    81
(* 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
    82
lemma OUN_least:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    83
     "(\<And>x. x<A \<Longrightarrow> B(x) \<subseteq> C) \<Longrightarrow> (\<Union>x<A. B(x)) \<subseteq> C"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    84
by (simp add: OUnion_def UN_least ltI)
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 OUN_least_le:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    87
     "\<lbrakk>Ord(i);  \<And>x. x<A \<Longrightarrow> b(x) \<le> i\<rbrakk> \<Longrightarrow> (\<Union>x<A. b(x)) \<le> i"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    88
by (simp add: OUnion_def UN_least_le ltI Ord_0_le)
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 le_implies_OUN_le_OUN:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    91
     "\<lbrakk>\<And>x. x<A \<Longrightarrow> c(x) \<le> d(x)\<rbrakk> \<Longrightarrow> (\<Union>x<A. c(x)) \<le> (\<Union>x<A. d(x))"
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    92
by (blast intro: OUN_least_le OUN_upper_le le_Ord2 Ord_OUN)
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    93
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    94
lemma OUN_UN_eq:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    95
     "(\<And>x. x \<in> A \<Longrightarrow> Ord(B(x)))
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
    96
      \<Longrightarrow> (\<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
    97
by (simp add: OUnion_def)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    98
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    99
lemma OUN_Union_eq:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   100
     "(\<And>x. x \<in> X \<Longrightarrow> Ord(x))
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   101
      \<Longrightarrow> (\<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
   102
by (simp add: OUnion_def)
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
   103
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   104
(*So that rule_format will get rid of this quantifier...*)
12763
6cecd9dfd53f now [rule_format] knows about ospec
paulson
parents: 12667
diff changeset
   105
lemma atomize_oall [symmetric, rulify]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   106
     "(\<And>x. x<A \<Longrightarrow> P(x)) \<equiv> Trueprop (\<forall>x<A. P(x))"
12763
6cecd9dfd53f now [rule_format] knows about ospec
paulson
parents: 12667
diff changeset
   107
by (simp add: oall_def atomize_all atomize_imp)
6cecd9dfd53f now [rule_format] knows about ospec
paulson
parents: 12667
diff changeset
   108
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   109
subsubsection \<open>universal quantifier for ordinals\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   110
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   111
lemma oallI [intro!]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   112
    "\<lbrakk>\<And>x. x<A \<Longrightarrow> P(x)\<rbrakk> \<Longrightarrow> \<forall>x<A. P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   113
by (simp add: oall_def)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   114
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   115
lemma ospec: "\<lbrakk>\<forall>x<A. P(x);  x<A\<rbrakk> \<Longrightarrow> P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   116
by (simp add: oall_def)
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 oallE:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   119
    "\<lbrakk>\<forall>x<A. P(x);  P(x) \<Longrightarrow> Q;  \<not>x<A \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> 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
lemma rev_oallE [elim]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   123
    "\<lbrakk>\<forall>x<A. P(x);  \<not>x<A \<Longrightarrow> Q;  P(x) \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   124
by (simp add: oall_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   125
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   126
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   127
(*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
   128
lemma oall_simp [simp]: "(\<forall>x<a. True) <-> True"
13170
paulson
parents: 13169
diff changeset
   129
by blast
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   130
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   131
(*Congruence rule for rewriting*)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   132
lemma oall_cong [cong]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   133
    "\<lbrakk>a=a';  \<And>x. x<a' \<Longrightarrow> P(x) <-> P'(x)\<rbrakk>
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
   134
     \<Longrightarrow> oall(a, \<lambda>x. P(x)) <-> oall(a', \<lambda>x. P'(x))"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   135
by (simp add: oall_def)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   136
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   137
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   138
subsubsection \<open>existential quantifier for ordinals\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   139
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   140
lemma oexI [intro]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   141
    "\<lbrakk>P(x);  x<A\<rbrakk> \<Longrightarrow> \<exists>x<A. P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   142
apply (simp add: oex_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   143
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   144
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   145
(*Not of the general form for such rules... *)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   146
lemma oexCI:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   147
   "\<lbrakk>\<forall>x<A. \<not>P(x) \<Longrightarrow> P(a);  a<A\<rbrakk> \<Longrightarrow> \<exists>x<A. P(x)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   148
apply (simp add: oex_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   149
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   150
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   151
lemma oexE [elim!]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   152
    "\<lbrakk>\<exists>x<A. P(x);  \<And>x. \<lbrakk>x<A; P(x)\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   153
apply (simp add: oex_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   154
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   155
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   156
lemma oex_cong [cong]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   157
    "\<lbrakk>a=a';  \<And>x. x<a' \<Longrightarrow> P(x) <-> P'(x)\<rbrakk>
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
   158
     \<Longrightarrow> oex(a, \<lambda>x. P(x)) <-> oex(a', \<lambda>x. P'(x))"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   159
apply (simp add: oex_def cong add: conj_cong)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   160
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   161
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   162
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   163
subsubsection \<open>Rules for Ordinal-Indexed Unions\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   164
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   165
lemma OUN_I [intro]: "\<lbrakk>a<i;  b \<in> B(a)\<rbrakk> \<Longrightarrow> b: (\<Union>z<i. B(z))"
13170
paulson
parents: 13169
diff changeset
   166
by (unfold OUnion_def lt_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   167
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   168
lemma OUN_E [elim!]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   169
    "\<lbrakk>b \<in> (\<Union>z<i. B(z));  \<And>a.\<lbrakk>b \<in> B(a);  a<i\<rbrakk> \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R"
13170
paulson
parents: 13169
diff changeset
   170
apply (unfold OUnion_def lt_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   171
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   172
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   173
lemma OUN_iff: "b \<in> (\<Union>x<i. B(x)) <-> (\<exists>x<i. b \<in> B(x))"
13170
paulson
parents: 13169
diff changeset
   174
by (unfold OUnion_def oex_def lt_def, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   175
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   176
lemma OUN_cong [cong]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   177
    "\<lbrakk>i=j;  \<And>x. x<j \<Longrightarrow> C(x)=D(x)\<rbrakk> \<Longrightarrow> (\<Union>x<i. C(x)) = (\<Union>x<j. D(x))"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   178
by (simp add: OUnion_def lt_def OUN_iff)
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   179
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   180
lemma lt_induct:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   181
    "\<lbrakk>i<k;  \<And>x.\<lbrakk>x<k;  \<forall>y<x. P(y)\<rbrakk> \<Longrightarrow> P(x)\<rbrakk>  \<Longrightarrow>  P(i)"
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   182
apply (simp add: lt_def oall_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   183
apply (erule conjE)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   184
apply (erule Ord_induct, assumption, blast)
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   185
done
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   186
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   187
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   188
subsection \<open>Quantification over a class\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   189
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   190
definition
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
   191
  "rall"     :: "[i\<Rightarrow>o, i\<Rightarrow>o] \<Rightarrow> o"  where
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   192
    "rall(M, P) \<equiv> \<forall>x. M(x) \<longrightarrow> P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   193
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   194
definition
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
   195
  "rex"      :: "[i\<Rightarrow>o, i\<Rightarrow>o] \<Rightarrow> o"  where
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   196
    "rex(M, P) \<equiv> \<exists>x. M(x) \<and> P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   197
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   198
syntax
80917
2a77bc3b4eac more inner syntax markup: minor object-logics;
wenzelm
parents: 80761
diff changeset
   199
  "_rall"     :: "[pttrn, i\<Rightarrow>o, o] \<Rightarrow> o"  (\<open>(\<open>indent=3 notation=\<open>binder \<forall>[]\<close>\<close>\<forall>_[_]./ _)\<close> 10)
2a77bc3b4eac more inner syntax markup: minor object-logics;
wenzelm
parents: 80761
diff changeset
   200
  "_rex"      :: "[pttrn, i\<Rightarrow>o, o] \<Rightarrow> o"  (\<open>(\<open>indent=3 notation=\<open>binder \<exists>[]\<close>\<close>\<exists>_[_]./ _)\<close> 10)
80761
bc936d3d8b45 tuned, following be8c0e039a5e;
wenzelm
parents: 80754
diff changeset
   201
syntax_consts
bc936d3d8b45 tuned, following be8c0e039a5e;
wenzelm
parents: 80754
diff changeset
   202
  "_rall" \<rightleftharpoons> rall and
bc936d3d8b45 tuned, following be8c0e039a5e;
wenzelm
parents: 80754
diff changeset
   203
  "_rex" \<rightleftharpoons> rex
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   204
translations
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   205
  "\<forall>x[M]. P" \<rightleftharpoons> "CONST rall(M, \<lambda>x. P)"
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   206
  "\<exists>x[M]. P" \<rightleftharpoons> "CONST rex(M, \<lambda>x. P)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   207
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   208
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   209
subsubsection\<open>Relativized universal quantifier\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   210
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   211
lemma rallI [intro!]: "\<lbrakk>\<And>x. M(x) \<Longrightarrow> P(x)\<rbrakk> \<Longrightarrow> \<forall>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   212
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   213
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   214
lemma rspec: "\<lbrakk>\<forall>x[M]. P(x); M(x)\<rbrakk> \<Longrightarrow> P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   215
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   216
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   217
(*Instantiates x first: better for automatic theorem proving?*)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   218
lemma rev_rallE [elim]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   219
    "\<lbrakk>\<forall>x[M]. P(x);  \<not> M(x) \<Longrightarrow> Q;  P(x) \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   220
by (simp add: rall_def, blast)
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   221
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   222
lemma rallE: "\<lbrakk>\<forall>x[M]. P(x);  P(x) \<Longrightarrow> Q;  \<not> M(x) \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   223
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   224
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   225
(*Trival rewrite rule;   (\<forall>x[M].P)<->P holds only if A is nonempty!*)
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   226
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
   227
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   228
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   229
(*Congruence rule for rewriting*)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   230
lemma rall_cong [cong]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   231
    "(\<And>x. M(x) \<Longrightarrow> P(x) <-> P'(x)) \<Longrightarrow> (\<forall>x[M]. P(x)) <-> (\<forall>x[M]. P'(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   232
by (simp add: rall_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   233
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   234
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   235
subsubsection\<open>Relativized existential quantifier\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   236
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   237
lemma rexI [intro]: "\<lbrakk>P(x); M(x)\<rbrakk> \<Longrightarrow> \<exists>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   238
by (simp add: rex_def, blast)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   239
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   240
(*The best argument order when there is only one M(x)*)
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   241
lemma rev_rexI: "\<lbrakk>M(x);  P(x)\<rbrakk> \<Longrightarrow> \<exists>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   242
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   243
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   244
(*Not of the general form for such rules... *)
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   245
lemma rexCI: "\<lbrakk>\<forall>x[M]. \<not>P(x) \<Longrightarrow> P(a); M(a)\<rbrakk> \<Longrightarrow> \<exists>x[M]. P(x)"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   246
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   247
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   248
lemma rexE [elim!]: "\<lbrakk>\<exists>x[M]. P(x);  \<And>x. \<lbrakk>M(x); P(x)\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   249
by (simp add: rex_def, blast)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   250
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   251
(*We do not even have (\<exists>x[M]. True) <-> True unless A is nonempty\<And>*)
61396
ce1b2234cab6 tuned syntax -- more symbols;
wenzelm
parents: 61378
diff changeset
   252
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
   253
by (simp add: rex_def)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   254
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   255
lemma rex_cong [cong]:
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   256
    "(\<And>x. M(x) \<Longrightarrow> P(x) <-> P'(x)) \<Longrightarrow> (\<exists>x[M]. P(x)) <-> (\<exists>x[M]. P'(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   257
by (simp add: rex_def cong: conj_cong)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   258
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
   259
lemma rall_is_ball [simp]: "(\<forall>x[\<lambda>z. z\<in>A]. P(x)) <-> (\<forall>x\<in>A. P(x))"
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   260
by blast
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   261
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
   262
lemma rex_is_bex [simp]: "(\<exists>x[\<lambda>z. z\<in>A]. P(x)) <-> (\<exists>x\<in>A. P(x))"
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   263
by blast
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   264
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   265
lemma atomize_rall: "(\<And>x. M(x) \<Longrightarrow> P(x)) \<equiv> Trueprop (\<forall>x[M]. P(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   266
by (simp add: rall_def atomize_all atomize_imp)
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   267
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   268
declare atomize_rall [symmetric, rulify]
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   269
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   270
lemma rall_simps1:
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   271
     "(\<forall>x[M]. P(x) \<and> Q)   <-> (\<forall>x[M]. P(x)) \<and> ((\<forall>x[M]. False) | Q)"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   272
     "(\<forall>x[M]. P(x) | Q)   <-> ((\<forall>x[M]. P(x)) | Q)"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   273
     "(\<forall>x[M]. P(x) \<longrightarrow> Q) <-> ((\<exists>x[M]. P(x)) \<longrightarrow> Q)"
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   274
     "(\<not>(\<forall>x[M]. P(x))) <-> (\<exists>x[M]. \<not>P(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   275
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   276
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   277
lemma rall_simps2:
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   278
     "(\<forall>x[M]. P \<and> Q(x))   <-> ((\<forall>x[M]. False) | P) \<and> (\<forall>x[M]. Q(x))"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   279
     "(\<forall>x[M]. P | Q(x))   <-> (P | (\<forall>x[M]. Q(x)))"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   280
     "(\<forall>x[M]. P \<longrightarrow> Q(x)) <-> (P \<longrightarrow> (\<forall>x[M]. Q(x)))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   281
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   282
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   283
lemmas rall_simps [simp] = rall_simps1 rall_simps2
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   284
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   285
lemma rall_conj_distrib:
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   286
    "(\<forall>x[M]. P(x) \<and> Q(x)) <-> ((\<forall>x[M]. P(x)) \<and> (\<forall>x[M]. Q(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_simps1:
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   290
     "(\<exists>x[M]. P(x) \<and> Q) <-> ((\<exists>x[M]. P(x)) \<and> Q)"
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   291
     "(\<exists>x[M]. P(x) | Q) <-> (\<exists>x[M]. P(x)) | ((\<exists>x[M]. True) \<and> Q)"
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   292
     "(\<exists>x[M]. P(x) \<longrightarrow> Q) <-> ((\<forall>x[M]. P(x)) \<longrightarrow> ((\<exists>x[M]. True) \<and> Q))"
76213
e44d86131648 Removal of obsolete ASCII syntax
paulson <lp15@cam.ac.uk>
parents: 71886
diff changeset
   293
     "(\<not>(\<exists>x[M]. P(x))) <-> (\<forall>x[M]. \<not>P(x))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   294
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   295
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   296
lemma rex_simps2:
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   297
     "(\<exists>x[M]. P \<and> Q(x)) <-> (P \<and> (\<exists>x[M]. Q(x)))"
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   298
     "(\<exists>x[M]. P | Q(x)) <-> ((\<exists>x[M]. True) \<and> P) | (\<exists>x[M]. Q(x))"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   299
     "(\<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
   300
by blast+
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   301
13289
53e201efdaa2 miniscoping for class-bounded quantifiers (rall and rex)
paulson
parents: 13253
diff changeset
   302
lemmas rex_simps [simp] = rex_simps1 rex_simps2
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   303
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   304
lemma rex_disj_distrib:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   305
    "(\<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
   306
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   307
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   308
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   309
subsubsection\<open>One-point rule for bounded quantifiers\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   310
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   311
lemma rex_triv_one_point1 [simp]: "(\<exists>x[M]. x=a) <-> ( M(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   312
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   313
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   314
lemma rex_triv_one_point2 [simp]: "(\<exists>x[M]. a=x) <-> ( M(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   315
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   316
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   317
lemma rex_one_point1 [simp]: "(\<exists>x[M]. x=a \<and> P(x)) <-> ( M(a) \<and> P(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   318
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   319
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   320
lemma rex_one_point2 [simp]: "(\<exists>x[M]. a=x \<and> P(x)) <-> ( M(a) \<and> P(a))"
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   321
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   322
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   323
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
   324
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   325
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   326
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
   327
by blast
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   328
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   329
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   330
subsubsection\<open>Sets as Classes\<close>
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   331
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 18324
diff changeset
   332
definition
81125
ec121999a9cb more inner-syntax markup;
wenzelm
parents: 80917
diff changeset
   333
  setclass :: "[i,i] \<Rightarrow> o"  (\<open>(\<open>open_block notation=\<open>prefix setclass\<close>\<close>##_)\<close> [40] 40)  where
76215
a642599ffdea More syntactic cleanup. LaTeX markup working
paulson <lp15@cam.ac.uk>
parents: 76214
diff changeset
   334
   "setclass(A) \<equiv> \<lambda>x. x \<in> A"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   335
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 45625
diff changeset
   336
lemma setclass_iff [simp]: "setclass(A,x) <-> x \<in> A"
13362
cd7f9ea58338 tweaked definition of setclass
paulson
parents: 13339
diff changeset
   337
by (simp add: setclass_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   338
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13615
diff changeset
   339
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
   340
by auto
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   341
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13615
diff changeset
   342
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
   343
by auto
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   344
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13289
diff changeset
   345
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   346
ML
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   347
\<open>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   348
val Ord_atomize =
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 69587
diff changeset
   349
  atomize ([(\<^const_name>\<open>oall\<close>, @{thms ospec}), (\<^const_name>\<open>rall\<close>, @{thms rspec})] @
56250
2c9f841f36b8 more antiquotations;
wenzelm
parents: 54998
diff changeset
   350
    ZF_conn_pairs, ZF_mem_pairs);
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   351
\<close>
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   352
declaration \<open>fn _ =>
59647
c6f413b660cf clarified Drule.gen_all: observe context more carefully;
wenzelm
parents: 59498
diff changeset
   353
  Simplifier.map_ss (Simplifier.set_mksimps (fn ctxt =>
60822
4f58f3662e7d more explicit context;
wenzelm
parents: 60770
diff changeset
   354
    map mk_eq o Ord_atomize o Variable.gen_all ctxt))
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   355
\<close>
13169
394a6c649547 conversion of OrdQuant.ML to Isar
paulson
parents: 13162
diff changeset
   356
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   357
text \<open>Setting up the one-point-rule simproc\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   358
76214
0c18df79b1c8 more modernisation of syntax
paulson <lp15@cam.ac.uk>
parents: 76213
diff changeset
   359
simproc_setup defined_rex ("\<exists>x[M]. P(x) \<and> Q(x)") = \<open>
78099
4d9349989d94 more uniform simproc_setup: avoid vacuous abstraction over morphism, which sometimes captures context values in its functional closure;
wenzelm
parents: 76215
diff changeset
   360
  K (Quantifier1.rearrange_Bex (fn ctxt => unfold_tac ctxt @{thms rex_def}))
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   361
\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   362
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   363
simproc_setup defined_rall ("\<forall>x[M]. P(x) \<longrightarrow> Q(x)") = \<open>
78099
4d9349989d94 more uniform simproc_setup: avoid vacuous abstraction over morphism, which sometimes captures context values in its functional closure;
wenzelm
parents: 76215
diff changeset
   364
  K (Quantifier1.rearrange_Ball (fn ctxt => unfold_tac ctxt @{thms rall_def}))
60770
240563fbf41d isabelle update_cartouches;
wenzelm
parents: 59647
diff changeset
   365
\<close>
13253
edbf32029d33 added class quantifiers
paulson
parents: 13244
diff changeset
   366
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents:
diff changeset
   367
end