# Surjection/Examples

## Examples of Surjections

### Arbitrary Finite Set

Let $S$ and $T$ be sets such that:

 $\ds S$ $=$ $\ds \set {a, b, c}$ $\ds T$ $=$ $\ds \set {x, y}$

Let $f: S \to T$ be the mapping defined as:

 $\ds \map f a$ $=$ $\ds x$ $\ds \map f b$ $=$ $\ds x$ $\ds \map f c$ $=$ $\ds y$

Then $f$ is a surjection.

### Negative Function on Integers

Let $f: \Z \to \Z$ be the mapping defined on the set of integers as:

$\forall x \in \Z: \map f x = -x$

Then $f$ is a surjection.

### Doubling Function on Reals

Let $f: \R \to \R$ be the real function defined as:

$\forall x \in \R: \map f x = 2 x$

Then $f$ is a surjection.

### Floor Function of $\dfrac {x + 1} 2$ on $\Z$

Let $f: \Z \to \Z$ be the mapping defined on the set of integers as:

$\forall x \in \Z: \map f x = \floor {\dfrac {x + 1} 2}$

where $\floor {\, \cdot \,}$ denotes the floor function.

Then $f$ is a surjection, but not an injection.

### $\map f x = \dfrac x 2$ for $x$ Even, $0$ for $x$ Odd

Let $f: \Z \to \Z$ be the mapping defined on the set of integers as:

$\forall x \in \Z: \map f x = \begin{cases} \dfrac x 2 & : x \text { even} \\ 0 & : x \text { odd} \end{cases}$

Then $f$ is a surjection.

### Real Sine Function to $\closedint 1 1$

Let $I$ denote the closed real interval $\closedint 1 1$.

Let $f: \R \to I$ be the mapping defined on the set of real numbers as:

$\forall x \in \R: \map f x = \sin x$

where $\sin$ denotes the sine function.

Then $f$ is a surjection, but not an injection.

### Real Square Function to $\R_{\ge 0}$

Let $f: \R \to \R_{\ge 0}$ be the real square function whose codomain is the set of non-negative reals:

$\forall x \in \R: \map f x = x^2$

Then $f$ is a surjection.

## Examples of Mappings which are Not Surjections

### Arbitrary Mapping on Sets

Let $A = \set {a, b, c}$.

Let $B = \set {1, 2, 3}$.

Let $f \subseteq {A \times B}$ be the mapping defined as:

$f = \set {\tuple {a, 2}, \tuple {b, 1}, \tuple {c, 1} }$

Then $f$ is not a surjection.

### Square Function is Not Surjection

Let $f: \R \to \R$ be the real square function:

$\forall x \in \R: \map f x = x^2$

Then $f$ is not a surjection.

### $2 x + 1$ Function on Integers Not Surjection

Let $f: \Z \to \Z$ be the mapping defined on the set of integers as:

$\forall x \in \Z: \map f x = 2 x + 1$

Then $f$ is not a surjection.