# Definition of square function

If we have two sets, the set of natural numbers and the set of integers and we relate each member of $\Bbb N$ to its squared value in $\Bbb Z$ then $f(x) = x^2$ and $\Bbb N$ is the domain of function and $\Bbb Z$ is the codomain. Is it okay to define the square function in this manner?

• What you have written is a valid function from $\mathbb{N}$ to $\mathbb{Z}$. If you want to call it a square function, that would also be fine, thought it would beg the question "why "a" and not "the"", ie this is an example, not a general definition. – Tobias Kildetoft Apr 1 '13 at 15:34
• Yes. This defines a function with no ambiguity. – Julien Apr 1 '13 at 15:34
• @TobiasKildetoft I'm sorry Tobias, I'm not a native speaker, I may make mistakes in grammar. – Samama Fahim Apr 1 '13 at 15:55

## 1 Answer

Yes, your definition is fine: $$f:\mathbb N \to \mathbb Z$$ $$f(x) = x^2\quad\text{i.e.,}\quad x\in \mathbb N \overset{\large f}{\longmapsto} x^2 \in \mathbb Z$$ is defined everywhere on $\mathbb N$, and is a well-defined function, pure and simple.

Note that the image of $f$ is $$\{x^2\mid x\in \mathbb N\} \subset \mathbb N \subset \mathbb Z$$ That is, the image of $f$ is a proper subset of the codomain you've defined for $f$, since $x^2 \geq 0$ for all $x \in \mathbb N$ (and for all $x \in \mathbb Z$, if the domain were $\mathbb Z$). That's not a problem with your definition. That's just an observation.

• I should sue you for plagiarism. But I'll upvote you instead. – Julien Apr 1 '13 at 15:37
• @julien Oh!...I just saw your "no ambiguity" Yikes! – Namaste Apr 1 '13 at 15:38
• @julien I think you have a case. – Pedro Tamaroff Apr 1 '13 at 15:48