src/HOL/Relation.thy
 author wenzelm Thu Jan 23 14:19:16 1997 +0100 (1997-01-23) changeset 2545 d10abc8c11fb parent 1983 f3f7bf0079fa child 3439 54785105178c permissions -rw-r--r--
```     1 (*  Title:      Relation.thy
```
```     2     ID:         \$Id\$
```
```     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
```
```     4     Copyright   1996  University of Cambridge
```
```     5 *)
```
```     6
```
```     7 Relation = Prod +
```
```     8 consts
```
```     9     id          :: "('a * 'a)set"               (*the identity relation*)
```
```    10     O           :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60)
```
```    11     trans       :: "('a * 'a)set => bool"       (*transitivity predicate*)
```
```    12     converse    :: "('a*'b) set => ('b*'a) set"
```
```    13     "^^"        :: "[('a*'b) set,'a set] => 'b set" (infixl 90)
```
```    14     Domain      :: "('a*'b) set => 'a set"
```
```    15     Range       :: "('a*'b) set => 'b set"
```
```    16 defs
```
```    17     id_def        "id == {p. ? x. p = (x,x)}"
```
```    18     comp_def      "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
```
```    19     trans_def     "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
```
```    20     converse_def  "converse(r) == {(y,x). (x,y):r}"
```
```    21     Domain_def    "Domain(r) == {x. ? y. (x,y):r}"
```
```    22     Range_def     "Range(r) == Domain(converse(r))"
```
```    23     Image_def     "r ^^ s == {y. ? x:s. (x,y):r}"
```
```    24 end
```