src/ZF/QPair.thy
author paulson
Fri, 11 Aug 2000 13:26:40 +0200
changeset 9577 9e66e8ed8237
parent 6093 87bf8c03b169
child 13220 62c899c77151
permissions -rw-r--r--
ZF arith
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/qpair.thy
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
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
Quine-inspired ordered pairs and disjoint sums, for non-well-founded data
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
structures in ZF.  Does not precisely follow Quine's construction.  Thanks
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
to Thomas Forster for suggesting this approach!
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
W. V. Quine, On Ordered Pairs and Relations, in Selected Logic Papers,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
1966.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1478
diff changeset
    14
QPair = Sum +
3923
c257b82a1200 global;
wenzelm
parents: 2469
diff changeset
    15
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
consts
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    17
  QPair     :: [i, i] => i                      ("<(_;/ _)>")
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1097
diff changeset
    18
  qfst,qsnd :: i => i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1097
diff changeset
    19
  qsplit    :: [[i, i] => 'a, i] => 'a::logic  (*for pattern-matching*)
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1097
diff changeset
    20
  qconverse :: i => i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1097
diff changeset
    21
  QSigma    :: [i, i => i] => i
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    23
  "<+>"     :: [i,i]=>i                         (infixr 65)
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1097
diff changeset
    24
  QInl,QInr :: i=>i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1097
diff changeset
    25
  qcase     :: [i=>i, i=>i, i]=>i
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
929
137035296ad6 Moved declarations of @QSUM and <*> to a syntax section.
lcp
parents: 753
diff changeset
    27
syntax
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1097
diff changeset
    28
  "@QSUM"   :: [idt, i, i] => i               ("(3QSUM _:_./ _)" 10)
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    29
  "<*>"     :: [i, i] => i                      (infixr 80)
929
137035296ad6 Moved declarations of @QSUM and <*> to a syntax section.
lcp
parents: 753
diff changeset
    30
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
translations
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
  "QSUM x:A. B"  => "QSigma(A, %x. B)"
44
00597b21a6a9 added parse rule for "<*>";
wenzelm
parents: 0
diff changeset
    33
  "A <*> B"      => "QSigma(A, _K(B))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
3923
c257b82a1200 global;
wenzelm
parents: 2469
diff changeset
    35
753
ec86863e87c8 replaced "rules" by "defs"
lcp
parents: 516
diff changeset
    36
defs
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
  QPair_def       "<a;b> == a+b"
1097
01379c46ad2d Changed definitions so that qsplit is now defined in terms of
lcp
parents: 929
diff changeset
    38
  qfst_def        "qfst(p) == THE a. EX b. p=<a;b>"
01379c46ad2d Changed definitions so that qsplit is now defined in terms of
lcp
parents: 929
diff changeset
    39
  qsnd_def        "qsnd(p) == THE b. EX a. p=<a;b>"
01379c46ad2d Changed definitions so that qsplit is now defined in terms of
lcp
parents: 929
diff changeset
    40
  qsplit_def      "qsplit(c,p) == c(qfst(p), qsnd(p))"
01379c46ad2d Changed definitions so that qsplit is now defined in terms of
lcp
parents: 929
diff changeset
    41
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
  qconverse_def   "qconverse(r) == {z. w:r, EX x y. w=<x;y> & z=<y;x>}"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
  QSigma_def      "QSigma(A,B)  ==  UN x:A. UN y:B(x). {<x;y>}"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
120
09287f26bfb8 changed all co- and co_ to co
lcp
parents: 44
diff changeset
    45
  qsum_def        "A <+> B      == ({0} <*> A) Un ({1} <*> B)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
  QInl_def        "QInl(a)      == <0;a>"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
  QInr_def        "QInr(b)      == <1;b>"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
  qcase_def       "qcase(c,d)   == qsplit(%y z. cond(y, d(z), c(z)))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
end
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
ML
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
val print_translation =
929
137035296ad6 Moved declarations of @QSUM and <*> to a syntax section.
lcp
parents: 753
diff changeset
    54
  [("QSigma", dependent_tr' ("@QSUM", "op <*>"))];