Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can someone explain the difference between symbols:

$\rightarrow$ and $\mapsto$

Thanks.

share|cite|improve this question

When referring to functions, $\rightarrow$ points from the domain of the function to its codomain. When we write $f:A\to B$, we mean that $f$ takes things in $A$ and maps them to thing in $B$. The symbol $\mapsto$ points from an element of the domain to its image in the codomain. $f:x\mapsto y$ means that $f(x)=y$.

share|cite|improve this answer
    
so why then different arrows needed? Sets are denoted using capital letters and elements using lowercase letters, isn't that enough? – Agzam 4 hours ago
2  
It's always good to add extra clarity. Besides, elements are not always lowercase. I write matrices as capital letters, and I often deal with functions mapping between sets of matrices. – Alex S 4 hours ago
1  
@Agzam You're probably seeing a function that is being represented just with sets like $A \rightarrow B$. This just means what is explained in the answer. If it isn't the case, give an example, because context is everyting with notations. – Red 4 hours ago
5  
If, for instance, $f:\mathcal P(A)\to\mathcal P(B)$, then the elements of the domain would be sets :) But a better answer is because the two arrows do psychologically different things: $\to$ just tells you something about the function, whereas $\mapsto$ is closer to actually "defining" a function. (Technically, the information for both arrow types are needed to define the function, but it sure seems like $\mapsto$ is doing most of the work...) – Eric Stucky 4 hours ago
    
Since a set may be an element of another set, it is not possible to reserve lower-case for members only, and upper-case for sets only. – user254665 2 hours ago

For sets $X$ and $Y$, $f\colon X \to Y$ is a function "from $X$ to $Y$", meaning that $f$ has domain $X$ and codomain $Y$. If $y = f(x)$, then we may write $x \mapsto y$, read as "$x$ maps to $y$". This is used only when the function that maps $x$ to $y$ is clear from the context. Sometimes, you may see a function defined as \begin{align*} f\colon\ & \mathbb R \to \mathbb R\\ & x \mapsto 4x^3 \end{align*} instead of $f(x) = 4x^3$.

See here.

share|cite|improve this answer

In programming parlance, $\to$ is part of a type signature, while $\mapsto$ is part of a function definition.

The expression $$x \mapsto \operatorname{floor}(1/x)$$ denotes the function that takes in a number and spits out the floor of its reciprocal.

There are many different type signatures that can be consistently assigned to this function. If you drop in numbers between $0$ and $1$, the function will spit out positive integers, so $$(0, 1) \to \mathbb{N}$$ is one valid type signature.

As M. Vinay noted, it's not unusual to combine these notations in a function definition. For example, I could declare a function $g$ with the definition and type signature above by writing $$\begin{align*} g \colon (0,1) & \to \mathbb{N} \\ x & \mapsto \operatorname{floor}(1/x). \end{align*}$$

share|cite|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.