src/HOL/Relation.thy
 author berghofe Fri Jul 16 12:09:48 1999 +0200 (1999-07-16) changeset 7014 11ee650edcd2 parent 6806 43c081a0858d child 7912 0e42be14f136 permissions -rw-r--r--
Added some definitions and theorems needed for the
construction of datatypes involving function types.
```     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   fun_rel_comp :: "['a => 'b, ('b * 'c) set] => ('a => 'c) set"
```
```    48     "fun_rel_comp f R == {g. !x. (f x, g x) : R}"
```
```    49
```
```    50 syntax
```
```    51   reflexive :: "('a * 'a)set => bool"       (*reflexivity over a type*)
```
```    52
```
```    53 translations
```
```    54   "reflexive" == "refl UNIV"
```
```    55
```
```    56 end
```