## Functions

[callout headingicon=”noicon” textalign=”textleft” type=”basic”]On the road to the City of Skepticism, I had to pass through the Valley of Ambiguity.

Adam Smith

[/callout]

What is a function? The notion of a function is fundamental to mathematics, but like many fundamental aspects of mathematics, its definition was not nailed down until relatively recently. Mathematicians were using functions without thinking all that hard about what functions were! Let’s rectify that.

The definition that I prefer to use is the following:

**Definition. **A *function* from the set $X$ to the set $Y$ is an unambiguous rule which assigns to each element of $X$ an element of $Y$.

By unambiguous, I mean that each $x\in X$ has only one element of $Y$ assigned to it. This may seem obvious, but in fact there are some interesting mathematical operations that turn out to be a little ambiguous, for example:

**Definition. **We say that $t$ is a square root of $x$ if $t^2=x$.

It’s not hard to see that both $-7$ and $7$ are square roots of $49$, so the phrase “the square root of $49$” is actually ambiguous. There are various ways to deal with such ambiguity: for example, we could just content ourselves with the symbol $\pm 7$, representing the two-element set $\{-7,7\}$, but then *the square root of a number isn’t a number!. *The most straightforward way is just to exclude it by assumption, as I’ve done with the definition of function I gave above.

To functionize the notion of square root, we usually do the following:

**Definition. **We say that $t$ is the principal square root of $x$, and write $t=\sqrt{x}$, if $t^2=x$ and $t\geq 0$.

That is, if there are the two possible choices for square root, we decide always to take the positive one. This notion of “the square root” is now unambiguous, i.e. a function.

Let’s connect this idea back to our formalism with relations. It’s clear that $t^2=x$ expresses a relationship between $t$ and $x$, so we can hope that our work on relations will help us develop a good definition of function as a kind of relation. For a function from $X$ to $Y$, we will want to consider pairs $(x,y)$, so our relation (let’s be traditional and call it $f$) will be a subset of $X\times Y$.

What would it mean for the rule to be ambiguous? There would be some $x\in X$ with $(x,y_1)\in f$ and $(x,y_2)\in f$, where $y_1$ and $y_2$ are distinct. That is, $f$ being ambiguous means

\begin{equation*}

\exists x\in X,\exists y_1\in Y, \exists y_2\in Y: (x,y_1)\in f \wedge (x,y_2)\in f\wedge y_1\neq y_2

\end{equation*}

**Activity. **Write a denial of the above logical sentence. This is what it means for $f$ to be unambiguous.

**Activity. **If your denial only includes $\sim$ and $\vee$, alter it using logical facts so that it contains a $\Rightarrow$.

### Overview of Functions

- Ambiguity (this page)
**The basics of functions****.**Functions as sets and as relations.**Domains and Rules.****Operations on functions.**How to combine functions.**Functions and Sets.****Sets of Functions.****Functions whose Inverses are Functions.**