Does the definition of a bijection and surjection not depend on our definition of the range

real-analysis

I have been reading the real analysis textbook, and in Section 1.2 the definitions of injections, bijections and surjections are discussed. However, doesn't the definition of some of these terms rely on our definition of the domain and range of the function?

As far as I understand it, and correct me if I'm wrong, we can define the range in any way we like, so long as the image of the domain is a subset of this set.

For example, given the Dirichlet function, which maps the set of real numbers (domain) to the set $\{0,1\}$ (image), we could actually define the range as $\mathbb{R}$ or indeed anything else we liked so long as the image was contained within it. How does it then make sense to define the terms surjection and injection, given we could also conceivably define the range as the set $\{0,1\}$, changing the function from not being a surjection to being a surjection?

Best Answer

What you are calling the range would more commonly be called the codomain of the function (the range is then defined as the image of the domain, i.e. for $f:A\to B$, the set $\{f(x) : x\in A\}$. With this in mind, the answer is:

  • yes, whether a function is surjective depends on the codomain.
  • no, whether a function is injective does not depend on the codomain (it depends on the domain)*

For example, the function $f:\mathbb R \to \mathbb R$ defined by $f(x)=x^2$ is not a surjection. But the function $g:\mathbb R \to \mathbb R^+ \cup \{0\}$ defined by $g(x)=x^2$ is a surjection.

In general, this is why we ought to specify the domain and codomain whenever we define a function: the functions $f$ and $g$ above are different functions even though they map the same inputs to the same outputs. Surjectivity is a property of a function fully defined, rather than something that can be determined just from the inputs and outputs.

Indeed, sometimes we rely on these facts in order to make a function invertible. For example, $\sin:\mathbb R \to \mathbb R$ is neither injective nor surjective, and hence does not have an inverse function. However, if we restrict it to the function $\sin: [-\frac{\pi}{2}, \frac{\pi}{2}] \to [-1,1]$ the new function is bijective and we can obtain $\sin^{-1}$.

*A sketch proof. Consider $f:A\to B_1$ and $g:A\to B_2$ where $f(x)=g(x)$ for all $x \in A$, and ensuring that $f(A)\subseteq B_1,B_2$ (a function cannot be defined with a codomain that does not include the range, so this assumption is not problematic). $f$ is injective iff $f(a_1)=f(a_2) \Rightarrow a_1=a_2$, and $g$ is injective iff $g(a_1)=g(a_2)\Rightarrow a_1=a_2$. But since $f$ and $g$ map $a_1$ and $a_2$ to the same elements of the range, these criteria are equivalent so $f$ is injective iff $g$ is. Hence injectivity does not depend on the choice of codomain.

Related Question