Binary relation

Encyclopedia

In mathematics

, a binary relation on a set A is a collection of ordered pair

s of elements of A. In other words, it is a subset

of the Cartesian product

A

An example is the "divides" relation between the set of prime number

s P and the set of integer

s Z, in which every prime p is associated with every integer z that is a multiple of p (and not with any integer that is not a multiple of p). In this relation, for instance, the prime 2 is associated with numbers that include −4, 0, 6, 10, but not 1 or 9; and the prime 3 is associated with numbers that include 0, 6, and 9, but not 4 or 13.

Binary relations are used in many branches of mathematics to model concepts like "is greater than", "is equal to", and "divides" in arithmetic

, "is congruent to

" in geometry

, "is adjacent to" in graph theory

, "is orthogonal to" in linear algebra

and many more. The concept of function

is defined as a special kind of binary relation. Binary relations are also heavily used in computer science

.

A binary relation is the special case of an n-ary relation R ⊆ A

s where the jth component of each n-tuple is taken from the jth domain A

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

.

of the Cartesian product

X × Y. The sets X and Y are called the domain

(or the set of departure) and codomain

(or the set of destination), respectively, of the relation, and G is called its graph

.

The statement (x,y) ∈ R is read "x is R-related to y", and is denoted by xRy or R(x,y). The latter notation corresponds to viewing R as the characteristic function on "X" x "Y" for the set of pairs of G.

The order of the elements in each pair of G is important: if a ≠ b, then aRb and bRa can be true or false, independently of each other.

Some mathematicians do not consider the sets X and Y to be part of the relation, and therefore define a binary relation as being a subset of X×Y, that is, just the graph G. According to this view, the set of pairs {(1,2),(1,3),(2,7)} is a relation from any set that contains {1,2} to any set that contains {2,3,7}.

A special case of this difference in points of view applies to the notion of function

. Most authors insist on distinguishing between a function's codomain

and its range

. Thus, a single "rule," like mapping every real number x to x

Either approach is adequate for most uses, provided that one attends to the necessary changes in language, notation, and the definitions of concepts like restrictions, composition

, inverse relation

, and so on. The choice between the two definitions usually matters only in very formal contexts, like category theory

.

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

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

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".

Uniqueness properties:

Totality properties:

Uniqueness and totality properties:

, where they're known as directed graph

s.

The set of all binary relations B(X) on a set X is a semigroup with involution

with the involution being the mapping of a relation to its inverse relation.

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

A relation that is reflexive, symmetric, and transitive is called an equivalence relation

. A relation that is reflexive, antisymmetric, and transitive is called a partial order. A partial order that is total is called a total order

, simple order, linear order, or a chain. A linear order where every nonempty set has a least element is called a well-order

. A relation that is symmetric, transitive, and serial is also reflexive.

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

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

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: (see main article composition of relations

)

The complement of the inverse is the inverse of the complement.

If X = Y the complement has the following properties:

The complement of the inverse has these same properties.

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

, its restrictions are too.

However, the transitive closure of a restriction is a subset of the restriction of the transitive closure, i.e., in general not equal.

Also, the various concepts of completeness

(not to be confused with being "total") do not carry over to restrictions. For example, on the set of real number

s 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 a set of rational numbers this supremum is not necessarily rational, so the same property does not hold on the restriction of the relation "≤" to the set of rational numbers.

The left-restriction (right-restriction, respectively) of a binary relation between X and Y to a subset S of its domain (codomain) is the set of all pairs (x, y) in the relation for which x (y) is an element of S.

For example, if we try to model the general concept of "equality" as a binary relation =, we must take the domain and codomain to be the "set of all sets", which is not a set in the usual set theory. The usual work-around to this problem is to select a "large enough" set A, that contains all the objects of interest, and work with the restriction =

Similarly, the "subset of" relation ⊆ needs to be restricted to have domain and codomain P(A) (the power set of a specific set A): the resulting set relation can be denoted ⊆

Another solution to this problem is to use a set theory with proper classes, such as NBG

or Morse–Kelley set theory

