Transitive binary relations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

✗ indicates that the property may, or may not hold. All definitions tacitly require the homogeneous relation be transitive: for all if and then and there are additional properties that a homogeneous relation may satisfy. | indicates that the column's property is required by the definition of the row's term (at the very left). For example, the definition of an equivalence relation requires it to be symmetric.

In mathematics, a **binary relation** is a general concept that defines some relation between the elements of two sets. It is a generalization of the more commonly understood idea of a mathematical function, but with fewer restrictions. A binary relation over sets X and Y is a set of ordered pairs (*x*, *y*) consisting of elements x in X and y in Y.^{[1]} It encodes the common concept of relation: an element x is *related* to an element y, if and only if the pair (*x*, *y*) belongs to the set of ordered pairs that defines the *binary relation*. A binary relation is the most studied special case *n* = 2 of an n-ary relation over sets *X*_{1}, ..., *X*_{n}, which is a subset of the Cartesian product *X*_{1} × ... × *X*_{n}.^{[1]}

A trivial example of a binary relation over set X of all real numbers () and set Y of all real numbers () is the set of all pairs for which elements . This is equivalent to the function .

Another example of a binary relation is the "divides" relation over the set of prime numbers and the set of integers , in which each prime p is related to each integer z that is a multiple of p, but not to an integer that is not a multiple of p. In this relation, for instance, the prime number 2 is related to numbers such as −4, 0, 6, 10, but not to 1 or 9, just as the prime number 3 is related to 0, 6, and 9, but not to 4 or 13.

Binary relations are used in many branches of mathematics to model a wide variety of concepts. These include, among others:

- the "is greater than", "is equal to", and "divides" relations in arithmetic;
- the "is congruent to" relation in geometry;
- the "is adjacent to" relation in graph theory;
- the "is orthogonal to" relation in linear algebra.

A function may be defined as a special kind of binary relation.^{[2]} Binary relations are also heavily used in computer science, such as in a relational database management system (RDBMS).

A binary relation over sets X and Y is an element of the power set of *X* × *Y*. Since the latter set is ordered by inclusion (⊆), each relation has a place in the lattice of subsets of *X* × *Y*. A binary relation is either a homogeneous relation or a heterogeneous relation depending on whether *X* = *Y* or not.

Since relations are sets, they can be manipulated using set operations, including union, intersection, and complementation, and satisfying the laws of an algebra of sets. Beyond that, operations like the converse of a relation and the composition of relations are available, satisfying the laws of a calculus of relations, for which there are textbooks by Ernst Schröder,^{[3]} Clarence Lewis,^{[4]} and Gunther Schmidt.^{[5]} A deeper analysis of relations involves decomposing them into subsets called *concepts*, and placing them in a complete lattice.

In some systems of axiomatic set theory, relations are extended to classes, which are generalizations of sets. This extension is needed for, among other things, modeling the concepts of "is an element of" or "is a subset of" in set theory, without running into logical inconsistencies such as Russell's paradox.

The terms *correspondence*,^{[6]} *dyadic relation* and *two-place relation* are synonyms for binary relation, though some authors use the term "binary relation" for any subset of a Cartesian product *X* × *Y* without reference to X and Y, and reserve the term "correspondence" for a binary relation with reference to X and Y.

Given sets *X* and *Y*, the Cartesian product *X* × *Y* is defined as {(*x*, *y*) | *x* ∈ *X* and *y* ∈ *Y*}, and its elements are called ordered pairs.

A *binary relation* *R* over sets *X* and *Y* is a subset of *X* × *Y*.^{[1]}^{[7]} The set *X* is called the **domain**^{[1]} or *set of departure* of *R*, and the set *Y* the *codomain* or *set of destination* of *R*. In order to specify the choices of the sets *X* and *Y*, some authors define a *binary relation* or *correspondence* as an ordered triple (*X*, *Y*, *G*), where *G* is a subset of *X* × *Y* called the *graph* of the binary relation. The statement (*x*, *y*) ∈ *R* reads "*x* is *R*-related to *y*" and is written in infix notation as *xRy*.^{[3]}^{[4]}^{[5]}^{[note 1]} The *domain of definition* or *active domain*^{[1]} of *R* is the set of all *x* such that *xRy* for at least one *y*. The *codomain of definition*, *active codomain*,^{[1]} *image* or *range* of *R* is the set of all *y* such that *xRy* for at least one *x*. The *field* of *R* is the union of its domain of definition and its codomain of definition.^{[9]}^{[10]}^{[11]}

