src/HOL/Relation.thy
author clasohm
Mon Feb 05 21:27:16 1996 +0100 (1996-02-05)
changeset 1475 7f5a4cd08209
parent 1454 d0266c81a85e
child 1695 0f9b9eda2a2c
permissions -rw-r--r--
expanded tabs; renamed subtype to typedef;
incorporated Konrad's changes
clasohm@1475
     1
(*  Title:      Relation.thy
nipkow@1128
     2
    ID:         $Id$
clasohm@1475
     3
    Author:     Riccardo Mattolini, Dip. Sistemi e Informatica
clasohm@1475
     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
clasohm@1475
    11
    id          :: "('a * 'a)set"               (*the identity relation*)
clasohm@1475
    12
    O           :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60)
clasohm@1475
    13
    trans       :: "('a * 'a)set => bool"       (*transitivity predicate*)
nipkow@1454
    14
    converse    :: "('a * 'b)set => ('b * 'a)set"
nipkow@1454
    15
    "^^"        :: "[('a * 'b) set, 'a set] => 'b set" (infixl 90)
nipkow@1454
    16
    Domain      :: "('a * 'b) set => 'a set"
nipkow@1454
    17
    Range       :: "('a * 'b) set => 'b set"
nipkow@1128
    18
defs
clasohm@1475
    19
    id_def      "id == {p. ? x. p = (x,x)}"
clasohm@1475
    20
    comp_def    "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
clasohm@1475
    21
    trans_def     "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
nipkow@1454
    22
    converse_def  "converse(r) == {(y,x). (x,y):r}"
nipkow@1454
    23
    Domain_def    "Domain(r) == {x. ? y. (x,y):r}"
nipkow@1128
    24
    Range_def     "Range(r) == Domain(converse(r))"
nipkow@1128
    25
    Image_def     "r ^^ s == {y. y:Range(r) &  (? x:s. (x,y):r)}"
nipkow@1128
    26
end