src/HOL/Relation.thy
author nipkow
Thu Oct 12 18:38:23 2000 +0200 (2000-10-12)
changeset 10212 33fe2d701ddd
parent 8703 816d8f6513be
child 10358 ef2a753cda2a
permissions -rw-r--r--
*** empty log message ***
     1 (*  Title:      Relation.thy
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   1996  University of Cambridge
     5 *)
     6 
     7 Relation = Product_Type +
     8 
     9 constdefs
    10   converse :: "('a*'b) set => ('b*'a) set"               ("(_^-1)" [1000] 999)
    11     "r^-1 == {(y,x). (x,y):r}"
    12 
    13   comp  :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set"  (infixr "O" 60)
    14     "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
    15 
    16   Image :: "[('a*'b) set,'a set] => 'b set"                (infixl "^^" 90)
    17     "r ^^ s == {y. ? x:s. (x,y):r}"
    18 
    19   Id    :: "('a * 'a)set"                            (*the identity relation*)
    20     "Id == {p. ? x. p = (x,x)}"
    21 
    22   diag  :: "'a set => ('a * 'a)set"          (*diagonal: identity over a set*)
    23     "diag(A) == UN x:A. {(x,x)}"
    24   
    25   Domain :: "('a*'b) set => 'a set"
    26     "Domain(r) == {x. ? y. (x,y):r}"
    27 
    28   Range  :: "('a*'b) set => 'b set"
    29     "Range(r) == Domain(r^-1)"
    30 
    31   refl   :: "['a set, ('a*'a) set] => bool" (*reflexivity over a set*)
    32     "refl A r == r <= A <*> A & (ALL x: A. (x,x) : r)"
    33 
    34   sym    :: "('a*'a) set=>bool"             (*symmetry predicate*)
    35     "sym(r) == ALL x y. (x,y): r --> (y,x): r"
    36 
    37   antisym:: "('a * 'a)set => bool"          (*antisymmetry predicate*)
    38     "antisym(r) == ALL x y. (x,y):r --> (y,x):r --> x=y"
    39 
    40   trans  :: "('a * 'a)set => bool"          (*transitivity predicate*)
    41     "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
    42 
    43   univalent :: "('a * 'b)set => bool"
    44     "univalent r == !x y. (x,y):r --> (!z. (x,z):r --> y=z)"
    45 
    46   fun_rel_comp :: "['a => 'b, ('b * 'c) set] => ('a => 'c) set"
    47     "fun_rel_comp f R == {g. !x. (f x, g x) : R}"
    48 
    49 syntax
    50   reflexive :: "('a * 'a)set => bool"       (*reflexivity over a type*)
    51 
    52 translations
    53   "reflexive" == "refl UNIV"
    54 
    55 end