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
```     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 + "simpdata" +
```
```    15 consts
```
```    16   QPair     :: [i, i] => i                      ("<(_;/ _)>")
```
```    17   qfst,qsnd :: i => i
```
```    18   qsplit    :: [[i, i] => 'a, i] => 'a::logic  (*for pattern-matching*)
```
```    19   qconverse :: i => i
```
```    20   QSigma    :: [i, i => i] => i
```
```    21
```
```    22   "<+>"     :: [i,i]=>i                         (infixr 65)
```
```    23   QInl,QInr :: i=>i
```
```    24   qcase     :: [i=>i, i=>i, i]=>i
```
```    25
```
```    26 syntax
```
```    27   "@QSUM"   :: [idt, i, i] => i               ("(3QSUM _:_./ _)" 10)
```
```    28   "<*>"     :: [i, i] => i                      (infixr 80)
```
```    29
```
```    30 translations
```
```    31   "QSUM x:A. B"  => "QSigma(A, %x. B)"
```
```    32   "A <*> B"      => "QSigma(A, _K(B))"
```
```    33
```
```    34 defs
```
```    35   QPair_def       "<a;b> == a+b"
```
```    36   qfst_def        "qfst(p) == THE a. EX b. p=<a;b>"
```
```    37   qsnd_def        "qsnd(p) == THE b. EX a. p=<a;b>"
```
```    38   qsplit_def      "qsplit(c,p) == c(qfst(p), qsnd(p))"
```
```    39
```
```    40   qconverse_def   "qconverse(r) == {z. w:r, EX x y. w=<x;y> & z=<y;x>}"
```
```    41   QSigma_def      "QSigma(A,B)  ==  UN x:A. UN y:B(x). {<x;y>}"
```
```    42
```
```    43   qsum_def        "A <+> B      == ({0} <*> A) Un ({1} <*> B)"
```
```    44   QInl_def        "QInl(a)      == <0;a>"
```
```    45   QInr_def        "QInr(b)      == <1;b>"
```
```    46   qcase_def       "qcase(c,d)   == qsplit(%y z. cond(y, d(z), c(z)))"
```
```    47 end
```
```    48
```
```    49 ML
```
```    50
```
```    51 val print_translation =
```
```    52   [("QSigma", dependent_tr' ("@QSUM", "op <*>"))];
```