# Binary relation

In mathematics, the concept of **binary relation**, sometimes called **dyadic relation**, is exemplified by such ideas as "is greater than" and "is equal to" in arithmetic, or "is congruent to" in geometry, or "is an element of" or "is a subset of" in set theory. Functions are also a special case of binary relations. Put in lay terms, a binary relation is a statement about two objects that may be true or false depending on the choice of objects, for example, "4 is less than 5" is true, and the relation is "is less than".

## Contents

## Definition and examples

### Definition

Formally, a binary relation over a set *X* and a set *Y* is an ordered triple *R*=(*X*, *Y*, G(*R*)) where G(*R*), called the *graph* of the relation *R*, is a subset of the Cartesian product *X* × *Y*. If (*x*,*y*) ∈ G(*R*) then we say that *x* is *R*-related to *y* and write *xRy* or *R*(*x*,*y*).

A binary relation may also be thought of as a Boolean-valued binary function that takes as arguments an element *x* of *X* and an element *y* of *Y* and evaluates to true or false, depending on whether *xRy* or not.

### Remark

It is common practice to identify the relation with its graph, i.e. if R ⊆ X × Y we call R a relation over X,Y. The distinction becomes important when one asks if the relation is total or surjective, or when dealing with restrictions and composition of relations (in particular, functions).

### Example

Example: Suppose there are four objects: {ball, car, doll, gun} and four persons: {John, Mary, So, Venus}. Suppose that John owns the ball, Mary owns the doll, and Venus owns the car. No one owns the gun and So owns nothing. Then the binary relation "is owned by" is given as

*R*=({ball, car, doll, gun}, {John, Mary, So, Venus}, {(ball, John), (doll, Mary), (car, Venus)}).

Thus the first element of R is the set of objects, the second is the set of people, and the last element is a set of ordered pairs of the form ( object, owner ).

The pair (ball, John), denoted by _{ball}*R*_{John} means that the ball is owned by John.

Two different relations could have the same graph. For example: the relation

- ({ball, car, doll, gun}, {John, Mary, Venus}, {(ball,John), (doll, Mary), (car, Venus)})

is different from the previous one as everyone is an owner. But the graphs of the two relations are the same.

Nevertheless, *R* is usually identified or even defined as G(*R*) and "an ordered pair (*x*, *y*) ∈ G(*R*)" is usually denoted as "(*x*, *y*) ∈ *R*".

## Special types of relations

Some important classes of binary relations *R* over *X* and *Y* are:

**total**: for all*x*in*X*there exists a*y*in*Y*such that*xRy*(this definition for*total*is different from the one in the next section).**functional**: for all*x*in*X*, and*y*and*z*in*Y*it holds that if*xRy*and*xRz*then*y*=*z*.**surjective**: for all*y*in*Y*there exists an*x*in*X*such that*xRy*.**injective**: for all*x*and*z*in*X*and*y*in*Y*it holds that if*xRy*and*zRy*then*x*=*z*.

A binary relation that is functional is called a partial function; a binary relation that is both total and functional is called a function.

## Relations over a set

If *X* = *Y* then we simply say that the binary relation is over *X*. Or it is an **endorelation** over *X*.

Some important classes of binary relations over a set *X* are:

