# Does the table define a function $f:A \to B$?

I am struggeling with this exercise: $A= \{ 1,2,3,4,5 \}, B= \{ 2,3,4,5,6,7 \}$ with $x \in A$ and $y \in B$ Does the table values define a function $f$ from A to B?

$$\begin{array}{c|rrrrrr} x & 1 & 2 & 3 & 4 & 5 & 4 \\ \hline y & 5 & 4 & 3 & 2 & 1 & 5 \end{array}$$

I would say that this does not define a function $A \to B$ because $A$ maps every value in $B$ and not vice versa! However, if I look at $B$ then I could argue that $B$ also maps every value in $A$?

Is this conclusion correct?

As written, it fails to be a function $f:A\to B$ in two ways. For one, $1\notin B,$ so $f(5)\notin B$. For another, it fails even to be a function, since if it were, we would have $2=f(4)=5.$

In order for a table to define a function $A\to B$, two conditions must be met:

1. Every $x$-value (value in $A$) must occur exactly once. Or, if a value occurs more than once, then in every occurrence it must correspond to the same $y$-value (this would be silly, though).
2. Every $y$-value must be an element of $B$.

Note that there is no need for every value in $B$ to occur on the table (in fact, this is impossible in this situation, since the range of a function cannot be larger than the domain, because of condition 1 above).

• what would be a table, that defines a proper function? Aug 6, 2013 at 14:07
• I have expanded my answer. Aug 6, 2013 at 14:08

This is not a function, because you have the same value appearing twice in your domain.

However, a function need not map every element in its domain set to an element in its range set. A function need not map to every element in its range, either!

For example, $f(x) = 0$ is a function from reals to the reals. But it only ever takes a single value!

A function that hits every value in its range is called onto. Think of onto functions as smearing butter on toast -- you want to make sure every bit of the toast is covered!

Sometimes, however, you want functions to hit each part of the target set exactly once. These functions are called injective. For example, $f(x) = x-1$ is injective, because any value in the range is only hit by a single value of $x$. This is like making sure you have a perfectly thin layer of butter on your toast.

Functions that are both injective and onto are very important functions -- they are called bijections, and they are crucially important in many areas of mathematics.