# Evaluating the statement an "An injective (but not surjective) function must have a left inverse"

I'm having a difficulty trying to understand the statement "An injective (but not surjective) function must have a left inverse" and how it works. I've tried breaking the statement down step by step using diagrams in order to see how it works and in order to keep the post short. About step 1: Here $f$ is an injective only function (one-to-one & into) and $g$ is a surjective only function (multi-to-one & onto).

About step 2: When $f$ maps $1,2\in X$, it outputs $r,s\in Y$ as the image. And the image of $f$ becomes the domain of $g$ in the composition. Which makes $t\in Y$ not mapped by $g$ in this case. It was easy to find a function which can invert $f$ back to the exact same members of $X$.

About step 3: The composition $g\circ f$ is a bijective function

My questions are:

1) In my comments of step 2 “And the image of $f$ becomes the domain of $g$ in the composition”. Is this statement correct?

2) In step 2, $t\in Y$ is not mapped by $g$ since it was not a member of the image of $f$. So doesn’t that makes $g$ a partial function in this case, since it doesn’t map all the members of its own domain ($Y$) ? Also another note is $t\in Y$ doesn’t have any element from $X$ who maps (relates) to it via $f$. Is there any reference which explicitly explain how to handle such $t\in Y$ like in the above function composition?

3) I have read somewhere that in order for the composition to give a valid (properly defined) result, “the image” of $f$ (in the example above) must be at least a “subset” of the “domain” of $g$ (which is $Y$ in the example above). But does that mean that the “codomain” of $f$ doesn’t have to be the same as the “domain” of $g$ for the function composition ($g\circ f$) to work aka validly defined? In the example above, Supposed that the codomain of $f$ is now $Z=(r, s, w)$ or $W=(r, s)$ and not $(r, s, t)$ but the image of $f$ remains the same $(r,s)$ and the domain of $g$ also remains the same $(r,s, t)$. What would happen to the composition? Will it still be valid & why?

• sory i had to edit my post cause the pic was not appearing. It seems imgur is blocked by my internet provider so i posted another link to the same pic using tinypic. Hope I didn't break any rules by doing this... Jul 31, 2016 at 6:33
• The statement you are trying to prove is not true. (For it to be true, you must require the domain to be nonempty.) Jul 31, 2016 at 7:01
• 1) is there any difference between "injective" and "injective-only" (I am not familiar with the last term). 2) If $f:A\to B$ is injective and $a_0\in A$ then you can define $g:B\to A$ by sending $b\in \text{im }f\subseteq B$ to the unique $a\in A$ that satisfies $f(a)=b$. If $b\in B$ is not in the image of $f$ then send it to $a_0$. Then $g$ is a left-inverse of $f$. If $A=\varnothing$ and $B\neq\varnothing$ then this does not work. In that case $f$ is vacuously injective, but has no left-inverse. Jul 31, 2016 at 7:04
• @EricWofsey if domain and codomain are both empty then it still works. Jul 31, 2016 at 7:05

I'm not sure what you mean by “injective-only”. Anyway, what you want is, given $f\colon A\to B$ that is injective, a map $g\colon B\to A$ such that $g\circ f$ is the identity on $A$ that is, for all $a\in A$, $g(f(a))=a$.

First let me add the assumption that $A$ is not empty (otherwise the result is false). Let $a_0\in A$. Which one? It's irrelevant.

Now, how do you define a map $g\colon B\to A$?

Let's look at step 1 in your picture. If $b\in B$, there are two cases:

1. $b=f(a)$, for some $a\in A$ (example: $s=f(2)$)
2. $b\ne f(a)$, for all $a\in A$ (example $t$)

In the first case, define $$g(b)=a$$ which is justified because there is a unique $a\in A$ such that $b=f(a)$, by injectivity.

In the second case, define $g(b)=a_0$.

Thus we have a map $g\colon B\to A$. If $a\in A$, then $$g(f(a))=a$$ by definition of $g$, so $g$ is really the sought left inverse of $f$.

The point about $a_0$ sometimes confuses beginners (just like those pictures do, actually). There is no special role about $a_0$; it is needed in order to define $g$ also on elements “not reached by $f$”. One might define $g$ on these elements by saying “pick an element of $A$ at random”, but this would be much more difficult to formalize. We are looking for one left inverse, not for all of them.

• One question, will the composition $g\circ f$ still be valid if the image of $f$ is indeed a subset of the domain of $g$, "but" at the same time, the codomain of $f$ is not the same as the domain of $g$? (read the third question). Or will the composition be undefined? Jul 31, 2016 at 8:24
• @Gin99 I'm not sure what you mean. You're probably confusing the concept of “image” and “codomain”. However, since the terminology can change from book to book, I'm not able to help more. Jul 31, 2016 at 8:34
• @Gin99 As I said, you're confusing “image” (the sets of values of $f$) and “codomain” (a set where the values of $f$ are supposed to live in). They can be different. The important thing is that $g$ is defined on the whole codomain, which is the reason for considering $a_0$. Jul 31, 2016 at 8:44
• I'm referring to : if $Z=\{r,s,w\}$, $B=\{r,s,t\}$, $f : A\to Z$, $im f=\{r,s\}$, and $g:B\to A$. Will $g\circ f$ hold valid or is it undefined ? Because $im f$ is still a subset of $B$ in this case. Jul 31, 2016 at 8:46
• @Gin99 Can't you verify it? Jul 31, 2016 at 10:48