# Function Notation

due to our national cirriculum (the way in which it was taught in high school). We just said that f(x) means a function. Though I understand this isn't necessarily correct? In high school we used that. However having entering university, we have something else.

Say,

$$f:[0,1]\rightarrow \mathbb{R}$$ where $$f(x)=x^2$$

Now I am not too familiar with the notation. All know is, [0,1] represents the domain and $$\mathbb{R}$$ represents codomain. Could anyone elaborate further?

• The name of the function is f. The value of the function f, at the point $x$, is $f(x)$ – The Chaz 2.0 May 7 '13 at 16:43
• No, the name of the function is ‘$f$’ ... – Peter Smith May 7 '13 at 19:47
• @PeterSmith The function is $f$ (and its name is called "A'sitting on a gate"?) – Andreas Blass May 8 '13 at 2:32

You are correct in your understanding of the domain, and codomain:

When we say $\;f: [0, 1] \to \mathbb R\;$ we are specifying (naming) a function $f$ which is defined on the domain $[0, 1]$, and which maps values in the domain $[0, 1]$ to values in the codomain, here, $\,\mathbb R$. Think of $f$ as the "action" or relation that connects (relates) each element in the domain with a unique element in the codomain.

Then, to define exactly how the function pairs a number from the domain with a number in the codomain, $f(x) = x^2$ is added, to tell us which output value in $\mathbb R$ to assign to an input value $x \in [0, 1].\;$ This means, as you are likely familiar with, $f$ takes as "input" a real number $x \in [0, 1],$ and assigns to it a unique real number, whose value is $x^2 \in \mathbb R:$ $$x \overset{f}{\longmapsto} x^2 \quad \text{or} \quad f: x\mapsto x^2$$

In the general case, the notation $f:X\to Y$, where $f$ is a function, and $X$ and $Y$ are sets represents a function called $f$ which takes any element belonging to the set $X$ (the domain) and maps it to an element within the set $Y$ (called the codomain and sometimes the range of the function). This is all the notation tells us without further information.

The definition you write in your question $f:[0,1]\to\mathbb{R}$ where $f(x)=x^{2}$ means that the function $f$ accepts any value $x$ in the interval $0\leq x\leq 1$ and will map it to a real number $x^{2}$.

Another related notation for defining your function is as follows:

$$f:x\mapsto x^{2}$$

Which reads as "$f$ is the function which maps $x$ to $x^{2}$".

• Bobby, note the difference between the two arrows used in this answer. – The Chaz 2.0 May 7 '13 at 16:44

In high-school, they want you to understand function in a kind of natural way: you give it something and it gives you something back using a formula. Much like you use $\Bbb N$ or $\Bbb R$ without constructing them first.

The real definition of functions need something else to be introduced first: Binary relations.

Binary relations $R$ is made of three things:

• Two sets $A$ and $B$

• A subset $G$ of $A\times B = \left\{(a,b)\mid a\in A, b \in B\right\}$

There are many times of binary relations including order relations ($\le$), equivalence relations and so on. Functions are a specific type of relations that have this property:

• For every $x\in A$, there is a unique $y\in B$ so that $(x,y)\in G$

