Binary relation
In mathematics, a binary relation over sets X and Y is a subset of the Cartesian product ; that is, it is a set of ordered pairs consisting of elements and. It encodes the information of relation: an element x is related to an element y, if and only if the pair belongs to the set. A binary relation is the most studied special case of an n-ary relation over sets, which is a subset of the Cartesian product.
An example of a binary relation is the "divides" relation over the set of prime numbers P and the set of integers Z, 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 binary relation over sets X and Y is an element of the power set of. Since the latter set is ordered by inclusion, each relation has a place in the lattice of subsets of.
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, Clarence Lewis, and Gunther Schmidt. 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, 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 without reference to X and Y, and reserve the term "correspondence" for a binary relation with reference to X and Y.
Definition
Given sets X and Y, the Cartesian product is defined as, and its elements are called ordered pairs.A binary relation R over sets X and Y is a subset of. The set X is called the domain 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, where G is a subset of called the graph of the binary relation. The statement reads "x is R-related to y", and is denoted using infix notation by xRy. The domain of definition or active domain of R is the set of all x such that xRy for at least one y. The codomain of definition, active codomain, 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.
When, a binary relation is called a homogeneous relation. To emphasize the fact that X and Y are allowed to be different, a binary relation is also called a heterogeneous relation.
In a binary relation, the order of the elements is important; if then xRy, but yRx can be true or false independently of xRy. For example, 3 divides 9, but 9 does not divide 3.
Example
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 = and four people B =. A possible relation on A and B is the relation "is owned by", given by R =. That is, John owns the ball, Mary owns the doll, and Venus owns the car. Nobody owns the cup and Ian owns nothing. As a set, R does not involve Ian, and therefore R could have been viewed as a subset of A ×, i.e. a relation over A and.
[|Special types of binary relations]
Some important types of binary relations R over sets X and Y are listed below.Uniqueness properties:
- Injective : for all x and z in X and y in Y, if xRy and zRy then. For such a relation, is called a primary key of R. For example, the green and blue binary relations in the diagram are injective, but the red one is not, nor the black one.
- Functional : for all x in X, and y and z in Y, if xRy and xRz then. Such a binary relation is called a partial function. For such a relation, is called a primary key of R. For example, the red and green binary relations in the diagram are functional, but the blue one is not, nor the black one.
- 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.
- Serial : 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, although also referred to as total by some authors, is different from the definition of connex 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 serial, but the blue one is not, nor the black one.
- Surjective : 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, nor the black one.
- 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.
Operations on binary relations
Union
If R and S are binary relations over sets X and Y then R ∪ S = 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 =.
Intersection
If R and S are binary relations over sets X and Y then R ∩ S = 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".
Composition
If R is a binary relation over sets X and Y, and S is a binary relation over sets Y and Z then 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, 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".
Converse
If R is a binary relation over sets X and Y then RT = 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.
Complement
If R is a binary relation over sets X and Y then = 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 RT is the converse of the complement:
If, 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.
Restriction
If R is a binary relation over sets X and Y and S is a subset of X then R|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 S is a subset of Y then R|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, or an equivalence relation, then so are its restrictions too.
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 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 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 contained in a relation S over X and Y, written R ⊆ S, if R is a subset of S, that is, for all x in X and y in Y, 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
Matrix representation
Binary relations over sets X and Y can be represented algebraically by logical matrices indexed by X and Y with entries in the Boolean semiring where matrix addition corresponds to union of relations, matrix multiplication corresponds to composition of relations, the Hadamard product corresponds to intersection of relations, the zero matrix corresponds to the empty relation, and the matrix of ones corresponds to the universal relation. Homogeneous relations form a matrix semiring where the identity matrix corresponds to the identity relation.Sets versus classes
Certain mathematical "relations", such as "equal to", "subset of", and "member 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 "class of all sets", which is not a set in the usual set theory.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 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 : the resulting set relation can be denoted by ⊆A. Also, the "member of" relation needs to be restricted to have domain A and codomain P to obtain a binary relation ∈A that is a set. Bertrand Russell has shown that assuming ∈ to be defined over all sets leads to a contradiction in naive set theory.
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 to be proper classes: in such a theory, equality, membership, and subset are binary relations without special comment. With this definition one can for instance define a binary relation over every set and its power set.
Homogeneous relation
A homogeneous relation over a set X is a binary relation over X and itself, i.e. it is a subset of the Cartesian product. 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. It is called the adjacency relation of the graph.
The set of all homogeneous relations over a set X is the set 2X × 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 an inverse semigroup.
Particular homogeneous relations
Some important particular homogeneous relations over a set X are:- the empty relation ;
- the universal relation ;
- the identity relation I =.
- xEy holds never;
- xUy holds always;
- xIy holds if and only if.
Properties
- Reflexive: for all x in X, xRx. For example, ≥ is a reflexive relation but > is not.
- Irreflexive : for all x in X, not xRx. For example, > is an irreflexive relation, but ≥ is not.
- Coreflexive: for all x and y in X, if xRy then. For example, the relation over the integers in which each odd number is related to itself is a coreflexive relation. The equality relation is the only example of a both reflexive and coreflexive relation, and any coreflexive relation is a subset of the identity relation.
- Quasi-reflexive: for all x and y in X, if xRy then xRx and yRy.
- Symmetric: for all x and y in 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 and y in X, if xRy and yRx then. For example, ≥ is an antisymmetric relation; so is >, but vacuously.
- Asymmetric: for all x and y in X, if xRy then not yRx. A relation is asymmetric if and only if it is both antisymmetric and irreflexive. For example, > is an asymmetric relation, but ≥ is not.
- Transitive: for all x, y and z in X, if xRy and yRz then xRz. A transitive relation is irreflexive if and only if it is asymmetric. For example, "is ancestor of" is a transitive relation, while "is parent of" is not.
- Antitransitive: for all x, y and z in X, if xRy and yRz then never xRz.
- Co-transitive: if the complement of R is transitive. That is, for all x, y and z in X, if xRz, then xRy or yRz. This is used in pseudo-orders in constructive mathematics.
- Quasitransitive: for all x, y and z in X, if xRy and yRz but neither yRx nor zRy, then xRz but not zRx.
- Transitivity of incomparability: for all x, y and z in X, if x,y are incomparable w.r.t. R and y,z are, then x,z are, too. This is used in weak orderings.
- Dense: for all x, y in X such that xRy, some z in X can be found such that xRz and zRy. This is used in dense orders.
- Connex: for all x and y in 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.
- Semiconnex: for all x and y in X, if 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.
- Trichotomous: for all x and y in X, exactly one of xRy, yRx or holds. For example, > is a trichotomous relation, while the relation "divides" over the natural numbers is not.
- Right Euclidean : for all x, y and z in X, if xRy and xRz then yRz. For example, = is a Euclidean relation because if and then.
- Left Euclidean: for all x, y and z in X, if yRx and zRx then yRz.
- Serial : for all x in X, there exists a y in 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. 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.
- Set-like : for all x in X, the class of all y such that yRx is a set. For example, the usual ordering < over the class of ordinal numbers is a set-like relation, while its [|inverse] > is not.
- Well-founded: every nonempty subset S of X contains a minimal element with respect to R. Well-foundedness implies the descending chain condition. If the axiom of dependent choice is assumed, both conditions are equivalent.
A partial order, also called order, is a relation that is reflexive, antisymmetric, and transitive. A strict partial order, also called strict order, is a relation that is irreflexive, antisymmetric, and transitive. A total order, also called connex order, linear order, simple order, or chain, is a relation that is reflexive, antisymmetric, transitive and connex. A strict total order, also called strict semiconnex order, strict linear order, strict simple order, or strict chain, is a relation that is irreflexive, antisymmetric, transitive and semiconnex.
A partial equivalence relation is a relation that is symmetric and transitive. An equivalence relation is a relation that is reflexive, symmetric, and transitive. It is also a relation that is symmetric, transitive, and serial, since these properties imply reflexivity.
Implications and conflicts between properties of homogeneous binary relations |
. |
Operations
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= = ∪ 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 \ 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, the smallest preorder containing R.
- Reflexive transitive symmetric closure: R≡, defined as the smallest equivalence relation over X containing R.
Enumeration
The number of distinct homogeneous relations over an n-element set is 2n2 :Notes:
- The number of irreflexive relations is the same as that of reflexive relations.
- The number of strict partial orders 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.
Examples
- Order relations, including strict orders:
- * Greater than
- * Greater than or equal to
- * Less than
- * Less than or equal to
- * Divides
- * Subset of
- Equivalence relations:
- * Equality
- * Parallel with
- * 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