# Function: the Most Important Concept in Mathematics

**Level 2**requires school mathematics. Suitable for pupils.

## Table of contents

## Necessary ingredient: Sets

A function needs the concept of a mathematical set. A **set** \(\mathbb{X}\) is a collection of **well-distinguishable elements**. You can think of a set as a bag full of all kinds of different toys (elements). In mathematics, it's usually the numbers that are in that bag. Exactly such bags with numbers are needed for the concept of a function. And these numbers are distinct, that is no equal numbers may occur in the set.

The elements of the set \(\mathbb{X}\) are written in curly brackets, separated by a comma:

**Example of a set with four elements**

The set \(\mathbb{X}\) consists of four elements. These do not have to be sorted in a particular way. In addition, as it MUST BE, no element (no number) occurs twice in the set.

For example, another set \(\mathbb{Y}\) might look like this:

**Example set with six elements**

There is also an **empty set** \(U\) which has no elements:

**Empty set**

Or there can also be an **infinite set** \(N\) which has infinitely many elements:

**Set of natural numbers**

You can then introduce, for example, a variable \(y\) which is a placeholder for one of the elements of the set \(\mathbb{X}\). Mathematically written down, \( y \in \mathbb{X}\) means that \(y\) stands for any element of \(\mathbb{X}\). It is said "\(y\) is an element of \(\mathbb{X}\)".

Let's look at the following set:

**Set with elements 1 5 3 6**

What does \( y \in \mathbb{X}\) mean? This means that the **variable** \(y\) can take the following values: \(y = 1\), \(y = 5\), \(y = 3\) or \(y = 6\). You may, of course, name the variable as you wish: \(y\) or \(x\) or even \(\psi\) (Greek letter "Psi"). It is just a *placeholder* for the elements of the set.

## Defining a function

Let us now define the concept of a **function** \(f\). For this we need two sets \(\mathbb{X}\) and \(\mathbb{Y}\). What the sets actually contain for elements depends on the specific function. However, since we want to define a function in general, we do not specify the sets concretely. For the definition it is also unimportant what is in the sets. There are any numbers there, but which one does not matter.

A function \(f\) is defined by assigning **to each** element of one set \(\mathbb{X}\) some element of the other set \(\mathbb{Y}\). Thus, the two sets are not equal. We need to select a set where we need to assign *ALL* elements. For the other set, we can also leave some of its elements unassigned.

We call the set \(\mathbb{X}\), where we have to assign

*all*elements, the**domain**of a function.We call the other set \(\mathbb{Y}\), where not all elements have a partner in the other set, a

**codomain**(or set of destination).

The function \(f\), its domain \(\mathbb{X}\), and its codomain \(\mathbb{Y}\) are notated as follows:

**Notation of the function rule**

Now we have to concretely assign to each element \(x \in \mathbb{X}\) an element \(y \in \mathbb{Y}\). Then we defined a concrete function. The assignment is notated as follows:

**Function value and function argument**

That means: Take the element \(x\) from the domain \(\mathbb{X}\) and assign to this element the element \(y\) from the codomain. Which element \(y\) it is exactly depends on the specific function \(f\). This is indicated by the notation \(f(x)\). Here \(x\) is called the **function argument** and \(f(x)\) the **function value**.

**Let us summarize**: Domain \(\mathbb{X}\) and the codomain \( \mathbb{Y} \) together with the corresponding assignment rule \( f(x) = y\) define a function \(f: ~\mathbb{X} ~\rightarrow~ \mathbb{Y} \).

## Image set of a function

Since we do not need to assign value \(x\) (element of the domain \(\mathbb{X}\)) to each \(y\) value (element of the codomain \(\mathbb{Y}\)), some \(y\) elements remain unassigned. All elements \(y\) which have been assigned an element \(x\) form a set which we call **image set** \(\mathbb{im}(f)\). This set is a subset of \(\mathbb{Y}\): \(\mathbb{im}(f) \subseteq \mathbb{Y}\).

**Definition: Image of a function**

The image \(\mathbb{im}(f)\) of the function \(f\) is a subset of \(\mathbb{Y}\) containing all \(y\) elements from \(\mathbb{Y}\) which have been assigned an element \(x\).

For the function \(f: ~\class{blue}{\mathbb{X}} ~\rightarrow~ \class{green}{\mathbb{Y}}\) constructed above in the example, the image set \(\class{green}{\mathbb{im}(}f\class{green}{)}\) of this function is:

**Example of an image set**

The elements \(\class{green}{y}=\class{green}{3}\) and \(\class{green}{y}=\class{green}{4}\) are not in the image set because no \(\class{blue}{x}\) element was assigned to these elements. Also, it is clear from the example that the image set is a **subset** of the codomain \(\class{green}{\mathbb{Y}}\):

**Image set is subset of codomain**

