[Math] Does a function need to be either surjective, injective, or bijective to be invertible

elementary-set-theoryfunctionsinverseinverse function

I believe a function has to be bijective to be invertible, in fact Wikipedia says that an invertible function is another name for a bijection.
https://en.wikipedia.org/wiki/Bijection

But in answers to the question Is a bijective function always invertible?, it is stated that a function only has to be injective to be invertible.

Best Answer

That depends on subtleties of your definition of inverse function. If you expect a function $f\,:\, A \to B$ to have an inverse $f^{-1} \,:\, B \to A$, then $f$ needs to be surjective. If it is not, there are some $b \in B$ that aren't reached by $f$ at all, so how would you define $f^{-1}$ for such elements of $B$?

However, any injective $f\,:\, A \to B$ can be made surjective by simply restricting $B$, i.e. by setting $\widetilde{B} = \{f(a)\,:\, a\in A\}$ and redefining $f$ as $f \,:\, A \to \widetilde{B}$. That redefined $f$ then has an inverse $f^{-1} \,:\, \widetilde{B} \to A$.

Note, however, that while this makes the concatenation $f^{-1} \circ f$ the identity funtion on $A$, it does not make $f \circ f^{-1}$ the identity function on $B$, only on $\widetilde{B} \subsetneq B$.

Thus, if $f \,:\, A \to B $ is injective but not surjective, it has a left-inverse, because we can find an $f^{-1}$ as above with the property that $f^{-1} \circ f$ is the identity on $A$. But it does not have a right-inverse, because we won't find a $f^{-1}$ such that $f \circ f^{-1}$ is the identity on $B$ - the best we can achieve is an identity on $\widetilde{B}$.

Similarly, if $f \,:\, A \to B$ is surjective but not injective, it has a right-inverse, but no left-inverse.