A mapping from a set $S$ to a set $T$ is a relationship (rule, correspondence) that assigns to each element of $S$ a uniquely determined element of $T.$ The set $S$ is called the domain of the mapping, and the set $T$ is called the codomain. Mappings will generally be denoted by Greek letters. To indicate that $\alpha$ is a mapping from $S$ to $T,$ we shall write $\alpha:S\rightarrow T$ or $S\stackrel{\alpha}\rightarrow T.$ If $x$ is an element of $S$, then $\alpha(x)$ will denote the unique element of $T$ that is assigned to $x;$ the element $\alpha(x)$ is called the image of $x$ under the mapping $\alpha.$ Sometimes, there will be a formula for $\alpha(x),$ as in the examples $f(x)=x^2$ and $f(x)=\sin x,$ but that certainly need not be the case.

Let $S=\{x,y,z\},$ $T=\{1,2,3\},$ $\alpha:S\rightarrow T$ defined by $\alpha(x)=2,$ $\alpha(y)=1,$ $\alpha(z)=3,$ and $\beta:S\rightarrow T$ defined by $\beta(x)=1,$ $\beta(y)=3,$ $\beta(z)=1.$

In general, any two $\alpha$ and $\beta$ are said to be equal mappings if their domains are equal, their codomains are equal, and $\alpha(x)=\beta(x)$ for every $x$ in their common domain.

In , $\alpha\ne\beta$ because, for instance, $\alpha(y)=1\ne\beta(y)=3.$ There are 27 different mappings from $S$ to $T$ in .

There are $\abs{T}^{\abs{S}}$ mappings $\alpha:S\rightarrow T.$

If $S$ is any set, we shall use $\iota$ (iota) to denote the identity mapping from $S$ to $S,$ which is defined by $\iota(x)=x$ for each $x\in S.$ If it is necessary to indicate which set $S$ is being considered, $\iota_s$ can be written instead of $\iota.$ It is sometimes convenient to write $x\stackrel{\alpha}\rightarrow y$ or $x\mapsto y$ to indicate that $y$ is the image of $x$ under a mapping.

We may write $x\stackrel{\alpha}{\rightarrow} y,$ $x\mapsto y$ or $\alpha:x\mapsto y$ to indicate $y$ is the image of $x$ under a mapping.

A mapping from the set of ordered pairs of real numbers to a real number, such as addition $(s,t)\rightarrow s+t,$ is an example of an operation on a set. Unlike addition, subtraction does not map $(s,t)$ and $(t,s)$ to the same element in $\R,$ illustrating the need for the distinction implied by ordered pairs, that $(s,t)\ne(t,s)$ when $s\ne t.$

If $\alpha:S\rightarrow T$ and $A$ is a subset of $S,$ then $\alpha(A)$ will denote the set of elements of $T$ that are images of elements of $A$ under the mapping $\alpha$ and we may write \( \alpha(A)=\{\alpha(x):x\in A\}. \) The set $\alpha(A)$ is called the image of $A$ under the mapping $\alpha.$

In , $\alpha(\{x,z\})=\{2,3\}$ and $\beta(\{x,z\})=\{1\}.$

If $\alpha:S\rightarrow T$ then $\alpha(S)$ will be called the image of $\alpha.$ If $\alpha:S\rightarrow T$ and $\alpha(S)=T,$ then $\alpha$ is said to be onto or a surjection. Thus, $\alpha$ is onto if for each $y\in T$ there is an $x\in S$ such that $\alpha(x)=y.$ Stated another way, $\alpha$ is onto if $\alpha(S)=T,$ and not onto if $\alpha(S)\ne T.$

In terms of diagrams like those in a mapping is onto provided each element of the codomain has at least one arrow pointing to it. Thus, in , $\alpha$ is onto but $\beta$ is not.

Neither $f:\R\rightarrow\R$ nor $g:\R\rightarrow\R$ defined by $f(x)=x^2$ and $g(x)=\sin x$ are onto, since the image of $f$ is the set of non-negative real numbers and the image of $g$ the set of real numbers between $-1$ and $1,$ inclusive.

A mapping $\alpha:S\rightarrow T$ is one-to-one if $x\ne y$ implies $\alpha(x)\ne\alpha(y)$ for each $x,y\in S,$ or equivalently, if $\alpha(x)=\alpha(y)$ implies $x=y.$

In terms of diagrams like those in , a mapping is one-to-one provided no two arrows point to the same element. Thus, in , $\alpha$ is one-to-one but $\beta$ is not.

Neither $f$ nor $g$ in , are one-to-one since $f(x)=x^2=f(-x)$ when $x\ne -x,$ and $g(x)=\sin x=g(x+2n\pi)$ for all $x\in\R$ and integer $n$.

Let $\alpha:\N\rightarrow\N,$ $\beta:\N\rightarrow\N,$ $\alpha(n)=2n$ and \[ \beta(n)= \left\{ \begin{array}{cl} (n+1)/2 &\text{if } n \text{ is odd}\\ n/2 &\text{if } n \text{ is even} \end{array} \right. \] Then $\alpha$ is one-to-one but not onto and $\beta$ is onto but not one-to-one. The existence of such mappings is precisely what distinguishes finite from infinite sets.

A set $S$ is infinite if a mapping exists from $S$ to $S$ that is one-to-one but not onto.

The following notation is adopted.

  • $\N$ the set of all natural numbers, $\{1,2,3,\ldots\}$
  • $\Z$ the set of all integers $\{\ldots,-2,-1,0,1,2,\ldots\}$
  • $\Q$ the set of all rational numbers. That is, real numbers of the form $a/b$ where $a,b\in\Z$ and $b\ne0.$
  • $\R$ the set of all real numbers
  • $\C$ the set of all complex numbers

An injection is a one-to-one mapping. A surjection is an onto mapping. A bijection is a mapping that is both one-to-one and onto, also called a one-to-one correspondence. The range of a mapping often refers to the codomain of a mapping, but is also used by some authors to refer to the image of a mapping.