In mathematics, a relation denotes some kind of relationship between two objects in a set, which may or may not hold.[1] As an example, "is less than" is a relation on the set of natural numbers; it holds, for instance, between the values 1 and 3 (denoted as 1 < 3), and likewise between 3 and 4 (denoted as 3 < 4), but not between the values 3 and 1 nor between 4 and 4, that is, 3 < 1 and 4 < 4 both evaluate to false. As another example, "is sister of" is a relation on the set of all people, it holds e.g. between Marie Curie and Bronisława Dłuska, and likewise vice versa. Set members may not be in relation "to a certain degree" – either they are in relation or they are not.
Formally, a relation R over a set X can be seen as a set of ordered pairs (x,y) of members of X.[2] The relation R holds between x and y if (x,y) is a member of R. For example, the relation "is less than" on the natural numbers is an infinite set Rless of pairs of natural numbers that contains both (1,3) and (3,4), but neither (3,1) nor (4,4). The relation "is a nontrivial divisor of" on the set of one-digit natural numbers is sufficiently small to be shown here: Rdv = { (2,4), (2,6), (2,8), (3,6), (3,9), (4,8) }; for example 2 is a nontrivial divisor of 8, but not vice versa, hence (2,8) ∈ Rdv, but (8,2) ∉ Rdv.
If R is a relation that holds for x and y, one often writes xRy. For most common relations in mathematics, special symbols are introduced, like "<" for "is less than", and "|" for "is a nontrivial divisor of", and, most popular "=" for "is equal to". For example, "1 < 3", "1 is less than 3", and "(1,3) ∈ Rless" mean all the same; some authors also write "(1,3) ∈ (<)".
Various properties of relations are investigated. A relation R is reflexive if xRx holds for all x, and irreflexive if xRx holds for no x. It is symmetric if xRy always implies yRx, and asymmetric if xRy implies that yRx is impossible. It is transitive if xRy and yRz always implies xRz. For example, "is less than" is irreflexive, asymmetric, and transitive, but neither reflexive nor symmetric. "is sister of" is transitive, but neither reflexive (e.g. Pierre Curie is not a sister of himself), nor symmetric, nor asymmetric; while being irreflexive or not may be a matter of definition (is every woman a sister of herself?), "is ancestor of" is transitive, while "is parent of" is not. Mathematical theorems are known about combinations of relation properties, such as "a transitive relation is irreflexive if, and only if, it is asymmetric".
Of particular importance are relations that satisfy certain combinations of properties. A partial order is a relation that is reflexive, antisymmetric, and transitive,[3] an equivalence relation is a relation that is reflexive, symmetric, and transitive,[4] a function is a relation that is right-unique and left-total (see below).[5][6]
Since relations are sets, they can be manipulated using set operations, including union, intersection, and complementation, leading to the algebra of sets. Furthermore, the calculus of relations includes the operations of taking the converse and composing relations.[7][8][9]
The above concept of relation[a] has been generalized to admit relations between members of two different sets (heterogeneous relation, like "lies on" between the set of all points and that of all lines in geometry), relations between three or more sets (finitary relation, like "person x lives in town y at time z"), and relations between classes[b] (like "is an element of" on the class of all sets, see Binary relation § Sets versus classes).
Given a set X, a relation R over X is a set of ordered pairs of elements from X, formally: R ⊆ { (x,y) | x, y ∈ X }.[2][10]
The statement (x,y) ∈ R reads "x is R-related to y" and is written in infix notation as xRy.[7][8] 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.
A relation R on a finite set X may be represented as:
A transitive[c] relation R on a finite set X may be also represented as
For example, on the set of all divisors of 12, define the relation Rdiv by
Formally, X = { 1, 2, 3, 4, 6, 12 } and Rdiv = { (1,2), (1,3), (1,4), (1,6), (1,12), (2,4), (2,6), (2,12), (3,6), (3,12), (4,12), (6,12) }. The representation of Rdiv as a Boolean matrix is shown in the middle table; the representation both as a Hasse diagram and as a directed graph is shown in the left picture.
The following are equivalent:
As another example, define the relation Rel on R by
The representation of Rel as a 2D-plot obtains an ellipse, see right picture. Since R is not finite, neither a directed graph, nor a finite Boolean matrix, nor a Hasse diagram can be used to depict Rel.
Some important properties that a relation R over a set X may have are:
The previous 2 alternatives are not exhaustive; e.g., the red relation y = x2 given in the diagram below is neither irreflexive, nor reflexive, since it contains the pair (0,0), but not (2,2), respectively.
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 (e.g. 5R1, but not 1R5) nor antisymmetric (e.g. 6R4, but also 4R6), let alone asymmetric.
Uniqueness properties:
Totality properties:
Relations that satisfy certain combinations of the above properties are particularly useful, and thus have received names by their own.
Orderings:
Uniqueness and totality properties:
A 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 ∈ X and y ∈ 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 > ∘ >.
The above concept of relation has been generalized to admit relations between members of two different sets. Given sets X and Y, a heterogeneous relation R over X and Y is a subset of { (x,y) | x∈X, y∈Y }.[2][22] When X = Y, the relation concept described above is obtained; it is often called homogeneous relation (or endorelation)[23][24] to distinguish it from its generalization. The above properties and operations that are marked "[d]" and "[e]", respectively, generalize to heterogeneous relations. An example of a heterogeneous relation is "ocean x borders continent y". The best-known examples are functions[f] with distinct domains and ranges, such as sqrt : N → R+.
{{cite book}}