Composition of relations explained

In the mathematics of binary relations, the composition of relations is the forming of a new binary relation from two given binary relations R and S. 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 of Uncle (

xUz

) is the composition of relations "is a brother of" (

xBy

) and "is a parent of" (

yPz

).U = BP \quad \text \quad xByPz \text xUz.

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

Definition

If

R\subseteqX x Y

and

S\subseteqY x Z

are two binary relations, thentheir composition

R;S

is the relationR; S = \.

In other words,

R;S\subseteqX x Z

is defined by the rule that says

(x,z)\inR;S

if and only if there is an element

y\inY

such that

xRySz

(that is,

(x,y)\inR

and

(y,z)\inS

).

Notational variations

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

A small circle

(R\circS)

has been used for the infix notation of composition of relations by John M. Howie in his books considering semigroups of relations.[6] However, the small circle is widely used to represent composition of functions

g(f(x))=(g\circf)(x)

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 (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[7] prefer to write

\circl

and

\circr

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:

\circ

is used to denote the traditional (right) composition, while left composition is denoted by a fat semicolon. The unicode symbols are ⨾ and ⨟.[8] [9]

Mathematical generalizations

Binary relations

R\subseteqX x Y

are morphisms

R:X\toY

in the category

Rel

. 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

Rel

where the maps

X\toY

are functions

f:X\toY

.

X

, its category of internal relations

Rel(X)

has the same objects as

X

, but now the morphisms

X\toY

are given by subobjects

R\subseteqX x Y

in

X

.[10] Formally, these are jointly monic spans between

X

and

Y

. Categories of internal relations are allegories. In particular

Rel(Set)\congRel

. 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\tom

linear subspaces

R\subseteqknkm

. The category of linear relations over the finite field

F2

is isomorphic to the phase-free qubit ZX-calculus modulo scalars.

Properties

R;(S;T)=(R;S);T.

R;S

is

(R;S)sf{T}=Ssf{T

} \, ; R^. This property makes the set of all binary relations on a set a semigroup with involution.

R

and

S

are injective, then

R;S

is injective, which conversely implies only the injectivity of

R.

R

and

S

are surjective, then

R;S

is surjective, which conversely implies only the surjectivity of

S.

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 x 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."[11]

Heterogeneous relations

Consider a heterogeneous relation

R\subseteqA x B;

that is, where

A

and

B

are distinct sets. Then using composition of relation

R

with its converse

Rsf{T},

there are homogeneous relations

RRsf{T}

(on

A

) and

Rsf{T}R

(on

B

).

If for all

x\inA

there exists some

y\inB,

such that

xRy

(that is,

R

is a (left-)total relation), then for all

x,xRRsf{T}x

so that

RRsf{T}

is a reflexive relation or

I\subseteqRRsf{T}

where I is the identity relation

\{(x,x):x\inA\}.

Similarly, if

R

is a surjective relation then R^\textsf R \supseteq I = \. In this case

R\subseteqRRsf{T}R.

The opposite inclusion occurs for a difunctional relation.

The composition

\bar{R}sf{T}R

is used to distinguish relations of Ferrer's type, which satisfy

R\bar{R}sf{T}R=R.

Example

Let

A=

and

B=

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:\begin 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 1 & 1\end.

Rsf{T}

corresponds to the transposed matrix, and the relation composition

Rsf{T};R

corresponds to the matrix product

Rsf{T}R

when summation is implemented by logical disjunction. It turns out that the

3 x 3

matrix

Rsf{T}R

contains a 1 at every position, while the reversed matrix product computes as:R R^\textsf = \begin 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 1 \\ 1 & 1 & 1 & 1\end.This matrix is symmetric, and represents a homogeneous relation on

A.

Correspondingly,

Rsf{T};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;Rsf{T}.

Schröder rules

For a given set

V,

the collection of all binary relations on

V

forms a Boolean lattice ordered by inclusion

(\subseteq).

Recall that complementation reverses inclusion:

A\subseteqBimpliesB\complement\subseteqA\complement.

In the calculus of relations[12] it is common to represent the complement of a set by an overbar:

\bar{A}=A\complement.

If

S

is a binary relation, let

Ssf{T}

represent the converse relation, also called the transpose. Then the Schröder rules areQ R \subseteq S \quad \text \quad Q^\textsf \bar \subseteq \bar \quad \text \quad \bar R^\textsf \subseteq \bar.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.[13]

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[14] L M \subseteq N \text \bar M^\textsf \subseteq \bar.

With Schröder rules and complementation one can solve for an unknown relation

X

in relation inclusions such as R X \subseteq S \quad \text \quad XR \subseteq S.For instance, by Schröder rule

RX\subseteqSimpliesRsf{T}\bar{S}\subseteq\bar{X},

and complementation gives

X\subseteq\overline{Rsf{T}\bar{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:

A\backslashBl{:=}\overline{Asf{T}\bar{B}}

D/Cl{:=}\overline{\bar{D}Csf{T}}

\operatorname{syq}(E,F)l{:=}\overline{Esf{T}\bar{F}}\cap\overline{\bar{E}sf{T}F}

Using Schröder's rules,

AX\subseteqB

is equivalent to

X\subseteqA\backslashB.

Thus the left residual is the greatest relation satisfying

AX\subseteqB.

Similarly, the inclusion

YC\subseteqD

is equivalent to

Y\subseteqD/C,

and the right residual is the greatest relation satisfying

YC\subseteqD.

One can practice the logic of residuals with Sudoku.

Join: another form of composition

A fork operator

(<)

has been introduced to fuse two relations

c:H\toA

and

d:H\toB

into

c(<)d:H\toA x B.

The construction depends on projections

a:A x B\toA

and

b:A x B\toB,

understood as relations, meaning that there are converse relations

asf{T

} and

bsf{T

}. Then the of

c

and

d

is given by[15] c\,(<)\,d ~\mathrel~ c ;a^\textsf \cap\ d ;b^\textsf.

Another form of composition of relations, which applies to general

n

-place relations for

n\geq2,

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).

References

Notes and References

  1. A. De Morgan (1860) "On the Syllogism: IV and on the Logic of Relations"
  2. [Ernst Schroder]
  3. Book: Paul Taylor. Practical Foundations of Mathematics. 1999. Cambridge University Press. 978-0-521-63107-5. 24. A free HTML version of the book is available at http://www.cs.man.ac.uk/~pt/Practical_Foundations/
  4. Michael Barr & Charles Wells (1998) Category Theory for Computer Scientists, page 6, from McGill University
  5. Rick Nouwen and others (2016) Dynamic Semantics §2.2, from Stanford Encyclopedia of Philosophy
  6. [John M. Howie ]
  7. Kilp, Knauer & Mikhalev, p. 7
  8. ISO/IEC 13568:2002(E), p. 23
  9. See U+2A3E and U+2A1F on FileFormat.info
  10. Web site: internal relations . nlab . 26 September 2023.
  11. [Irving Copilowish]
  12. [Vaughn Pratt]
  13. [Gunther Schmidt]
  14. De Morgan indicated contraries by lower case, conversion as M−1, and inclusion with)), so his notation was

    nM-1))l.

  15. [Gunther Schmidt]