When *X* = *Y*, a binary relation is called a *homogeneous relation* (or *endorelation*). Otherwise it is a *heterogeneous relation*.^{[12]}^{[13]}^{[14]}

In a binary relation, the order of the elements is important; if *x* ≠ *y* then *yRx* can be true or false independently of *xRy*. For example, 3 divides 9, but 9 does not divide 3.

AB′ |
ball | car | doll | cup |
---|---|---|---|---|

John | + |
− | − | − |

Mary | − | − | + |
− |

Venus | − | + |
− | − |

AB |
ball | car | doll | cup |
---|---|---|---|---|

John | + |
− | − | − |

Mary | − | − | + |
− |

Ian | − | − | − | − |

Venus | − | + |
− | − |

The following example shows that the choice of codomain is important. Suppose there are four objects *A* = {ball, car, doll, cup} and four people *B* = {John, Mary, Ian, Venus}. A possible relation on *A* and *B* is the relation "is owned by", given by *R* = {(ball, John), (doll, Mary), (car, Venus)}. That is, John owns the ball, Mary owns the doll, and Venus owns the car. Nobody owns the cup and Ian owns nothing, see 1st example. As a set, *R* does not involve Ian, and therefore *R* could have been viewed as a subset of *A* × {John, Mary, Venus}, i.e. a relation over *A* and {John, Mary, Venus}, see 2nd example. While the 2nd example relation is surjective (see below), the 1st is not.

Some important types of binary relations *R* over sets *X* and *Y* are listed below.

Uniqueness properties:

*Injective*(also called*left-unique*)^{[15]}- For all
*x*,*z*∈*X*and all*y*∈*Y*, if*xRy*and*zRy*then*x*=*z*. For such a relation, {*Y*} is called*a primary key*of*R*.^{[1]}For example, the green and blue binary relations in the diagram are injective, but the red one is not (as it relates both −1 and 1 to 1), nor the black one (as it relates both −1 and 1 to 0). *Functional*(also called*right-unique*,^{[15]}*right-definite*^{[16]}or*univalent*)^{[5]}For all*x*∈*X*and all*y*,*z*∈*Y*, if*xRy*and*xRz*then*y*=*z*. Such a binary relation is called a*partial function*. For such a relation, {*X*} is called*a primary key*of*R*.^{[1]}For example, the red and green binary relations in the diagram are functional, but the blue one is not (as it relates 1 to both −1 and 1), nor the black one (as it relates 0 to both −1 and 1).*One-to-one*- Injective and functional. For example, the green binary relation in the diagram is one-to-one, but the red, blue and black ones are not.
*One-to-many*- Injective and not functional. For example, the blue binary relation in the diagram is one-to-many, but the red, green and black ones are not.
*Many-to-one*- Functional and not injective. For example, the red binary relation in the diagram is many-to-one, but the green, blue and black ones are not.
*Many-to-many*- Not injective nor functional. For example, the black binary relation in the diagram is many-to-many, but the red, green and blue ones are not.

Totality properties (only definable if the domain *X* and codomain *Y* are specified):

*Total*(also called*left-total*)- For all
*x*in*X*there exists a*y*in*Y*such that*xRy*. In other words, the domain of definition of*R*is equal to*X*. This property is different from the definition of*connected*(also called*total*by some authors)^{[citation needed]}in the section Properties. Such a binary relation is called a*multivalued function*. For example, the red and green binary relations in the diagram are total, but the blue one is not (as it does not relate −1 to any real number), nor the black one (as it does not relate 2 to any real number). *Surjective*(also called*right-total*^{[15]}or*onto*)- For all
*y*in*Y*, there exists an*x*in*X*such that*xRy*. In other words, the codomain of definition of*R*is equal to*Y*. For example, the green and blue binary relations in the diagram are surjective, but the red one is not (as it does not relate any real number to −1), nor the black one (as it does not relate any real number to 2).

Uniqueness and totality properties (only definable if the domain *X* and codomain *Y* are specified):

