src/ZF/QPair.thy
author clasohm
Tue Feb 06 12:27:17 1996 +0100 (1996-02-06)
changeset 1478 2b8c2a7547ab
parent 1401 0c439768f45c
child 2469 b50b8c0eec01
permissions -rw-r--r--
expanded tabs
clasohm@1478
     1
(*  Title:      ZF/qpair.thy
clasohm@0
     2
    ID:         $Id$
clasohm@1478
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1993  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Quine-inspired ordered pairs and disjoint sums, for non-well-founded data
clasohm@0
     7
structures in ZF.  Does not precisely follow Quine's construction.  Thanks
clasohm@0
     8
to Thomas Forster for suggesting this approach!
clasohm@0
     9
clasohm@0
    10
W. V. Quine, On Ordered Pairs and Relations, in Selected Logic Papers,
clasohm@0
    11
1966.
clasohm@0
    12
*)
clasohm@0
    13
clasohm@124
    14
QPair = Sum + "simpdata" +
clasohm@0
    15
consts
clasohm@1478
    16
  QPair     :: [i, i] => i                      ("<(_;/ _)>")
clasohm@1401
    17
  qfst,qsnd :: i => i
clasohm@1401
    18
  qsplit    :: [[i, i] => 'a, i] => 'a::logic  (*for pattern-matching*)
clasohm@1401
    19
  qconverse :: i => i
clasohm@1401
    20
  QSigma    :: [i, i => i] => i
clasohm@0
    21
clasohm@1478
    22
  "<+>"     :: [i,i]=>i                         (infixr 65)
clasohm@1401
    23
  QInl,QInr :: i=>i
clasohm@1401
    24
  qcase     :: [i=>i, i=>i, i]=>i
clasohm@0
    25
lcp@929
    26
syntax
clasohm@1401
    27
  "@QSUM"   :: [idt, i, i] => i               ("(3QSUM _:_./ _)" 10)
clasohm@1478
    28
  "<*>"     :: [i, i] => i                      (infixr 80)
lcp@929
    29
clasohm@0
    30
translations
clasohm@0
    31
  "QSUM x:A. B"  => "QSigma(A, %x. B)"
wenzelm@44
    32
  "A <*> B"      => "QSigma(A, _K(B))"
clasohm@0
    33
lcp@753
    34
defs
clasohm@0
    35
  QPair_def       "<a;b> == a+b"
lcp@1097
    36
  qfst_def        "qfst(p) == THE a. EX b. p=<a;b>"
lcp@1097
    37
  qsnd_def        "qsnd(p) == THE b. EX a. p=<a;b>"
lcp@1097
    38
  qsplit_def      "qsplit(c,p) == c(qfst(p), qsnd(p))"
lcp@1097
    39
clasohm@0
    40
  qconverse_def   "qconverse(r) == {z. w:r, EX x y. w=<x;y> & z=<y;x>}"
clasohm@0
    41
  QSigma_def      "QSigma(A,B)  ==  UN x:A. UN y:B(x). {<x;y>}"
clasohm@0
    42
lcp@120
    43
  qsum_def        "A <+> B      == ({0} <*> A) Un ({1} <*> B)"
clasohm@0
    44
  QInl_def        "QInl(a)      == <0;a>"
clasohm@0
    45
  QInr_def        "QInr(b)      == <1;b>"
clasohm@0
    46
  qcase_def       "qcase(c,d)   == qsplit(%y z. cond(y, d(z), c(z)))"
clasohm@0
    47
end
clasohm@0
    48
clasohm@0
    49
ML
clasohm@0
    50
clasohm@0
    51
val print_translation =
lcp@929
    52
  [("QSigma", dependent_tr' ("@QSUM", "op <*>"))];