(in fact it's more like two properties: existence and uniqueness)

This allows you to write that unique $y$ as $f(x)$

So your function is given by the same three things except they are given different names:

• $A$ is called the domain

• $B$ is called the codomain

• And the set of ordered pairs. But since we know that for each $a\in A$ there is a unique $b\in B$ associated with it, we often, instead of giving all pairs, simply give a formula that tells us how to get $y$ from $x$. But there isn't always such a formula.

Then those functions can have additional properties:

• Injectivity: For any $y \in B$, if there is a $x\in A$ so that $f(x)=y$, it is unique

• Sujectivity: For any $y \in B$, there is at least one $x\in A$ so that $f(x)=y$

And you have both, you have what is called bijectivity which lets you define another function by switching $A$ and $B$ and replacing $(x,y)$ by $(y,x)$ in the binary relation. And that function is called $f^{-1}$.

Now I guess you would want to see some concrete examples to explain you why you should bother keeping in mind what $A$ and $B$ are.

Think of $f:\left.\begin{array}{ll}\Bbb R \to \Bbb R\\ x \mapsto x ^ 2\end{array}\right.$

Now imagine you want to define its inverse function: you can't because it does not exist. Why? The existence of an inverse function implies that if I pick $x\in \Bbb R$ and give you $x^2$, you can find out what $x$ is. And in this case, you would have no way of knowing if I picked $x=-2$ or $x=2$ if I told you $x^2=4$. Our function is not injective. Also, our function isn't surjective either because there is no $x\in \Bbb R$ so that $x^2 = -1$.

The easiest thing to fix is surjectivity. We define the image of $f:A\to B$ to be $Im(f)=\left\{f(x) \mid x \in A\right\}$. It can easily be shown that $g:A \to Im(f)$ is always sujective.

In our case, $Im(f)=\left\{x^2 \mid x \in \Bbb R\right\} = \Bbb R_+$.

So now we have $g:\left.\begin{array}{ll}\Bbb R \to \Bbb R_+\\ x \mapsto x ^ 2\end{array}\right.$ which is surjective but it's still not injective.

To make it injective, we need to notice that $x_1^2=x_2^2 \Leftrightarrow x_1=\pm x_2$. So if we restrict ourselves to $\Bbb R_+$ or $\Bbb R_-$, we'll know the sign and will have $x_1=x_2$. Of course those two sets aren't the only ones we can restrict our function to in order to make it injective but out of the biggest set we can keep while making it injective, those two are the simplest.

So now we have $h:\left.\begin{array}{ll}\Bbb R_+ \to \Bbb R_+\\ x \mapsto x ^ 2\end{array}\right.$ which is bijective.

So now we can talk about $h^{-1}$:

$h^{-1}:\left.\begin{array}{ll}\Bbb R_+ \to \Bbb R_+\\ x \mapsto \sqrt{x}\end{array}\right.$

About notations, $f(x)$ is not a function. It's an element of $B$. $f$ is a function.

$\mathbb R$ is the set of real numbers. $[0,1]$ is the set of real numbers that are between 0 and 1, inclusive.

“$f(x) = x^2$” means that this is the function where, if you put in $x$, where $x$ is a real number between 0 and 1, you get out the real number $x^2$.

I think what confuses you a little is the lack of the formal notion of what a function is: given sets $A$ and $B$ we can think of them just as collections of some types of objects. You can have a set $A$ whose elements are potatoes and a set $B$ whose elements are apples and so on. Given two sets, we can relate the elements of the sets. We can have for instance the set $A$ of all men in some country and the set $B$ of all women and we can relate the elements saying that one man is related to some woman if they are married.

But this is just intuition right? How can we give substance to this idea? Well, we can say that for each man and woman related we can create one ordered pair being the first element the husband and the second the wife. Indeed this is pretty good to make this things precise, because we'll have that if $\text{John}$ is married with $\text{Anna}$ then we can refer to the relation as $(\text{John}, \text{Anna})$.

The set of all ordered pairs whose first element is in $A$ and second element is in $B$ is called the cartesian product of $A$ and $B$ denoted $A\times B$. A relation between the sets $A$ and $B$ is thus a subset $R \subset A \times B$ containing the pairs representing the objects related. If $a \in A$ and $b\ in B$ are related we usually write $aRb$.

A function is then just a relation: it's a way to relate two sets. But a function is a relaiton plus a property, so that we define a function as: "let $A$ and $B$ be sets, a function from $A$ to $B$ is a relation $f \subset A \times B$ such that if $(a,b) \in f$ and $(a,c) \in f$ then $b = c$".

Now, a function is just a relation on which if one object on the set $A$ has at most one object related on the set $B$. Now, since for each $a \in A$ if we have $(a,b) \in f$ then $b$ is unique we can give it a name and the name is $f(a)$. This captures pretty well the idea: $f(a)$ gives us the impression that $f(a)$ is related to $a$ and that it's unique (so that we can give it a name).

However, look at the construction: a function is a subset of the cartesian product, while $f(a)$ is an element of $B$. It is thus not pretty right to say "the function $f(a)$". Now the notation $f: A \to B$ is used just to mean that we have $f \subset A \times B$ and $f$ is a function. Also we give to $A$ the special name domain and to $B$ the special name range (or sometimes codomain).

Now, to specify the relation it's pretty common to get some arbitrary element of the domain and say how it should be mapped like $f : \mathbb{R} \to \mathbb{R}$ given by $f(x) = 5x$. I think that now you understand that saying the domain and range are really part of the function. It's pretty easy to see that $f : \mathbb{R} \to \mathbb{R}$ given by $f(x) = x^2$ is pretty different than $f: \mathbb{R}^+ \to \mathbb{R}$ given by $f(x) = x^2$: look that on the first one you have the pair $(-2,4)$ and on the second this pair doesn't exists because $-2 \notin \mathbb{R}^+$.

$f$ is a subset of $[0,1] \times R$, while $f(x)$ is an element of $\mathbb{R}$ .

They are not the same.

In your example, $f=\{\left<x,x^2\right>|x \in [0,1]\}=\{\left<x,f(x)\right>|x \in [0,1]\}$.