Notation for maps: is “$A$” in “$\alpha : A \to B$” always the domain

functionsnotation

According to the Wikipedia page on functions / maps (emphasis added):

A function is a process or a relation that associates each element x of a set X, the domain of the function, to a single element y of another set Y (possibly the same set), the codomain of the function.

It then goes on to say, in the subsection Specifying a function By a formula, from the same page (emphasis added):

For example, ${\displaystyle f(x)={\sqrt {1+x^{2}}}}$ defines a function $f\colon \mathbb{R} \to \mathbb{R}$ whose domain is ${\displaystyle \mathbb {R} ,}$ because ${\displaystyle 1+x^{2}}$ is always positive if $x$ is a real number. On the other hand, $f(x)=\sqrt{1-x^2}$ defines a function from the reals to the reals whose domain is reduced to the interval $[–1, 1]$.

which would seem to suggest that, for the latter function, one should write:
"let $f \colon \mathbb{R} \to \mathbb{R}$ be the function defined by the equation $f(x) = \sqrt{1-x^2}$, valid for all $x \in [-1,1]$", i.e. $\mathbb{R}$ is not the domain, but some set containing the domain; however, in another subsection, Notation Arrow notation it says:

For explicitly expressing [the] domain $X$ and the codomain $Y$ of a function $f$, the arrow notation is often used (read: "the function $f$ from $X$ to $Y$" or "the function $f$ mapping elements of $X$ to elements of $Y$"):
$$f\colon X\to Y$$

which seems to imply that it is not correct to write $f: \mathbb{R} \to \mathbb{R}$ for the function $x \mapsto \sqrt{1-x^2}$, as the domain is not $\mathbb{R}$, nor is the codomain $\mathbb{R}$.


Should one write

$$ \begin{array}{ll}f\colon \mathbb{R} &\hspace{-0.6em} \to \mathbb{R} \\[5pt] & \hspace{-0.6em} x \mapsto \sqrt{1-x^2}, \end{array}$$

where $\mathbb{R} \to \mathbb{R}$ implies that the domain and image are subsets of $\mathbb{R}$, respectively? or should one write:

$$
\begin{array}{ll}f:[-1,1] & \hspace{-0.6em} \to [0,1] \\[5pt] & \hspace{-0.6em} x \mapsto \sqrt{1-x^2}, \end{array}
$$


N.B. My interest is not just pedantic: I have never studied maps, formally, and am trying to clarify whether a map from the set $A$ onto the set $B$ requires only that every element in $B$ be an image, or whether it also requires that every element of $A$ have an image, as well. I've consulted 2 different textbooks, as well as the Wikipedia page; unfortunately, although great care is given to distinguish the codomain and the image, all the explanations and examples provided do not address whether the domain is $A$ or if it may be a subset of $A$.

Moreover, several textbooks I've read have made much ado about the fact that one ought to distinguish between a function and a function of and imply that the distinction is to be found in these definitions (unfortunately, none of them consider it important enough to actually clarify within their own text).

Best Answer

If you write $f : A \to B$ that is usually understood to mean that:

  • for every $a \in A$, the value $f(a)$ is defined
  • this value is an element of $B$.

So the domain has to be $A$. However, $B$ is not necessarily the image but just the codomain (i.e. it is acceptable for $f$ to not “hit” every value in $B$; however, if $f$ does "hit" every value in $B$, then the image is equal to the codomain).

For your definition $f(x) = \sqrt{1 - x^2}$, writing $f : \mathbb{R} \to \mathbb{R}$ would be considered wrong in most circumstances (people get sloppy sometimes, or figuring out the exact domain might be something they want you to do; writing $f : \mathbb{R} \to \mathbb{R}$ still sloppy in the latter case, though). So you have to be more precise in your domain, i.e. $f: [-1, 1] \to \mathbb{R}$ would be fine (note: you do not have to specify the image, just a superset of it), as would $f : [0,1] \to [0, 1]$ would (i.e. you can consider the function restricted to a subset of its maximal domain).

Related Question