src/HOL/Relation.thy
author paulson
Fri Oct 22 17:04:19 1999 +0200 (1999-10-22)
changeset 7912 0e42be14f136
parent 7014 11ee650edcd2
child 8268 722074b93cdd
permissions -rw-r--r--
tidied using modern infix form
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
paulson@5978
     9
constdefs
paulson@7912
    10
  converse :: "('a*'b) set => ('b*'a) set"               ("(_^-1)" [1000] 999)
paulson@7912
    11
    "r^-1 == {(y,x). (x,y):r}"
paulson@7912
    12
paulson@7912
    13
  comp  :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set"  (infixr "O" 60)
paulson@7912
    14
    "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
paulson@5978
    15
paulson@7912
    16
  Image :: "[('a*'b) set,'a set] => 'b set"                (infixl "^^" 90)
paulson@7912
    17
    "r ^^ s == {y. ? x:s. (x,y):r}"
paulson@7912
    18
paulson@7912
    19
  Id    :: "('a * 'a)set"                            (*the identity relation*)
paulson@7912
    20
    "Id == {p. ? x. p = (x,x)}"
paulson@7912
    21
paulson@7912
    22
  diag  :: "'a set => ('a * 'a)set"          (*diagonal: identity over a set*)
paulson@5978
    23
    "diag(A) == UN x:A. {(x,x)}"
paulson@5978
    24
  
paulson@6806
    25
  Domain :: "('a*'b) set => 'a set"
paulson@5978
    26
    "Domain(r) == {x. ? y. (x,y):r}"
paulson@5978
    27
paulson@6806
    28
  Range  :: "('a*'b) set => 'b set"
paulson@5978
    29
    "Range(r) == Domain(r^-1)"
paulson@5978
    30
paulson@6806
    31
  refl   :: "['a set, ('a*'a) set] => bool" (*reflexivity over a set*)
paulson@6806
    32
    "refl A r == r <= A Times A & (ALL x: A. (x,x) : r)"
paulson@6806
    33
paulson@6806
    34
  sym    :: "('a*'a) set=>bool"             (*symmetry predicate*)
paulson@6806
    35
    "sym(r) == ALL x y. (x,y): r --> (y,x): r"
paulson@6806
    36
paulson@6806
    37
  antisym:: "('a * 'a)set => bool"          (*antisymmetry predicate*)
paulson@6806
    38
    "antisym(r) == ALL x y. (x,y):r --> (y,x):r --> x=y"
paulson@6806
    39
paulson@6806
    40
  trans  :: "('a * 'a)set => bool"          (*transitivity predicate*)
paulson@5978
    41
    "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
paulson@5978
    42
paulson@6806
    43
  Univalent :: "('a * 'b)set => bool"
paulson@5978
    44
    "Univalent r == !x y. (x,y):r --> (!z. (x,z):r --> y=z)"
paulson@5978
    45
berghofe@7014
    46
  fun_rel_comp :: "['a => 'b, ('b * 'c) set] => ('a => 'c) set"
berghofe@7014
    47
    "fun_rel_comp f R == {g. !x. (f x, g x) : R}"
berghofe@7014
    48
paulson@6806
    49
syntax
paulson@6806
    50
  reflexive :: "('a * 'a)set => bool"       (*reflexivity over a type*)
paulson@6806
    51
paulson@6806
    52
translations
paulson@6806
    53
  "reflexive" == "refl UNIV"
paulson@6806
    54
nipkow@1128
    55
end