, and allow the domain and codomain (and so the graph) to be proper classes: in such a theory, equality, membership, and subset are binary relations without special comment. (A minor modification needs to be made to the concept of the ordered triple (X, Y, G), as normally a proper class cannot be a member of an ordered tuple; or of course one can identify the function with its graph in this context.)

In most mathematical contexts, references to the relations of equality, membership and subset are harmless because they can be understood implicitly to be restricted to some set in the context.

Notes:

The binary relations can be grouped into pairs (relation, complement), except that for n = 0 the relation is its own complement. The non-symmetric ones can be grouped into quadruple

s (relation, complement, inverse, inverse complement).

Mathematics

Mathematics is the study of quantity, space, structure, and change. Mathematicians seek out patterns and formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proofs, which are arguments sufficient to convince other mathematicians of their validity...

, a binary relation on a set A is a collection of ordered pair

Ordered pair

In mathematics, an ordered pair is a pair of mathematical objects. In the ordered pair , the object a is called the first entry, and the object b the second entry of the pair...

s of elements of A. In other words, it is a subset

Subset

In mathematics, especially in set theory, a set A is a subset of a set B if A is "contained" inside B. A and B may coincide. The relationship of one set being a subset of another is called inclusion or sometimes containment...

of the Cartesian product

Cartesian product

In mathematics, a Cartesian product is a construction to build a new set out of a number of given sets. Each member of the Cartesian product corresponds to the selection of one element each in every one of those sets...

A

^{2}= . More generally, a binary relation between two sets A and B is a subset of . The terms dyadic relation and 2-place relation are synonyms for binary relations.An example is the "divides" relation between the set of prime number

Prime number

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the divisors 2...

s P and the set of integer

Integer

The integers are formed by the natural numbers together with the negatives of the non-zero natural numbers .They are known as Positive and Negative Integers respectively...

s Z, in which every prime p is associated with every integer z that is a multiple of p (and not with any integer that is not a multiple of p). In this relation, for instance, the prime 2 is associated with numbers that include −4, 0, 6, 10, but not 1 or 9; and the prime 3 is associated with numbers that include 0, 6, and 9, but not 4 or 13.

Binary relations are used in many branches of mathematics to model concepts like "is greater than", "is equal to", and "divides" in arithmetic

Arithmetic

Arithmetic or arithmetics is the oldest and most elementary branch of mathematics, used by almost everyone, for tasks ranging from simple day-to-day counting to advanced science and business calculations. It involves the study of quantity, especially as the result of combining numbers...

, "is congruent to

Congruence (geometry)

In geometry, two figures are congruent if they have the same shape and size. This means that either object can be repositioned so as to coincide precisely with the other object...

" in geometry

Geometry

Geometry arose as the field of knowledge dealing with spatial relationships. Geometry was one of the two fields of pre-modern mathematics, the other being the study of numbers ....

, "is adjacent to" in graph theory

Graph theory

In mathematics and computer science, graph theory is the study of graphs, mathematical structures used to model pairwise relations between objects from a certain collection. A "graph" in this context refers to a collection of vertices or 'nodes' and a collection of edges that connect pairs of...

, "is orthogonal to" in linear algebra

Linear algebra

Linear algebra is a branch of mathematics that studies vector spaces, also called linear spaces, along with linear functions that input one vector and output another. Such functions are called linear maps and can be represented by matrices if a basis is given. Thus matrix theory is often...

and many more. The concept of function

Function (mathematics)

In mathematics, a function associates one quantity, the argument of the function, also known as the input, with another quantity, the value of the function, also known as the output. A function assigns exactly one output to each input. The argument and the value may be real numbers, but they can...

is defined as a special kind of binary relation. Binary relations are also heavily used in computer science

Computer science

Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

.

A binary relation is the special case of an n-ary relation R ⊆ A

_{1}× … × A_{n}, that is, a set of n-tupleTuple

In mathematics and computer science, a tuple is an ordered list of elements. In set theory, an n-tuple is a sequence of n elements, where n is a positive integer. There is also one 0-tuple, an empty sequence. An n-tuple is defined inductively using the construction of an ordered pair...

s where the jth component of each n-tuple is taken from the jth domain A

_{j}of the relation.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

Set theory

Set theory is the branch of mathematics that studies sets, which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics...

