Functions

A function from a set \(A\) to a set \(B\) is a map from elements of \(A\) to elements of \(B\) which pairs each element of \(A\) with exactly one element of \(B\). If \(f\) is such a function, we write \[f : A → B\] to indicate this. We call \(A\) the domain of the function, and we call \(B\) the codomain of the function. If \(a ∈ A\), then we write \[f(a)\] to pick out the unique \(b ∈ B\) that \(f\) pairs \(a\) up with. In case \(f(a) = b\) (for some \(a\) and \(b\)), we call \(a\) the argument of the function \(f\), and we call \(b\) the value of the function \(f\) on \(a\).

Kind of like with relations, the definition of (unary) functions can be generalized to that for n-ary functions by considering the latter to be a map from the product of \(n\) sets \(A₁, ..., Aₙ\) to a set \(B\). If \(f\) is such an \(n\)-ary function, we write \[f : A_1 × ... × A_n → B\] to indicate this. Given \(n\) arguments \(a₁ ∈ A₁, ..., aₙ ∈ Aₙ\), we write \[f(a_1, ..., a_n)\] to pick out out the \(b ∈ B\) that \(f\) maps \(a₁, ..., aₙ\) to.

Importantly, there is a corresponding notion of function composition. We need only consider functions from \(A\) to \(B\) a type of relation on \(A\) and \(B\)—one that relations every element in \(A\) to exactly one element in \(B\). Given functions \(f : A → B\) and \(g : B → C\), their composition \(g ∘ f : A → C\) is such that \((g ∘ f)(x) = g(f(x))\), for any \(x ∈ A\).