src/HOL/Relation.thy
author paulson
Thu Jun 10 10:35:58 1999 +0200 (1999-06-10)
changeset 6806 43c081a0858d
parent 5978 fa2c2dd74f8c
child 7014 11ee650edcd2
permissions -rw-r--r--
new preficates refl, sym [from Integ/Equiv], antisym
     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 = Prod +
     8 
     9 consts
    10   O           :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60)
    11   converse    :: "('a*'b) set => ('b*'a) set"     ("(_^-1)" [1000] 999)
    12   "^^"        :: "[('a*'b) set,'a set] => 'b set" (infixl 90)
    13   
    14 defs
    15   comp_def      "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
    16   converse_def  "r^-1 == {(y,x). (x,y):r}"
    17   Image_def     "r ^^ s == {y. ? x:s. (x,y):r}"
    18   
    19 constdefs
    20   Id     :: "('a * 'a)set"                 (*the identity relation*)
    21       "Id == {p. ? x. p = (x,x)}"
    22 
    23   diag   :: "'a set => ('a * 'a)set"
    24     "diag(A) == UN x:A. {(x,x)}"
    25   
    26   Domain :: "('a*'b) set => 'a set"
    27     "Domain(r) == {x. ? y. (x,y):r}"
    28 
    29   Range  :: "('a*'b) set => 'b set"
    30     "Range(r) == Domain(r^-1)"
    31 
    32   refl   :: "['a set, ('a*'a) set] => bool" (*reflexivity over a set*)
    33     "refl A r == r <= A Times A & (ALL x: A. (x,x) : r)"
    34 
    35   sym    :: "('a*'a) set=>bool"             (*symmetry predicate*)
    36     "sym(r) == ALL x y. (x,y): r --> (y,x): r"
    37 
    38   antisym:: "('a * 'a)set => bool"          (*antisymmetry predicate*)
    39     "antisym(r) == ALL x y. (x,y):r --> (y,x):r --> x=y"
    40 
    41   trans  :: "('a * 'a)set => bool"          (*transitivity predicate*)
    42     "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
    43 
    44   Univalent :: "('a * 'b)set => bool"
    45     "Univalent r == !x y. (x,y):r --> (!z. (x,z):r --> y=z)"
    46 
    47 syntax
    48   reflexive :: "('a * 'a)set => bool"       (*reflexivity over a type*)
    49 
    50 translations
    51   "reflexive" == "refl UNIV"
    52 
    53 end