, without running into logical inconsistencies such as Russell's paradox

Russell's paradox

In the foundations of mathematics, Russell's paradox , discovered by Bertrand Russell in 1901, showed that the naive set theory created by Georg Cantor leads to a contradiction...

.

## Formal definition

A binary relation R is usually defined as an ordered triple (X, Y, G) where X and Y are arbitrary sets (or classes), and G is a subsetSubset

In mathematics, especially in set theory, a set A is a subset of a set B if A is "contained" inside B. A and B may coincide. The relationship of one set being a subset of another is called inclusion or sometimes containment...

of the Cartesian product

Cartesian product

In mathematics, a Cartesian product is a construction to build a new set out of a number of given sets. Each member of the Cartesian product corresponds to the selection of one element each in every one of those sets...

X × Y. The sets X and Y are called the domain

Domain (mathematics)

In mathematics, the domain of definition or simply the domain of a function is the set of "input" or argument values for which the function is defined...

(or the set of departure) and codomain

Codomain

In mathematics, the codomain or target set of a function is the set into which all of the output of the function is constrained to fall. It is the set in the notation...

(or the set of destination), respectively, of the relation, and G is called its graph

Graph of a function

In mathematics, the graph of a function f is the collection of all ordered pairs . In particular, if x is a real number, graph means the graphical representation of this collection, in the form of a curve on a Cartesian plane, together with Cartesian axes, etc. Graphing on a Cartesian plane is...

.

The statement (x,y) ∈ R is read "x is R-related to y", and is denoted by xRy or R(x,y). The latter notation corresponds to viewing R as the characteristic function on "X" x "Y" for the set of pairs of G.

The order of the elements in each pair of G is important: if a ≠ b, then aRb and bRa can be true or false, independently of each other.

### Is a relation more than its graph?

According to the definition above, two relations with the same graph may be different, if they differ in the sets X and Y. For example, if G = {(1,2),(1,3),(2,7)}, then (Z,Z, G), (R, N, G), and (N, R, G) are three distinct relations.Some mathematicians do not consider the sets X and Y to be part of the relation, and therefore define a binary relation as being a subset of X×Y, that is, just the graph G. According to this view, the set of pairs {(1,2),(1,3),(2,7)} is a relation from any set that contains {1,2} to any set that contains {2,3,7}.

A special case of this difference in points of view applies to the notion of function

Function (mathematics)

In mathematics, a function associates one quantity, the argument of the function, also known as the input, with another quantity, the value of the function, also known as the output. A function assigns exactly one output to each input. The argument and the value may be real numbers, but they can...

. Most authors insist on distinguishing between a function's codomain

Codomain

In mathematics, the codomain or target set of a function is the set into which all of the output of the function is constrained to fall. It is the set in the notation...

and its range

Range (mathematics)

In mathematics, the range of a function refers to either the codomain or the image of the function, depending upon usage. This ambiguity is illustrated by the function f that maps real numbers to real numbers with f = x^2. Some books say that range of this function is its codomain, the set of all...

. Thus, a single "rule," like mapping every real number x to x

^{2}, can lead to distinct functions f:R→R and g:R→R^{+}, depending on whether the images under that rule are understood to be reals or, more restrictively, non-negative reals. But others view functions as simply sets of ordered pairs with unique first components. This difference in perspectives does raise some nontrivial issues. As an example, the former camp considers surjectivity—or being onto—as a property of functions, while the latter sees it as a relationship that functions may bear to sets.Either approach is adequate for most uses, provided that one attends to the necessary changes in language, notation, and the definitions of concepts like restrictions, composition

Composition of relations

In mathematics, the composition of binary relations is a concept of forming a new relation from two given relations R and S, having as its most well-known special case the composition of functions.- Definition :...

, inverse relation

Inverse relation

In mathematics, the inverse relation of a binary relation is the relation that occurs when you switch the order of the elements in the relation. For example, the inverse of the relation 'child of' is the relation 'parent of'...

, and so on. The choice between the two definitions usually matters only in very formal contexts, like category theory

Category theory

Category theory is an area of study in mathematics that examines in an abstract way the properties of particular mathematical concepts, by formalising them as collections of objects and arrows , where these collections satisfy certain basic conditions...

