[Math] Uniqueness proof of the left-inverse of a function

elementary-set-theoryfunctionsproof-explanationproof-verificationproof-writing

I attempted to prove directly that a function cannot have more than one left inverse, by showing that two left inverses of a function $f$, must be the same function.

My Proof

Let $f: A \to B, g: B \to A, h: B \to A$. Suppose $g$ and $h$ are left-inverses of $f$.

Thus $ g \circ f = i_A = h \circ f$. Where $i_A(x) =x$ for all $x \in A$.

Therefore we have $g(f(a)) = h(f(a))$ for $a\in A$. Now since $f$ must be injective for $f$ to have a left-inverse, we have $f(a) = f(a) \implies a = a$ for all $a \in A$ and for all $f(a) \in B$

Put $b = f(a)$. Then $g(b) = h(b) \
\ \ \forall b \in B$, and thus $g = h$. $\square$


However based on the answers I saw here: Can a function have more than one left inverse?, it seems that my proof may be incorrect. But which part of my proof is incorrect, I can't seem to find anything wrong with my proof.

Best Answer

You're assuming that whenever you have a $b\in B$ there will be some $a$ such that $b=f(a)$. This is not necessarily the case!

However, if you explicitly add an assumption that $f$ is surjective, then a left inverse, if it exists, will be unique.


For your comment: There are two different things you can conclude from the additional assumption that $f$ is surjective:

  • There is at least one right inverse.
  • There is at most one left inverse (and if there is one, it is actually two-sided).

Conversely, if you assume that $f$ is injective, you will know that

  • There is at most one right inverse (and if there is one, it is actually two-sided).
  • There is at least one left inverse (except in the case drhab points out below).