src/HOL/Relation.thy
author nipkow
Fri May 26 18:11:47 1995 +0200 (1995-05-26)
changeset 1128 64b30e3cc6d4
child 1454 d0266c81a85e
permissions -rw-r--r--
Trancl is now based on Relation which used to be in Integ.
nipkow@1128
     1
(*  Title: 	Relation.thy
nipkow@1128
     2
    ID:         $Id$
nipkow@1128
     3
    Author: 	Riccardo Mattolini, Dip. Sistemi e Informatica
nipkow@1128
     4
        and	Lawrence C Paulson, Cambridge University Computer Laboratory
nipkow@1128
     5
    Copyright   1994 Universita' di Firenze
nipkow@1128
     6
    Copyright   1993  University of Cambridge
nipkow@1128
     7
*)
nipkow@1128
     8
nipkow@1128
     9
Relation = Prod +
nipkow@1128
    10
consts
nipkow@1128
    11
    id	        :: "('a * 'a)set"               (*the identity relation*)
nipkow@1128
    12
    O	        :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60)
nipkow@1128
    13
    trans       :: "('a * 'a)set => bool" 	(*transitivity predicate*)
nipkow@1128
    14
    converse    :: "('a*'a) set => ('a*'a) set"
nipkow@1128
    15
    "^^"        :: "[('a*'a) set,'a set] => 'a set" (infixl 90)
nipkow@1128
    16
    Domain      :: "('a*'a) set => 'a set"
nipkow@1128
    17
    Range       :: "('a*'a) set => 'a set"
nipkow@1128
    18
defs
nipkow@1128
    19
    id_def	"id == {p. ? x. p = (x,x)}"
nipkow@1128
    20
    comp_def	(*composition of relations*)
nipkow@1128
    21
		"r O s == {xz. ? x y z. xz = (x,z) & (x,y):s & (y,z):r}"
nipkow@1128
    22
    trans_def	  "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
nipkow@1128
    23
    converse_def  "converse(r) == {z. (? w:r. ? x y. w=(x,y) & z=(y,x))}"
nipkow@1128
    24
    Domain_def    "Domain(r) == {z. ! x. (z=x --> (? y. (x,y):r))}"
nipkow@1128
    25
    Range_def     "Range(r) == Domain(converse(r))"
nipkow@1128
    26
    Image_def     "r ^^ s == {y. y:Range(r) &  (? x:s. (x,y):r)}"
nipkow@1128
    27
end