6.1 Definitions

Before we can start working with functions, we need to give a precise mathematical definition.

Definition 6.1:
Given two sets \(X,Y\), we define the Cartesian product of \(X\) and \(Y\), denoted by \(X\times Y\), by \[X\times Y = \{(x,y):\ x\in X,\ y\in Y\ \}.\]
Remark:
Note that if \(X=\emptyset\) or \(Y=\emptyset\), then \(X\times Y=\emptyset\).
Example:
We have that \[\mathbb{R}\times\mathbb{R}=\{(x,y):\ x,y\in\mathbb{R}\ \}.\] So \(\mathbb{R}\times\mathbb{R}\) is the Cartesian plane.
Example:

Let \(X=\{1,2,3\}\) and \(Y=\{4,5,6\}\). Then \[X\times Y=\{(1,4),\,(1,5),\,(1,6),\,(2,4),\,(2,5),\,(2,6),\,(3,4),\,(3,5),\,(3,6)\},\] \[Y\times X=\{(4,1),\,(4,2),\,(4,3),\,(5,1),\,(5,2),\,(5,3),\,(6,1),\,(6,2),\,(6,3)\}.\]

Note that \(X\times Y \neq Y \times X\).
Definition 6.2:

Let \(X,Y\) be non-empty sets. A function \(f\) from \(X\) into \(Y\), denoted by \(f:X\to Y\), is a set \(f\subseteq X\times Y\) which satisfies that for each element \(x\in X\) there exists exactly one element \(f(x)\in Y\) such that \((x,f(x))\in f\). That is, \[f=\{(x,f(x)):\ x\in X\ \}\subseteq X\times Y.\]

Symbolically, we have \(f\subseteq X \times Y\) is a function if \(\forall x \in X, \exists! y \in Y\) such that \((x,y)\in f\) (or \(y = f(x)\)).
Remark:

We negate the above statement to say that, symbolically, \(f \subseteq X\times Y\) is not a function if \(\exists x \in X\) such that \(\forall y \in Y, (x,y)\notin f\), or, \(\exists x \in X\) such that \(\exists y_1,y_2 \in Y\) such that \((x,y_1)\in f, (x,y_2) \in f\) and \(y_1\neq y_2\).

In other words, \(f \subseteq X\times Y\) is not a function if there is \(x\in X\) such that either \((x,y)\notin f\) for all \(y\in Y\), or there exists two distinct \(y_1,y_2\in Y\) with \((x,y_1),(x,y_2)\in f\).
Example:
Let \(X=\{1,2,3\}\) and \(Y=\{4,5,6\}\). Let \[ f=\{(1,4),\,(2,5),\,(3,4)\}, \] \[ g=\{(1,4),\,(1,5),\,(3,6)\}. \] Then \(f\) is a function from \(X\) into \(Y\) since, for each \(x\in X\), there is exactly one \(y\in Y\) such that \((x,y)\in f\). However, \(g\) is not a function from \(X\) into \(Y\) for two different reasons. One reason is because \(2\in X\) but there is no value of \(y\in Y\) such that \((2,y)\in g\). The other is \(1\in X\), but there are two different values of \(y\in Y\) (namely \(y=4\) and \(y=5\)) such that \((1,y)\in g\).
Notation:

Consider \(f:X\to Y\) and let \(A\subseteq X\). Then, the image of \(A\) under \(f\) is denoted by \[f[A] = \{f(x):x \in A\} = \{y \in Y: \exists x \in A \text{ with } y=f(x)\}.\]

We have \(f[\emptyset] = \emptyset\).

Remark:
In this introductory course we use the notation \(f[ ]\) to distinguish when we expect the input and the output to be a set (as opposed to \(f( )\) which expects an element as input and output). However, many sources make no such distinction, and will use \(f( )\) regardless of whether the input is a set or an element. The key thing to note is that the output is an element of \(Y\) if the input is an element of \(X\), and a subset of \(Y\) if the input is a subset of \(X\).
Definition 6.3:
Consider \(f:X\to Y\). We say that \(X\) is the domain of \(f\) and \(Y\) is the co-domain of \(f\). The image (or range) of \(f\) is the image of \(X\) under \(f\), i.e., the set \(f[X]\).
Etymology:

The word function comes from the Latin functus which is a form of the verb meaning “to perform”. A function can be thought as a set of operations that are performed on each values that are inputed. Interestingly, the word function (which was first introduced by Gottfried Leibniz (German mathematician, 1646 - 1716) ) was used for maps that returned more than one output for the same input. It was only in the later half of the 20th century that a function was restricted to “exactly one output for each input”.

The word domain comes from the Latin domus which means “house, home”. The domain is the place where all the inputs of \(f\) live in. Another way to look at it is, the word domus gave the word dominus which means “lord, master”, the person that ruled the house (i.e., a domain is the property owned by a Lord). The domain of a function is the set of all the \(x\) that \(f\) has “control over”.

Example:

Define \(f:\mathbb{Z}\times\mathbb{Z}\to\mathbb{Z}\) by \(f((m,n))=n^2\), for all \(m,n\in\mathbb{Z}\). We have \(\mathbb{Z}\times \mathbb{Z}\) is the domain of \(f\), while \(\mathbb{Z}\) is the codomain. The image of \(f\) is \(\{n^2: n\in\mathbb{Z}\}\) (i.e., the square numbers).

Now, let \(A=\{(m,n):m,n\in\mathbb{Z}, n=2m \}\). Note that \(A=\{(m,2m): m\in\mathbb{Z} \}.\) The image of \(A\) under \(f\) is \[\begin{align*} f[A]&=\{f((m,n)): (m,n)\in A \}\\ &=\{f((m,2m)): m\in\mathbb{Z} \}\\ &=\{(2m)^2: m\in\mathbb{Z} \}\\ &=\{4m^2: m\in\mathbb{Z} \}. \end{align*}\]
Theorem 6.4:

Consider \(f:X\to Y\) and \(g:X\to Y\). Then \(f=g\) if and only if \(f(x)=g(x)\) for all \(x\in X\).

Proof.

We prove both implication separately.

\(\Rightarrow\)). First, suppose that \(f=g\). Take (arbitrary) \(x\in X\) and choose (the unique) \(y\in Y\) such that \((x,y)\in f\). Then \((x,y)\in g\) (since \(f=g\)) and by definition \(f(x)=y=g(x)\). This is true for all \(x\in X\), so it follows that \(f(x)=g(x)\) for every \(x\in X\).

\(\Leftarrow\)). Second, suppose that \(f(x)=g(x)\) for all \(x\in X\). Then \[f=\{(x,f(x)): x\in X \}=\{(x,g(x)): x\in X \}=g.\]

It follows that \(f=g\) if and only if \(f(x)=g(x),\) for all \(x\in X\).

Proof techniques:

Notice that in this proof (and all others) that the correct punctuation follows each equations, whether they are in-line or own their own (displayed). Maths should be read as part of a grammatically correct sentence. For example “Consider \(f:X\to Y\) and \(g:X\to Y\)” reads “Consider \(f\) a function from \(X\) to \(Y\) and \(g\) a function from \(X\) to \(Y\)”, or “then \(f=\{(x,f(x)): x\in X \}=\{(x,g(x)): x\in X \}=g.\)” reads as “then \(f\) is equal to the set of pairs \((x,f(x))\) where \(x\) is in \(X\) which is equal to….”.

It is for this reason that we should not start a sentence with maths symbol.