- A
*function* - A binary relation that is functional and serial. For example, the red and green binary relations in the diagram are functions, but the blue and black ones are not.
- An
*injection* - A function that is injective. For example, the green binary relation in the diagram is an injection, but the red, blue and black ones are not.
- A
*surjection* - A function that is surjective. For example, the green binary relation in the diagram is a surjection, but the red, blue and black ones are not.
- A
*bijection* - A function that is injective and surjective. For example, the green binary relation in the diagram is a bijection, but the red, blue and black ones are not.

If *R* and *S* are binary relations over sets *X* and *Y* then *R* ∪ *S* = {(*x*, *y*) | *xRy* or *xSy*} is the *union relation* of *R* and *S* over *X* and *Y*.

The identity element is the empty relation. For example, ≤ is the union of < and =, and ≥ is the union of > and =.

If *R* and *S* are binary relations over sets *X* and *Y* then *R* ∩ *S* = {(*x*, *y*) | *xRy* and *xSy*} is the *intersection relation* of *R* and *S* over *X* and *Y*.

The identity element is the universal relation. For example, the relation "is divisible by 6" is the intersection of the relations "is divisible by 3" and "is divisible by 2".

Main article: Composition of relations |

If *R* is a binary relation over sets *X* and *Y*, and *S* is a binary relation over sets *Y* and *Z* then *S* ∘ *R* = {(*x*, *z*) | there exists *y* ∈ *Y* such that *xRy* and *ySz*} (also denoted by *R*; *S*) is the *composition relation* of *R* and *S* over *X* and *Z*.

The identity element is the identity relation. The order of *R* and *S* in the notation *S* ∘ *R*, used here agrees with the standard notational order for composition of functions. For example, the composition "is mother of" ∘ "is parent of" yields "is maternal grandparent of", while the composition "is parent of" ∘ "is mother of" yields "is grandmother of". For the former case, if *x* is the parent of *y* and *y* is the mother of *z*, then *x* is the maternal grandparent of *z*.

Main article: Converse relation |

See also: Duality (order theory) |

If *R* is a binary relation over sets *X* and *Y* then *R*^{T} = {(*y*, *x*) | *xRy*} is the *converse relation* of *R* over *Y* and *X*.

For example, = is the converse of itself, as is ≠, and < and > are each other's converse, as are ≤ and ≥. A binary relation is equal to its converse if and only if it is symmetric.

Main article: Complementary relation |

If *R* is a binary relation over sets *X* and *Y* then *R* = {(*x*, *y*) | not *xRy*} (also denoted by or ¬ *R**R*) is the *complementary relation* of *R* over *X* and *Y*.

For example, = and ≠ are each other's complement, as are ⊆ and ⊈, ⊇ and ⊉, and ∈ and ∉, and, for total orders, also < and ≥, and > and ≤.

The complement of the converse relation *R*^{T} is the converse of the complement:

If *X* = *Y*, the complement has the following properties:

- If a relation is symmetric, then so is the complement.
- The complement of a reflexive relation is irreflexive—and vice versa.
- The complement of a strict weak order is a total preorder—and vice versa.

Main article: Restriction (mathematics) |

If *R* is a binary homogeneous relation over a set *X* and *S* is a subset of *X* then *R*_{|S} = {(*x*, *y*) | *xRy* and *x* ∈ *S* and *y* ∈ *S*} is the *restriction relation* of *R* to *S* over *X*.

If *R* is a binary relation over sets *X* and *Y* and if *S* is a subset of *X* then *R*_{|S} = {(*x*, *y*) | *xRy* and *x* ∈ *S*} is the *left-restriction relation* of *R* to *S* over *X* and *Y*.

If *R* is a binary relation over sets *X* and *Y* and if *S* is a subset of *Y* then *R*^{|S} = {(*x*, *y*) | *xRy* and *y* ∈ *S*} is the *right-restriction relation* of *R* to *S* over *X* and *Y*.

If a relation is reflexive, irreflexive, symmetric, antisymmetric, asymmetric, transitive, total, trichotomous, a partial order, total order, strict weak order, total preorder (weak order), or an equivalence relation, then so too are its restrictions.

However, the transitive closure of a restriction is a subset of the restriction of the transitive closure, i.e., in general not equal. For example, restricting the relation "*x* is parent of *y*" to females yields the relation "*x* is mother of the woman *y*"; its transitive closure doesn't relate a woman with her paternal grandmother. On the other hand, the transitive closure of "is parent of" is "is ancestor of"; its restriction to females does relate a woman with her paternal grandmother.

