src/HOL/Relation.thy
changeset 1128 64b30e3cc6d4
child 1454 d0266c81a85e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/Relation.thy	Fri May 26 18:11:47 1995 +0200
     1.3 @@ -0,0 +1,27 @@
     1.4 +(*  Title: 	Relation.thy
     1.5 +    ID:         $Id$
     1.6 +    Author: 	Riccardo Mattolini, Dip. Sistemi e Informatica
     1.7 +        and	Lawrence C Paulson, Cambridge University Computer Laboratory
     1.8 +    Copyright   1994 Universita' di Firenze
     1.9 +    Copyright   1993  University of Cambridge
    1.10 +*)
    1.11 +
    1.12 +Relation = Prod +
    1.13 +consts
    1.14 +    id	        :: "('a * 'a)set"               (*the identity relation*)
    1.15 +    O	        :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60)
    1.16 +    trans       :: "('a * 'a)set => bool" 	(*transitivity predicate*)
    1.17 +    converse    :: "('a*'a) set => ('a*'a) set"
    1.18 +    "^^"        :: "[('a*'a) set,'a set] => 'a set" (infixl 90)
    1.19 +    Domain      :: "('a*'a) set => 'a set"
    1.20 +    Range       :: "('a*'a) set => 'a set"
    1.21 +defs
    1.22 +    id_def	"id == {p. ? x. p = (x,x)}"
    1.23 +    comp_def	(*composition of relations*)
    1.24 +		"r O s == {xz. ? x y z. xz = (x,z) & (x,y):s & (y,z):r}"
    1.25 +    trans_def	  "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
    1.26 +    converse_def  "converse(r) == {z. (? w:r. ? x y. w=(x,y) & z=(y,x))}"
    1.27 +    Domain_def    "Domain(r) == {z. ! x. (z=x --> (? y. (x,y):r))}"
    1.28 +    Range_def     "Range(r) == Domain(converse(r))"
    1.29 +    Image_def     "r ^^ s == {y. y:Range(r) &  (? x:s. (x,y):r)}"
    1.30 +end