2

I am wondering why $x^2$ is surjective if the domain and codomain is $\Bbb R \to \Bbb R^+ \cup \{0\}$ but not surjective without $0$. If we remove $0$ all the numbers in $y$ would still be in $x$ since $x$ is all reals anyway? So what I mean is, why is $ \Bbb R \to \Bbb R^+$ not surjective?

Arthur
  • 199,419

1 Answers1

3

$x\mapsto x^2$, considered as $\Bbb R\to \Bbb R^+$, is still surjective. It just fails to be an actual function, since we don't have anywhere to send $0$ any more: $0^2$ isn't an element of $\Bbb R^+$.

Arthur
  • 199,419
  • But why would we need to take zero into account if it is not from the codomain? Like we also do not need to take -1 into account since it is not a part of positive reals. –  Jan 10 '18 at 08:12
  • 2
    @StudentCoderJava Every element in the domain needs to be sent somewhere ($-1$ is sent to $1$, for instance). That's part of the conventional definition of a function in modern mathematics. If there are elements in the domain that aren't sent anywhere, what you have is called a generalized function, but it won't be a function any more. – Arthur Jan 10 '18 at 08:14
  • I see, so if we only took positive reals to positive reals it would also be surjective? –  Jan 10 '18 at 08:17
  • @StudentCoderJava Yes, considered as $\Bbb R^+\to \Bbb R^+$, squaring would be a function, and it would be surjective. – Arthur Jan 10 '18 at 08:17
  • Would we need to include zero in the codomain here too? –  Jan 10 '18 at 08:18
  • There is no number in the domain $\Bbb R^+$ that becomes $0$ when you square it, so it is not necessary to have in the codomain. You could use $\Bbb R^+\to \Bbb R^+\cup {0}$ if you wanted, but then it wouldn't be surjective any more. – Arthur Jan 10 '18 at 08:19
  • Thank you, I understand it now. –  Jan 10 '18 at 08:19