src/HOL/Relation.thy
author paulson
Mon Dec 07 18:26:25 1998 +0100 (1998-12-07)
changeset 6019 0e55c2fb2ebb
parent 5978 fa2c2dd74f8c
child 6806 43c081a0858d
permissions -rw-r--r--
tidying
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 +
paulson@5978
     8
nipkow@1128
     9
consts
paulson@5978
    10
  O           :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60)
paulson@5978
    11
  converse    :: "('a*'b) set => ('b*'a) set"     ("(_^-1)" [1000] 999)
paulson@5978
    12
  "^^"        :: "[('a*'b) set,'a set] => 'b set" (infixl 90)
paulson@5978
    13
  
nipkow@1128
    14
defs
paulson@5978
    15
  comp_def      "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
paulson@5978
    16
  converse_def  "r^-1 == {(y,x). (x,y):r}"
paulson@5978
    17
  Image_def     "r ^^ s == {y. ? x:s. (x,y):r}"
paulson@5978
    18
  
paulson@5978
    19
constdefs
paulson@5978
    20
  Id          :: "('a * 'a)set"               (*the identity relation*)
paulson@5978
    21
      "Id == {p. ? x. p = (x,x)}"
paulson@5978
    22
paulson@5978
    23
  diag   :: "'a set => ('a * 'a)set"
paulson@5978
    24
    "diag(A) == UN x:A. {(x,x)}"
paulson@5978
    25
  
paulson@5978
    26
  Domain      :: "('a*'b) set => 'a set"
paulson@5978
    27
    "Domain(r) == {x. ? y. (x,y):r}"
paulson@5978
    28
paulson@5978
    29
  Range       :: "('a*'b) set => 'b set"
paulson@5978
    30
    "Range(r) == Domain(r^-1)"
paulson@5978
    31
paulson@5978
    32
  trans       :: "('a * 'a)set => bool"       (*transitivity predicate*)
paulson@5978
    33
    "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
paulson@5978
    34
paulson@5978
    35
  Univalent   :: "('a * 'b)set => bool"
paulson@5978
    36
    "Univalent r == !x y. (x,y):r --> (!z. (x,z):r --> y=z)"
paulson@5978
    37
nipkow@1128
    38
end