Preimages of a Function
The preimage (or inverse image) of an element \( y \in Y \) in the codomain of a function \( f: X \to Y \), is the set of all elements \( x \in X \) in the domain that are mapped to \( y \) - in other words, all \( x \) such that \( f(x) = y \). The preimage of \( y \) is denoted by: $$ f^{-1}(\{y\}) = \{ x \in X \mid f(x) = y \} $$
Put simply, the preimage of an element $ y $ in the codomain $ Y $ consists of all those values in the domain $ X $ which, when passed through the function $ f(x) $, yield $ y $ as output.

More generally, the preimage of a subset of $ Y $ under a function $ y = f(x) $ is the set of all domain elements $ X $ that the function maps into that subset of the codomain.
The preimage of a set tells us which elements in the domain map into a given subset via the function \( f \).
Note that the preimage \( f^{-1}(y) \) of an element \( y \) is not necessarily the inverse function, since it may associate one element in the codomain with multiple elements in the domain (that is, it may define a relation rather than a true function).

This happens because a function is not required to be injective - a single codomain element may correspond to multiple domain elements.

The preimage is always well-defined, regardless of whether the function is injective or surjective.
Moreover, the preimage of a subset may be empty if no elements in the domain map into it.
Difference between a function and a relation. A function associates each element of the domain with exactly one element of the codomain. A relation, by contrast, may associate an element of the codomain with one or more elements of the domain. Thus, while every function is a relation, not every relation is a function.
A Practical Example
Consider the function \( f(x) = x^2 \).
The domain is the set of real numbers \( \mathbb{R} \), and the codomain is the set of non-negative real numbers \( \mathbb{R}^{\geq 0} \).
If we take an element in the codomain, say \( 4 \), then the preimage of \( 4 \) is the set of all \( x \) in the domain such that \( x^2 = 4 \):
$$ f^{-1}(\{4\}) = \{ -2, 2 \} $$
In this case, $ -2 $ and $ 2 $, since both \( (-2)^2 = 4 \) and \( 2^2 = 4 \).

Thus, the preimage of \( 4 \) is the set \( \{ -2, 2 \} \), as these are precisely the domain elements that map to \( 4 \) under \( x^2 \).
Note. In this example, the preimages in $ Y $ do not define an inverse function - rather, they define an inverse relation.
Properties of Preimages
Key properties of preimages under a function:
- Preimage of a union
The preimage of the union of two sets equals the union of the preimages: $$ f^{-1}(A \cup B) = f^{-1}(A) \cup f^{-1}(B) $$ - Preimage of an intersection
The preimage of the intersection of two sets equals the intersection of their preimages: $$ f^{-1}(A \cap B) = f^{-1}(A) \cap f^{-1}(B) $$ - Preimage of a complement
The preimage of the complement of a set equals the complement of the preimage: $$ f^{-1}(Y \setminus A) = X \setminus f^{-1}(A) $$
These are sometimes referred to as the preimage preservation properties under union, intersection, and difference.
Example
Now consider the function:
$$ f(x) = \sqrt{x} $$
where \( f: \mathbb{R}^{\geq 0} \to \mathbb{R}^{\geq 0} \), since the square root is only defined for \( x \geq 0 \).
Let us choose two subsets of the domain:
$$ A_1 = [0, 1) $$
$$ A_2 = [4, 9] $$
The preimage of the interval \( A_1 = [0, 1) \) is:
$$ f^{-1}(A_1) = \{ x \in \mathbb{R}^{\geq 0} \mid \sqrt{x} \in [0, 1) \} = [0, 1) $$
The preimage of \( A_2 = [4, 9] \) is:
$$ f^{-1}(A_2) = \{ x \in \mathbb{R}^{\geq 0} \mid \sqrt{x} \in [4, 9] \} = [16, 81] $$
Now let us check the three set operations:
A] Union
The union of the preimages is:
$$ f^{-1}(A_1) \cup f^{-1}(A_2) = [0, 1) \cup [16, 81] $$
The union of the intervals is:
$$ A_1 \cup A_2 = [0, 1) \cup [4, 9] $$
Thus, the preimage of the union is:
$$ f^{-1}(A_1 \cup A_2) = f^{-1}([0, 1) \cup [4, 9]) = [0, 1) \cup [16, 81] $$
This confirms that \( f(x) = \sqrt{x} \) preserves unions:
$$ f^{-1}(A_1 \cup A_2) = f^{-1}(A_1) \cup f^{-1}(A_2) $$
B] Intersection
The intersection of the preimages is the empty set, since there is no overlap between \( [0, 1) \) and \( [4, 9] \):
$$ f^{-1}(A_1) \cap f^{-1}(A_2) = [0, 1) \cap [16, 81] = \emptyset $$
Likewise, the preimage of the intersection is also empty:
$$ f^{-1}(A_1 \cap A_2) = f^{-1}(\emptyset) = \emptyset $$
Again, this confirms that \( f(x) = \sqrt{x} \) preserves intersections:
$$ f^{-1}(A_1 \cap A_2) = f^{-1}(A_1) \cap f^{-1}(A_2) $$
C] Complement
Now consider the complement of \( A_1 = [0, 1) \) in \( \mathbb{R}^{+} \):
$$ \mathbb{R}^{+} \setminus A_1 = [1, \infty) $$
The preimage of the complement is:
$$ f^{-1}(\mathbb{R}^{+} \setminus A_1) = f^{-1}([1, \infty)) = [1, \infty) $$
The complement of the preimage of \( A_1 \) is:
$$ \mathbb{R}^{+} \setminus f^{-1}(A_1) = \mathbb{R}^{+} \setminus [0, 1) = [1, \infty) $$
Thus, \( f(x) = \sqrt{x} \) also preserves complements:
$$ f^{-1}(\mathbb{R}^{+} \setminus A_1) = \mathbb{R}^{+} \setminus f^{-1}(A_1) $$
In this example, all the key preimage properties with respect to union, intersection, and complement are satisfied.
And so on.
