Recent from talks
Contribute something
Nothing was collected or created yet.
Composition of relations
View on WikipediaIn 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 of Uncle () is the composition of relations "is a brother of" () and "is a parent of" ().
Beginning with Augustus De Morgan,[3] the traditional form of reasoning by syllogism has been subsumed by relational logical expressions and their composition.[4]
Definition
[edit]If and are two binary relations, then their composition is the relation
In other words, is defined by the rule that says if and only if there is an element such that (that is, and ).[5]: 13
Notational variations
[edit]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 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 , 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 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 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 (right) composition, while left composition is denoted by a fat semicolon. The unicode symbols are ⨾ and ⨟.[12][13]
Mathematical generalizations
[edit]Binary relations are morphisms in the category . In Rel the objects are sets, the morphisms are binary relations and the composition of morphisms is exactly composition of relations as defined above. The category Set of sets and functions is a subcategory of where the maps are functions .
Given a regular category , its category of internal relations has the same objects as , but now the morphisms are given by subobjects in .[14] Formally, these are jointly monic spans between and . Categories of internal relations are allegories. In particular . Given a field (or more generally a principal ideal domain), 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
[edit]- 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 (partial) functions (that is, functional relations) is again a (partial) function.
- If and are injective, then is injective, which conversely implies only the injectivity of
- If and are surjective, then is surjective, which conversely implies only the surjectivity of
- The set of binary relations on a set (that is, relations from to ) together with (left or right) 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
[edit]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 and 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."[15]
Heterogeneous relations
[edit]Consider a heterogeneous relation that is, where and are distinct sets. Then using composition of relation with its converse there are homogeneous relations (on ) and (on ).
If for all there exists some such that (that is, is a (left-)total relation), 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
[edit]Let { France, Germany, Italy, Switzerland } and { French, German, Italian } with the relation given by when is a national language of Since both and is finite, can be represented by a logical matrix, assuming rows (top to bottom) and columns (left to right) 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 (in fact: Switzerland). Vice versa, the question whether two given nations share a language can be answered using
Schröder rules
[edit]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[16] 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.[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[17]
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
[edit]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:
- Right residual:
- Symmetric quotient:
Using Schröder's rules, is equivalent to Thus the left residual is the greatest relation satisfying Similarly, the inclusion is equivalent to and the right residual is the greatest relation satisfying [2]: 43–6
One can practice the logic of residuals with Sudoku.[further explanation needed]
Join: another form of composition
[edit]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 fork of and is given by[18]
Another 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 (SQL).
See also
[edit]- Demonic composition – Mathematical operation
- Friend of a friend – Human contact that exists because of a mutual friend
Notes
[edit]- ^ 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
- ^ a b c Gunther Schmidt (2011) Relational Mathematics, Encyclopedia of Mathematics and its Applications, vol. 132, Cambridge University Press ISBN 978-0-521-76268-7
- ^ A. De Morgan (1860) "On the Syllogism: IV and on the Logic of Relations"
- ^ a b Daniel D. Merrill (1990) Augustus De Morgan and the Logic of Relations, page 121, Kluwer Academic ISBN 9789400920477
- ^ a b c Gunther Schmidt & Thomas Ströhlein (1993) Relations and Graphs, Springer books
- ^ Ernst Schröder (1895) Algebra und Logik der Relative
- ^ Paul Taylor (1999). Practical Foundations of Mathematics. Cambridge University Press. p. 24. ISBN 978-0-521-63107-5. A free HTML version of the book is available at http://www.cs.man.ac.uk/~pt/Practical_Foundations/
- ^ Michael Barr & Charles Wells (1998) Category Theory for Computer Scientists Archived 2016-03-04 at the Wayback Machine, page 6, from McGill University
- ^ Rick Nouwen and others (2016) Dynamic Semantics §2.2, from Stanford Encyclopedia of Philosophy
- ^ John M. Howie (1995) Fundamentals of Semigroup Theory, page 16, LMS Monograph #12, Clarendon Press ISBN 0-19-851194-9
- ^ Kilp, Knauer & Mikhalev, p. 7
- ^ ISO/IEC 13568:2002(E), p. 23
- ^ See U+2A3E and U+2A1F on FileFormat.info
- ^ "internal relations". nlab. Retrieved 26 September 2023.
- ^ 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
- ^ Vaughn Pratt The Origins of the Calculus of Relations, from Stanford University
- ^ De Morgan indicated contraries by lower case, conversion as M−1, and inclusion with )), so his notation was
- ^ 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
[edit]- 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.
Composition of relations
View on GrokipediaFundamentals
Definition
In set theory, given binary relations and , their composition, often denoted , is the binary relation defined as the set of all ordered pairs such that there exists some satisfying and .[8] This construction captures the transitive linkage between elements of and through intermediate elements in , formalized via existential quantification over .[8] When and are functional relations—meaning each element in the domain maps to exactly one element in the codomain—the composition reduces precisely to the standard composition of functions, where for .[9] The concept of relation composition, introduced by Augustus de Morgan in 1860 and developed by Charles Sanders Peirce, was systematized by Ernst Schröder in the 1890s, particularly in his work on the calculus of relations within the algebra of logic.[7][10]Notation and Variations
The composition of two binary relations and is commonly denoted in modern mathematical literature as , where the circle symbol indicates the relational product, with applied first followed by .[11] This notation aligns with the standard convention for function composition, emphasizing the sequential application from right to left. An alternative infix notation uses juxtaposition, writing for the same operation, particularly in contexts where the relations are treated as elements of a monoid under composition; however, this form requires care to distinguish it from other binary operations on relations.[11] Historically, the semicolon notation —again with first—was introduced by Ernst Schröder in his 1895 treatise on the algebra and logic of relative theory, where it served as the infix operator for the relative product of relatives (binary relations). Alfred Tarski adopted and formalized this semicolon notation in his 1941 axiomatic treatment of the calculus of relations, defining to hold if there exists such that and , and using it throughout his development of relation algebras.[12] In domain-specific formalisms, variations reflect syntactic or applicative needs. The Z notation, a formal specification language for software, employs the semicolon for forward relational composition (with right-to-left application, as in ), but also supports the dedicated Unicode symbol (U+2A3E) to explicitly denote relational composition in typeset documents. In relational algebra, foundational to database query languages, direct composition of relations is not a primitive but is realized through the natural join operator , which combines tuples from two relations on matching attributes, effectively computing the relational product under equality conditions.[13] A key concern with juxtaposition is its potential ambiguity, as it may be misinterpreted as the union or, less commonly, the Cartesian product in texts where these operations lack explicit symbols; authors often mitigate this by reserving juxtaposition strictly for composition or qualifying it contextually.[11]Properties and Generalizations
Algebraic Properties
Relation composition exhibits several fundamental algebraic properties that mirror those of binary operations in abstract algebra. Foremost among these is associativity: for binary relations , , and , the composition satisfies . This property allows for unambiguous iteration of compositions without parentheses, facilitating the definition of powers of relations, such as transitive closures.[14] The operation also possesses an identity element. For a set , the identity relation acts as a two-sided unit under composition: if , then and . This neutral behavior ensures that adjoining the identity does not alter the relation, analogous to the role of the identity function in function composition.[15][14] In addition, the empty relation functions as an absorbing zero element. For any relation compatible with , the compositions and . This absorption property highlights how the absence of connecting elements in one relation renders the overall composition void, underscoring the set-theoretic foundations of the operation.[14] These properties collectively endow the collection of all binary relations on a fixed set , denoted , with a monoid structure under composition. Specifically, forms a monoid, where associativity ensures well-defined multiple compositions and provides the required unit. This algebraic framework is central to relation algebra and enables the study of relations as elements in a semigroup with identity.[15][14] Composition further interacts compatibly with the converse operation on relations. The converse of a relation is , which reverses the direction of the relation. For compatible relations and , the key identity holds: . This reversal property preserves the chaining structure while flipping the order, proving useful in analyzing symmetries and inverses in relational systems.[14]Mathematical Generalizations
In category theory, the composition of relations generalizes to the category Rel, where objects are sets and morphisms are binary relations between them, with composition defined by the standard relational product: for relations and , the composite .73066-8) This category is dagger-compact and serves as the primary example of an allegory, a bicategory where every morphism has a converse, enabling a calculus of relations that captures properties like associativity and converse preservation under composition.73066-8) The structure of Rel highlights how relation composition extends beyond mere set-theoretic operations to a framework supporting enriched categorical constructions, such as monoidal structures induced by Cartesian products. In more abstract settings, such as regular categories—those with finite limits, coequalizers of kernel pairs, and pullback-stable regular epimorphisms—internal relations are defined using spans or jointly monic pairs. A relation from object to is a jointly monic span , where the pair induces a monomorphism , representing subobjects of the product.[16] Composition of two such relations, say and , proceeds via the pullback along the codomain and domain maps, followed by taking the regular image of the induced map to to ensure the result is again a jointly monic span.[16] This construction yields a bicategory of relations internal to the regular category, equivalent to the 2-category of relational po-categories, where composition is associative and independent of the choice of span representatives.[16] Linear relations provide a further generalization over vector spaces or modules, where a relation between vector spaces and over a field (such as ) is a linear subspace , closed under addition and scalar multiplication.[17] Composition mirrors the relational case but leverages linearity: for and , the composite is , which is again a linear subspace of . In finite-dimensional settings over , the category of linear relations is isomorphic to the phase-free fragment of the qubit ZX-calculus, where linear maps and relations are depicted as Z- and X-spiders connected by wires, allowing diagrammatic simplification of composites through rewrite rules like the bialgebra laws.[18] This framework is particularly useful in quantum information, where ZX-diagrams encode compositions of linear relations on Hilbert spaces. Profunctors, also known as distributors, extend relation composition to arbitrary categories, generalizing binary relations as bifunctors that assign to objects and a set of "relations" between them. Composition of profunctors and is given by the coend formula , which quotients by the actions of morphisms in to ensure functoriality, forming the bicategory of categories, profunctors, and natural transformations. When restricted to the category of sets, profunctors recover ordinary relations, with composition reducing to the relational product, but in general, this construction applies to arrow categories (where objects are arrows in a base category and morphisms are commuting squares) by viewing arrows as fibrations and profunctors as generalized relations between them, preserving associativity up to isomorphism in the bicategorical sense. This abstraction underpins applications in database theory and open systems modeling, where profunctor composition models relational queries across structured categories.Representation and Computation
Matrix Composition
A binary relation on finite sets and can be represented by an logical matrix , where the entry if and otherwise.[19] This representation uses Boolean entries to encode membership directly, facilitating algebraic manipulation. The composition , where and for finite , corresponds to the Boolean matrix product . In this product, addition is the logical OR (, with ) and multiplication is the logical AND ().[20] Thus, the entry in row and column of is computed as , indicating existence of an intermediate element connecting to .[19] For illustration, consider sets , , , with so and so The composition yields , with [21] This matrix approach enables efficient computation of relation compositions for finite sets, as the Boolean product can be evaluated in time using standard algorithms adapted for logical operations.[20] Moreover, when , the logical matrix aligns with the adjacency matrix of the directed graph representing the relation, allowing composition to model path existence in graph theory.[19]Heterogeneous Relations
Heterogeneous relations arise in the composition of binary relations where the underlying sets differ in type or cardinality, allowing for more general structures beyond homogeneous cases. A relation is heterogeneous if and are distinct sets, possibly with . The composition with another relation follows the standard definition: if and only if there exists such that and . This is valid whenever the codomain of aligns with the domain of , even if or , enabling compositions across mismatched domains and codomains. Key constructions in heterogeneous relation algebra involve the converse relation , defined by if and only if . The self-composition captures connectivity within ; in particular, is total on (every relates to some ) if and only if the identity relation satisfies , since holds precisely when there exists with . Dually, assesses coverage on ; is surjective on (every is related to by some ) if and only if . These tests are fundamental for verifying completeness and exhaustiveness in relational mappings between disparate sets.[19] Heterogeneous relations are computationally represented by rectangular Boolean matrices, with rows indexed by elements of and columns by , where entry if and 0 otherwise. For composition with an matrix and a matrix, the result is the Boolean matrix product: using disjunction () as addition and conjunction () as multiplication in the Boolean semiring. This accommodates dimensional heterogeneity, unlike square matrices in homogeneous cases. Consider sets of countries and of languages. The border relation (symmetric) includes: France–Germany, France–Switzerland, Germany–Switzerland, Switzerland–Italy. Its matrix (rows/columns: F, G, I, S) is: The speaking relation is given by:- France relates to French,
- Germany to German,
- Italy to Italian,
- Switzerland to French, German, and Italian.
| Country | French | German | Italian |
|---|---|---|---|
| France | 1 | 1 | 1 |
| Germany | 1 | 1 | 1 |
| Italy | 1 | 1 | 1 |
| Switzerland | 1 | 1 | 1 |
