Surjection iff Right Inverse

Theorem
A mapping $$f: S \to T, S \ne \varnothing$$ is a surjection iff:
 * $$\exists g: T \to S: f \circ g = I_T$$

where $$g$$ is a mapping.

This mapping $$g: T \to S$$ is called a right inverse.

Proof 1

 * Assume $$\exists g: T \to S: f \circ g = I_S$$.

From Identity Mapping is a Surjection, $$I_T$$ is surjective, so $$f \circ g$$ is surjective.

So from Composite with Surjection is a Surjection, $$f$$ is a surjection.

Note that the existence of such a $$g$$ requires that $$S \ne \varnothing$$.


 * Now, assume $$f$$ is a surjection. Then:

$$\forall y \in T: f^{-1} \left({\left\{{y}\right\}}\right) \ne \varnothing$$

Let $$f^{-1} \left({\left\{{y}\right\}}\right) = X_y = \left\{{x_{y_1}, x_{y_2}, \ldots}\right\}$$

Using the Axiom of Choice, for each $$y \in T$$ we can choose any of the elements $$x_{y_1}, x_{y_2}, \ldots$$ to be identified as $$x_y$$, and thereby define:

$$g: T \to S: g \left({y}\right) = x_y$$

Then we see that $$f \circ g \left({y}\right) = f \left({x_y}\right) = y$$

and thus $$f \circ g = I_T$$.

Proof 2
Take the result Condition for Composite Mapping on Right:

Let $$A, B, C$$ be sets.

Let $$f: B \to A$$ and $$g: C \to A$$ be mappings.

Then:
 * $$\operatorname {Im} \left({g}\right) \subseteq \operatorname {Im} \left({f}\right)$$ iff $$\exists h: C \to B$$ such that $$h$$ is a mapping and $$f \circ h = g$$

Let $$C = A = T$$, let $$B = S$$ and let $$g = I_T$$.

Then the above translates into:


 * $$\operatorname {Im} \left({I_T}\right) \subseteq \operatorname {Im} \left({f}\right)$$ iff $$\exists g: T \to S$$ such that $$g$$ is a mapping and $$f \circ g = I_T$$

But we know that $$\operatorname {Im} \left({f}\right) \subseteq T = \operatorname {Im} \left({I_T}\right)$$.

So by definition of set equality, the result follows.