src/ZF/QPair.thy
author wenzelm
Fri Oct 17 17:40:02 1997 +0200 (1997-10-17)
changeset 3923 c257b82a1200
parent 2469 b50b8c0eec01
child 3940 1d5bee4d047f
permissions -rw-r--r--
global;
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
paulson@2469
    14
QPair = Sum +
wenzelm@3923
    15
wenzelm@3923
    16
global
wenzelm@3923
    17
clasohm@0
    18
consts
clasohm@1478
    19
  QPair     :: [i, i] => i                      ("<(_;/ _)>")
clasohm@1401
    20
  qfst,qsnd :: i => i
clasohm@1401
    21
  qsplit    :: [[i, i] => 'a, i] => 'a::logic  (*for pattern-matching*)
clasohm@1401
    22
  qconverse :: i => i
clasohm@1401
    23
  QSigma    :: [i, i => i] => i
clasohm@0
    24
clasohm@1478
    25
  "<+>"     :: [i,i]=>i                         (infixr 65)
clasohm@1401
    26
  QInl,QInr :: i=>i
clasohm@1401
    27
  qcase     :: [i=>i, i=>i, i]=>i
clasohm@0
    28
lcp@929
    29
syntax
clasohm@1401
    30
  "@QSUM"   :: [idt, i, i] => i               ("(3QSUM _:_./ _)" 10)
clasohm@1478
    31
  "<*>"     :: [i, i] => i                      (infixr 80)
lcp@929
    32
clasohm@0
    33
translations
clasohm@0
    34
  "QSUM x:A. B"  => "QSigma(A, %x. B)"
wenzelm@44
    35
  "A <*> B"      => "QSigma(A, _K(B))"
clasohm@0
    36
wenzelm@3923
    37
path QPair
wenzelm@3923
    38
lcp@753
    39
defs
clasohm@0
    40
  QPair_def       "<a;b> == a+b"
lcp@1097
    41
  qfst_def        "qfst(p) == THE a. EX b. p=<a;b>"
lcp@1097
    42
  qsnd_def        "qsnd(p) == THE b. EX a. p=<a;b>"
lcp@1097
    43
  qsplit_def      "qsplit(c,p) == c(qfst(p), qsnd(p))"
lcp@1097
    44
clasohm@0
    45
  qconverse_def   "qconverse(r) == {z. w:r, EX x y. w=<x;y> & z=<y;x>}"
clasohm@0
    46
  QSigma_def      "QSigma(A,B)  ==  UN x:A. UN y:B(x). {<x;y>}"
clasohm@0
    47
lcp@120
    48
  qsum_def        "A <+> B      == ({0} <*> A) Un ({1} <*> B)"
clasohm@0
    49
  QInl_def        "QInl(a)      == <0;a>"
clasohm@0
    50
  QInr_def        "QInr(b)      == <1;b>"
clasohm@0
    51
  qcase_def       "qcase(c,d)   == qsplit(%y z. cond(y, d(z), c(z)))"
clasohm@0
    52
end
clasohm@0
    53
clasohm@0
    54
ML
clasohm@0
    55
clasohm@0
    56
val print_translation =
lcp@929
    57
  [("QSigma", dependent_tr' ("@QSUM", "op <*>"))];