Also, the various concepts of completeness (not to be confused with being "total") do not carry over to restrictions. For example, over the real numbers a property of the relation ≤ is that every non-empty subset *S* of **R** with an upper bound in **R** has a least upper bound (also called supremum) in **R**. However, for the rational numbers this supremum is not necessarily rational, so the same property does not hold on the restriction of the relation ≤ to the rational numbers.

A binary relation *R* over sets *X* and *Y* is said to be ((em|contained in a relation *S* over *X* and *Y*, written if *R* is a subset of *S*, that is, for all and if *xRy*, then *xSy*. If *R* is contained in *S* and *S* is contained in *R*, then *R* and *S* are called *equal* written *R* = *S*. If *R* is contained in *S* but *S* is not contained in *R*, then *R* is said to be *smaller* than *S*, written *R* ⊊ *S*. For example, on the rational numbers, the relation > is smaller than ≥, and equal to the composition > ∘ >.

A *homogeneous relation*(also called *endorelation*) over a set *X* is a binary relation over *X* and itself, i.e. it is a subset of the Cartesian product *X* × *X*.^{[14]}^{[17]}^{[18]} It is also simply called a (binary) relation over *X*. An example of a homogeneous relation is the relation of kinship, where the relation is over people.

A homogeneous relation *R* over a set *X* may be identified with a directed simple graph permitting loops, or if it is symmetric, with an undirected simple graph permitting loops, where *X* is the vertex set and *R* is the edge set (there is an edge from a vertex *x* to a vertex *y* if and only if *xRy*). It is called the *adjacency relation* of the graph.

The set of all homogeneous relations over a set *X* is the set 2^{X × X} which is a Boolean algebra augmented with the involution of mapping of a relation to its converse relation. Considering composition of relations as a binary operation on , it forms a semigroup with involution.

Some important particular homogeneous relations over a set *X* are:

- The
*empty relation* *E*= ∅ ⊆*X*×*X*;- The
*universal relation* *U*=*X*×*X*;- The
*identity relation* *I*= {(*x*,*x*) |*x*∈*X*}.

For arbitrary elements *x* and *y* of *X*:

- xEy holds never;
- xUy holds always;
- xIy holds if and only if
*x*=*y*.

Some important properties that a homogeneous relation R over a set X may have are:

*Reflexive*- for all
*x*∈*X*,*xRx*. For example, ≥ is a reflexive relation but > is not. *Irreflexive*(or*strict*)- for all
*x*∈*X*, not*xRx*. For example, > is an irreflexive relation, but ≥ is not.

The previous 2 alternatives are not exhaustive; e.g., the red binary relation *y* = *x*^{2} given in the section § Special types of binary relations is neither irreflexive, nor reflexive, since it contains the pair (0, 0), but not (2, 2), respectively.

*Symmetric*- for all
*x*,*y*∈*X*, if*xRy*then*yRx*. For example, "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*,*y*∈*X*, if*xRy*and*yRx*then*x*=*y*. For example, ≥ is an antisymmetric relation; so is >, but vacuously (the condition in the definition is always false).^{[19]} *Asymmetric*- for all
*x*,*y*∈*X*, if*xRy*then not*yRx*. A relation is asymmetric if and only if it is both antisymmetric and irreflexive.^{[20]}For example, > is an asymmetric relation, but ≥ is not.

Again, the previous 3 alternatives are far from being exhaustive; as an example over the natural numbers, the relation *xRy* defined by *x* > 2 is neither symmetric nor antisymmetric, let alone asymmetric.

*Transitive*- for all
*x*,*y*,*z*∈*X*, if*xRy*and*yRz*then*xRz*. A transitive relation is irreflexive if and only if it is asymmetric.^{[21]}For example, "is ancestor of" is a transitive relation, while "is parent of" is not.

*Dense*- for all
*x*,*y*∈*X*such that*xRy*, there exists some*z*∈*X*such that*xRz*and*zRy*. This is used in dense orders. *Connected*- for all
*x*,*y*∈*X*, if*x*≠*y*then*xRy*or*yRx*. This property is sometimes called "total", which is distinct from the definitions of "total" given in the section Special types of binary relations. *Strongly connected*- for all
*x*,*y*∈*X*,*xRy*or*yRx*. This property is sometimes called "total", which is distinct from the definitions of "total" given in the section Special types of binary relations. *Trichotomous*- for all
*x*,*y*∈*X*, exactly one of*xRy*,*yRx*or*x*=*y*holds. For example, > is a trichotomous relation, while the relation "divides" over the natural numbers is not.^{[22]} *Serial*(or*left-total*)- for all
*x*∈*X*, there exists some*y*∈*X*such that*xRy*. For example, > is a serial relation over the integers. But it is not a serial relation over the positive integers, because there is no y in the positive integers such that 1 >*y*.^{[23]}However, < is a serial relation over the positive integers, the rational numbers and the real numbers. Every reflexive relation is serial: for a given x, choose*y*=*x*. *Well-founded*- every nonempty subset S of X contains a minimal element with respect to R. Well-foundedness implies the descending chain condition (that is, no infinite chain ...
*x*_{n}*R*...*Rx*_{3}*Rx*_{2}*Rx*_{1}can exist). If the axiom of dependent choice is assumed, both conditions are equivalent.^{[24]}^{[25]}

*Preorder*- A relation that is reflexive and transitive.
*Total preorder*(also,*linear preorder*or*weak order*)- A relation that is reflexive, transitive, and connected.

*Partial order*(also,*order*^{[citation needed]})- A relation that is reflexive, antisymmetric, and transitive.
*Strict partial order*(also,*strict order*^{[citation needed]})- A relation that is irreflexive, antisymmetric, and transitive.
*Total order*(also,*linear order*,*simple order*, or*chain*)- A relation that is reflexive, antisymmetric, transitive and connected.
^{[26]} *Strict total order*(also,*strict linear order*,*strict simple order*, or*strict chain*)- A relation that is irreflexive, antisymmetric, transitive and connected.

*Partial equivalence relation*- A relation that is symmetric and transitive.
*Equivalence relation*- A relation that is reflexive, symmetric, and transitive. It is also a relation that is symmetric, transitive, and serial, since these properties imply reflexivity.

If *R* is a homogeneous relation over a set *X* then each of the following is a homogeneous relation over *X*:

*Reflexive closure**R*^{=}, defined as*R*^{=}= {(*x*,*x*) |*x*∈*X*} ∪*R*or the smallest reflexive relation over*X*containing*R*. This can be proven to be equal to the intersection of all reflexive relations containing*R*.*Reflexive reduction**R*^{≠}, defined as*R*^{≠}=*R*\ {(*x*,*x*) |*x*∈*X*} or the largest irreflexive relation over*X*contained in*R*.*Transitive closure**R*^{+}, defined as the smallest transitive relation over*X*containing*R*. This can be seen to be equal to the intersection of all transitive relations containing*R*.*Reflexive transitive closure**R**, defined as*R** = (*R*^{+})^{=}, the smallest preorder containing*R*.*Reflexive transitive symmetric closure**R*^{≡}, defined as the smallest equivalence relation over*X*containing*R*.

All operations defined in the section § Operations on binary relations also apply to homogeneous relations.

Homogeneous relations by property Reflexivity Symmetry Transitivity Connectedness Symbol Example Directed graph → Undirected graph Symmetric Dependency Reflexive Symmetric Tournament Irreflexive Antisymmetric Pecking order Preorder Reflexive Yes ≤ Preference Total preorder Reflexive Yes Yes ≤ Partial order Reflexive Antisymmetric Yes ≤ Subset Strict partial order Irreflexive Antisymmetric Yes < Strict subset Total order Reflexive Antisymmetric Yes Yes ≤ Alphabetical order Strict total order Irreflexive Antisymmetric Yes Yes < Strict alphabetical order Partial equivalence relation Symmetric Yes Equivalence relation Reflexive Symmetric Yes ∼, ≡ Equality

- Order relations, including strict orders:
- Greater than
- Greater than or equal to
- Less than
- Less than or equal to
- Divides (evenly)
- Subset of

- Equivalence relations:
- Equality
- Parallel with (for affine spaces)
- Is in bijection with
- Isomorphic

- Tolerance relation, a reflexive and symmetric relation:
- Dependency relation, a finite tolerance relation
- Independency relation, the complement of some dependency relation

- Kinship relations