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