Skip to content
Part IA Michaelmas, Lent Term

Relational Composition

Definition

Given relations R:A↛BR : A \nrightarrow B and S:B↛CS : B \nrightarrow C, the composite S∘R:A↛CS \circ R : A \nrightarrow C is:

S∘R={(a,c)∈A×C:∃b∈B.aRb∧bSc}S \circ R = \{(a, c) \in A \times C : \exists b \in B. aRb \land bSc\}

In words: aa is related to cc by S∘RS \circ R iff there is some intermediate bb connecting them through RR and then SS.

Notation Warning

Some sources write composition as R;SR ; S or RSRS. The order convention varies. Our convention: (S∘R)(a)=S(R(a))(S \circ R)(a) = S(R(a)).

Example

Let R:{1,2,3}↛{a,b}R : \{1, 2, 3\} \nrightarrow \{a, b\} with R={(1,a),(2,b),(3,a)}R = \{(1, a), (2, b), (3, a)\}.

Let S:{a,b}↛{X,Y}S : \{a, b\} \nrightarrow \{X, Y\} with S={(a,X),(b,Y),(b,X)}S = \{(a, X), (b, Y), (b, X)\}.

Then S∘R={(1,X),(2,X),(2,Y),(3,X)}S \circ R = \{(1, X), (2, X), (2, Y), (3, X)\}.

Check: 1Ra1Ra and aSXaSX, so (1,X)∈S∘R(1, X) \in S \circ R. And 2Rb2Rb with bSYbSY and bSXbSX, so (2,Y),(2,X)∈S∘R(2, Y), (2, X) \in S \circ R.

Examinable Proof: Associativity

Theorem: Relational composition is associative: (T∘S)∘R=T∘(S∘R)(T \circ S) \circ R = T \circ (S \circ R).

Proof:

By extensionality, we show both sides relate the same pairs.

a((T∘S)∘R)d  ⟺  ∃c.aRc∧c(T∘S)da ((T \circ S) \circ R) d \iff \exists c. aRc \land c(T \circ S)d   ⟺  ∃c.aRc∧(∃b.cSb∧bTd)\iff \exists c. aRc \land (\exists b. cSb \land bTd)   ⟺  ∃b,c.aRc∧cSb∧bTd\iff \exists b, c. aRc \land cSb \land bTd

a(T∘(S∘R))d  ⟺  ∃b.a(S∘R)b∧bTda (T \circ (S \circ R)) d \iff \exists b. a(S \circ R)b \land bTd   ⟺  ∃b.(∃c.aRc∧cSb)∧bTd\iff \exists b. (\exists c. aRc \land cSb) \land bTd   ⟺  ∃b,c.aRc∧cSb∧bTd\iff \exists b, c. aRc \land cSb \land bTd

Both sides are equivalent to ∃b,c.aRc∧cSb∧bTd\exists b, c. aRc \land cSb \land bTd.

Therefore (T∘S)∘R=T∘(S∘R)(T \circ S) \circ R = T \circ (S \circ R).

Examinable Proof: Identity Laws

Theorem: The identity relation is a neutral element for composition.

idB∘R=R=R∘idA\text{id}_B \circ R = R = R \circ \text{id}_A

for R:A↛BR : A \nrightarrow B.

Proof:

a(idB∘R)b  ⟺  ∃c∈B.aRc∧c idB ba(\text{id}_B \circ R)b \iff \exists c \in B. aRc \land c\,\text{id}_B\,b   ⟺  ∃c∈B.aRc∧c=b\iff \exists c \in B. aRc \land c = b   ⟺  aRb\iff aRb

Similarly: a(R∘idA)b  ⟺  ∃c∈A.a idA c∧cRba(R \circ \text{id}_A)b \iff \exists c \in A. a\,\text{id}_A\,c \land cRb   ⟺  ∃c∈A.a=c∧cRb\iff \exists c \in A. a = c \land cRb   ⟺  aRb\iff aRb

Monoid Structure

The endo-relations Rel(A,A)\text{Rel}(A, A) on a set AA form a monoid under composition:

  • Associativity: (R∘S)∘T=R∘(S∘T)(R \circ S) \circ T = R \circ (S \circ T)
  • Identity: R∘idA=R=idA∘RR \circ \text{id}_A = R = \text{id}_A \circ R

This is a foundational structure with many applications.

n-fold Iteration

For a relation RR on AA, define the nn-fold iteration:

R∘0=idAR^{\circ 0} = \text{id}_A R∘(n+1)=R∘R∘nR^{\circ (n+1)} = R \circ R^{\circ n}

Interpretation

  • R∘0R^{\circ 0}: “be the same element”
  • R∘1=RR^{\circ 1} = R: “take one RR-step”
  • R∘nR^{\circ n}: “take exactly nn RR-steps”

The Path Relation

The path relation (or reflexive-transitive closure) is:

R∘∗=⋃n≥0R∘nR^{\circ *} = \bigcup_{n \geq 0} R^{\circ n}

This relates aa to bb iff there is a path of length ≥0\geq 0 from aa to bb.

Properties

  • Always reflexive: idA⊆R∘∗\text{id}_A \subseteq R^{\circ *}
  • Always transitive: R∘∗∘R∘∗=R∘∗R^{\circ *} \circ R^{\circ *} = R^{\circ *}

Summary

  • S∘R={(a,c):∃b.aRb∧bSc}S \circ R = \{(a, c) : \exists b. aRb \land bSc\}
  • Composition is associative with identity id\text{id}
  • Endo-relations form a monoid under composition
  • R∘nR^{\circ n} is nn-fold iteration; R∘∗=⋃nR∘nR^{\circ *} = \bigcup_n R^{\circ n} is the path relation