By the way, if each element of \(\class{green}{\mathbb{Y}}\) has a partner \(\class{blue}{x}\), then the image set would be exactly the codomain: \( \class{green}{\mathbb{im}(}f\class{green}{)} = \class{green}{\mathbb{Y}}\).

## Graph of a function

The image set (that is, the set of all \(y\) elements to which an \(x\) element has been assigned) together with the associated \(x\) elements, forms a **graph**. The graph of a function \(f\) is also a set. Let us denote it by \(\mathbb{G}(f)\). However, in this set \(\mathbb{G}(f)\) there are not directly numbers \(x\), \(y\) in it, but **tuples** \((x,y)\) of numbers. With the tuple notation we indicate that the \(x\)- and \(y\)-elements, combined in the tuple, belong together. Mathematically, the graph set can be notated as follows:

**Definition: Graph of a function**

Here \(\mathbb{X} \times \mathbb{Y}\) is a so-called **cartesian product** of two sets \(\mathbb{X}\) and \(\mathbb{Y}\). \(\mathbb{X} \times \mathbb{Y}\) is a set in which all tuples \((x,y)\) are in without having to satisfy the property \(y = f(x)\), as in the case of the graph:

**Definition of the Cartesian product**

For the function \(f: ~\class{blue}{\mathbb{X}} ~\rightarrow~ \class{green}{\mathbb{Y}}\) constructed in the example, the graph is \(\mathbb{G}(f)\):

**Graph set example**

And the Cartesian product \(\class{blue}{\mathbb{X}} \times \class{green}{\mathbb{Y}}\) is the following quantity:

**Example for the Cartesian product**

&~~ (\class{blue}{1},\class{green}{10}),~ (\class{blue}{1},\class{green}{4}),~ (\class{blue}{1},\class{green}{3}),~ (\class{blue}{1},\class{green}{42}),~ (\class{blue}{1},\class{green}{2}), \\\\

&~~ (\class{blue}{3},\class{green}{10}),~ (\class{blue}{3},\class{green}{4}),~ (\class{blue}{3},\class{green}{3}),~ (\class{blue}{3},\class{green}{42}),~ (\class{blue}{3},\class{green}{2}), \\\\

&~~ (\class{blue}{6},\class{green}{10}),~ (\class{blue}{6},\class{green}{4}),~ (\class{blue}{6},\class{green}{3}),~ (\class{blue}{6},\class{green}{42}),~ (\class{blue}{6},\class{green}{2}) \} \end{align} $$

The graph \(\mathbb{G}(f)\) of a function \(f\) can be visualized by plotting on one axis the \(x\) elements (we call it \(x\) axis). And on the other axis, which is *perpendicular* to the \(x\)-axis, all \(y\)-elements (we call it \(y\)-axis) are plotted, to which an \(x\)-element was assigned.

Consider the graph set from the above example (equation 15

). If you now draw a horizontal line through a \(y\) point and a vertical line through the corresponding \(x\) point, this will create an intersection of the two lines. This intersection is marked. This is exactly what is done with all the other tuples of the graph set. In such a way you can visualize the function \(f\):

## Injective, surjective or bijective function

Three important properties of a function \(f\), from which further properties can be derived, are: *Injection*, *Surjection*, *Bijection*.

A function \(f\) is injective if each element \(x\) in \(\mathbb{X}\) is assigned a *different* \(y\) element in \(\mathbb{Y}\):

Mathematically, an injective function is defined as follows:

A function \(f\) is **injective** if the following property is satisfied for all \(x_1\), \(x_2 \in \mathbb{X}\):

**Injective function**

Translated it means: \(f(x_1)\) is a \(y\) element to which \(x_1\) in \(\mathbb{X}\) has been assigned. And \(f(x_2)\) is a \(y\) element to which \(x_2\) in \(\mathbb{X}\) was assigned. Now if the two \(y\) elements are equal: \(f(x_1) = f(x_2)\)then the corresponding \(x\) elements must also be equal: \(x_1 = x_2 \). If this is satisfied, then the function \(f\) is injective.

A function \(f\) is surjective if *each* element \(y\) in \(\mathbb{Y}\) has been assigned an \(x\) element in \(\mathbb{X}\). So the image set is equal to the codomain: \(\text{im}(f) = \mathbb{Y}\) if the function is surjective:

A function \(f\) is **surjective** if for all \(y \in \mathbb{Y}\) there exists an \(x \in \mathbb{X}\) such that: \( f(x) = y \).

If a function \(f\) satisfies both the surjectivity property and the injectivity property, then the function is called **bijective**. So bijection is just a combination of surjection and injection under one term. Instead of saying: "*The function \(f\) is injective and surjective*" one says: "*The function \(f\) is bijective*". For physicists, bijective functions are the functions that cause the least problems!

A function \(f\) is **bijective** if it is injective AND surjective.

With this basic knowledge, you should now have no problems constructing a function, writing it down mathematically, or checking whether it is injective, surjective, or bijective.