Mapsto notation

by Qiaochu Yuan May 27 2016 updated Jul 23 2016

There's an arrow called \mapsto in LaTeX. What does it mean?

In mathematics, the arrow $~$\mapsto$~$ (which in LaTeX is called "\mapsto") is used to describe what a function does to an arbitrary input. It is commonly used in combination with colon-to notation, which describes what a function's domain and codomain are.

By itself, $~$\mapsto$~$ can be used to describe a function without naming it, and so is a way to describe [anonymous_function anonymous functions] in mathematics.


The function $~$f(x) = x^2$~$ from the real numbers to the real numbers can be described using a combination of colon-to notation and mapsto notation as

$$~$f : \mathbb{R} \to \mathbb{R}$~$$ $$~$x \mapsto x^2.$~$$

In one line, although this is less common,

$$~$f : \mathbb{R} \ni x \mapsto x^2 \in \mathbb{R}.$~$$

(see in notation).