34

I am doing IGCSE Maths, and am having a few problems with function notation. I understand the form $f(x)$.

What does the form $f: x ↦ y$ mean? Could you also give one or two examples?

And, if possible, state your source. Thank you.

Masacroso
  • 30,417
  • See https://en.wikipedia.org/wiki/Function_(mathematics)#Notation. – lhf Apr 20 '16 at 13:11
  • @lhf Could you please explain this for a beginner? Thanks! – Annabelle Sykes Apr 20 '16 at 13:12
  • 1
    Examples: $f:x\mapsto x^2$ is the squaring function and $g:x\mapsto x+1$ is the function which adds one. – anon Apr 20 '16 at 13:14
  • 3
    I really prefer $f:x\in\mathbb{R}\mapsto x^2\in[0,\infty)$. It's a more complete description. Maybe for this function it's not needed, but there is LOT of cases when it's best to tell what is the domain and codomain. – Integral Apr 20 '16 at 13:26
  • 1
    Related: http://math.stackexchange.com/questions/1740154/different-arrows-in-set-theory-rightarrow-and-mapsto and http://math.stackexchange.com/questions/473247/different-of-mapsto-and-right-arrow (The latter was posted by Deusovi in a comment under their answer.) – Martin Sleziak Apr 20 '16 at 13:48
  • Every function must have an input and an output. When a function has an input $x$ and an output $y$, this is commonly expressed as $f(x) = y$ or similarly, $f : x \mapsto y$. The $(:)$ means such that where this notation is said as follows: A function $f$ such that $x$ is our input and $y$ is our output. Nevertheless, a nicer way to put this would be, A function $f$ that takes the value $x$ to the value $y$ just like how @Deusovi put it. – Mr Pie Dec 26 '17 at 13:21
  • 1
    @Integral Why not $f = x \mapsto x^2 : A \rightarrow B$? – user76284 Oct 29 '19 at 19:01
  • @user76284 This is also good, maybe better. – Integral Oct 31 '19 at 18:12

4 Answers4

45

It means that $f$ is a function that takes the value $x$ to the value $y$. For instance, $$f: x\mapsto x^2$$ is an alternate way of writing $f(x) = x^2$.

Deusovi
  • 2,792
  • 1
  • 20
  • 23
  • Could you please state your source? Thanks :) – Annabelle Sykes Apr 20 '16 at 13:21
  • 1
    @SWFApp: I've known this for a while so I don't have the source that I used; here is another SE question with several answers that agree with me. – Deusovi Apr 20 '16 at 13:22
  • So, is there any scenario where you would need to use the "↦" notation instead of "=" notation? If your answer is a full explanation, it seems to me that ↦ is entirely useless. – twiz Jul 29 '16 at 11:15
  • 7
    @twiz: Just using = leaves open the possibility that x is a constant. Sure, we assume that it's a variable, but it's not necessarily the case. For instance, what if $f(x)$ was actually the function where $x \mapsto x³-4$? Then "$f(x) = x^2$" would be an equation to solve, not a definition of a function. That sort of thing pops up all the time - for instance, when we want to find the roots of the function, we use the equation $f(x) = 0$; that does not mean that we're redefining $f$ to be the function that always gives $0$. – Deusovi Jul 29 '16 at 11:19
  • what about $f: A \to B$ when $A, B$ are sets? – Charlie Parker Sep 29 '22 at 20:24
  • @CharlieParker it means that the function takes an element from set $A$ and maps it into an element of set $B$. The way how it maps is not defined, so $f$ serves like a black box: we only know possible input and possible output, but not how it works inside. – NChechulin Feb 03 '23 at 14:58
32

$f:x \mapsto y$ means that $f$ is a function which takes in a value $x$ and gives out $y$.

But,
$f: \mathbb{N} \to \mathbb{N}$ means that $f$ is a function which takes a natural number as domain and results in a natural number as the result.

22

As it is evident from math.stackexchange notation — the symbol $\mapsto$ reads as "maps to".
This is backed up by Wikipedia article on functions:

... the notation $\mapsto$ ("maps to", an arrow with a bar at its tail) ...

There is another arrow-symbol, which also used for mapping $\rightarrow$, which might be a bit confusing. The difference between two (as it is mentioned in the linked answer, as well as in the answer by MathEnthusiast):

  • $\mapsto$ maps an element of one set to an element of another set;
  • $\rightarrow$ maps a set to a set.

Example (borrowed from here):

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

It means that: under $f$, any element $x \subset R$ gets mapped to the element $x∗x=x^2$ (which is also an element of $R$).

2

The function given by $y = f(x)$ is, itself, named and denoted as $f: x ↦ y$ which, for all intents and purposes, could just as well be stated as an equality $f = (x ↦ y)$, though people don't generally use the notation that way, as well.

An alternate - and more standard - notation for denoting a function itself is $f = (λx)y$. Thus, $x ↦ y$ is essentially synonymous with $(λx)y$, except that the mathematical literature tends to be allergic to basement-level foundational concepts (like the lambda-calculus), passing them off as "stuff for computer scientists and engineers, beneath our consideration" and therefore prefers the mapping notation $x ↦ y$. So, $↦$ is really just the math operator/binder $λ$, in disguise.

Thus, one might just as well write $(x ↦ x^2)(3) = 3^2 = 9$, denoting the function directly rather than through a level of indirection. Correspondingly, it can be used in a broader context, e.g. $3 ↦ 3^2 = 9$ or $y^3 ↦ \left(y^3\right)^2 = y^6$ to denote the application of the function to particular instances, though this may be better regarded as short-hand for the composition of functions $(x ↦ x^2)∘(() ↦ 3) = (() ↦ 9)$ or $(x ↦ x^2)∘(y ↦ y^3) = (y ↦ y^6)$.

The notation - as well as the lambda calculus - helps make concepts clearer, such as the distinction between $fg: x ↦ f(x) g(x)$, as the pointwise-product of two functions $f$ and $g$, versus $f(x) g(x)$ as the product of terms $f(x)$ and $g(x)$ involving a variable $x$, versus function composition $f∘g: x ↦ f(g(x))$, which is sometimes also written as $fg$.

A parallel situation exists in programming languages. Up until around 2010 in C or C++ if you wanted to use a function-as-value, you had to declare and define it somewhere, rather than writing it directly in-line at the point of use. So, now they have anonymous functions, defined through lambda terms, the actual syntax used for the terms more closely resembling the arrow notation than the lambda notation.

As is the case with programming languages, the lambdas and arrows can be typed, e.g. $(λx∈ℝ)x²∈ℝ$ to denote the function $x∈ℝ ↦ x²∈ℝ$. One might also consider partial functions, such as: $$nOf: f∈ℝ^ℝ ↦ \lim_{h,k→0} {1\over k}\left({f(h(1+k))\over f(h)} - 1\right) = \lim_{h→0} {{h f'(h)}\over f(h)}∈ℝ.$$ whose domain is a subset of $ℝ^ℝ$ that includes functions such as the Bessel functions, with $nOf:j_n ↦ n$ for both integer and half-integer $n$.

Thus $nOf: (x ↦ x^n) ∈ ℝ^ℝ ↦ n ∈ ℝ$, for all exponents $n ∈ ℝ$, while $nOf: (x ↦ x^x) ↦ 0$ and $nOf: (x ↦ x^x - 1) ↦ 1$, while from $nOf: (x ↦ f(x) - (mx + b)) ↦ n > 1$ would follow that $f(0) = b$ and $f'(0) = m$. Those are ways of directly stating what would be more difficult to state without either the $↦$ or $λ$.

NinjaDarth
  • 540
  • 2
  • 4