Composition of relations
In the mathematics of binary relations, the composition of relations is the forming of a new binary relation from two given binary relations and. In the calculus of relations, the composition of relations is called relative multiplication, and its result is called a relative product. Function composition is the special case of composition of relations where all relations involved are functions.
The word uncle indicates a compound relation: for a person to be an uncle, he must be the brother of a parent. In algebraic logic it is said that the relation "is uncle of" is the composition of relations "is a brother of" and "is a parent of".
Beginning with Augustus De Morgan, the traditional form of reasoning by syllogism has been subsumed by relational logical expressions and their composition.
Definition
If and are two binary relations, thentheir composition is the relation
In other words, is defined by the rule that says if and only if there is an element such that .
Notational variations
The semicolon as an infix notation for composition of relations dates back to Ernst Schröder's textbook of 1895. Gunther Schmidt has renewed the use of the semicolon, particularly in Relational Mathematics. The use of the semicolon coincides with the notation for function composition used in category theory, as well as the notation for dynamic conjunction within linguistic dynamic semantics.A small circle has been used for the infix notation of composition of relations by John M. Howie in his books considering semigroups of relations. However, the small circle is widely used to represent composition of functions, which reverses the text sequence from the operation sequence. The small circle was used in the introductory pages of Graphs and Relations until it was dropped in favor of juxtaposition. Juxtaposition is commonly used in algebra to signify multiplication, so too, it can signify relative multiplication.
Further with the circle notation, subscripts may be used. Some authors prefer to write and explicitly when necessary, depending whether the left or the right relation is the first one applied. A further variation encountered in computer science is the Z notation: is used to denote the traditional composition, while left composition is denoted by a fat semicolon. The unicode symbols are ⨾ and ⨟.
Mathematical generalizations
Binary relations are morphisms in the category of relations. Its objects are sets, its morphisms are binary relations and the composition of morphisms is exactly composition of relations as defined above. The category of sets of sets and functions is a subcategory of where the mapsare functions.
Given a regular category, its category of internal relations has the same objects as , but now the morphisms are given by subobjects in. Formally, these are jointly monic spans between and. Categories of internal relations are allegories. In particular. Given a field , the category of relations internal to matrices over, has morphisms the linear subspaces. The category of linear relations over the finite field is isomorphic to the phase-free qubit ZX-calculus modulo scalars.
Properties
- Composition of relations is associative:
- The converse relation of is This property makes the set of all binary relations on a set a semigroup with involution.
- The composition of functions is again a function.
- If and are injective, then is injective, which conversely together with the requirement that is also left total on implies the injectivity of only
- If and are surjective, then is surjective, which conversely implies the surjectivity of only
- The set of binary relations on a set together with relation composition forms a monoid with zero, where the identity map on is the neutral element, and the empty set is the zero element.
Composition in terms of matrices
Heterogeneous relations
Consider a heterogeneous relation, that is, where and may be distinct sets. Then using composition of relation with its converse there are homogeneous relations and .If for all there exists some such that , then for all, so that is a reflexive relation or where I is the identity relation Similarly, if is a surjective relation then
In this case The opposite inclusion occurs for a difunctional relation.
The composition is used to distinguish relations of Ferrer's type, which satisfy
Example
Let and with the relation given by when is a national language ofSince both and is finite, can be represented by a logical matrix, assuming rows and columns are ordered alphabetically:
The converse relation corresponds to the transposed matrix, and the relation composition corresponds to the matrix product when summation is implemented by logical disjunction. It turns out that the matrix contains a 1 at every position, while the reversed matrix product computes as:
This matrix is symmetric, and represents a homogeneous relation on
Correspondingly, is the universal relation on hence any two languages share a nation where they both are spoken.
Vice versa, the question whether two given nations share a language can be answered using
Schröder rules
For a given set the collection of all binary relations on forms a Boolean lattice ordered by inclusion Recall that complementation reverses inclusion:In the calculus of relations it is common to represent the complement of a set by an overbar:
If is a binary relation, let represent the converse relation, also called the transpose. Then the Schröder rules are
Verbally, one equivalence can be obtained from another: select the first or second factor and transpose it; then complement the other two relations and permute them.
Though this transformation of an inclusion of a composition of relations was detailed by Ernst Schröder, in fact Augustus De Morgan first articulated the transformation as Theorem K in 1860. He wrote
With Schröder rules and complementation one can solve for an unknown relation in relation inclusions such as
For instance, by Schröder rule and complementation gives which is called the left residual of by.
Quotients
Just as composition of relations is a type of multiplication resulting in a product, so some operations compare to division and produce quotients. Three quotients are exhibited here: left residual, right residual, and symmetric quotient. The left residual of two relations is defined presuming that they have the same domain, and the right residual presumes the same codomain. The symmetric quotient presumes two relations share a domain and a codomain.Definitions:
- Left residual:
- Right residual:
- Symmetric quotient:
One can practice the logic of residuals with Sudoku.
Join: another form of composition
A fork operator has been introduced to fuse two relations and into The construction depends on projections and understood as relations, meaning that there are converse relations and Then the of and is given byAnother form of composition of relations, which applies to general -place relations for is the join operation of relational algebra. The usual composition of two binary relations as defined here can be obtained by taking their join, leading to a ternary relation, followed by a projection that removes the middle component. For example, in the query language SQL there is the operation join.