Determine if relation $P: R^+ \rightarrow R$ is a function, $(x, y) \in P$ means that $x = y^2$ I am self studying discrete mathematics using the book Discrete Mathematics with Applications (Epp, 4e international version) and I have been stuck trying to figure out the answer to the below question (pg. 22, question 11)



Define a relation $P$ from $\mathbb{R^+}$ to $\mathbb{R}$ as follows: For all real numbers $x$ and $y$ with $x > 0$, $(x,y) \in P$ means that $x = y^2$
Is $P$ a function?

I reasoned that $P$ is a function as it satisfies the properties of a function:

*

*For every element $x$ in $\mathbb{R^+}$ there is an element $y$ in $\mathbb{R}$

*No two distinct ordered pairs in $P$ have the same first element because, the domain $\mathbb{R^+}$ which means that $x$ is always positive, so y = $\sqrt x$ would also be a positive real number.

However, the solution provided for the problem states: $P$ is not a function because, for example, $(4, 2) \in P$ and $(4, -2) \in P$ but $2 \ne -2$
I can't work out why it would not be function given that $P$ explicitly means $x = y^2$, so using the example provided, $(4, -2) \not\in P$ because $\sqrt 4 \ne -2$.
Can anyone give a hint that might help me to get unstuck or should I re-read this chapter as I've missed something fundamental?
 A: Your mistake is that you assumed that, for $x>0$: $x=y^2$ is equivalent with $y=\sqrt{x}$. This is not true. $x=y^2$ is actually equivalent with: $$y=\sqrt{x}\text{ or }y=-\sqrt{x}$$
A: $\newcommand{\R}{\mathbb R}$
Although there might be some ambiguity in the way $P$ is defined (using the verb "mean" in "$(x, y) \in P$ means that ..." is not very precise. Is this is an equivalence or an implication ?!), we can safely assume that what was intended is the formal definition
$$\forall (x, y) \in \R^+ \times \R, (x, y) \in P \Leftrightarrow (x = y^2) $$
Using this definition, we have indeed that both $(4, 2)$ and $(4, -2)$ are in $P$, so $P$ can not be a function.
Your second point is false: $x$ is indeed non-negative, but it does not imply that $y \in \R^+$; as we just saw, it can very much be negative, as in $(4, -2) \in P$.
A: Any relation from $\mathbb R^+\rightarrow\mathbb R$ is a subset of $\mathbb R^+\times\mathbb R$ which contains the distinct ordered pairs of type $(a^2,a) $ as well as $(a^2,-a)$ for some $a\ne 0(say)$. Now it is upto you which type of pair you choose exclusively in order to have a well defined function.

Infact, defining the function like $x\mapsto y$ by rule $x=y^2$ doesn't work as it enforces you to pick up both the types of pairs in $f$. In order to have a positive answer define something like $y=\sqrt{x}$ or $y=-\sqrt{x}$.

