src/ZF/ZF.thy
author paulson
Mon, 13 May 2002 13:22:15 +0200
changeset 13144 c5ae1522fb82
parent 13121 4888694b2829
child 13175 81082cfa5618
permissions -rw-r--r--
quotes around types
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
     1
(*  Title:      ZF/ZF.thy
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author:     Lawrence C Paulson and Martin D Coen, CU Computer Laboratory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Zermelo-Fraenkel Set Theory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
13108
wenzelm
parents: 12891
diff changeset
     9
ZF = Let +
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
3906
5ae0e1324c56 global;
wenzelm
parents: 3840
diff changeset
    11
global
5ae0e1324c56 global;
wenzelm
parents: 3840
diff changeset
    12
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
types
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    14
  i
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
arities
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    17
  i :: "term"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
consts
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    21
  "0"         :: "i"                  ("0")   (*the empty set*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    22
  Pow         :: "i => i"                     (*power sets*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    23
  Inf         :: "i"                          (*infinite set*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
  (* Bounded Quantifiers *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    27
  Ball, Bex   :: "[i, i => o] => o"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
  (* General Union and Intersection *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    31
  Union,Inter :: "i => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
  (* Variations on Replacement *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    35
  PrimReplace :: "[i, [i, i] => o] => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    36
  Replace     :: "[i, [i, i] => o] => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    37
  RepFun      :: "[i, i => i] => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    38
  Collect     :: "[i, i => o] => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
  (* Descriptions *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    42
  The         :: (i => o) => i      (binder "THE " 10)
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    43
  If          :: "[o, i, i] => i"     ("(if (_)/ then (_)/ else (_))" [10] 10)
6068
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 3940
diff changeset
    44
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 3940
diff changeset
    45
syntax
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    46
  old_if      :: "[o, i, i] => i"   ("if '(_,_,_')")
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
6068
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 3940
diff changeset
    48
translations
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 3940
diff changeset
    49
  "if(P,a,b)" => "If(P,a,b)"
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 3940
diff changeset
    50
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 3940
diff changeset
    51
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 3940
diff changeset
    52
consts
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
  (* Finite Sets *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    55
  Upair, cons :: "[i, i] => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    56
  succ        :: "i => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    58
  (* Ordered Pairing *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    60
  Pair        :: "[i, i] => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    61
  fst, snd    :: "i => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    62
  split       :: "[[i, i] => 'a, i] => 'a::logic"  (*for pattern-matching*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
  (* Sigma and Pi Operators *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    66
  Sigma, Pi   :: "[i, i => i] => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
  (* Relations and Functions *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    70
  domain      :: "i => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    71
  range       :: "i => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    72
  field       :: "i => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    73
  converse    :: "i => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    74
  relation    :: "i => o"         (*recognizes sets of pairs*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    75
  function    :: "i => o"         (*recognizes functions; can have non-pairs*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    76
  Lambda      :: "[i, i => i] => i"
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    77
  restrict    :: "[i, i] => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
  (* Infixes in order of decreasing precedence *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    81
  "``"        :: "[i, i] => i"    (infixl 90) (*image*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    82
  "-``"       :: "[i, i] => i"    (infixl 90) (*inverse image*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    83
  "`"         :: "[i, i] => i"    (infixl 90) (*function application*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    84
(*"*"         :: "[i, i] => i"    (infixr 80) (*Cartesian product*)*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    85
  "Int"       :: "[i, i] => i"    (infixl 70) (*binary intersection*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    86
  "Un"        :: "[i, i] => i"    (infixl 65) (*binary union*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    87
  "-"         :: "[i, i] => i"    (infixl 65) (*set difference*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    88
(*"->"        :: "[i, i] => i"    (infixr 60) (*function space*)*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    89
  "<="        :: "[i, i] => o"    (infixl 50) (*subset relation*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    90
  ":"         :: "[i, i] => o"    (infixl 50) (*membership relation*)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    91
(*"~:"        :: "[i, i] => o"    (infixl 50) (*negated membership relation*)*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    94
types
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    95
  is
3692
9f9bcce140ce tuned pattern syntax;
wenzelm
parents: 3068
diff changeset
    96
  patterns
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    97
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    98
syntax
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
    99
  ""          :: "i => is"                   ("_")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   100
  "@Enum"     :: "[i, is] => is"             ("_,/ _")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   101
  "~:"        :: "[i, i] => o"               (infixl 50)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   102
  "@Finset"   :: "is => i"                   ("{(_)}")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   103
  "@Tuple"    :: "[i, is] => i"              ("<(_,/ _)>")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   104
  "@Collect"  :: "[pttrn, i, o] => i"        ("(1{_: _ ./ _})")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   105
  "@Replace"  :: "[pttrn, pttrn, i, o] => i" ("(1{_ ./ _: _, _})")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   106
  "@RepFun"   :: "[i, pttrn, i] => i"        ("(1{_ ./ _: _})" [51,0,51])
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   107
  "@INTER"    :: "[pttrn, i, i] => i"        ("(3INT _:_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   108
  "@UNION"    :: "[pttrn, i, i] => i"        ("(3UN _:_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   109
  "@PROD"     :: "[pttrn, i, i] => i"        ("(3PROD _:_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   110
  "@SUM"      :: "[pttrn, i, i] => i"        ("(3SUM _:_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   111
  "->"        :: "[i, i] => i"               (infixr 60)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   112
  "*"         :: "[i, i] => i"               (infixr 80)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   113
  "@lam"      :: "[pttrn, i, i] => i"        ("(3lam _:_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   114
  "@Ball"     :: "[pttrn, i, o] => o"        ("(3ALL _:_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   115
  "@Bex"      :: "[pttrn, i, o] => o"        ("(3EX _:_./ _)" 10)
1106
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   116
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   117
  (** Patterns -- extends pre-defined type "pttrn" used in abstractions **)
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   118
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   119
  "@pattern"  :: "patterns => pttrn"         ("<_>")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   120
  ""          :: "pttrn => patterns"         ("_")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   121
  "@patterns" :: "[pttrn, patterns] => patterns"  ("_,/_")
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   122
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
translations
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   124
  "x ~: y"      == "~ (x : y)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
  "{x, xs}"     == "cons(x, {xs})"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
  "{x}"         == "cons(x, 0)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
  "{x:A. P}"    == "Collect(A, %x. P)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   128
  "{y. x:A, Q}" == "Replace(A, %x y. Q)"
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   129
  "{b. x:A}"    == "RepFun(A, %x. b)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
  "INT x:A. B"  == "Inter({B. x:A})"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
  "UN x:A. B"   == "Union({B. x:A})"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
  "PROD x:A. B" => "Pi(A, %x. B)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
  "SUM x:A. B"  => "Sigma(A, %x. B)"
49
c78503b345c4 "The" now a binder, removed translation;
wenzelm
parents: 37
diff changeset
   134
  "A -> B"      => "Pi(A, _K(B))"
c78503b345c4 "The" now a binder, removed translation;
wenzelm
parents: 37
diff changeset
   135
  "A * B"       => "Sigma(A, _K(B))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
  "lam x:A. f"  == "Lambda(A, %x. f)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
  "ALL x:A. P"  == "Ball(A, %x. P)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
  "EX x:A. P"   == "Bex(A, %x. P)"
37
cebe01deba80 added ~: for "not in"
lcp
parents: 0
diff changeset
   139
1106
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   140
  "<x, y, z>"   == "<x, <y, z>>"
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   141
  "<x, y>"      == "Pair(x, y)"
2286
c2f76a5bad65 removed out-dated comment;
wenzelm
parents: 1478
diff changeset
   142
  "%<x,y,zs>.b" == "split(%x <y,zs>.b)"
3840
e0baea4d485a fixed dots;
wenzelm
parents: 3692
diff changeset
   143
  "%<x,y>.b"    == "split(%x y. b)"
2286
c2f76a5bad65 removed out-dated comment;
wenzelm
parents: 1478
diff changeset
   144
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
12114
a8e860c86252 eliminated old "symbols" syntax, use "xsymbols" instead;
wenzelm
parents: 11322
diff changeset
   146
syntax (xsymbols)
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   147
  "op *"      :: "[i, i] => i"               (infixr "\\<times>" 80)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   148
  "op Int"    :: "[i, i] => i"    	   (infixl "\\<inter>" 70)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   149
  "op Un"     :: "[i, i] => i"    	   (infixl "\\<union>" 65)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   150
  "op ->"     :: "[i, i] => i"               (infixr "\\<rightarrow>" 60)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   151
  "op <="     :: "[i, i] => o"    	   (infixl "\\<subseteq>" 50)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   152
  "op :"      :: "[i, i] => o"    	   (infixl "\\<in>" 50)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   153
  "op ~:"     :: "[i, i] => o"               (infixl "\\<notin>" 50)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   154
  "@Collect"  :: "[pttrn, i, o] => i"        ("(1{_ \\<in> _ ./ _})")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   155
  "@Replace"  :: "[pttrn, pttrn, i, o] => i" ("(1{_ ./ _ \\<in> _, _})")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   156
  "@RepFun"   :: "[i, pttrn, i] => i"        ("(1{_ ./ _ \\<in> _})" [51,0,51])
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   157
  "@UNION"    :: "[pttrn, i, i] => i"        ("(3\\<Union>_\\<in>_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   158
  "@INTER"    :: "[pttrn, i, i] => i"        ("(3\\<Inter>_\\<in>_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   159
  Union       :: "i =>i"                     ("\\<Union>_" [90] 90)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   160
  Inter       :: "i =>i"                     ("\\<Inter>_" [90] 90)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   161
  "@PROD"     :: "[pttrn, i, i] => i"        ("(3\\<Pi>_\\<in>_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   162
  "@SUM"      :: "[pttrn, i, i] => i"        ("(3\\<Sigma>_\\<in>_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   163
  "@lam"      :: "[pttrn, i, i] => i"        ("(3\\<lambda>_\\<in>_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   164
  "@Ball"     :: "[pttrn, i, o] => o"        ("(3\\<forall>_\\<in>_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   165
  "@Bex"      :: "[pttrn, i, o] => o"        ("(3\\<exists>_\\<in>_./ _)" 10)
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   166
  "@Tuple"    :: "[i, is] => i"              ("\\<langle>(_,/ _)\\<rangle>")
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   167
  "@pattern"  :: "patterns => pttrn"         ("\\<langle>_\\<rangle>")
2540
ba8311047f18 added symbols syntax;
wenzelm
parents: 2469
diff changeset
   168
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6068
diff changeset
   169
syntax (HTML output)
13144
c5ae1522fb82 quotes around types
paulson
parents: 13121
diff changeset
   170
  "op *"      :: "[i, i] => i"               (infixr "\\<times>" 80)
6340
7d5cbd5819a0 HTML output;
wenzelm
parents: 6068
diff changeset
   171
2540
ba8311047f18 added symbols syntax;
wenzelm
parents: 2469
diff changeset
   172
690
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   173
defs
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   175
  (* Bounded Quantifiers *)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   176
  Ball_def      "Ball(A, P) == ALL x. x:A --> P(x)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   177
  Bex_def       "Bex(A, P) == EX x. x:A & P(x)"
690
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   178
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   179
  subset_def    "A <= B == ALL x:A. x:B"
690
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   180
  succ_def      "succ(i) == cons(i, i)"
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   181
3906
5ae0e1324c56 global;
wenzelm
parents: 3840
diff changeset
   182
3940
wenzelm
parents: 3906
diff changeset
   183
local
3906
5ae0e1324c56 global;
wenzelm
parents: 3840
diff changeset
   184
690
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   185
rules
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   187
  (* ZF axioms -- see Suppes p.238
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   188
     Axioms for Union, Pow and Replace state existence only,
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   189
     uniqueness is derivable using extensionality. *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   190
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   191
  extension     "A = B <-> A <= B & B <= A"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   192
  Union_iff     "A : Union(C) <-> (EX B:C. A:B)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   193
  Pow_iff       "A : Pow(B) <-> A <= B"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   195
  (*We may name this set, though it is not uniquely defined.*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   196
  infinity      "0:Inf & (ALL y:Inf. succ(y): Inf)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   198
  (*This formulation facilitates case analysis on A.*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   199
  foundation    "A=0 | (EX x:A. ALL y:x. y~:A)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   201
  (*Schema axiom since predicate P is a higher-order variable*)
12762
a0c0a1e3a53a split can now be unfolded even with one argument
paulson
parents: 12552
diff changeset
   202
  replacement   "(ALL x:A. ALL y z. P(x,y) & P(x,z) --> y=z) ==>
1155
928a16e02f9f removed \...\ inside strings
clasohm
parents: 1116
diff changeset
   203
                         b : PrimReplace(A,P) <-> (EX x:A. P(x,b))"
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   204
690
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   205
defs
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   206
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   207
  (* Derived form of replacement, restricting P to its functional part.
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   208
     The resulting set (for functional P) is the same as with
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   209
     PrimReplace, but the rules are simpler. *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
3840
e0baea4d485a fixed dots;
wenzelm
parents: 3692
diff changeset
   211
  Replace_def   "Replace(A,P) == PrimReplace(A, %x y. (EX!z. P(x,z)) & P(x,y))"
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   212
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   213
  (* Functional form of replacement -- analgous to ML's map functional *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   215
  RepFun_def    "RepFun(A,f) == {y . x:A, y=f(x)}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   216
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   217
  (* Separation and Pairing can be derived from the Replacement
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   218
     and Powerset Axioms using the following definitions. *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   219
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   220
  Collect_def   "Collect(A,P) == {y . x:A, x=y & P(x)}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   222
  (*Unordered pairs (Upair) express binary union/intersection and cons;
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   223
    set enumerations translate as {a,...,z} = cons(a,...,cons(z,0)...)*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   224
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   225
  Upair_def   "Upair(a,b) == {y. x:Pow(Pow(0)), (x=0 & y=a) | (x=Pow(0) & y=b)}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   226
  cons_def    "cons(a,A) == Upair(a,a) Un A"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   227
2872
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   228
  (* Difference, general intersection, binary union and small intersection *)
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   229
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   230
  Diff_def      "A - B    == { x:A . ~(x:B) }"
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   231
  Inter_def     "Inter(A) == { x:Union(A) . ALL y:A. x:y}"
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   232
  Un_def        "A Un  B  == Union(Upair(A,B))"
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   233
  Int_def       "A Int B  == Inter(Upair(A,B))"
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   234
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   235
  (* Definite descriptions -- via Replace over the set "1" *)
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   236
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   237
  the_def       "The(P)    == Union({y . x:{0}, P(y)})"
ac81a17f86f8 Moved definitions (binary intersection, etc.) from upair.thy back to ZF.thy
paulson
parents: 2540
diff changeset
   238
  if_def        "if(P,a,b) == THE z. P & z=a | ~P & z=b"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   239
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   240
  (* this "symmetric" definition works better than {{a}, {a,b}} *)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   241
  Pair_def      "<a,b>  == {{a,a}, {a,b}}"
1106
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   242
  fst_def       "fst(p) == THE a. EX b. p=<a,b>"
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   243
  snd_def       "snd(p) == THE b. EX a. p=<a,b>"
12762
a0c0a1e3a53a split can now be unfolded even with one argument
paulson
parents: 12552
diff changeset
   244
  split_def     "split(c) == %p. c(fst(p), snd(p))"
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   245
  Sigma_def     "Sigma(A,B) == UN x:A. UN y:B(x). {<x,y>}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   246
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   247
  (* Operations on relations *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   248
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   249
  (*converse of relation r, inverse of function*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   250
  converse_def  "converse(r) == {z. w:r, EX x y. w=<x,y> & z=<y,x>}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   251
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   252
  domain_def    "domain(r) == {x. w:r, EX y. w=<x,y>}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   253
  range_def     "range(r) == domain(converse(r))"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   254
  field_def     "field(r) == domain(r) Un range(r)"
13121
4888694b2829 the new predicate "relation"
paulson
parents: 13108
diff changeset
   255
  relation_def  "relation(r) == ALL z:r. EX x y. z = <x,y>"
4888694b2829 the new predicate "relation"
paulson
parents: 13108
diff changeset
   256
  function_def  "function(r) ==
4888694b2829 the new predicate "relation"
paulson
parents: 13108
diff changeset
   257
		    ALL x y. <x,y>:r --> (ALL y'. <x,y'>:r --> y=y')"
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   258
  image_def     "r `` A  == {y : range(r) . EX x:A. <x,y> : r}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   259
  vimage_def    "r -`` A == converse(r)``A"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   260
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   261
  (* Abstraction, application and Cartesian product of a family of sets *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   262
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   263
  lam_def       "Lambda(A,b) == {<x,b(x)> . x:A}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   264
  apply_def     "f`a == THE y. <a,y> : f"
690
b2bd1d5a3d16 ZF: NEW DEFINITION OF PI(A,B)
lcp
parents: 675
diff changeset
   265
  Pi_def        "Pi(A,B)  == {f: Pow(Sigma(A,B)). A<=domain(f) & function(f)}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   266
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12762
diff changeset
   267
  (* Restrict the relation r to the domain A *)
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12762
diff changeset
   268
  restrict_def  "restrict(r,A) == {z : r. EX x:A. EX y. z = <x,y>}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   269
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   270
end
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   271
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   272
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   273
ML
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   274
1106
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   275
(* Pattern-matching and 'Dependent' type operators *)
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   276
12762
a0c0a1e3a53a split can now be unfolded even with one argument
paulson
parents: 12552
diff changeset
   277
val print_translation =
1116
7fca5aabcbb0 Modified translation for pattern abstraction.
nipkow
parents: 1106
diff changeset
   278
  [(*("split", split_tr'),*)
1106
62bdb9e5722b Added pattern-matching code from CHOL/Prod.thy. Changed
lcp
parents: 690
diff changeset
   279
   ("Pi",    dependent_tr' ("@PROD", "op ->")),
632
f9a3f77f71e8 fixed infix names in print_translations;
wenzelm
parents: 615
diff changeset
   280
   ("Sigma", dependent_tr' ("@SUM", "op *"))];