2

$f: A \to B$ is called a mapping, where $A$ and $B$ are two sets.

What is $a \mapsto b$, where $a \in A$ and $b \in B$, called then? Thanks.

Note that $a↦b$ is not a function/mapping, since $a$ and $b$ are not sets. Note that $a↦b$ is not necessarily related to $f$: it can be a part of $f$ or not.

An example would be in the definition of formal grammar, a set $P$ of rules forms a mapping $: \text{a subset of }(Σ \cup N)^* N (Σ \cup N)^* \to (Σ \cup N)^*$. But each rule is just like $a \mapsto b$, where $a \in \text{a subset of }(Σ \cup N)^* N (Σ \cup N)^*$ and $b \in (Σ \cup N)^*$.

Tim
  • 47,382
  • Are you familiar with the term "anonymous functions" from functional programming? – Asaf Karagila May 27 '14 at 16:02
  • I always thought $f : A \to B$ was called a function and $a \mapsto b$ a map. One can also see that as $f$ sends $a$ to $b$. – Hubble May 27 '14 at 16:03
  • @AsafKaragila: I heard of it, it is a function that is not given a name in its definition. But here, $a↦b$ is not a function/mapping, since $a$ and $b$ are not sets. Note that $a↦b$ is not related to $f$. – Tim May 27 '14 at 16:04
  • 1
    And the relation ${(a,b)\mid a\mapsto b}$ is a function, one which you may or may not have given a proper name to. – Asaf Karagila May 27 '14 at 16:05
  • @Asaf: see my edited example from formal grammar. I think I didn't make myself clear for you to understand my question. Yes ${(a,b)∣a↦b}$ is a relation, and then how do you call $a↦b$ then? – Tim May 27 '14 at 16:09
  • Tim, I think that I have understood your question, you just didn't understand my comment and/or the definition of "rule" in the example that you posted. Rules are functions for generating new objects from old objects. – Asaf Karagila May 27 '14 at 16:13

1 Answers1

2

The relation is called $f$ sends $a$ to $b$. However if as you note in a comment $a\mapsto b$ is written in a context with no relation to $f$ (or any other specified function) then it is perfectly meaningless. There is always some function that sends a given element $a$ to a given element $b$, so this is telling you nothing. One can invent artificial situations in which this would have a meaning; for instance if one is discussing the functions $\{a\}\to B$ then $a\mapsto b$ selects exactly one of them, or one could announce that $a$ is a variable ranging over $A$ while $b\in B$ is a constant, in which case this specifies the constant function with value$~b$.

What is much more common that left of "$\mapsto$" one writes a variable ranging of some specified domain, and to the right of it some expression involving that variable. For instance $x\mapsto 2x^3-4x^2+7$ describes a function once the domain and codomain are separately specified; thus this notation allows introducing a function without having to introduce a name for it, which is the "anonymyous function" that Asaf refers to in a comment.

To answer the addition to the question, I don't think $a\mapsto b$ has any conventional use in the context of formal grammars. One can imagine using it in writing production rules, but again $b$ would usually be replaced by a more elaborate expression, and even then I think it would be mostly confusing, especially since there may be multiple production rules with the same left hand side but different right hand sides.

  • "maps $a$ to $b$", this would even be consistent with the $\LaTeX$ command. :-) – Asaf Karagila May 27 '14 at 16:03
  • thanks. See my edited example from formal grammar. I think I didn't make myself clear for you to understand my question. – Tim May 27 '14 at 16:09
  • To add to your last paragraph, sometimes we want not to have a name for something, because it won't be referenced in the future. For example we want to show that $|A|\leq|\mathcal P(A)|$. We can write something like: The map $a\mapsto{a}$ is clearly injective, therefore $|A|\leq|\mathcal P(A)|$, and not worry too much about domains, codomains and so on, because everything is clear from context. This is why anonymity pays off! – Asaf Karagila May 27 '14 at 16:24
  • Does the concept "anonymous function" exist in math, besides in functional programming languages? @Asaf. I know the example you gave is in math, but it seems like some implicit usage of "anonymous function". I wonder if there is a concept explicitly for "anonymous function" – Tim May 27 '14 at 18:29
  • @Marc: Is it right that $a \mapsto b$ is used only for defining a function explicitly? – Tim May 27 '14 at 18:41
  • @Tim The concept of "anonymous function" exists in the same sense as "anonymous polynomial" (think $X^3-5X+3$) or "anonymous group element" (think $g^{-1}h$) exists: it is not really a concept, but any time you write down a function (polynomial, group element) without giving it an explicit name, you are using it. And (second comment) yes, in my experience the symbol $\mapsto$ is only used for defining functions. – Marc van Leeuwen May 28 '14 at 08:10