# Use of $\mapsto$ and $\to$

I'm confused as to when one uses $\mapsto$ and when one uses $\to$. From what I understand, we use $\to$ when dealing with sets and $\mapsto$ when dealing with elements but I'm not entirely sure.

For example which of the two is used for the following? $$\begin{pmatrix} x \\ y \\ z \end{pmatrix} \cdots \begin{pmatrix} x+y \\ z+y \\ x+z \\ -z\end{pmatrix}$$

• The common usage is to use "$\rightarrow$" when showing the domain and range, and to use "$\mapsto$" when showing to what a specific or generic element of the domain maps. The main advantage that I see for using "$\mapsto$" is that the function need not be named. For example, one could speak of the function mapping $\mathbb R \rightarrow \mathbb R$ where $x \mapsto x^2$. You recognize this as a simple quadratic, but note that I haven't named the function. The name isn't really part of the function definition, after all -- just the domain, range, and rule matters.
– MPW
Commented Sep 18, 2014 at 14:37
• Commented Sep 18, 2014 at 14:53
• Commented Sep 18, 2014 at 14:53

The $$\to$$ arrow points from the domain of a function to its codomain or target set. The $$\mapsto$$ arrow (fittingly called \mapsto in TeX) shows what an individual element of the domain will be mapped to, i.e. it shows what the function does while $$\to$$ shows where it operates (so to say).

So, the elaborate way to write a function definition is $$f:\begin{cases}A\to B\\x\mapsto f(x)\end{cases}$$ where "$$f(x)$$" will typically be something like "$$x^2+42$$" or whatever. So, both arrows play different roles when describing the function and they are both needed to describe the function as a whole.

But note that you might have a function like $$f:\begin{cases}{\cal P}(\{1,2,3\})\to \mathbb{N}\\A\mapsto |A|\end{cases}$$ where there's a set on the left side of the $$\mapsto$$, so the rule isn't as easy as "$$\to$$ is for sets and $$\mapsto$$ for the rest". (As every set theorist will be eager to explain to you, everything is a set anyway...)

Two examples:

$$f_1:\begin{cases}\mathbb{R}\to \mathbb{R}\\x\mapsto x^3\end{cases} \quad\quad f_2:\begin{cases}\mathbb{N}\to \mathbb{R}\\x\mapsto x^3\end{cases}$$

Here $$f_1$$ and $$f_2$$ are different functions. They do the same thing, but on different domains.

$$g_1:\begin{cases}\mathbb{R}\to \mathbb{R}\\x\mapsto x^3\end{cases} \quad\quad g_2:\begin{cases}\mathbb{R}\to \mathbb{R}\\x\mapsto x^5\end{cases}$$

And $$g_1$$ and $$g_2$$ are again different functions. This time, they act on the same domain, but they do different things.

The difference is that $\mapsto$ denotes the function itself. Thus you need not name the function. $a\mapsto b$ fully describes the action of the function. $\to$, on the other hand, describes only the domain and codomain. Thus one might say $x\mapsto x+1$ is equivalent to $f(x)=x+1$, in which case we would say $f:\mathbb{R}\to\mathbb{R}$.

Your operative definition of $\longrightarrow$ and $\longmapsto$ are correct. In your example you are dealing with vectors in $\mathbb{R}^n$, which are elements of a set, so you should use $\longmapsto$.

• @Frunobulax I see your point. I intended to say that if you are dealing with elements of a set then you should use $\mapsto$. Indeed, if you consider a function defined over a collection of sets, these sets are elements. Commented Sep 18, 2014 at 14:58