# Left Inverse: An Analysis on Injectivity

I'm told that $g$ is a left inverse of $f$ if $g\circ f=1_X$. I'm also told that if $f$ has a left inverse, then $f$ must be injective. I'm now asked to prove the converse, namely that if $f:X\rightarrow Y$ is injective, then there exists a function $g:Y\rightarrow X$ such that $g\circ f =1_X$. Where might I start here?

• It's not true if $X=\emptyset$. Jul 14, 2013 at 0:54
• Try it with particular finite $X,Y$. In particular, pretty much all injective maps are "like" inclusions where $X\subseteq Y$ and $f:X\to Y$ is the injection map. Jul 14, 2013 at 0:56
• @ThomasAndrews Explain your $\emptyset$ comment. Jul 14, 2013 at 0:57
• If $X$ is empty, then for any $Y$ there is an unique injection $i:X\to Y$. On the other hand, if $Y\neq \emptyset$ then there are no maps $Y\to\emptyset$. Jul 14, 2013 at 1:02

One way to think about injective functions is that they preserve information in the domain. Suppose $f:X\to Y$ is injective, then we can tell whether $x=y\in X$ just by looking at whether $f(x)=f(y)\in Y$, so we see the information about points in the domain are preserved by this mapping.

Then it follows easily that such functions have left-inverses, because since all information in the domain is preserved in the image, then we can get the domain from the image. This is what a left-inverse does.

Following this philosophy, we might just define this $g: Y\to X$ on two pieces. On $f(X)$, we define $g(y)=x$ where $f(x)=y$. On $Y\backslash f(X)$, we just pick an arbitrary point $x^*\in X$ and let $g$ maps constantly to this $x^*$.

Assume $X$ is not empty. If $f:X\to Y$ is injective define $g:Y\to X$ by $g(y)=x$ if $y=f(x)$ and define it arbitrarily on the rest of $Y$. With this definition we have that

$g(f(x))=x$ by definition. so $gof=Id_X$

Since $f: X \to Y$ is an injection, it is a bijection onto its image. Hence, there is an inverse $h: f(X) \to X$. Choose a point $x \in X$. Define $g: Y \to X$ by

$$g(y) = \begin{cases} h(y) & \text{if } y \in f(X) \\ x & \text{otherwise} \end{cases}$$