Here we will have an abstract look at the operation of composition. We start with a simple observation. Recall that IdA denotes the identity mapping on a set A.
Fact.
Let T be a mapping from a set A to a set B. ThenT ○ IdA = T andIdB ○ T = T.
Indeed, the identity mapping leaves elements as they are (or to put it another way, it sends every element to itself), so the first statement is proved by considering an arbitrary a and calculating
The second statement is proved in a similar way.
This gets even more interesting if we consider a set A and the space M of all mappings from A to A. Since starting and target sets are the same, we can always compose any two such mappings. Thus composition is a binary operation on M. If we denote the identity map on A as I, we can write the above Fact in this way:
This means that identity I acts as a unit element of the space M endowed with the operation of composition, just like number 1 acts as a unity for real numbers and multiplication. It gets even more interesting when we recall the condition for an inverse function. For mappings from A to A it reads
Again, for multiplication we have similar equality that defines the
reciprocal number,
One can also prove that composition satisfies the associative law. However,
that's where the similarity stops: The composition is not commutative. If we
have two mappings T and S from A to A, then in
most likelihood, unless we are extremely lucky, the compositions