# Mapsto vs. rightarrow

This is perhaps half a math question and half a typesetting one. In what circumstances do I use \mapsto and when \rightarrow? I feel like the standard seems to be: when you're specifying the operator you use \rightarrow, but if you're just saying that one domain maps to another you use \mapsto. Is that correct?

e.g. I would say Q\times\Gamma\mapsto Q but \delta:Q\times\Gamma\rightarrow Q.

• – hola
Apr 5, 2019 at 2:22

You use \mapsto to denote the actual function mapping. For example, consider the function $f:\mathbb N\to\mathbb N$ given by $f(n)=5n$. You could write that second part as $n\mapsto5n$.
• The \mapsto notation is useful for talking about a function without inventing a name for it, e.g. "the map $\mathbb{R}\to \mathbb{R}$ given by $x\mapsto x^2$ is not injective". Note that \to is a nice shorthand for \rightarrow, which at the same time is more semantic. Nov 10, 2010 at 10:36
• I'd prefer using \colon instead of :; in fact I'd even more prefer $f\from\mathbb N\to\mathbb N$, with \newcommand*\from{\colon}. Nov 10, 2010 at 14:41
• @Hendrik: I like the idea of using \from. I think I've seen equal numbers of : and \colon in books (or the equivalent spacing) so I think it's just up to personal preference (or editor preference, really). I have no strong feelings on that one.
• @Pacerier: There is a visible difference in the colon spacings between : and \colon. The former has equal spacing on each side (it's a \mathrel, I think), while the latter has greater spacing on the right. That is, f : A \to B renders as "f : AB," while f \colon A \to B renders as "f: AB." Jul 18, 2015 at 1:28