Composition of relations

Short description: Mathematical operation

Composition R;S (magenta arrows) of example binary relations R (red) and S (blue)

In the mathematics of binary relations, the composition of relations is the forming of a new binary relation R;S from two given binary relations R and S. In the calculus of relations, the composition of relations is called relative multiplication,[1] and its result is called a relative product.[2]: 40 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" (xUz) is the composition of relations "is a brother of" (xBy) and "is a parent of" (yPz). U=B;P is equivalent to: xUz if and only if ∃y. xBy and yPz.

Beginning with Augustus De Morgan,[3] the traditional form of reasoning by syllogism has been subsumed by relational logical expressions and their composition.[4]

## Contents

* 1 Definition
* 1.1 Notational variations
* 1.2 Mathematical generalizations
* 2 Properties
* 3 Composition in terms of matrices
* 4 Heterogeneous relations
* 4.1 Example
* 5 Schröder rules
* 6 Quotients
* 7 Join: another form of composition
* 8 See also
* 9 Notes
* 10 References

## Definition

If R⊆X×Y and S⊆Y×Z are two binary relations, then their composition R;S is the relation R;S={(x,z)∈X×Z: there exists y∈Y such that (x,y)∈R and (y,z)∈S}.

In other words, R;S⊆X×Z is defined by the rule that says (x,z)∈R;S if and only if there is an element y∈Y such that xRySz (that is, (x,y)∈R and (y,z)∈S).[5]: 13

### Notational variations

The semicolon as an infix notation for composition of relations dates back to Ernst Schröder's textbook of 1895.[6] Gunther Schmidt has renewed the use of the semicolon, particularly in Relational Mathematics (2011).[2]: 40 [7] The use of the semicolon coincides with the notation for function composition used (mostly by computer scientists) in category theory,[8] as well as the notation for dynamic conjunction within linguistic dynamic semantics.[9]

A small circle (R∘S) has been used for the infix notation of composition of relations by John M. Howie in his books considering semigroups of relations.[10] However, the small circle is widely used to represent composition of functions g(f(x))=(g∘f)(x), which reverses the text sequence from the operation sequence. The small circle was used in the introductory pages of Graphs and Relations[5]: 18 until it was dropped in favor of juxtaposition (no infix notation). Juxtaposition (RS) 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[11] prefer to write ∘l and ∘r 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 (right) composition, while left composition is denoted by a fat semicolon. The unicode symbols are ⨾ and ⨟.[12][13]

### Mathematical generalizations

Binary relations R⊆X×Y are morphisms R:X->Y in the category of relations Rel. 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 Set of sets and functions is a subcategory of Rel where the maps X->Y are functions f:X->Y.

Given a regular category 𝕏, its category of internal relations Rel(𝕏) has the same objects as 𝕏, but now the morphisms X->Y are given by subobjects R⊆X×Y in 𝕏.[14] Formally, these are jointly monic spans between X and Y. Categories of internal relations are allegories. In particular Rel(Set)≅Rel. Given a field k (or more generally a principal ideal domain), the category of relations internal to matrices over k, Rel(Mat(k)), has morphisms n->m the linear subspaces R⊆kn⊕km. The category of linear relations over the finite field 𝔽2 is isomorphic to the phase-free qubit ZX-calculus modulo scalars.

## Properties

* Composition of relations is associative: R;(S;T)=(R;S);T.
* The converse relation of R;S is (R;S)T=ST;RT. This property makes the set of all binary relations on a set a semigroup with involution.
* The composition of (partial) functions (that is, functional relations) is again a (partial) function.
* If R and S are injective, then R;S is injective, which conversely together with the requirement that S is also left total on range(R)[15] implies the injectivity of only R.
* If R and S are surjective, then R;S is surjective, which conversely implies the surjectivity of only S.
* The set of binary relations on a set X (that is, relations from X to X) together with (left or right) relation composition forms a monoid with zero, where the identity map on X is the neutral element, and the empty set is the zero element.

## Composition in terms of matrices

Finite binary relations are represented by logical matrices. The entries of these matrices are either zero or one, depending on whether the relation represented is false or true for the row and column corresponding to compared objects. Working with such matrices involves the Boolean arithmetic with 1+1=1 and 1×1=1. An entry in the matrix product of two logical matrices will be 1, then, only if the row and column multiplied have a corresponding 1. Thus the logical matrix of a composition of relations can be found by computing the matrix product of the matrices representing the factors of the composition. "Matrices constitute a method for computing the conclusions traditionally drawn by means of hypothetical syllogisms and sorites."[16]

## Heterogeneous relations

Consider a heterogeneous relation R⊆A×B, that is, where A and B may be distinct sets. Then using composition of relation R with its converse RT, there are homogeneous relations R;RT (on A) and RT;R (on B).

If for all x∈A there exists some y∈B, such that xRy (that is, R is a (left-)total relation), then for all x, xR;RTx so that R;RT is a reflexive relation or I⊆R;RT where I is the identity relation {(x,x):x∈A}. Similarly, if R is a surjective relation then RT;R⊇I={(x,x):x∈B}. In this case R⊆R;RT;R. The opposite inclusion occurs for a difunctional relation.

The composition R¯T;R is used to distinguish relations of Ferrer's type, which satisfy R;R¯T;R=R.

### Example

Let A= { France, Germany, Italy, Switzerland } and B= { French, German, Italian } with the relation R given by aRb when b is a national language of a. Since both A and B is finite, R can be represented by a logical matrix, assuming rows (top to bottom) and columns (left to right) are ordered alphabetically: (100010001111).

