src/HOL/Relation.thy
author nipkow
Tue Jan 09 15:22:13 2001 +0100 (2001-01-09)
changeset 10832 e33b47e4246d
parent 10797 028d22926a41
child 11136 e34e7f6d9b57
permissions -rw-r--r--
`` -> and ``` -> ``
wenzelm@10358
     1
(*  Title:      HOL/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@10212
     7
Relation = Product_Type +
paulson@5978
     8
paulson@5978
     9
constdefs
wenzelm@10358
    10
  converse :: "('a * 'b) set => ('b * 'a) set"    ("(_^-1)" [1000] 999)
wenzelm@10358
    11
  "r^-1 == {(y, x). (x, y) : r}"
wenzelm@10358
    12
syntax (xsymbols)
wenzelm@10358
    13
  converse :: "('a * 'b) set => ('b * 'a) set"    ("(_\\<inverse>)" [1000] 999)
paulson@7912
    14
wenzelm@10358
    15
constdefs
paulson@7912
    16
  comp  :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set"  (infixr "O" 60)
paulson@7912
    17
    "r O s == {(x,z). ? y. (x,y):s & (y,z):r}"
paulson@5978
    18
nipkow@10832
    19
  Image :: "[('a*'b) set,'a set] => 'b set"                (infixl "``" 90)
nipkow@10832
    20
    "r `` s == {y. ? x:s. (x,y):r}"
paulson@7912
    21
paulson@7912
    22
  Id    :: "('a * 'a)set"                            (*the identity relation*)
paulson@7912
    23
    "Id == {p. ? x. p = (x,x)}"
paulson@7912
    24
paulson@7912
    25
  diag  :: "'a set => ('a * 'a)set"          (*diagonal: identity over a set*)
paulson@5978
    26
    "diag(A) == UN x:A. {(x,x)}"
paulson@5978
    27
  
paulson@6806
    28
  Domain :: "('a*'b) set => 'a set"
paulson@5978
    29
    "Domain(r) == {x. ? y. (x,y):r}"
paulson@5978
    30
paulson@6806
    31
  Range  :: "('a*'b) set => 'b set"
paulson@5978
    32
    "Range(r) == Domain(r^-1)"
paulson@5978
    33
paulson@10786
    34
  Field :: "('a*'a)set=>'a set"
paulson@10786
    35
    "Field r == Domain r Un Range r"
paulson@10786
    36
paulson@6806
    37
  refl   :: "['a set, ('a*'a) set] => bool" (*reflexivity over a set*)
nipkow@8703
    38
    "refl A r == r <= A <*> A & (ALL x: A. (x,x) : r)"
paulson@6806
    39
paulson@6806
    40
  sym    :: "('a*'a) set=>bool"             (*symmetry predicate*)
paulson@6806
    41
    "sym(r) == ALL x y. (x,y): r --> (y,x): r"
paulson@6806
    42
paulson@6806
    43
  antisym:: "('a * 'a)set => bool"          (*antisymmetry predicate*)
paulson@6806
    44
    "antisym(r) == ALL x y. (x,y):r --> (y,x):r --> x=y"
paulson@6806
    45
paulson@6806
    46
  trans  :: "('a * 'a)set => bool"          (*transitivity predicate*)
paulson@5978
    47
    "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)"
paulson@5978
    48
nipkow@10797
    49
  single_valued :: "('a * 'b)set => bool"
nipkow@10797
    50
    "single_valued r == !x y. (x,y):r --> (!z. (x,z):r --> y=z)"
paulson@5978
    51
berghofe@7014
    52
  fun_rel_comp :: "['a => 'b, ('b * 'c) set] => ('a => 'c) set"
berghofe@7014
    53
    "fun_rel_comp f R == {g. !x. (f x, g x) : R}"
berghofe@7014
    54
paulson@6806
    55
syntax
paulson@6806
    56
  reflexive :: "('a * 'a)set => bool"       (*reflexivity over a type*)
paulson@6806
    57
translations
paulson@6806
    58
  "reflexive" == "refl UNIV"
paulson@6806
    59
nipkow@1128
    60
end