Right inverse if and only if onto

functionssolution-verification

I am trying to prove the following result.

Prove that $f: X \to Y$ is onto if and only if it possesses a right inverse. Then prove that this inverse is not necessarily unique (i.e., when $f$ is not injective).

Here is what I came up with, though in particular, my "proof" of lack of uniqueness is not very rigorous.

Proof. Suppose $f: X \to Y$ is surjective. Let $y \in Y$, so there exists $x \in X$ such that $f(x) = y$. Though this $x$ may not be unique, we define the mapping $g: Y \to X$ by the rule $g(y) = x$, using the Axiom of Choice. For any such $y$ with the property that $g(y) = x$, we have:
$$
(f \circ g)(y) = f(g(y)) = f(x) = y,
$$

so $f \circ g = i_Y$, and $g$ is a right inverse. Conversely, suppose $f$ possesses a right inverse, $g: Y \to X$ with the property that $f \circ g = i_Y$. Let $y \in Y$. Then $g(y) = x$ for some $x \in X$. Then, we observe that
$$
(f \circ g)(y) = f(g(y)) = f(x) = i_Y (y) = y
$$

so $f$ is surjective. This right inverse is not unique because we needed to invoke the Axiom of Choice to define $g(y) = x$ for some $x$. In the case where $f$ is not injective, given any $y \in Y $, there are potentially infinitely many $x$ such that $f(x) = y$, and we could define $g(y)$ to equal any of those x's, each of which would give an equally valid right inverse.

How does this proof look? Is this an appropriate use of choice? Is there a way to make the proof of lack of uniqueness more rigorous?

Thanks in advance.

Best Answer

Your if and only if proof looks pretty good to me. However your non-uniqueness proof is a bit flimsy.

To prove non-uniqueness it is sufficient (and almost always easier) to show it by an example. You can cook up any example but here is the first one that came to my head.

Suppose that $X=\mathbb{R}^2$ and $Y=\mathbb{R}$ with $f:X\to Y$ being $f(x,y)=x$. Clearly this function is onto. Now define the following map $S_1:Y\to X$ by $S_1(x)=(x,0)$. It shouldn't take much to convince you that $f(S_1(x))=i_Y$.

In addition the map $S_2:Y\to X$ defined by $S_2(x)=(x,x)$ will also give $S_2(f(x))=i_Y$. But $S_1\neq S_2$ so we have shown that there are two functions that produce the desired result that are not the same (and hence the inverse need not be unique).