What's the difference between "relation", "mapping", and "function"?

Mathematically speaking, a mapping and a function are the same. We called the relation $$ f=\{(x,y)\in X\times Y : \text{For all $x$ there exists a unique $y$ such that $(x,y)\in f$} \} $$ a function from $X$ to $Y$, denoted by $f:X\to Y$. A mapping is just another word for a function, i.e. a relation that pairs exactly one element of $Y$ to each element of $X$.

In practice, sometime one word is preferred over another, depending on the context.

The word mapping is usually used when we want to view $f:X\to Y$ as a transformation of one object to another. For instance, a linear mapping $T:V \to W$ signifies that we want to view $T$ as a transformation of $v\in V$ to the vector $Tv\in W$. Another example is a conformal map, which transforms a domain in $\Bbb C$ to another domain.

The word function is used more often and in various contexts. For example, when we want to view $f:X\to Y$ as a graph in $X\times Y$.


There is basically no difference between mapping and function. In algebra, one uses the notion of operation which is the same as mapping or function. The notion of relation is more general. Functions are specific relations (those which are left-total and right-unique).


In Mathspeak:

The words 'function' and 'mapping' are synonymous in most contexts. Formally, the definition of a function $f$ requires that for each value $x$ in the domain, there exists one and only one value $y$ in the codomain such that $y=f(x)$*.

A relation is any assignment of values in one set to values in another, regardless of whether or not the assignment is unique. For example, if $(X,Y,R)$ is the relation from a domain $X\subseteq\mathbb{R}$ to a range $Y\subseteq\mathbb{R}$ such that $xRy\iff x=y^2$, then the set of all points $\left\{(x,y)\in\mathbb{R}^2\mid x=y^2\right\}$ is a relation, but not a function, because there are two values $y\in Y$ such that $y^2=x$ for each $x\in X$.

It is worth pointing out that while every function is a relation, not every relation is a function. As stated by Wuestenfux, a function is the special case of a relation which is both left-total and right-unique.

In English:

A function is a relation where each input corresponds to a single output. A relation with more than one output for each input is still a relation, but it is not a funciton. For example, $y=\pm\sqrt{x}$ is a relation, because it relates $x$ to $y$, but not a function, because there are two values ($\sqrt{x}$ and $-\sqrt{x}$) for each input $x$.


In regards to user2662833's answer:

I believe that what user2662833 is trying to say is that while not every relation is a function, a relation over $n$ variables which is not a function, contains the inputs to a function of $n$ variables for which that function is constant. In the example given the points $(x,y)$ specified by the equation $x^2+y^2=4$ are the points for which $f(x,y)=x^2+y^2-4$ is $0$, and $g(x,y)=x^2+y^2$ is 4.

With an additional restriction, this could be restated as "every relation of $n$ variables contains all zeros of a function of $n$ variables". enter image description here This should still be the case outside the real numbers.


*In complex analysis, specifically, this is not always required as some authors prefer to regard certain complex 'multivalued functions' as functions.