Show that if $g\circ f$ is injective, then $f$ must be injective. Show as well that if $g\circ f$ is surjective, then $g$ must be surjective.

555 Views Asked by At

Let $f:X\rightarrow Y$ and $g:Y\rightarrow Z$ be functions. Show that if $g\circ f$ is injective, then $f$ must be injective. Is it true that $g$ must also be injective? Show that if $g\circ f$ is surjective, then $g$ must be surjective. Is it true that $f$ must also be surjective?

MY ATTEMPT

Let us prove the first statement first. Assume $g\circ f$ is injective. Thus we have that \begin{align*} f(x) = f(y) \Longrightarrow g(f(x)) = g(f(y)) \Longrightarrow (g\circ f)(x) = (g\circ f)(y) \Longrightarrow x = y \end{align*} where it has been used the fact that $g\circ f$ is injective. Hence $f$ is injective.

However it does not necessarily hold that $g$ is injective. Consider, for instance, the functions $f:\{0,1\}\rightarrow\{0,1,2\}$ such that $f(0) = 0$ and $f(1) = 1$ and $g:\{0,1,2\}\rightarrow\{0,1\}$ such that $g(0) = 0$, $g(1) = 1$ and $g(2) = 0$. Consequently, $g\circ f:\{0,1\}\rightarrow\{0,1\}$ is given by $(g\circ f)(0) = 0$ and $(g\circ f)(1) = 1$. Although $f$ is injective, $g$ is not.

We may now proceed and prove the second part. We need to show that $g(Y) = Z$. We already have that $g(Y)\subseteq Z$. Therefore we have to prove that $Z\subseteq g(Y)$. Indeed, one has that \begin{align*} (g\circ f)(X) = g(f(X)) = Z \subseteq g(Y) \end{align*}

since $f(X)\subseteq Y$. Consequently, $g(Y) = Z$ and $g$ is surjective.

Similarly, $f$ need not be surjective. Consider, for instance, that $f:\{0,1\}\rightarrow\{0,1,2\}$ is given by $f(0) = 0$ and $f(1) = 1$ and $g:\{0,1,2\}\rightarrow\{0,1\}$ such that $g(0) = 0$, $g(1) = g(2) = 1$. We have that $g\circ f:\{0,1\}\rightarrow\{0,1\}$ is given by $(g\circ f)(0) = 0$ and $(g\circ f)(1) = 1$ is surjective as well as $g$, but $f$ is not surjective.

Could someone double-check my solution? Any other counterexamples would be appreciatted.

1

There are 1 best solutions below

0
On BEST ANSWER

This looks very good. Well done!

Some minor nitpicks: In your "$g$ doesn't have to be injective" example, the domains and codomains of $f$ and $g$ do not match up. Presumably that's just a typo. Also, one can simplify by using 1 and 2 element sets rather than 2 and 3.

You can also use the same counterexample in both cases, so there is no need to repeat everything. Show that $f$ is injective and $g$ is surjective first, then present the single counterexample disproving both $f$ is surjective and $g$ is injective at the same time. That makes it a bit more elegant.