**reflexive**: for all*x*in*X*it holds that*xRx*. For example, "greater than or equal to" is a reflexive relation but "greater than" is not.**irreflexive**: for all*x*in*X*it holds that**not***xRx*. "Greater than" is an example of an irreflexive relation.**coreflexive**: for all*x*and*y*in*X*it holds that if*xRy*then*x*=*y*.**symmetric**: for all*x*and*y*in*X*it holds that if*xRy*then*yRx*. "Is a blood relative of" is a symmetric relation, because*x*is a blood relative of*y*if and only if*y*is a blood relative of*x*.**antisymmetric**: for all*x*and*y*in*X*it holds that if*xRy*and*yRx*then*x*=*y*. "Greater than or equal to" is an antisymmetric relation, because of*x*≥*y*and*y*≥*x*, then*x*=*y*.**transitive**: for all*x*,*y*and*z*in*X*it holds that if*xRy*and*yRz*then*xRz*. "Is an ancestor of" is a transitive relation, because if*x*is an ancestor of*y*and*y*is an ancestor of*z*, then*x*is an ancestor of*z*.**total**: for all*x*and*y*in*X*it holds that*xRy*or*yRx*(or both). "Is greater than or equal to" is an example of a total relation (this definition for*total*is different from the one in the previous section).**trichotomous**: for all*x*and*y*in*X*exactly one of*xRy*,*yRx*or*x*=*y*holds. "Is greater than" is an example of a trichotomous relation.**extendable**: for all*x*in*X*, there exists*y*in*X*such that*xRy*. "Is greater than" is an extendable relation on the integers. But it is not an extendable relation on the positive integers, because there is no*y*in the positive integers such that 1>*y*.**set-like**: for every*x*in*X*, the class of all*y*such that*yRx*is a set. (This makes sense only if we allow relations on proper classes.) The usual ordering < on the class of ordinal numbers is set-like, while its inverse <^{-1}is not.

A relation which is reflexive, symmetric and transitive is called an equivalence relation. A relation which is reflexive, antisymmetric and transitive is called a partial order. A partial order which is total is called a total order or a linear order or a chain. A linear order in which every nonempty set has the least element is called a well-order.

A relation which is symmetric, transitive, and extendable is also reflexive.

## Operations on binary relations

If *R* is a binary relation over *X*, then each of the following are binary relations over *X*:

**Converse**:*R*^{-1}⊆*Y*×*X*, defined as*R*^{-1}= { (y, x) | (x, y) ∈*R*}. A binary relation over a set is equal to its converse if and only if it is symmetric. The converse of a surjective and injective function is called its inverse.**Reflexive closure**:*R*^{=}, defined as*R*^{=}= { (*x*,*x*) |*x*∈*X*} ∪*R*or the smallest reflexive relation over*X*containing*R*. This can seen to be equal to the intersection of all reflexive relations containing*R*.**Transitive closure**:*R*^{+}, defined as the smallest transitive relation over*X*containing*R*. This can seen to be equal to the intersection of all transitive relations containing*R*.**Transitive-reflexive closure**:*R*^{*}, defined as*R*^{*}= (*R*^{+})^{=}.

If *R*, *S* are binary relations over *X* and *Y*, then each of the following are binary relations:

**Union**:*R*∪*S*⊆*X*×*Y*, defined as*R*∪*S*= { (*x*,*y*) | (*x*,*y*) ∈*R*or (*x*,*y*) ∈*S*}.**Intersection**:*R*∩*S*⊆*X*×*Y*, defined as*R*∩*S*= { (*x*,*y*) | (*x*,*y*) ∈*R*and (*x*,*y*) ∈*S*}.

If *R* is a binary relation over *X* and *Y*, and *S* is a binary relation over *Y* and *Z*, then the following is a binary relation over *X* and *Z*:

**Composition**:*S*o*R*(also denoted*R*o*S*), defined as*S*o*R*= { (*x*,*z*) | there exists*y*∈*Y*, such that (*x*,*y*) ∈*R*and (*y*,*z*) ∈*S*}. The order of*R*and*S*in the notation*S*o*R*, used above agrees with the standard notational order for composition of functions.

## Related topics

- Reflexive relation
- Relation (mathematics)
- Function
- Equivalence relation
- Partial order
- Total order
- Well-order
- Correspondence

cs:Binární relace et:Binaarne seos es:Relación binaria fr:Relation binaire he:יחס it:Relazione binaria ja:二項関係 pl:Relacja (matematyka) ru:Бинарное отношение uk:Бінарне відношення zh:二元关系