Please Login to access more options.


Exercise (A Function Is Surjective Iff Codomain And Image Are Equal)

Prove that a function is surjective if and only if the codomain of $f$ and the image of $f$ are equal.

Click to see a solution.

Let $f:X\to Y$. Suppose $f$ is surjective. Clearly the image of $f$ is a subset of the codomain by definition. Let $y$ be an element of the codomain. Since $f$ is surjective, this means we can pick $x$ in the domain such that $f(x)=y$. This shows that $y$ is in the image of $f$, which completes the proof that if $f$ is surjective, then the image of $f$ equals the codomain of $f$.

Now suppose that the image of $f$ equals the codomain of $f$. We need to show that $f$ is surjective. Pick $y$ in the codomain of $f$. Since the image equals the codomain, this means $y$ is in the image of $f$. This means that we can pick $x$ in the domain such that $f(x)=y$. This completes the proof that $f$ is surjective when the image equals the codomain.