src/ZF/ZF.thy
author wenzelm
Wed, 21 Sep 1994 15:39:02 +0200
changeset 615 84ac5f101bd1
parent 516 1957113f0d7d
child 632 f9a3f77f71e8
permissions -rw-r--r--
minor cleanup, added 'syntax' section;
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
ZF = FOL +
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
types
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    12
  i
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
arities
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
  i :: term
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
consts
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    19
  "0"           :: "i"                  ("0")   (*the empty set*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    20
  Pow           :: "i => i"                     (*power sets*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    21
  Inf           :: "i"                          (*infinite set*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
  (* Bounded Quantifiers *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    25
  Ball, Bex     :: "[i, i => o] => o"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
  (* General Union and Intersection *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
80
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    29
  Union, Inter  :: "i => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
  (* Variations on Replacement *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
80
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    33
  PrimReplace   :: "[i, [i, i] => o] => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    34
  Replace       :: "[i, [i, i] => o] => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    35
  RepFun        :: "[i, i => i] => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    36
  Collect       :: "[i, i => o] => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
  (* Descriptions *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    40
  The           :: "(i => o) => i"      (binder "THE " 10)
80
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    41
  if            :: "[o, i, i] => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
  (* Finite Sets *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
80
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    45
  Upair, cons   :: "[i, i] => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    46
  succ          :: "i => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    48
  (* Ordered Pairing *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
80
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    50
  Pair          :: "[i, i] => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    51
  fst, snd      :: "i => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    52
  split         :: "[[i, i] => i, i] => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    53
  fsplit        :: "[[i, i] => o, i] => o"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
  (* Sigma and Pi Operators *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    57
  Sigma, Pi     :: "[i, i => i] => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
  (* Relations and Functions *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
80
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    61
  domain        :: "i => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    62
  range         :: "i => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    63
  field         :: "i => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    64
  converse      :: "i => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    65
  Lambda        :: "[i, i => i] => i"
0d10b8a501d5 added white-space;
wenzelm
parents: 49
diff changeset
    66
  restrict      :: "[i, i] => i"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
  (* Infixes in order of decreasing precedence *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    70
  "``"          :: "[i, i] => i"    (infixl 90) (*image*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    71
  "-``"         :: "[i, i] => i"    (infixl 90) (*inverse image*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    72
  "`"           :: "[i, i] => i"    (infixl 90) (*function application*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    73
(*"*"           :: "[i, i] => i"    (infixr 80) (*Cartesian product*)*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    74
  "Int"         :: "[i, i] => i"    (infixl 70) (*binary intersection*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    75
  "Un"          :: "[i, i] => i"    (infixl 65) (*binary union*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    76
  "-"           :: "[i, i] => i"    (infixl 65) (*set difference*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    77
(*"->"          :: "[i, i] => i"    (infixr 60) (*function space*)*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    78
  "<="          :: "[i, i] => o"    (infixl 50) (*subset relation*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    79
  ":"           :: "[i, i] => o"    (infixl 50) (*membership relation*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    80
(*"~:"          :: "[i, i] => o"    (infixl 50) (*negated membership relation*)*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    83
types
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    84
  is
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    85
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    86
syntax
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    87
  ""            :: "i => is"                    ("_")
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    88
  "@Enum"       :: "[i, is] => is"              ("_,/ _")
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    89
  "~:"          :: "[i, i] => o"                (infixl 50)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    90
  "@Finset"     :: "is => i"                    ("{(_)}")
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    91
  "@Tuple"      :: "[i, is] => i"               ("<(_,/ _)>")
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    92
  "@Collect"    :: "[idt, i, o] => i"           ("(1{_: _ ./ _})")
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    93
  "@Replace"    :: "[idt, idt, i, o] => i"      ("(1{_ ./ _: _, _})")
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    94
  "@RepFun"     :: "[i, idt, i] => i"           ("(1{_ ./ _: _})")
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    95
  "@INTER"      :: "[idt, i, i] => i"           ("(3INT _:_./ _)" 10)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    96
  "@UNION"      :: "[idt, i, i] => i"           ("(3UN _:_./ _)" 10)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    97
  "@PROD"       :: "[idt, i, i] => i"           ("(3PROD _:_./ _)" 10)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    98
  "@SUM"        :: "[idt, i, i] => i"           ("(3SUM _:_./ _)" 10)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
    99
  "->"          :: "[i, i] => i"                (infixr 60)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   100
  "*"           :: "[i, i] => i"                (infixr 80)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   101
  "@lam"        :: "[idt, i, i] => i"           ("(3lam _:_./ _)" 10)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   102
  "@Ball"       :: "[idt, i, o] => o"           ("(3ALL _:_./ _)" 10)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   103
  "@Bex"        :: "[idt, i, o] => o"           ("(3EX _:_./ _)" 10)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   104
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
translations
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   106
  "x ~: y"      == "~ (x : y)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
  "{x, xs}"     == "cons(x, {xs})"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
  "{x}"         == "cons(x, 0)"
49
c78503b345c4 "The" now a binder, removed translation;
wenzelm
parents: 37
diff changeset
   109
  "<x, y, z>"   == "<x, <y, z>>"
c78503b345c4 "The" now a binder, removed translation;
wenzelm
parents: 37
diff changeset
   110
  "<x, y>"      == "Pair(x, y)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
  "{x:A. P}"    == "Collect(A, %x. P)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
  "{y. x:A, Q}" == "Replace(A, %x y. Q)"
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   113
  "{b. x:A}"    == "RepFun(A, %x. b)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
  "INT x:A. B"  == "Inter({B. x:A})"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
  "UN x:A. B"   == "Union({B. x:A})"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
  "PROD x:A. B" => "Pi(A, %x. B)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
  "SUM x:A. B"  => "Sigma(A, %x. B)"
49
c78503b345c4 "The" now a binder, removed translation;
wenzelm
parents: 37
diff changeset
   118
  "A -> B"      => "Pi(A, _K(B))"
c78503b345c4 "The" now a binder, removed translation;
wenzelm
parents: 37
diff changeset
   119
  "A * B"       => "Sigma(A, _K(B))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
  "lam x:A. f"  == "Lambda(A, %x. f)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
  "ALL x:A. P"  == "Ball(A, %x. P)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
  "EX x:A. P"   == "Bex(A, %x. P)"
37
cebe01deba80 added ~: for "not in"
lcp
parents: 0
diff changeset
   123
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
rules
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   127
  (* Bounded Quantifiers *)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   128
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   129
  Ball_def      "Ball(A, P) == ALL x. x:A --> P(x)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   130
  Bex_def       "Bex(A, P) == EX x. x:A & P(x)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   131
  subset_def    "A <= B == ALL x:A. x:B"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   133
  (* ZF axioms -- see Suppes p.238
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   134
     Axioms for Union, Pow and Replace state existence only,
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   135
     uniqueness is derivable using extensionality. *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   137
  extension     "A = B <-> A <= B & B <= A"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   138
  Union_iff     "A : Union(C) <-> (EX B:C. A:B)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   139
  Pow_iff       "A : Pow(B) <-> A <= B"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   140
  succ_def      "succ(i) == cons(i, i)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   142
  (*We may name this set, though it is not uniquely defined.*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   143
  infinity      "0:Inf & (ALL y:Inf. succ(y): Inf)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   145
  (*This formulation facilitates case analysis on A.*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   146
  foundation    "A=0 | (EX x:A. ALL y:x. y~:A)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   148
  (*Schema axiom since predicate P is a higher-order variable*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   149
  replacement   "(ALL x:A. ALL y z. P(x,y) & P(x,z) --> y=z) ==> \
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   150
                \        b : PrimReplace(A,P) <-> (EX x:A. P(x,b))"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   151
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   152
  (* Derived form of replacement, restricting P to its functional part.
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   153
     The resulting set (for functional P) is the same as with
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   154
     PrimReplace, but the rules are simpler. *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   156
  Replace_def   "Replace(A,P) == PrimReplace(A, %x y. (EX!z.P(x,z)) & P(x,y))"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   157
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   158
  (* Functional form of replacement -- analgous to ML's map functional *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   160
  RepFun_def    "RepFun(A,f) == {y . x:A, y=f(x)}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   162
  (* Separation and Pairing can be derived from the Replacement
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   163
     and Powerset Axioms using the following definitions. *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   165
  Collect_def   "Collect(A,P) == {y . x:A, x=y & P(x)}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   167
  (*Unordered pairs (Upair) express binary union/intersection and cons;
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   168
    set enumerations translate as {a,...,z} = cons(a,...,cons(z,0)...)*)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   170
  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
   171
  cons_def    "cons(a,A) == Upair(a,a) Un A"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   172
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   173
  (* Difference, general intersection, binary union and small intersection *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   175
  Diff_def      "A - B    == { x:A . ~(x:B) }"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   176
  Inter_def     "Inter(A) == { x:Union(A) . ALL y:A. x:y}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   177
  Un_def        "A Un  B  == Union(Upair(A,B))"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   178
  Int_def       "A Int B  == Inter(Upair(A,B))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   180
  (* Definite descriptions -- via Replace over the set "1" *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   182
  the_def       "The(P)    == Union({y . x:{0}, P(y)})"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   183
  if_def        "if(P,a,b) == THE z. P & z=a | ~P & z=b"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   185
  (* Ordered pairs and disjoint union of a family of sets *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   187
  (* this "symmetric" definition works better than {{a}, {a,b}} *)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   188
  Pair_def      "<a,b>  == {{a,a}, {a,b}}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   189
  fst_def       "fst == split(%x y.x)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   190
  snd_def       "snd == split(%x y.y)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   191
  split_def     "split(c,p) == THE y. EX a b. p=<a,b> & y=c(a,b)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   192
  fsplit_def    "fsplit(R,z) == EX x y. z=<x,y> & R(x,y)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   193
  Sigma_def     "Sigma(A,B) == UN x:A. UN y:B(x). {<x,y>}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   195
  (* Operations on relations *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   197
  (*converse of relation r, inverse of function*)
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   198
  converse_def  "converse(r) == {z. w:r, EX x y. w=<x,y> & z=<y,x>}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   199
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   200
  domain_def    "domain(r) == {x. w:r, EX y. w=<x,y>}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   201
  range_def     "range(r) == domain(converse(r))"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   202
  field_def     "field(r) == domain(r) Un range(r)"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   203
  image_def     "r `` A  == {y : range(r) . EX x:A. <x,y> : r}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   204
  vimage_def    "r -`` A == converse(r)``A"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   205
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   206
  (* Abstraction, application and Cartesian product of a family of sets *)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   207
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   208
  lam_def       "Lambda(A,b) == {<x,b(x)> . x:A}"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   209
  apply_def     "f`a == THE y. <a,y> : f"
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   210
  Pi_def        "Pi(A,B)  == {f: Pow(Sigma(A,B)). ALL x:A. EX! y. <x,y>: f}"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   211
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
  (* Restrict the function f to the domain A *)
615
84ac5f101bd1 minor cleanup, added 'syntax' section;
wenzelm
parents: 516
diff changeset
   213
  restrict_def  "restrict(f,A) == lam x:A.f`x"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
end
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   216
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   217
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   218
ML
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   219
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   220
(* 'Dependent' type operators *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   222
val print_translation =
516
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 485
diff changeset
   223
  [("Pi", dependent_tr' ("@PROD", "->")),
1957113f0d7d installation of new inductive/datatype sections
lcp
parents: 485
diff changeset
   224
   ("Sigma", dependent_tr' ("@SUM", "*"))];