if $f \circ g = id_y$, is $f$ injective?

115 Views Asked by At

Let $f: X \rightarrow Y$ and $g: Y \rightarrow X$

If $f \circ g = id_y$, is $f$ injective?

$f \circ g = id_y$

$\equiv g^{-1} \circ g = id_y \Rightarrow $g is leftinverse and by definition injective

$f \circ g = id_y$

$\equiv f \circ f^{-1}=id_y \Rightarrow$ f is rightinverse and by definition surjective

So $f$ is surjective and not injective

Question: Is that or do I miss something here?

3

There are 3 best solutions below

2
On BEST ANSWER

Let $X=\{1,2\}$ and $Y=\{0\}$. Let $g:Y\rightarrow X$, $g(0)=1$ and $f:X\rightarrow Y$, $f(x)=0$ for $x=1,2$. Note that $f$ is not injective. Now we have

$$f\circ g(0)=0$$

and since $0$ is the only element of $Y$ we have $f\circ g= id_Y$.

This is an example of two functions $f$ and $g$ where $f$ is not injective but nontheless $f\circ g=id_Y$.

Your proof was not correct. You proved that $f$ had to be surjective (which is correct), but that was not the question The question was "does it have to be injective?" The answer is no and the easiest way to show that is to just give a counterexample.

0
On

Another counterexample. Consider $f:\mathbb{N}\to\mathbb{N}$ such that $$ \forall n\in\mathbb{N},\; f(n)= \begin{cases} 0&if\,n=0\\ n-1&otherwise. \end{cases} $$ And $g:\mathbb{N}\to\mathbb{N}$ such that $g(n)=n+1$ for all $n\in\mathbb{N}$.

Then $f\circ g=id$ but $f$ is not injective.

0
On

Let it be that $f:X\to Y$ and $g:Y\to X$ are functions.

If $f\circ g=1_Y$ then we can prove that $f$ is surjective and $g$ is injective.

  • For $y\in Y$ we find $y=1_Y(y)=f(g(y))$ showing that $f$ is surjective.
  • If $g(a)=g(b)$ then $a=1_Y(a)=f(g(a))=f(g(b))=1_Y(b)=b$ showing that $g$ is injective.

These facts can also be stated as: "left-inverses are surjective and right-inverses are injective".

It cannot be proved in general that $f$ is injective and also it cannot be proved that $g$ is surjective. As a counterexample let $Y$ be a singleton and let $X$ be a set that has more than one element. Then a (unique) function $f:X\to Y$ exists and is not injective and functions $g:Y\to X$ exist and are all non-surjective. In all these cases we have: $f\circ g=1_Y$.