Composite Mapping is Mapping

Theorem
Let $S_1, S_2, S_3$ be sets.

Let $f: S_1 \to S_2$ and $g: S_2 \to S_3$ be mappings.

Then the composite mapping $g \circ f$ is also a mapping.

Proof
The composite of $f$ and $g$ is defined as:


 * $g \circ f := \set {\tuple {x, z} \in S_1 \times S_3: \exists y \in S_2: \tuple {x, y} \in f \land \tuple {y, z} \in g}$

It is necessary to show that $g \circ f$ is both left-total and many-to-one.

Left-total
From the definition of a mapping:

That is, $g \circ f$ is left-total.

Many-to-one
Suppose $x_1, x_2 \in S_1: x_1 = x_2$.

Then as $f$ is a mapping and so by definition many-to-one:
 * $\map f {x_1} = \map f {x_2}$

and so:
 * $\map g {\map f {x_1} } = \map g {\map f {x_2} }$

demonstrating that $g \circ f$ is similarly many-to-one.