The converse relation RT corresponds to the transposed matrix, and the relation composition RT;R corresponds to the matrix product RTR when summation is implemented by logical disjunction. It turns out that the 3×3 matrix RTR contains a 1 at every position, while the reversed matrix product computes as: RRT=(1001010100111111). This matrix is symmetric, and represents a homogeneous relation on A.

Correspondingly, RT;R is the universal relation on B, hence any two languages share a nation where they both are spoken (in fact: Switzerland). Vice versa, the question whether two given nations share a language can be answered using R;RT.

## Schröder rules

For a given set V, the collection of all binary relations on V forms a Boolean lattice ordered by inclusion (⊆). Recall that complementation reverses inclusion: A⊆B implies B∁⊆A∁. In the calculus of relations[17] it is common to represent the complement of a set by an overbar: A¯=A∁.

If S is a binary relation, let ST represent the converse relation, also called the transpose. Then the Schröder rules are Q;R⊆S is equivalent to QT;S¯⊆R¯ is equivalent to S¯;RT⊆Q¯. 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.[5]: 15–19

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.[4] He wrote[18] L;M⊆N implies N¯;MT⊆L¯.

With Schröder rules and complementation one can solve for an unknown relation X in relation inclusions such as R;X⊆SandX;R⊆S. For instance, by Schröder rule R;X⊆S implies RT;S¯⊆X¯, and complementation gives X⊆RT;S¯‾, which is called the left residual of S by R.

## 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 (source), and the right residual presumes the same codomain (range, target). The symmetric quotient presumes two relations share a domain and a codomain.

Definitions:

* Left residual: A∖B:=AT;B¯‾ [19]
* Right residual: D/C:=D¯;CT‾
* Symmetric quotient: syq⁡(E,F):=ET;F¯‾∩E¯T;F‾

Using Schröder's rules, A;X⊆B is equivalent to X⊆A∖B. Thus the left residual is the greatest relation satisfying A;X⊆B. Similarly, the inclusion Y;C⊆D is equivalent to Y⊆D/C, and the right residual is the greatest relation satisfying Y;C⊆D.[2]: 43–6

## Join: another form of composition

A fork operator (<) has been introduced to fuse two relations c:H->A and d:H->B into c(<)d:H->A×B. The construction depends on projections a:A×B->A and b:A×B->B, understood as relations, meaning that there are converse relations aT and bT. Then the fork of c and d is given by[20] c(<)d:=c;aT∩ d;bT.

Another form of composition of relations, which applies to general n-place relations for n≥2, 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 (SQL).

## See also

* Demonic composition
* Social:Friend of a friend - Human contact that exists because of a mutual friend

## Notes

1. ↑ Bjarni Jónsson (1984) "Maximal Algebras of Binary Relations", in Contributions to Group Theory, K.I. Appel editor American Mathematical Society ISBN 978-0-8218-5035-0
2. ↑ 2.0 2.1 2.2 Gunther Schmidt (2011) Relational Mathematics, Encyclopedia of Mathematics and its Applications, vol. 132, Cambridge University Press ISBN 978-0-521-76268-7
3. ↑ A. De Morgan (1860) "On the Syllogism: IV and on the Logic of Relations"
4. ↑ 4.0 4.1 Daniel D. Merrill (1990) Augustus De Morgan and the Logic of Relations, page 121, Kluwer Academic ISBN 9789400920477
5. ↑ 5.0 5.1 5.2 Gunther Schmidt & Thomas Ströhlein (1993) Relations and Graphs, Springer books
6. ↑ Ernst Schröder (1895) Algebra und Logik der Relative
7. ↑ Paul Taylor (1999). Practical Foundations of Mathematics. Cambridge University Press. p. 24. ISBN 978-0-521-63107-5. https://books.google.com/books?id=iSCqyNgzamcC&pg=PA24. A free HTML version of the book is available at http://www.cs.man.ac.uk/~pt/Practical_Foundations/
8. ↑ Michael Barr & Charles Wells (1998) Category Theory for Computer Scientists , page 6, from McGill University
9. ↑ Rick Nouwen and others (2016) Dynamic Semantics §2.2, from Stanford Encyclopedia of Philosophy
10. ↑ John M. Howie(1995) Fundamentals of Semigroup Theory, page 16, LMS Monograph #12, Clarendon Press ISBN 0-19-851194-9
11. ↑ Kilp, Knauer & Mikhalev, p. 7
12. ↑ ISO/IEC 13568:2002(E), p. 23
13. ↑ See U+2A3E and U+2A1F on FileFormat.info
14. ↑ "internal relations". https://ncatlab.org/nlab/show/internal+relation.
15. ↑ See the image for an example where R;S is injective, but R is not
16. ↑ Irving Copilowish (December 1948) "Matrix development of the calculus of relations", Journal of Symbolic Logic 13(4): 193–203 Jstor link, quote from page 203
17. ↑ Vaughan Pratt The Origins of the Calculus of Relations, from Stanford University
18. ↑ De Morgan indicated contraries by lower case, conversion as M−1, and inclusion with )), so his notation was nM−1)) l.
19. ↑ not to be confused with set difference
20. ↑ Gunther Schmidt and Michael Winter (2018): Relational Topology, page 26, Lecture Notes in Mathematics vol. 2208, Springer books, ISBN 978-3-319-74451-3

## References

* M. Kilp, U. Knauer, A.V. Mikhalev (2000) Monoids, Acts and Categories with Applications to Wreath Products and Graphs, De Gruyter Expositions in Mathematics vol. 29, Walter de Gruyter,ISBN 3-11-015248-7.

Template:Order theory

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Composition of relations. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Composition_of_relations&oldid=4299790"