.

### Example

Example: Suppose there are four objects {ball, car, doll, gun} and four persons {John, Mary, Ian, Venus}. Suppose that John owns the ball, Mary owns the doll, and Venus owns the car. Nobody owns the gun and Ian owns nothing. Then the binary relation "is owned by" is given as- R=({ball, car, doll, gun}, {John, Mary, Ian, 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 binary relations

Some important classes of binary relations R between X and Y are listed below.Uniqueness properties:

- injectiveInjective functionIn mathematics, an injective function is a function that preserves distinctness: it never maps distinct elements of its domain to the same element of its codomain. In other words, every element of the function's codomain is mapped to by at most one element of its domain...

(also called left-unique): for all x and z in X and y in Y it holds that if xRy and zRy then x = z. - functional (also called right-unique or right-definite): for all x in X, and y and z in Y it holds that if xRy and xRz then y = z; such a binary relation is called a partial functionPartial functionIn mathematics, a partial function from X to Y is a function ƒ: X' → Y, where X' is a subset of X. It generalizes the concept of a function by not forcing f to map every element of X to an element of Y . If X' = X, then ƒ is called a total function and is equivalent to a function...

. - one-to-one (also written 1-to-1): injective and functional.

Totality properties:

- left-total: for all x in X there exists a y in Y such that xRy (this property, although sometimes also referred to as total, is different from the definition of total in the next section).
- surjectiveSurjective functionIn mathematics, a function f from a set X to a set Y is surjective , or a surjection, if every element y in Y has a corresponding element x in X so that f = y...

(also called right-total): for all y in Y there exists an x in X such that xRy. - A correspondenceCorrespondence (mathematics)In mathematics and mathematical economics, correspondence is a term with several related but not identical meanings.* In general mathematics, correspondence is an alternative term for a relation between two sets...

: a binary relation that is both left-total and surjective.

Uniqueness and totality properties:

- A functionFunction (mathematics)In mathematics, a function associates one quantity, the argument of the function, also known as the input, with another quantity, the value of the function, also known as the output. A function assigns exactly one output to each input. The argument and the value may be real numbers, but they can...

: a relation that is functional and left-total. - A bijectionBijectionA bijection is a function giving an exact pairing of the elements of two sets. A bijection from the set X to the set Y has an inverse function from Y to X. If X and Y are finite sets, then the existence of a bijection means they have the same number of elements...

: a one-to-one correspondence; such a relation is a function and is said to be bijective.

## 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 classes of endorelations are widely studied in graph theoryGraph theory

In mathematics and computer science, graph theory is the study of graphs, mathematical structures used to model pairwise relations between objects from a certain collection. A "graph" in this context refers to a collection of vertices or 'nodes' and a collection of edges that connect pairs of...

, where they're known as directed graph

Directed graph

A directed graph or digraph is a pair G= of:* a set V, whose elements are called vertices or nodes,...

s.

The set of all binary relations B(X) on a set X is a semigroup with involution

Semigroup with involution

In mathematics, in semigroup theory, an involution in a semigroup is a transformation of the semigroup which is its own inverse and which is an anti-automorphism of the semigroup. A semigroup in which an involution is defined is called a semigroup with involution...

with the involution being the mapping of a relation to its inverse relation.

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

- reflexiveReflexive relationIn mathematics, a reflexive relation is a binary relation on a set for which every element is related to itself, i.e., a relation ~ on S where x~x holds true for every x in S. For example, ~ could be "is equal to".-Related terms:...

: 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 (or strict): for all x in X it holds that not xRx. "Greater than" is an example of an irreflexive relation.
- coreflexiveCoreflexive relationIn mathematics, a coreflexive relation is a binary relation that is a subset of the identity relation. Thus if a is related to b then a is equal to b , but if c is equal to d it does not necessarily hold that c is related to d .In mathematical notation, this is:\forall a, b \in X,\ a...

: for all x and y in X it holds that if xRy then x = y. "Equal to and odd" is an example of a coreflexive relation. - symmetricSymmetric relationIn mathematics, a binary relation R over a set X is symmetric if it holds for all a and b in X that if a is related to b then b is related to a.In mathematical notation, this is:...

: 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. - antisymmetricAntisymmetric relationIn mathematics, a binary relation R on a set X is antisymmetric if, for all a and b in Xor, equivalently,In mathematical notation, this is:\forall a, b \in X,\ R \and R \; \Rightarrow \; a = bor, equivalently,...

: for all distinct x and y in X, if xRy then not yRx. - asymmetricAsymmetric relationAsymmetric often means, simply: not symmetric. In this sense an asymmetric relation is a binary relation which is not a symmetric relation.That is,\lnot....

: for all x and y in X, if xRy then not yRx. (So asymmetricity is stronger than anti-symmetry. In fact, asymmetry is equivalent to anti-symmetry plus irreflexivity.) - transitiveTransitive relationIn mathematics, a binary relation R over a set X is transitive if whenever an element a is related to an element b, and b is in turn related to an element c, then a is also related to c....

: for all x, y and z in X it holds that if xRy and yRz then xRz. (Note that, under the assumption of transitivity, irreflexivity and asymmetry are equivalent.) - totalTotal relationIn mathematics, a binary relation R over a set X is total if for all a and b in X, a is related to b or b is related to a .In mathematical notation, this is\forall a, b \in X,\ a R b \or b R a....

: 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 left total 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.
- EuclideanEuclidean relationIn mathematics, Euclidean relations are a class of binary relations that satisfy a weakened form of transitivity that formalizes Euclid's "Common Notion 1" in The Elements: things which equal the same thing also equal one another.-Definition:...

: for all x, y and z in X it holds that if xRy and xRz, then yRz (and zRy). Equality is a Euclidean relation because if x=y and x=z, then y=z. - serial: for all x in X, there exists y in X such that xRy. "Is greater than" is a serial relation on the integers. But it is not a serial relation on the positive integers, because there is no y in the positive integers such that 1>y. However, the "Is less than" is a serial relation on the positive integers (the natural numbers), the rational numbers and the real numbers. Every reflexive relation is serial.
- set-like: for every x in X, the classClass (set theory)In set theory and its applications throughout mathematics, a class is a collection of sets which can be unambiguously defined by a property that all its members share. The precise definition of "class" depends on foundational context...

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 > is not.

A relation that is reflexive, symmetric, and transitive is called an equivalence relation

Equivalence relation

In mathematics, an equivalence relation is a relation that, loosely speaking, partitions a set so that every element of the set is a member of one and only one cell of the partition. Two elements of the set are considered equivalent if and only if they are elements of the same cell...

. A relation that is reflexive, antisymmetric, and transitive is called a partial order. A partial order that is total is called a total order

Total order

In set theory, a total order, linear order, simple order, or ordering is a binary relation on some set X. The relation is transitive, antisymmetric, and total...

, simple order, linear order, or a chain. A linear order where every nonempty set has a least element is called a well-order

Well-order

In mathematics, a well-order relation on a set S is a strict total order on S with the property that every non-empty subset of S has a least element in this ordering. Equivalently, a well-ordering is a well-founded strict total order...

. A relation that is symmetric, transitive, and serial is also reflexive.

## Operations on binary relations

If R is a binary relation over X and Y, then the following is a binary relation over Y and X:- InverseInverse relationIn mathematics, the inverse relation of a binary relation is the relation that occurs when you switch the order of the elements in the relation. For example, the inverse of the relation 'child of' is the relation 'parent of'...

or converse: R^{−1}, defined as R^{−1}= { (y, x) | (x, y) ∈ R }. A binary relation over a set is equal to its inverse if and only if it is symmetric. See also duality (order theory)Duality (order theory)In the mathematical area of order theory, every partially ordered set P gives rise to a dual partially ordered set which is often denoted by Pop or Pd. This dual order Pop is defined to be the set with the inverse order, i.e. x ≤ y holds in Pop if and only if y ≤ x holds in P...

.

If R is a binary relation over X, then each of the following is a binary 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 seen 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 closureTransitive closureIn mathematics, the transitive closure of a binary relation R on a set X is the transitive relation R+ on set X such that R+ contains R and R+ is minimal . If the binary relation itself is transitive, then the transitive closure will be that same binary relation; otherwise, the 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. - Transitive reductionTransitive reductionIn mathematics, a transitive reduction of a binary relation R on a set X is a minimal relation R' on X such that the transitive closure of R' is the same as the transitive closure of R. If the transitive closure of R is antisymmetric and finite, then R' is unique...

: R^{−}, defined as a minimal relation having the same transitive closure as R. - Reflexive transitive closure: R *, defined as R * = (R
^{+})^{=}, the smallest preorderPreorderIn mathematics, especially in order theory, preorders are binary relations that are reflexive and transitive.For example, all partial orders and equivalence relations are preorders...

containing R. - Reflexive transitive symmetric closure: R
^{≡}, defined as the smallest equivalence relationEquivalence relationIn mathematics, an equivalence relation is a relation that, loosely speaking, partitions a set so that every element of the set is a member of one and only one cell of the partition. Two elements of the set are considered equivalent if and only if they are elements of the same cell...

over X containing R.

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

- 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: (see main article composition of relations

Composition of relations

In mathematics, the composition of binary relations is a concept of forming a new relation from two given relations R and S, having as its most well-known special case the composition of functions.- Definition :...

)

- Composition: S ∘ R, also denoted R ; S (or more ambiguously R ∘ S), defined as S ∘ 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 ∘ R, used here agrees with the standard notational order for composition of functions.

### Complement

If R is a binary relation over X and Y, then the following too:- The complementComplement (set theory)In set theory, a complement of a set A refers to things not in , A. The relative complement of A with respect to a set B, is the set of elements in B but not in A...

S is defined as x S y if not x R y.

The complement of the inverse is the inverse of the complement.

If X = Y the complement has the following properties:

- If a relation is symmetric, the complement is too.
- 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.

The complement of the inverse has these same properties.

### Restriction

The restriction of a binary relation on a set X to a subset S is the set of all pairs (x, y) in the relation for which x and y are in S.If a relation is reflexive

Reflexive relation

In mathematics, a reflexive relation is a binary relation on a set for which every element is related to itself, i.e., a relation ~ on S where x~x holds true for every x in S. For example, ~ could be "is equal to".-Related terms:...

, irreflexive, symmetric

Symmetric relation

In mathematics, a binary relation R over a set X is symmetric if it holds for all a and b in X that if a is related to b then b is related to a.In mathematical notation, this is:...

, antisymmetric

Antisymmetric relation

In mathematics, a binary relation R on a set X is antisymmetric if, for all a and b in Xor, equivalently,In mathematical notation, this is:\forall a, b \in X,\ R \and R \; \Rightarrow \; a = bor, equivalently,...

, asymmetric

Asymmetric relation

Asymmetric often means, simply: not symmetric. In this sense an asymmetric relation is a binary relation which is not a symmetric relation.That is,\lnot....

, transitive

Transitive relation

In mathematics, a binary relation R over a set X is transitive if whenever an element a is related to an element b, and b is in turn related to an element c, then a is also related to c....

, total

Total relation

In mathematics, a binary relation R over a set X is total if for all a and b in X, a is related to b or b is related to a .In mathematical notation, this is\forall a, b \in X,\ a R b \or b R a....

, trichotomous, a partial order, total order

Total order

In set theory, a total order, linear order, simple order, or ordering is a binary relation on some set X. The relation is transitive, antisymmetric, and total...

, strict weak order, total preorder (weak order), or an equivalence relation

Equivalence relation

In mathematics, an equivalence relation is a relation that, loosely speaking, partitions a set so that every element of the set is a member of one and only one cell of the partition. Two elements of the set are considered equivalent if and only if they are elements of the same cell...

, its restrictions are too.

However, the transitive closure of a restriction is a subset of the restriction of the transitive closure, i.e., in general not equal.

Also, the various concepts of completeness

Completeness (order theory)

In the mathematical area of order theory, completeness properties assert the existence of certain infima or suprema of a given partially ordered set . A special use of the term refers to complete partial orders or complete lattices...

(not to be confused with being "total") do not carry over to restrictions. For example, on the set of real number

Real number

In mathematics, a real number is a value that represents a quantity along a continuum, such as -5 , 4/3 , 8.6 , √2 and π...

s a property of the relation "≤" is that every non-empty

Empty set

In mathematics, and more specifically set theory, the empty set is the unique set having no elements; its size or cardinality is zero. Some axiomatic set theories assure that the empty set exists by including an axiom of empty set; in other theories, its existence can be deduced...

subset S of R with an upper bound

Upper bound

In mathematics, especially in order theory, an upper bound of a subset S of some partially ordered set is an element of P which is greater than or equal to every element of S. The term lower bound is defined dually as an element of P which is lesser than or equal to every element of S...

in R has a least upper bound

Supremum

In mathematics, given a subset S of a totally or partially ordered set T, the supremum of S, if it exists, is the least element of T that is greater than or equal to every element of S. Consequently, the supremum is also referred to as the least upper bound . If the supremum exists, it is unique...

(also called supremum) in R. However, for a set of rational numbers this supremum is not necessarily rational, so the same property does not hold on the restriction of the relation "≤" to the set of rational numbers.

The left-restriction (right-restriction, respectively) of a binary relation between X and Y to a subset S of its domain (codomain) is the set of all pairs (x, y) in the relation for which x (y) is an element of S.

## Sets versus classes

Certain mathematical "relations", such as "equal to", "member of", and "subset of", cannot be understood to be binary relations as defined above, because their domains and codomains cannot be taken to be sets in the usual systems of axiomatic set theory.For example, if we try to model the general concept of "equality" as a binary relation =, we must take the domain and codomain to be the "set of all sets", which is not a set in the usual set theory. The usual work-around to this problem is to select a "large enough" set A, that contains all the objects of interest, and work with the restriction =

_{A}instead of =.Similarly, the "subset of" relation ⊆ needs to be restricted to have domain and codomain P(A) (the power set of a specific set A): the resulting set relation can be denoted ⊆

_{A}. Also, the "member of" relation needs to be restricted to have domain A and codomain P(A) to obtain a binary relation ∈_{A}that is a set.Another solution to this problem is to use a set theory with proper classes, such as NBG

Von Neumann–Bernays–Gödel set theory

In the foundations of mathematics, von Neumann–Bernays–Gödel set theory is an axiomatic set theory that is a conservative extension of the canonical axiomatic set theory ZFC. A statement in the language of ZFC is provable in NBG if and only if it is provable in ZFC. The ontology of NBG includes...

or Morse–Kelley set theory

Morse–Kelley set theory

In the foundation of mathematics, Morse–Kelley set theory or Kelley–Morse set theory is a first order axiomatic set theory that is closely related to von Neumann–Bernays–Gödel set theory...

, and allow the domain and codomain (and so the graph) to be proper classes: in such a theory, equality, membership, and subset are binary relations without special comment. (A minor modification needs to be made to the concept of the ordered triple (X, Y, G), as normally a proper class cannot be a member of an ordered tuple; or of course one can identify the function with its graph in this context.)

In most mathematical contexts, references to the relations of equality, membership and subset are harmless because they can be understood implicitly to be restricted to some set in the context.

## The number of binary relations

The number of distinct binary relations on an n-element set is 2^{n2}:Notes:

- The number of irreflexive relations is the same as that of reflexive relations.
- The number of strict partial orders (irreflexive transitive relations) is the same as that of partial orders.
- The number of strict weak orders is the same as that of total preorders.
- The total orders are the partial orders that are also total preorders. The number of preorders that are neither a partial order nor a total preorder is, therefore, the number of preorders, minus the number of partial orders, minus the number of total preorders, plus the number of total orders: 0, 0, 0, 3, and 85, respectively.
- the number of equivalence relations is the number of partitionPartition of a setIn mathematics, a partition of a set X is a division of X into non-overlapping and non-empty "parts" or "blocks" or "cells" that cover all of X...

s, which is the Bell numberBell numberIn combinatorics, the nth Bell number, named after Eric Temple Bell, is the number of partitions of a set with n members, or equivalently, the number of equivalence relations on it...

.

The binary relations can be grouped into pairs (relation, complement), except that for n = 0 the relation is its own complement. The non-symmetric ones can be grouped into quadruple

Quadruple

Quadruple may refer to:* Tuple, a mathematical structure* Quadruple, a term for winning four association trophies* Quad , a figure skating jump* Home run in baseball* Quadruple-precision floating-point format in computing...

s (relation, complement, inverse, inverse complement).

## Examples of common binary relations

- order relations, including strict orders:
- greater than
- greater than or equal to
- less than
- less than or equal to
- divides (evenly)
- is a subsetSubsetIn mathematics, especially in set theory, a set A is a subset of a set B if A is "contained" inside B. A and B may coincide. The relationship of one set being a subset of another is called inclusion or sometimes containment...

of

- equivalence relationEquivalence relation

s:- equality
- is parallelParallel (geometry)Parallelism is a term in geometry and in everyday life that refers to a property in Euclidean space of two or more lines or planes, or a combination of these. The assumed existence and properties of parallel lines are the basis of Euclid's parallel postulate. Two lines in a plane that do not...

to (for affine spaceAffine spaceIn mathematics, an affine space is a geometric structure that generalizes the affine properties of Euclidean space. In an affine space, one can subtract points to get vectors, or add a vector to a point to get another point, but one cannot add points. In particular, there is no distinguished point...

s) - is in bijectionBijectionA bijection is a function giving an exact pairing of the elements of two sets. A bijection from the set X to the set Y has an inverse function from Y to X. If X and Y are finite sets, then the existence of a bijection means they have the same number of elements...

with - isomorphyIsomorphismIn abstract algebra, an isomorphism is a mapping between objects that shows a relationship between two properties or operations. If there exists an isomorphism between two structures, the two structures are said to be isomorphic. In a certain sense, isomorphic structures are...

- dependency relationDependency relationIn mathematics and computer science, a dependency relation is a binary relation that is finite, symmetric, and reflexive; i.e. a finite tolerance relation...

, a symmetric, reflexive relation. - independency relation, a symmetric, irreflexive relation.

reflexive Reflexive relation In mathematics, a reflexive relation is a binary relation on a set for which every element is related to itself, i.e., a relation ~ on S where x~x holds true for every x in S. For example, ~ could be "is equal to".-Related terms:... |
symmetric Symmetric relation In mathematics, a binary relation R over a set X is symmetric if it holds for all a and b in X that if a is related to b then b is related to a.In mathematical notation, this is:... |
transitive Transitive relation In mathematics, a binary relation R over a set X is transitive if whenever an element a is related to an element b, and b is in turn related to an element c, then a is also related to c.... |
symbol | example | |

directed graph Directed graph A directed graph or digraph is a pair G= of:* a set V, whose elements are called vertices or nodes,... |
→ | ||||

undirected graph Graph (mathematics) In mathematics, a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected objects are represented by mathematical abstractions called vertices, and the links that connect some pairs of vertices are called edges... |
|||||

tournament Tournament (graph theory) A tournament is a directed graph obtained by assigning a direction for each edge in an undirected complete graph. That is, it is a directed graph in which every pair of vertices is connected by a single directed edge.... |
pecking order Pecking order Pecking order or just peck order is the colloquial term for a hierarchical system of social organization in chickens. It was first described from the behaviour of poultry by Thorleif Schjelderup-Ebbe in 1921 under the German terms Hackordnung or Hackliste' ... |
||||

dependency Dependency relation In mathematics and computer science, a dependency relation is a binary relation that is finite, symmetric, and reflexive; i.e. a finite tolerance relation... |
|||||

weak order | ≤ | ||||

preorder Preorder In mathematics, especially in order theory, preorders are binary relations that are reflexive and transitive.For example, all partial orders and equivalence relations are preorders... |
≤ | preference Preference -Definitions in different disciplines:The term “preferences” is used in a variety of related, but not identical, ways in the scientific literature. This makes it necessary to make explicit the sense in which the term is used in different social sciences.... |
|||

partial order | ≤ | subset Subset |
|||

partial equivalence Partial equivalence relation In mathematics, a partial equivalence relation R on a set X is a relation that is symmetric and transitive... |
|||||

equivalence relation Equivalence relation |
∼, ≅, ≈, ≡ | equality | |||

strict partial order | < | proper subset |