# How to formally prove whether this function is onto or not?$K(x) = x^ 2$ where $x \ge 0$.

$K(x) = x^2.$ The domain and range of this function comprise of non-negative real numbers. If it were real numbers instead of "non-negative" real numbers, then it seems easy to prove it by counterexample. The range includes negative integers but their square root can't be represented as real number. It is complex number and so, the function is not onto function.

But in case of "non-negative" real numbers, it is easy to see that the range will include only positive real numbers (and 0). And intuitively it seems obvious that square root of positive real numbers is another positive real number. So, the function should be onto. However, how do I formally show this statement? I am assuming the intuition I presented in the earlier paragraph doesn't qualify as formal proof.

• The main thing in the formal proof will be the defintion of "onto". So, start by writing down that defintion. – GEdgar Jul 26 '16 at 23:18
• "the range will include only positive real numbers." Why? Don't we have $K(0) = 0$? – avs Jul 26 '16 at 23:19
• One can use some tools from the Calculus (Intermediate Value Theorem) to show that every non-negative number has a square root. One can also prove it from the more basic fact that the reals have the Least Upper Bound Property. – André Nicolas Jul 26 '16 at 23:21
• @avs yes, but it easily handled as square root of 0 is 0 which is again non-negative real number. I agree it is not perfect to say that "the range will include only positive real numbers". – aste123 Jul 26 '16 at 23:21
• To prove that it is onto is not a matter of showing every square is non neg real; you need to prove every non, neg real is a square root. I.E. for every x; 0 <= x then there exists a y; y >= 0 such that f (y) = \sqr (y) = x. – fleablood Jul 26 '16 at 23:23

Recall definition of an onto function $f: A \to B$: $\forall y \in B, \exists x \in A: f(x) = y$. Thus for any $y \in \mathbb{R^{+}}\cup \{0\}$, choose $x = \sqrt{y}\implies x \ge 0 \implies f(x) = f(\sqrt{y}) = (\sqrt{y})^2 = y$. Thus $f$ is onto.

• (+1) as I think this answer is what the (book) author of the question had in mind. – snulty Jul 27 '16 at 0:59

Hint: A function $f:X\to Y$ is onto if for each $y\in Y$ there exists an $x \in X$ such that $f(x)=y$.

If $K:\Bbb{R}^+_0\to \Bbb{R}^+_0$ via $K(x)=x^2$.

If we pick a $y$ non-negative, what $x$ gives us $K(x)=x^2=y$?

• I think it should be negative, instead of positive. – Jorge Fernández Hidalgo Jul 26 '16 at 23:23
• If I understood you correctly, it means that I've to then prove that every non-negative number has a square root which is itself a non-negative number, right? If yes, I don't know how to do that. It seems too trivial at first. – aste123 Jul 26 '16 at 23:29
• @aste123 If just from rules of indices you know what the answer is. If you do want to prove that every non-negative real has a square root, it is the opposite of trivial as Spivak's book on Calculus mentions and I refer to here math.stackexchange.com/a/1384533/128967. The way to do this would involve writing down axioms for the real numbers, defining continuity, proving polynomials or at least quadratics are continuous. Then prove the intermediate value theorem. Then for $a\in\Bbb{R}^+_0$ apply the intermediate value theorem to $f_a(x)=x^2-a$. $f(0)<0$, and either $f(1)>0$ or $f(a)>0$. – snulty Jul 26 '16 at 23:38
• That or $a=1$ and $\sqrt{1}=1$. – snulty Jul 26 '16 at 23:41
• In that case, how do I satisfy the question without proving all that? Your first sentence says something about indices which seem a bit hard to comprehend for me. Maybe there is a typing mistake in that sentence. Can you tell me how the rules of indices can help here? Thank you :) – aste123 Jul 26 '16 at 23:41