Definition
Given relations R:A↛B and S:B↛C, the composite S∘R:A↛C is:
S∘R={(a,c)∈A×C:∃b∈B.aRb∧bSc}
In words: a is related to c by S∘R iff there is some intermediate b connecting them through R and then S.
Notation Warning
Some sources write composition as R;S or RS. The order convention varies. Our convention: (S∘R)(a)=S(R(a)).
Example
Let R:{1,2,3}↛{a,b} with R={(1,a),(2,b),(3,a)}.
Let S:{a,b}↛{X,Y} with S={(a,X),(b,Y),(b,X)}.
Then S∘R={(1,X),(2,X),(2,Y),(3,X)}.
Check: 1Ra and aSX, so (1,X)∈S∘R. And 2Rb with bSY and bSX, so (2,Y),(2,X)∈S∘R.
Examinable Proof: Associativity
Theorem: Relational composition is associative: (T∘S)∘R=T∘(S∘R).
Proof:
By extensionality, we show both sides relate the same pairs.
a((T∘S)∘R)d⟺∃c.aRc∧c(T∘S)d
⟺∃c.aRc∧(∃b.cSb∧bTd)
⟺∃b,c.aRc∧cSb∧bTd
a(T∘(S∘R))d⟺∃b.a(S∘R)b∧bTd
⟺∃b.(∃c.aRc∧cSb)∧bTd
⟺∃b,c.aRc∧cSb∧bTd
Both sides are equivalent to ∃b,c.aRc∧cSb∧bTd.
Therefore (T∘S)∘R=T∘(S∘R).
Examinable Proof: Identity Laws
Theorem: The identity relation is a neutral element for composition.
idB∘R=R=R∘idA
for R:A↛B.
Proof:
a(idB∘R)b⟺∃c∈B.aRc∧cidBb
⟺∃c∈B.aRc∧c=b
⟺aRb
Similarly: a(R∘idA)b⟺∃c∈A.aidAc∧cRb
⟺∃c∈A.a=c∧cRb
⟺aRb
Monoid Structure
The endo-relations Rel(A,A) on a set A form a monoid under composition:
- Associativity: (R∘S)∘T=R∘(S∘T)
- Identity: R∘idA=R=idA∘R
This is a foundational structure with many applications.
n-fold Iteration
For a relation R on A, define the n-fold iteration:
R∘0=idA
R∘(n+1)=R∘R∘n
Interpretation
- R∘0: “be the same element”
- R∘1=R: “take one R-step”
- R∘n: “take exactly n R-steps”
The Path Relation
The path relation (or reflexive-transitive closure) is:
R∘∗=⋃n≥0R∘n
This relates a to b iff there is a path of length ≥0 from a to b.
Properties
- Always reflexive: idA⊆R∘∗
- Always transitive: R∘∗∘R∘∗=R∘∗
Summary
- S∘R={(a,c):∃b.aRb∧bSc}
- Composition is associative with identity id
- Endo-relations form a monoid under composition
- R∘n is n-fold iteration; R∘∗=⋃nR∘n is the path relation