1. Functions

1.1. Definitions

1.1.1. A function with domain $X$ and codomain $Y$, denoted by $f:X \to Y$, is a collection of ordered pairs $(x,y)$ with $x \in X$ and $y \in Y$ such that, for each $x \in X$, there is only one $y \in Y$. This is the set-theoretic formalization of the naïve notion of a rule that assigns a unique value to each input.

Given a function $f:X \to Y$, we write $f(x) = y$ to denote an ordered pair $(x,y)$ associated with the function $f$. If the rule of assignment can be written explicitly, we sometimes use the $\mapsto$ notation to denote a function. For example: $x \mapsto 3x$.

We note that the set-theoretic definition of a function encompasses multivariate functions as well. Indeed, a multivariate function $f(x_1,\ldots,x_n)$ with values in $Y$ and variables $x_i \in X^i$ for each $1 \leq i \leq n$ is, in fact, a function from the Cartesian product $X^1 \times \cdots \times X^n$ to $Y$.

1.1.2. We write $\operatorname{dom} f$ and $\operatorname{im} f$ to denote the domain and the range of a function $f$. A function $f:X \to Y$ is injective if $f(x) = f(x')$ implies $x = x'$ for all choices of $x,x' \in X$. $f$ is surjective if, for each $y \in Y$, there exists at least one $x \in X$ such that $f(x) = y$. $f$ is bijective if $f$ is both injective and surjective. If $f$ is bijective, then, for each $y \in Y$, there is precisely one $x \in X$ such that $f(x)= y$. Therefore, we can construct a unique inverse function $f^{-1}:Y \to X$ such that $f^{-1}(y) = x$ whenever $f(x) = y$. In light of this, we call a bijective function $f$ an invertible function.

1.1.3. Given a function $f:X \to Y$, the notation $f^{-1}$ is also used to denote the preimage function $f^{-1}:\mathcal{P}(Y) \to \mathcal{P}(X)$, where $\mathcal{P}(S)$ denotes the power set of a set $S$. The preimage function is defined by the formula

$$f^{-1}(A) = \{x \in X : f(x) \in A\}$$

for each subset $A$ of $Y$. If $f$ is invertible, then the preimage of a singleton set is always a singleton set. By considering the restriction $f^{-1}\vert_{S}$ of the preimage function to the collection

$$S = \{\{y\} : y \in Y\}$$

of all singleton sets and identifying singleton sets with their elements, we see that the preimage function of an invertible function coincides with the inverse function.

Similar to the preimage function, the forward image function $f: \mathcal{P}(X) \to \mathcal{P}(Y)$ is defined by the formula

$$f(A)= \{f(x): x \in A\}$$

for each subset $A$ of $X$. The subset $f(A)$ of $Y$ is typically called the image of $A$ under $f$.