# Question about $x\mapsto f(x)$ notation.

I'm trying to learn this notation, but I have some questions regarding its uses:

Why is a "$:$" used instead of "$=$" when defining the function, e.g. $f: x\mapsto f(x)$ isntead of $f = x\mapsto f(x)$, or even $f\triangleq x\mapsto f(x)$, as you define the function?

WolframAlpha uses the symbol $\to$ instead of $\mapsto$, and mentions the latter being "used when explicitly considered as a "map."", but what's the difference between a function and a map? Is $f:x\to f(x)$ better?

And lastly, is there a way with this notation to define the function at a value? Like $(f : x\mapsto f(x))|_{x=a} = f(a)$ or something?

• I think of ":" as "sends". A function $f:A \to B$ sends elements from $A$ to $B$. – Théophile Jan 23 '15 at 17:00
• Not important enough for a full-fledged answer. I find the “$\mapsto$” notation most useful when I haven’t named the function with its own letter. So I might write “$x\mapsto x^5$” to refer to the fifth-power function. If I need a letter for a function, then I often say, “$f$, defined by $f(x)=x^5$”. As a personal matter, I don’t usually use a function-letter and the “$\mapsto$” in the same sentence. – Lubin Jan 23 '15 at 17:26
• @Théophile Really? I would think the arrow would stand for "sends" since it is directional. – layman Jan 23 '15 at 17:35
• @user46944 The way I read it, the arrow stands for "to". So I see "$f : A \to B\;$" as effectively saying "$f$ sends (elements of) $A$ to $B\;$". Sending is an action, but to gives the direction. – Théophile Jan 23 '15 at 18:54

Here is what I have seen used:

Usually, we write $f: A \to B$, where $A$ is the domain of $f$ (i.e. the set of inputs), and $B$ is the codomain of $f$, i.e., the set where the outputs lie (note that it isn't necessarily true that an element of $B$ must be an output of $A$ -- if this were true, $f$ would be called onto).

Now, if we want to specify where each specific element goes, perhaps by a formula, then we use the $\mapsto$ arrow instead of $\to$. So we might write $f: \Bbb R \to \Bbb R$ with $x \mapsto x^{2}$. This tells us that $f$ takes input from $\Bbb R$, and has output in $\Bbb R$, and each element $x \in \Bbb R$ is sent to $x^{2}$.

Usually, when we use the equal sign, =, we are using it between two objects that are of the same type. For example, if $A$ and $B$ are sets, we might write $A = B$. If $x$ and $y$ are numbers, we might write $x = y$. If $M$ and $N$ are both matrices with the same dimensions, we might write $M = N$. But if $x$ is a number and $A$ is a set, it doesn't make sense to write $x = A$. For example, $2 = 2$, clearly, and $\{ x, y, z \} = \{ x, y, z\}$, clearly, but does it make sense to say $2 = \{ x, y, z \}$? We can't even say these two aren't equal because they aren't the same type of thing.

We only use $=$ between two things that are of the same type to indicate they are the same thing. This is why it doesn't make sense to say $f = A \to B$. What are we saying? That $f$ equals $A$ arrow $B$? Instead, we use $:$ because it is a definition. Like if you write the definition of a word:

running: (n) a physical activity.

• @fvel It's important for you to remember that it doesn't matter what symbols you use, as long as you are clear and consistent. Usually, other people will use ":" in their function definition, and it is kind of universally accepted in the math community. We don't use ":" because some law tells us to, it's just that we've all kind of accepted the standard. This means when we do math, we are all being consistent, and so we don't have to spend as much time clarifying what the symbols we use mean. If you really wanted to, you could use some weird symbol in your function definition... – layman Jan 23 '15 at 17:32
• @fvel ...but then you would have to keep reminding the reader/listener what your new symbol means, so that you are clear. And you would have to keep track of all of these different new symbols you are defining and what they mean, and you have to make sure you are being consistent. Why go through all that trouble when the rest of the math community has already pretty much accepted the standard that ":" is usually used for function definitions? If you use the community accepted standards, it saves you time and headaches from trying to be consistent and clear... – layman Jan 23 '15 at 17:34
• @fvel ...and it also allows the other people listening to you that have accepted the community standards to be able to follow along with your work without getting a headache themselves. – layman Jan 23 '15 at 17:34
• @user46944 I was curious if it was for historic reasons or not. I just like things following a standard, so I didn't understand why it wasn't just $\triangleq$(or the similar) like one usually uses when defining things. Imo things get less clear when they have different symbols for the 'same' thing. – Frank Vel Jan 23 '15 at 17:38
• @fvel I agree with you that having multiple symbols mean the same thing can be confusing. I'm not sure where the colon came from historically in the function definition. That's a good question. Hopefully someone has an answer. – layman Jan 23 '15 at 17:39

A lot of times mathematics, it's actually more important that there is a function from some structure $X$ to a structure $Y$ with certain properties than what the function actually does on the values. That's just details. So to capture this essential information, we write

$$f : X \to Y$$

and there's no other notation for it. $f$ could not be equal to $X \to Y$, it's just its type. If you know programming in a statically typed language like C#, it's like giving the signature of your methods

int Add(int, int);


add :: Int -> Int -> Int


You can get a great deal of your program right by just working out the datatypes and leave all procedure code blank. What they do is details ;)

