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