# Can anyone walk me through the idea of “why's” in this method of proving a function is surjective

I understand that a function $f:X\to Y$ is surjective iff $\forall \, y \in Y, \exists x \in X$, such that $f(x)=y$

Basically, every element of $Y$ needs to have at least $1$ pre image.

Intuitively, I can show a function is surjective if I can show that Range = Codomain.

But given my limited skills, I'm not always able to find Range of every function. So while looking up alternatives, I watched a video on youtube, that first started off by expressing $x$ in terms of $y$ and then substituted this $x$ in $f(x)$ to show $f(x)=y$

I don't know how correct this method is, but if it's correct can anyone explain me what is going on in this method? And is this method always 100% going to be right?

EDIT : I don't remember the video, but I'll just give my own self made example to show what exactly happened.

$f: \mathbb{R} \to \mathbb{R}$ and $f(x)= 2x+3$ clearly this is an onto function. But let's show it, using that method.

$x= \dfrac{y-3}{2}$ and $f\left(\dfrac{y-3}{2} \right) = y$ and it then concluded that $f$ is a surjective.

• Are you saying that the video alowed the existence of an $x = f^{-1}(y)$? – Kevin Sep 28 '18 at 13:42
• Which video was it? We can better explain to you what they meant if we know exactly what they said and what illustrations they used. – Arthur Sep 28 '18 at 13:43
• @Arthur I updated my answer – William Sep 28 '18 at 13:47
• There is no methodical algorithm for finding the range of a function or determining if it's surjective. You can try solving $f(x) = y$ for $x$, but this will not be feasible for every awful function that we can come up with. There are a bunch of other techniques that you can use in various situations (some can be quite sophisticated mathematically), but it is a hard problem in general. – Theo Bendit Sep 28 '18 at 13:47
• @Kevin I think that the idea is to get $x$ in terms of $y$ with the possibility that for a given $x$ there are serveral $y$'s. – mfl Sep 28 '18 at 13:48

Just an example

Consider the function $$x\in \mathbb{R}\to x^2 \in [0,\infty).$$ That is, we have $$y=x^2$$ or in other words $$x=\pm\sqrt{y}.$$

Note that $$x=\pm \sqrt y$$ is not a function.

But we get that $$f(\pm \sqrt{y})=y$$ and thus we have shown that the function $$f:\mathbb{R}\to [0,\infty), x\to x^2$$ is surjective.

Comment

I don't know what video you have seen. But, in general, get $$x$$ in terms of $$y$$ can be very difficult or impossible. More difficult that show that $$f$$ is surjective by other methods.

Another example

The function $$f(x)=x+\sin x$$ is surjective as a function from $$\mathbb{R}\to \mathbb{R}.$$ We have $$y=x+\sin x.$$ But, how we get $$x$$ in terms of $$y?$$

• And if your codomain was $\mathbb{R}$ , you would still get a $y$, how can you conclude $f(x)$ is surjective function from that... – William Sep 28 '18 at 13:50
• @William No. If $y<0$ then $x=\pm \sqrt y$ doesn't exist in real numbers. – mfl Sep 28 '18 at 13:52
• yes but that you concluded from $x=±\sqrt{y}$ so $y$ is non negative.. agreed. But you were still able to show $f(x)= y$ even though it isn't surjective for co-domain = $\mathbb{R}$ ... That is what bothers me ... – William Sep 28 '18 at 14:01
• @William You can conclude, that $f$ is surjective in this example, because you have given for arbitrary $y\in Y$ an $x\in X$ such that $f(x)=y$. And your $x$ is given by $\frac{y-3}{2}$. – Cornman Sep 28 '18 at 14:02
• @William Your shown method is often used to calculate the invers function, which is not always possible, because for an inverse to exists your function has to be bijective. For a surjective function there only has to exist a "right-inverse". To give this right-inverse is not always possible, because you have to solve equations for it. And not every equation can be solved algebraically. – Cornman Sep 28 '18 at 14:04

The method you are describing can be summarized as

Solve for $$x$$ in terms of $$y$$.

Why does that work? Well if you can find an $$x$$ for every $$y$$ in the codomain then you have proved the function is surjective since that's essentially the definition of "surjective".

As commenters have noted, that's not always easy, or possible algebraically. Nor s it necessary to show surjectivity.

Since you seem to know some calculus, here's another method. The function defined by $$f(x) = x + e^x$$ from $$\mathbb{R}$$ to $$\mathbb{R}$$ is surjective since it takes on arbitrarily large negative and positive values and it's continuous. That means it takes on any value in between any two values in its range. There is no nice closed form algebraic way to solve $$y = f(x)$$ for $$x$$ in terms of $$y$$.