Composition of Mappings is not Commutative

Theorem
The composition of mappings is not in general a commutative binary operation:


 * $f_2 \circ f_1 \ne f_1 \circ f_2$

Proof

 * Proof by Counterexample:

Let $f_1: S_1 \to S_2$ and $f_2: S_2 \to S_3$ be mappings.

First note that unless $S_1 = S_3$ then $f_2 \circ f_1$ is not even defined.

So in that case $f_2 \circ f_1$ is definitely not the same thing as $f_1 \circ f_2$.

So, let us suppose $S_1 = S_3$ and so we define $f_1: S_1 \to S_2$ and $f_2: S_2 \to S_1$.

If $S_1 \ne S_2$ then:
 * $f_2 \circ f_1: S_1 \to S_1$
 * $f_1 \circ f_2: S_2 \to S_2$

and so by Equality of Mappings they are unequal because their domains and codomains are different.

Finally, suppose $S_1 = S_2$, and consider the following.


 * $S_1 = S_2 = \left\{{a, b}\right\}$
 * $f_1 = \left\{{\left({a, a}\right), \left({b, a}\right)}\right\}$
 * $f_2 = \left\{{\left({a, b}\right), \left({b, b}\right)}\right\}$

It is straightforward to check that $f_1$ and $f_2$ are mappings, and that:


 * $f_1 \circ f_2 = \left\{{\left({a, b}\right), \left({b, b}\right)}\right\}$
 * $f_2 \circ f_1 = \left\{{\left({a, a}\right), \left({b, a}\right)}\right\}$

Thus, even in this limitingly simple case, we see that:


 * $f_2 \circ f_1 \ne f_1 \circ f_2$