# Injection / Surjection

Here's the question

I got that it is injective. By saying:

$f(y) = 3 - y^2$

Suppose;

$f(x) = f(y)$

$3 - x^2 = 3 - y^2$

$x^2 = y^2$

$sqrt(x) = sqrt(y)$

$±x = ±y$

I conclude the it's not injective because $-x =!$ $y$ Is this the right way to come to this conclusion?

I'm not sure how to find out if it's surjective or not.

-
That's not quite right since you've simply shown that that line of reasoning doesn't show $x=y$. It would be better to find two particular real numbers that get sent to the same number. Your calculation suggests taking say $1$ and $-1$. To show a failure of surjectivity, you also only need to find a single number not in the range. – Grumpy Parsnip Apr 22 '13 at 13:36

That is the right way of testing whether or not it is injective, although personally I would prefer to use $a$ and $b$ instead of $x$ and $y$. As for surjectivity, try to solve $f(x) = 4$.

-
To me, it looks like the OP's reasoning is $f(x)=f(y)$ implies $x=\pm y$, which is not sufficient to show it's not injective. If you take the reasoning to be an if and only if, that's different. – Grumpy Parsnip Apr 22 '13 at 13:37
Is $4$ just a random number? Why 4? – Adegoke A Apr 22 '13 at 13:37
@AdegokeA $4$ is a "slightly" random number. The important thing is that it is larger than $3$. As the constant term is $3$, and the $-x^2$ term cannot be positive, the calue of the function is never larger than $3$, so trying to solve for any such value would yield a negative result. Other examples include $\pi$, $\sqrt{10}$ and a million. – Arthur Apr 22 '13 at 13:40
@GrumpyParsnip When I determine injectivity, that is the way I usually go. If you can show that $f(x) = f(y)\Rightarrow x=y$ then the function is injective, and if you get anything else, it's more often than not a large hint in the hunt for a pair of different inputs yielding the same outputs, in this case $x=-y$. – Arthur Apr 22 '13 at 13:43
@Arthur: I agree that it is a large hint, just not the complete proof. – Grumpy Parsnip Apr 22 '13 at 13:45

First, drawing a picture for something like this in invaluable:

Injective means that if $f(x)=f(x')$ then you must have $x=x'$. You can see that $f(1)=f(-1)$ for example, so it cannot be injective.

Surjective means that for any $y$ in the range, there is some $x$ in the domain such that $f(x) = y$. Since $x^2 \ge 0$ for any $x$, you can see that $f(x) \le 3$ for all $x$. Hence any point $y>3$ cannot be in the range and so it is not surjective.

-
Sorry, I'm just trying to get my head around this. So if $x = 1$, it's compliment is $-1$, right? But for injection, $x$ must equal $x'$. Can you give me an example where $x$ actually equals to $x'$. I can't think of any. – Adegoke A Apr 22 '13 at 13:50
I think you are misunderstanding "$x$ actually equals $x'$". It means that there aren't two distinct $x$ values; they are the same. – The Chaz 2.0 Apr 22 '13 at 14:00
@AdegokeA: The function is injective iff whenever $f(x)=f(x')$ then you must have $x=x'$. In the above picture, you can draw a horizontal line through the graph. If the line is $y=2$ for example, it intersects the graph twice which means there are two $x$ values that product the same $y$ value. Hence is cannot be injective. – copper.hat Apr 22 '13 at 14:04
I totally get that now. Thanks! – Adegoke A Apr 22 '13 at 14:33

This is a good calculation, that will help you find an answer. To prove a function is NOT injective you need a single counterexample. Using your calculation, let's pick some $x,y$ that we expect will map to the same place. For example, $x=4, y=-4$. Then $f(4)=3-4^2=-13$ and $f(y)=3-(-4)^2=3-16=-13$.

To determine if it's surjective, let $a\in \mathbb{R}$ and try to find some $x$ such that $f(x)=a$. (i.e. solve for $x$). If you succeed regardless of $a$, you've proved it's surjective. If you fail for some $a$, you will have a roadmap to find a counterexample.

-
I only understand how this works when I imagine two sets, A & B. So 4 is A and -4 is B. Injection means that for every element in A, there's a uniqe one in B, right? But because there's limit, which in 3, right? -13 is then invalid. Is any of what I said right? – Adegoke A Apr 22 '13 at 13:46
$4,-4$ are both in $A$. $f:A\rightarrow B$. – vadim123 Apr 22 '13 at 14:01
^no. A function is a rule that assigns elements in A to elements in B. "For every element in A, there is a unique element in B" is part of the function being defined on the domain A. "For every b in B, there is a unique a in A such that f(a) = b" is injective – The Chaz 2.0 Apr 22 '13 at 14:03
@Chaz: The goal is to prove that $f$ is not injective. – vadim123 Apr 22 '13 at 14:11
@TheChaz2.0 This is how I like to define it. Injective means that every member of "A" has its own unique matching member in "B".link – Adegoke A Apr 22 '13 at 14:27

Easiest method

1.Draw Graph
2.Draw Horizontal lines. If any horizontal line intersects the graph more than once,then the graph is not injective.
I hope I have illustrated that and surjectivity in the image :)

:

-