Functions#

A function is a rule that assigns each input exactly one output. We call the output the image of the input. The set of all inputs for a function is called the domain. The set of all allowable outputs is called the codomain. We would write \(f : X → Y\) to describe a function with name \(f\), domain \(X\) and codomain \(Y\). This does not tell us which function \(f\) is though. To define the function, we must describe the rule. This is often done by giving a formula to compute the output for any input (although this is certainly not the only way to describe the rule).

For example, consider the function \(f : ℕ → ℕ\) defined by \(f(x) = x ^ 2 + 3\). Here the domain and codomain are the same set (the natural numbers). The rule is: take your input, multiply it by itself and add 3.This works because we can apply this rule to every natural number (every element of the domain) and the result is always a natural number (an element of the codomain). Notice though that not every natural number is actually an output (there is no way to get \(0\), \(1\), \(2\), \(5\), etc.). The set of natural numbers that are outputs is called the range of the function (in this case, the range is \(\{ 3, 4, 7, 12, 19, 28, ... \}\), all the natural numbers that are 3 or more than a perfect square).

The key thing that makes a rule a function is that there is exactly one output for each input. That is, it is important that the rule be a good rule. What output do we assign to the input \(7\)? There can only be one answer for any particular.

Function Properties

  1. Injection

  2. Surjection

  3. Bijection

Types of Functions#

Glossary#

A function is a rule that assigns each element of a set, called the domain, to exactly one element of a second set, called the codomain.

Notation \(f:X→Y\) is the way of saying that the function is called \(f\), the domain is the set \(X\), and the codomain is the set \(Y\).

To specify the rule for a function with small domain, user two-line notation by writing a matrix with each output directly below its corresponding input, as in:

\[\begin{split}f = \begin{pmatrix}1 & 2 & 3 & 4 \\ 2 & 1 & 3 & 1 \end{pmatrix}\end{split}\]

\(f(x)=y\) means the element \(x\) of the domain (input) is assigned to the element \(y\) of the codomain. We say \(y\) is an output. Alternatively, we call \(y\) the image of :math:`x` under :math:`f`.

The range is a subset of the codomain. It is the set of all elements which are assigned to at least one element of the domain by the function. That is, the range is the set of all outputs.

A function is injective if every element of the codomain is the image of at most one element from the domain.

A function is surjective if every element of the codomain is the image of at least one element from the domain.

A bijection is a function which is both an injection and surjection. In other words, if every element of the codomain is the image of exactly one element from the domain.

The image of an element \(x\) in the domain is the element \(y\) in the codomain that \(x\) is mapped to. That is, the image of \(x\) under \(f\) is \(f(x)\).

The complete inverse image of an element \(y\) in the codomain, written \(f^{-1}(y)\), is the set of all elements in the domain which are assigned to \(y\) by the function.

The image of a subset \(A\) of the domain is the set \(f(A) = \{ f(a) \in Y:a \in A \}\).

The inverse image of a subset \(B\) of the codomain is the set \(f^{-1}(B) = \{ x \in X:f(x) \in B \}\).


Sources

discrete.openmathbooks.org