Y indicates that the column's property is always true for the row's term (at the very left), while✗ indicates that the property is not guaranteed in general (it might, or might not, hold). For example, that every equivalence relation is symmetric, but not necessarily antisymmetric, is indicated byY in the "Symmetric" column and✗ in the "Antisymmetric" column, respectively.
All definitions tacitly require thehomogeneous relation betransitive: for all if and then A term's definition may require additional properties that are not listed in this table.
An example of a binary relation R between two finite sets ofnatural numbers, A and B. Note that R is a subset of theCartesian product, A× B. In this example, R = {(a, b) ∈ A× B: a < b}.
Inmathematics, abinary relation associates some elements of oneset called thedomain with some elements of another set (possibly the same) called thecodomain.[1] Precisely, a binary relation over sets and is a set ofordered pairs, where is an element of and is an element of.[2] It encodes the common concept of relation: an element isrelated to an element,if and only if the pair belongs to the set of ordered pairs that defines the binary relation.
An example of a binary relation is the "divides" relation over the set ofprime numbers and the set ofintegers, in which each prime is related to each integer that is amultiple of, but not to an integer that is not amultiple of. In this relation, for instance, the prime number is related to numbers such as,,,, but not to or, just as the prime number is related to,, and, but not to or.
A binary relation is called ahomogeneous relation when. A binary relation is also called aheterogeneous relation when it is not necessary that.
Binary relations, and especially homogeneous relations, are used in many branches of mathematics to model a wide variety of concepts. These include, among others:
In some systems ofaxiomatic set theory, relations are extended toclasses, 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 asRussell's paradox.
Given sets and, the Cartesian product is defined as and its elements are calledordered pairs.
Abinary relation over sets and is a subset of[2][4] The set is called thedomain[2] orset of departure of, and the set thecodomain orset of destination of. In order to specify the choices of the sets and, some authors define abinary relation orcorrespondence as an ordered triple, where is a subset of called thegraph of the binary relation. The statement reads " is-related to" and is denoted by.[5][6][7][a] Thedomain of definition oractive domain[2] of is the set of all such that for at least one. Thecodomain of definition,active codomain,[2]image orrange of is the set of all such that for at least one. Thefield of is the union of its domain of definition and its codomain of definition.[9][10][11]
When a binary relation is called ahomogeneous relation (orendorelation). To emphasize the fact that and are allowed to be different, a binary relation is also called aheterogeneous relation.[12][13][14] The prefixhetero is from the Greek ἕτερος (heteros, "other, another, different").
A heterogeneous relation has been called arectangular relation,[14] suggesting that it does not have the square-like symmetry of ahomogeneous relation on a set where Commenting on the development of binary relations beyond homogeneous relations, researchers wrote, "... a variant of the theory has evolved that treats relations from the very beginning asheterogeneous orrectangular, i.e. as relations where the normal case is that they are relations between different sets."[15]
The termscorrespondence,[16]dyadic relation andtwo-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 and, and reserve the term "correspondence" for a binary relation with reference to and.[citation needed]
In a binary relation, the order of the elements is important; if then can be true or false independently of. For example, divides, but does not divide.
If and are binary relations over sets and then is theintersection relation of and over and.
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".
If is a binary relation over sets and, and is a binary relation over sets and then (also denoted by) is thecomposition relation of and over and.
The identity element is the identity relation. The order of and in the notation used here agrees with the standard notational order forcomposition of functions. For example, the composition (is parent of)(is mother of) yields (is maternal grandparent of), while the composition (is mother of)(is parent of) yields (is grandmother of). For the former case, if is the parent of and is the mother of, then is the maternal grandparent of.
If is a binary relation over sets and then is theconverse relation,[17] also calledinverse relation,[18] of over and.
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 issymmetric.
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 " is parent of" to females yields the relation " is mother of the woman"; its transitive closure does not 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 ofcompleteness (not to be confused with being "total") do not carry over to restrictions. For example, over thereal numbers a property of the relation is that everynon-empty subset with anupper bound in has aleast upper bound (also called supremum) in 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 over sets and is said to becontained in a relation over and, written if is a subset of, that is, for all and if, then. If is contained in and is contained in, then and are calledequal written. If is contained in but is not contained in, then is said to besmaller than, written For example, on therational numbers, the relation is smaller than, and equal to the composition.
Binary relations over sets and can be represented algebraically bylogical matrices indexed by and with entries in theBoolean semiring (addition corresponds to OR and multiplication to AND) wherematrix addition corresponds to union of relations,matrix multiplication corresponds to composition of relations (of a relation over and and a relation over and),[19] theHadamard product corresponds to intersection of relations, thezero matrix corresponds to the empty relation, and thematrix of ones corresponds to the universal relation. Homogeneous relations (when) form amatrix semiring (indeed, amatrix semialgebra over the Boolean semiring) where theidentity matrix corresponds to the identity relation.[20]
The following example shows that the choice of codomain is important. Suppose there are four objects and four people A possible relation on and is the relation "is owned by", given by That is, John owns the ball, Mary owns the doll, and Venus owns the car. Nobody owns the cup and Ian owns nothing; see the 1st example. As a set, does not involve Ian, and therefore could have been viewed as a subset of i.e. a relation over and see the 2nd example. But in that second example, contains no information about the ownership by Ian.
While the 2nd example relation is surjective (seebelow), the 1st is not.
Oceans and continents (islands omitted)
Ocean borders continent
NA
SA
AF
EU
AS
AU
AA
Indian
0
0
1
0
1
1
1
Arctic
1
0
0
1
1
0
0
Atlantic
1
1
1
1
0
0
1
Pacific
1
1
0
0
1
1
1
Let, theoceans of the globe, and, thecontinents. Let represent that ocean borders continent. Then thelogical matrix for this relation is:
The connectivity of the planet Earth can be viewed through and, the former being a relation on, which is the universal relation ( or a logical matrix of all ones). This universal relation reflects the fact that every ocean is separated from the others by at most one continent. On the other hand, is a relation on whichfails to be universal because at least two oceans must be traversed to voyage fromEurope toAustralia.
Visualization of relations leans ongraph theory: For relations on a set (homogeneous relations), adirected graph illustrates a relation and agraph asymmetric relation. For heterogeneous relations ahypergraph has edges possibly with more than two nodes, and can be illustrated by abipartite graph.Just as theclique is integral to relations on a set, sobicliques are used to describe heterogeneous relations; indeed, they are the "concepts" that generate a lattice associated with a relation.The various axes represent time for observers in motion, the corresponding axes are their lines of simultaneity.
Hyperbolic orthogonality: Time and space are different categories, and temporal properties are separate from spatial properties. The idea ofsimultaneous events is simple inabsolute space and time since each time determines a simultaneoushyperplane in that cosmology.Hermann Minkowski changed that when he articulated the notion ofrelative simultaneity, which exists when spatial events are "normal" to a time characterized by a velocity. He used an indefinite inner product, and specified that a time vector is normal to a space vector when that product is zero. The indefinite inner product in acomposition algebra is given by
Ageometric configuration can be considered a relation between its points and its lines. The relation is expressed asincidence. Finite and infinite projective and affine planes are included.Jakob Steiner pioneered the cataloguing of configurations with theSteiner systems which have an n-element set and a set of k-element subsets calledblocks, such that a subset with elements lies in just one block. Theseincidence structures have been generalized withblock designs. Theincidence matrix used in these geometrical contexts corresponds to the logical matrix used generally with binary relations.
An incidence structure is a triple where and are any two disjoint sets and is a binary relation between and, i.e. The elements of will be calledpoints, those ofblocks, and those offlags.[22]
Examples of four types of binary relations over thereal numbers: one-to-one (in green), one-to-many (in blue), many-to-one (in red), many-to-many (in black).
Some important types of binary relations over sets and are listed below.
Uniqueness properties:
Injective[23] (also calledleft-unique[24]): for all and all if and then. In other words, every element of the codomain hasat most onepreimage element. For such a relation, is calledaprimary key of.[2] For example, the green and blue binary relations in the diagram are injective, but the red one is not (as it relates both and to), nor the black one (as it relates both and to).
Functional[23][25][26] (also calledright-unique[24] orunivalent[27]): for all and all if and then. In other words, every element of the domain hasat most oneimage element. Such a binary relation is called apartial function orpartial mapping.[28] For such a relation, is calleda primary key of.[2] For example, the red and green binary relations in the diagram are functional, but the blue one is not (as it relates to both and), nor the black one (as it relates to both and).
One-to-one: injective and functional. For example, the green binary relation in the diagram is one-to-one, but the red, blue and black ones are not.
One-to-many: injective and not functional. For example, the blue binary relation in the diagram is one-to-many, but the red, green and black ones are not.
Many-to-one: functional and not injective. For example, the red binary relation in the diagram is many-to-one, but the green, blue and black ones are not.
Many-to-many: not injective nor functional. For example, the black binary relation in the diagram is many-to-many, but the red, green and blue ones are not.
Totality properties (only definable if the domain and codomain are specified):
Total[23] (also calledleft-total[24]): for all there exists a such that. In other words, every element of the domain hasat least one image element. In other words, the domain of definition of is equal to. This property, is different from the definition ofconnected (also calledtotal by some authors)[citation needed] inProperties. Such a binary relation is called amultivalued function. For example, the red and green binary relations in the diagram are total, but the blue one is not (as it does not relate to any real number), nor the black one (as it does not relate to any real number). As another example, is a total relation over theintegers. But it is not a total relation over the positive integers, because there is no in the positive integers such that.[29] However, is a total relation over the positive integers, the rational numbers and the real numbers. Every reflexive relation is total: for a given, choose.
Surjective[23] (also calledright-total[24]): for all, there exists an such that. In other words, every element of the codomain hasat least one preimage element. In other words, the codomain of definition of is equal to. For example, the green and blue binary relations in the diagram are surjective, but the red one is not (as it does not relate any real number to), nor the black one (as it does not relate any real number to).
Uniqueness and totality properties (only definable if the domain and codomain are specified):
Afunction (also calledmapping[24]): a binary relation that is functional and total. In other words, every element of the domain hasexactly one image element. For example, the red and green binary relations in the diagram are functions, but the blue and black ones are not.
Aninjection: a function that is injective. For example, the green relation in the diagram is an injection, but the red one is not; the black and the blue relation is not even a function.
Asurjection: a function that is surjective. For example, the green relation in the diagram is a surjection, but the red one is not.
Abijection: a function that is injective and surjective. In other words, every element of the domain hasexactly one image element and every element of the codomain hasexactly one preimage element. For example, the green binary relation in the diagram is a bijection, but the red one is not.
If relations over proper classes are allowed:
Set-like (also calledlocal): for all, theclass of all such that, i.e., is a set. For example, the relation is set-like, and every relation on two sets is set-like.[30] The usual ordering < over the class ofordinal numbers is a set-like relation, while its inverse > is not.[citation needed]
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 ofaxiomatic set theory. For example, to model the general concept of "equality" as a binary relation, 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, that contains all the objects of interest, and work with the restriction instead of. Similarly, the "subset of" relation needs to be restricted to have domain and codomain (the power set of a specific set): the resulting set relation can be denoted by Also, the "member of" relation needs to be restricted to have domain and codomain to obtain a binary relation that is a set.Bertrand Russell has shown that assuming to be defined over all sets leads to a contradiction innaive set theory, seeRussell's paradox.
Another solution to this problem is to use a set theory with proper classes, such asNBG orMorse–Kelley set theory, and allow the domain and codomain (and so the graph) to beproper 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, as normally a proper class cannot be a member of an ordered tuple; or of course one can identify the binary relation with its graph in this context.)[31] With this definition one can for instance define a binary relation over every set and its power set.
Ahomogeneous relation over a set is a binary relation over and itself, i.e. it is a subset of the Cartesian product[14][32][33] It is also simply called a (binary) relation over.
Some important properties that a homogeneous relation over a set may have are:
Reflexive: for all. For example, is a reflexive relation but > is not.
Irreflexive: for all not. For example, is an irreflexive relation, but is not.
Symmetric: for all if then. For example, "is a blood relative of" is a symmetric relation.
Antisymmetric: for all if and then For example, is an antisymmetric relation.[34]
Asymmetric: for all if then not. A relation is asymmetric if and only if it is both antisymmetric and irreflexive.[35] For example, > is an asymmetric relation, but is not.
Transitive: for all if and then. A transitive relation is irreflexive if and only if it is asymmetric.[36] For example, "is ancestor of" is a transitive relation, while "is parent of" is not.
Apartial order is a relation that is reflexive, antisymmetric, and transitive. Astrict partial order is a relation that is irreflexive, asymmetric, and transitive. Atotal order is a relation that is reflexive, antisymmetric, transitive and connected.[37] Astrict total order is a relation that is irreflexive, asymmetric, transitive and connected.Anequivalence relation is a relation that is reflexive, symmetric, and transitive.For example, " divides" is a partial, but not a total order onnatural numbers "" is a strict total order on and " is parallel to" is an equivalence relation on the set of all lines in theEuclidean plane.
All operations defined in section§ Operations also apply to homogeneous relations.Beyond that, a homogeneous relation over a set may be subjected to closure operations like:
In contrast to homogeneous relations, thecomposition of relations operation is only apartial function. The necessity of matching target to source of composed relations has led to the suggestion that the study of heterogeneous relations is a chapter ofcategory theory as in thecategory of sets, except that themorphisms of this category are relations. Theobjects of the categoryRel are sets, and the relation-morphisms compose as required in acategory.[citation needed]
is maximal, not contained in any other outer product. Thus is described as anon-enlargeable rectangle.
For a given relation the set of concepts, enlarged by their joins and meets, forms an "induced lattice of concepts", with inclusion forming apreorder.
TheMacNeille completion theorem (1937) (that any partial order may be embedded in acomplete lattice) is cited in a 2013 survey article "Decomposition of relations on concept lattices".[38] The decomposition is
, where and arefunctions, calledmappings or left-total, functional relations in this context. The "induced concept lattice is isomorphic to the cut completion of the partial order that belongs to the minimal decomposition of the relation."
Particular cases are considered below: total order corresponds to Ferrers type, and identity corresponds to difunctional, a generalization ofequivalence relation on a set.
Relations may be ranked by theSchein rank which counts the number of concepts necessary to cover a relation.[39] Structural analysis of relations with concepts provides an approach fordata mining.[40]
The idea of a difunctional relation is to partition objects by distinguishing attributes, as a generalization of the concept of anequivalence relation. One way this can be done is with an intervening set ofindicators. The partitioning relation is acomposition of relations usingfunctional relationsJacques Riguet named these relationsdifunctional since the composition involves functional relations, commonly calledpartial functions.
In 1950 Riguet showed that such relations satisfy the inclusion:[41]
Inautomata theory, the termrectangular relation has also been used to denote a difunctional relation. This terminology recalls the fact that, when represented as alogical matrix, the columns and rows of a difunctional relation can be arranged as ablock matrix with rectangular blocks of ones on the (asymmetric) main diagonal.[42] More formally, a relation on is difunctional if and only if it can be written as the union of Cartesian products, where the are a partition of a subset of and the likewise a partition of a subset of.[43]
Using the notation, a difunctional relation can also be characterized as a relation such that wherever and have a non-empty intersection, then these two sets coincide; formally implies[44]
In 1997 researchers found "utility of binary decomposition based on difunctional dependencies indatabase management."[45] Furthermore, difunctional relations are fundamental in the study ofbisimulations.[46]
The corresponding logical matrix of a general binary relation has rows which finish with a sequence of ones. Thus the dots of a Ferrer's diagram are changed to ones and aligned on the right in the matrix.
An algebraic statement required for a Ferrers type relation R is
If any one of the relations is of Ferrers type, then all of them are.[48]
Suppose is thepower set of, the set of allsubsets of. Then a relation is acontact relation if it satisfies three properties:
Theset membership relation, "is an element of", satisfies these properties so is a contact relation. The notion of a general contact relation was introduced byGeorg Aumann in 1970.[49][50]
In terms of the calculus of relations, sufficient conditions for a contact relation include where is the converse of set membership ().[51]: 280
Every relation generates apreorder which is theleft residual.[52] In terms of converse and complements, Forming the diagonal of, the corresponding row of and column of will be of opposite logical values, so the diagonal is all zeros. Then
Given a relation, itsfringe is the sub-relation defined as
When is a partial identity relation, difunctional, or a block diagonal relation, then. Otherwise the operator selects a boundary sub-relation described in terms of its logical matrix: is the side diagonal if is an upper right triangularlinear order orstrict order. is the block fringe if is irreflexive () or upper right block triangular. is a sequence of boundary rectangles when is of Ferrers type.
On the other hand, when is adense, linear, strict order.[51]
Given two sets and, the set of binary relations between them can be equipped with aternary operation where denotes theconverse relation of. In 1953Viktor Wagner used properties of this ternary operation to definesemiheaps, heaps, and generalized heaps.[53][54] The contrast of heterogeneous and homogeneous relations is highlighted by these definitions:
There is a pleasant symmetry in Wagner's work between heaps, semiheaps, and generalised heaps on the one hand, and groups, semigroups, and generalised groups on the other. Essentially, the various types of semiheaps appear whenever we consider binary relations (and partial one-one mappings) betweendifferent sets and, while the various types of semigroups appear in the case where.
— Christopher Hollings, "Mathematics across the Iron Curtain: a history of the algebraic theory of semigroups"[55]
^Smullyan, Raymond M.; Fitting, Melvin (2010) [revised and corrected republication of the work originally published in 1996 by Oxford University Press, New York].Set Theory and the Continuum Problem. Dover.ISBN978-0-486-47484-7.
^Levy, Azriel (2002) [republication of the work published by Springer-Verlag, Berlin, Heidelberg and New York in 1979].Basic Set Theory. Dover.ISBN0-486-42079-5.
^M. E. Müller (2012).Relational Knowledge Discovery. Cambridge University Press. p. 22.ISBN978-0-521-19021-3.
^Peter J. Pahl; Rudolf Damrath (2001).Mathematical Foundations of Computational Engineering: A Handbook. Springer Science & Business Media. p. 496.ISBN978-3-540-67995-0.
^Smith, Douglas; Eggen, Maurice; St. Andre, Richard (2006),A Transition to Advanced Mathematics (6th ed.), Brooks/Cole, p. 160,ISBN0-534-39900-2
^Nievergelt, Yves (2002),Foundations of Logic and Mathematics: Applications to Computer Science and Cryptography, Springer-Verlag, p. 158.
^Flaška, V.; Ježek, J.; Kepka, T.; Kortelainen, J. (2007).Transitive Closures of Binary Relations I(PDF). Prague: School of Mathematics – Physics Charles University. p. 1. Archived fromthe original(PDF) on 2013-11-02. Lemma 1.1 (iv). This source refers to asymmetric relations as "strictly antisymmetric".
^Joseph G. Rosenstein,Linear orderings, Academic Press, 1982,ISBN0-12-597680-1, p. 4
^Ali Jaoua, Rehab Duwairi, Samir Elloumi, and Sadok Ben Yahia (2009) "Data mining, reasoning and incremental information retrieval through non enlargeable rectangular relation coverage", pages 199 to 210 inRelations and Kleene algebras in computer science,Lecture Notes in Computer Science 5827, SpringerMR2781235
^Julius Richard Büchi (1989).Finite Automata, Their Algebras and Grammars: Towards a Theory of Formal Expressions. Springer Science & Business Media. pp. 35–37.ISBN978-1-4613-8853-1.
^Georg Aumann (1971)."Kontakt-Relationen".Sitzungsberichte der mathematisch-physikalischen Klasse der Bayerischen Akademie der Wissenschaften München.1970 (II):67–77.
Kilp, Mati; Knauer, Ulrich; Mikhalev, Alexander (2000).Monoids, Acts and Categories: with Applications to Wreath Products and Graphs. Berlin:De Gruyter.ISBN978-3-11-015248-7.
Van Gasteren, Antonetta (1990).On the Shape of Mathematical Arguments. Berlin: Springer.ISBN9783540528494.