So if you write down a function, you give the essential information

$$f : \mathbb R \to \mathbb R$$

and then (maybe) add what it does in detail

$$f : \mathbb R \to \mathbb R, x \mapsto x^2$$

This can even be more concrete

$$f : \{1,2\} \to \{a,b\}, 1 \mapsto b, 2 \mapsto a$$

Now if it's completely obvious what domain and target of your function are, the above may be shortened to

$$f : x \mapsto x^2$$

However you could just say $f(x) = x^2$ as well. The long form here is "Let $f : \mathbb R \to \mathbb R$ be defined by $f(x)=x^2$".

You can be customary to think of $x \mapsto x^2$ as an anonymous function $\mathbb R \to \mathbb R$. In this context, it would make sense to write $f = (x \mapsto x^2)$. There are other notations to it, like lambda-calculus $f = \lambda x.x^2$. However, this is just common in contexts where you deal with functions of functions. For example

$$i(x) := (u \mapsto u(x))$$

though you could write as well

$$i(x)(u) = u(x).$$

Confusing? That's why we usually dont think of $x \mapsto f(x)$ as an anonymous function but just of an explanation what $f : X \to Y$ does.

I'm trying to learn this notation, but I have some questions regarding its uses:

Why is a "$:$" used instead of "$=$" when defining the function, e.g. $f: x\mapsto f(x)$ isntead of $f = x\mapsto f(x)$, or even $f\triangleq x\mapsto f(x)$, as you define the function?

Because stating $f = x\mapsto f(x)$ could easily be misinterpreted as $f = x$, and $f$ gets mapped into $f(x)$, which is ambiguous.

WolframAlpha uses the symbol $\to$ instead of $\mapsto$, and mentions the latter being "used when explicitly considered as a "map."", but what's the difference between a function and a map? Is $f:x\to f(x)$ better?

There is no significant difference.

And lastly, is there a way with this notation to define the function at a value? Like $f|_{x=a} : x\mapsto f(x)|_{x=a}$ or something?

e.g. $x = 5 \Longrightarrow f : 5 \to f(5)$

• At the last example I didn't mean that I wanted to define a function with a single value, but rather specify that the function takes the value $a$. Like if you defined $f: x\mapsto x^2$, then put the value 3 into it, how would you do that? $f : 3 \mapsto 9$ looks like it's another function. I want something like $(f : x\mapsto x^2)|_{x=3} = 9$, but how would one usually write this? – Frank Vel Jan 23 '15 at 17:42
• You would define the function on the domain that includes the value $a$. – Don Larynx Jan 23 '15 at 18:02
• but how would I explicitly write the functions value at the point a? Is $(f:x\mapsto x^2)|_{x=3} = 9$ fine or is there another common way of writing it instead of $f(3) = 9$? – Frank Vel Jan 23 '15 at 18:08

Generally there is no difference between map, function, rule of correspondence, application and family although those terms are used in different contexts, for example application is used to say something like let $T:V\to W$ be a linear application, and family is used to just label some objects and is often written as let $\{A_i\}_{i\in I}$ be a family of (something). I think the notation $f:x\mapsto f(x)$ or $f=x\mapsto f(x)$ are both incorrect because none of them specify a very important thing of a function: its domain. I think the best way to define a function is as $f:A\to B,f(x)=\text{something in x}$ and the $\mapsto$ symbol is only useful when you don't want to introduce more variables but want to express something related to a function, for example: The multiplicative group $(R^+,\cdot)$ and the additive $(R,+)$ group are isomorphic because the function $R\to R^+$, $x\mapsto e^x$ is an isomorphism.

The family notation is also useful in some contexts, for example you might find something like let $\{A_i\}_{i\in I}$ be a "family" of sets. There the term family is used to indicate a function $A$ whose domain is $I$ .

In general you have to just figure out what is the author telling you, there are a lot of different ways to write functions.

• Isn't it possible to use $\mapsto$ with multi-variable functions? Like $x,y \mapsto x\times y$? – Frank Vel Jan 23 '15 at 17:27
• @fvel of course, the $x$ can be anything (tuples, sets, functions, whatever). – Zero Jan 23 '15 at 17:46