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