Binary relation

In mathematics, a binary relation on a set A is a collection of ordered pairs of elements of A. In other words, it is a subset of the Cartesian product A2 = A × A. More generally, a binary relation between two sets A and B is a subset of A × B. The terms dyadic relation and 2-place relation are synonyms for binary relations.

An example is the "divides" relation between the set of prime numbers P and the set of integers 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 n = 2 of an n-ary relation R ⊆ A1 × … × An, that is, a set of n-tuples where the jth component of each n-tuple is taken from the jth domain Aj 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, without running into logical inconsistencies such as Russell's paradox.


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 subset 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 ab, 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. Most authors insist on distinguishing between a function's codomain and its range. Thus, a single "rule," like mapping every real number x to x2, can lead to distinct functions f:RR and g:RR+, 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, inverse relation, and so on. The choice between the two definitions usually matters only in very formal contexts, like category theory.


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 ballRJohn 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:

  • injective (also called left-unique[1]): 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[1] or right-definite[citation needed]): 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 function.
  • one-to-one (also written 1-to-1): injective and functional.

Totality properties:

  • left-total[1]: 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).
  • surjective (also called right-total[1]): for all y in Y there exists an x in X such that xRy.
  • A correspondence: a binary relation that is both left-total and surjective.

Uniqueness and totality properties:

  • A function: a relation that is functional and left-total.
  • A bijection: 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 theory, where they're known as directed graphs.

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:

  • 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 (or strict): 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. "Equal to and odd" is an example of a coreflexive relation.
  • 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 if xy and yx, then x=y.
  • asymmetric: for all x and y in X it holds that if xRy then not yRx. "Greater than" is an asymmetric relation, because if x>y then not y>x.
  • 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 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.
  • Euclidean: 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.[2] 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 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 > is not.

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.[3] 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.

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:

  • Inverse 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).

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) | xX } ∪ 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) | xX } 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.
  • Transitive reduction: R, defined as a minimal relation having the same transitive closure as 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.

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

  • Union: RSX × Y, defined as RS = { (x, y) | (x, y) ∈ R or (x, y) ∈ S }.
  • Intersection: RSX × Y, defined as RS = { (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: S ∘ R, also denoted R;S (or more ambiguously R ∘ S), defined as S ∘ R = { (x, z) | there exists yY, 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.


If R is a binary relation over X and Y, then the following too:

  • The complement 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.


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

The number of binary relations

The number of distinct binary relations on an n-element set is 2n2 (sequence A002416 in OEIS):

Number of n-element binary relations of different types
n all transitive reflexive preorder partial order total preorder total order equivalence relation
0 1 1 1 1 1 1 1 1
1 2 2 1 1 1 1 1 1
2 16 13 4 4 3 3 2 2
3 512 171 64 29 19 13 6 5
4 65536 3994 4096 355 219 75 24 15
OEIS A002416 A006905 A053763 A000798 A001035 A000670 A000142 A000110


  • 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 partitions, which is the Bell number.

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 quadruples (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 subset of
  • dependency relation, a symmetric, reflexive relation.
  • independency relation, a symmetric, irreflexive relation.
Binary relations by property
reflexive symmetric transitive symbol example
directed graph
undirected graph No Yes
tournament No No pecking order
dependency Yes Yes
weak order Yes
preorder Yes Yes preference
partial order Yes No Yes subset
partial equivalence Yes Yes
equivalence relation Yes Yes Yes ∼, ≅, ≈, ≡ equality
strict partial order No No Yes < proper subset

See also


  1. ^ a b c d Klip, Knauer and Mikhalev: p. 3
  2. ^ Yao, Y.Y.; Wong, S.K.M. (1995). "Generalization of rough sets using relationships between attribute values". Proceedings of the 2nd Annual Joint Conference on Information Sciences: 30–33. .
  3. ^ Joseph G. Rosenstein, Linear orderings, Academic Press, 1982, ISBN 012597680, p. 4


  • M. Kilp, U. Knauer, A.V. Mikhalev, Monoids, Acts and Categories with Applications to Wreath Products and Graphs, De Gruyter Expositions in Mathematics vol. 29, Walter de Gruyter, 2000, ISBN 3110152487.

Wikimedia Foundation. 2010.

Look at other dictionaries:

  • binary relation — noun A relation, such as is less than or is the daughter of , that makes statements about pairs of objects, these statements being true or false depending on the objects …   Wiktionary

  • Relation algebra — is different from relational algebra, a framework developed by Edgar Codd in 1970 for relational databases. In mathematics, a relation algebra is a residuated Boolean algebra supporting an involutary unary operation called converse. The… …   Wikipedia

  • Relation — may refer to:*Relation, a person to whom one is related, i.e. a family member (see also Kinship) *Relation (mathematics), a generalization of arithmetic relations, such as = and …   Wikipedia

  • Relation (mathematics) — This article sets out the set theoretic notion of relation. For a more elementary point of view, see binary relations and triadic relations. : For a more combinatorial viewpoint, see theory of relations. In mathematics, especially set theory, and …   Wikipedia

  • Binary operation — Not to be confused with Bitwise operation. In mathematics, a binary operation is a calculation involving two operands, in other words, an operation whose arity is two. Examples include the familiar arithmetic operations of addition, subtraction,… …   Wikipedia

  • Relation reduction — In logic and mathematics, relation reduction and relational reducibility have to do with the extent to which a given relation is determined by an indexed family or a sequence of other relations, called the relation dataset . The relation under… …   Wikipedia

  • Binary set — A binary set is a set with (exactly) two distinct elements, or, equivalently, a set whose cardinality is two.Examples: * The set { a , b } is binary. * The set { a , a } is not binary, since it is the same set as { a }, and is thus a singleton.In …   Wikipedia

  • relation — Philosophically relations are interesting because of the historic prejudice, given its most forceful expression by Leibniz, that they are somehow ‘unreal’ compared to the intrinsic, monadic properties of things. A way of putting the idea is that… …   Philosophy dictionary

  • Binary star — For the hip hop group, see Binary Star (band). Hubble image of the …   Wikipedia

  • Binary heap — Example of a complete binary max heap Example of a complete binary min heap A binary …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”