src/HOL/Relation.thy
 author paulson Fri Nov 27 10:40:29 1998 +0100 (1998-11-27) changeset 5978 fa2c2dd74f8c parent 5608 a82a038a3e7a child 6806 43c081a0858d permissions -rw-r--r--
moved diag (diagonal relation) from Univ to Relation
1 (*  Title:      Relation.thy
2     ID:         \$Id\$
3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
4     Copyright   1996  University of Cambridge
5 *)
7 Relation = Prod +
9 consts
10   O           :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60)
11   converse    :: "('a*'b) set => ('b*'a) set"     ("(_^-1)" [1000] 999)
12   "^^"        :: "[('a*'b) set,'a set] => 'b set" (infixl 90)
14 defs
15   comp_def      "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
16   converse_def  "r^-1 == {(y,x). (x,y):r}"
17   Image_def     "r ^^ s == {y. ? x:s. (x,y):r}"
19 constdefs
20   Id          :: "('a * 'a)set"               (*the identity relation*)
21       "Id == {p. ? x. p = (x,x)}"
23   diag   :: "'a set => ('a * 'a)set"
24     "diag(A) == UN x:A. {(x,x)}"
26   Domain      :: "('a*'b) set => 'a set"
27     "Domain(r) == {x. ? y. (x,y):r}"
29   Range       :: "('a*'b) set => 'b set"
30     "Range(r) == Domain(r^-1)"
32   trans       :: "('a * 'a)set => bool"       (*transitivity predicate*)
33     "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
35   Univalent   :: "('a * 'b)set => bool"
36     "Univalent r == !x y. (x,y):r --> (!z. (x,z):r --> y=z)"
38 end