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