Preimages and Set Operations
A function assigns each point of its domain one value in its codomain. Given a subset of the codomain, its preimage is the collection of domain points whose values lie in that subset. The central point of this tutorial is that membership in a preimage translates directly into membership of a function value. That translation gives exact identities for unions, intersections, and complements.
Let \(f:X\to Y\) be a function, where \(X\) is its domain and \(Y\) is its codomain. For a subset \(B\subseteq Y\), the preimage of \(B\) under \(f\) is the subset of \(X\) defined below. No topology on \(X\) or \(Y\) is needed for these identities.
In particular, \(x\in f^{-1}(B)\) means exactly that \(x\in X\) and \(f(x)\in B\). If a family of subsets is indexed by a set \(J\), its union consists of points that belong to at least one member of the family, while its intersection consists of points that belong to every member. We use these membership descriptions to prove the identities, including when \(J\) is infinite.
Preimages of Arbitrary Unions and Intersections
Proof. We prove each equality by showing that a point \(x\in X\) belongs to the left-hand set exactly when it belongs to the right-hand set. For the union, the definitions give \(x\in f^{-1}(\bigcup_{j\in J}B_j)\) if and only if \(f(x)\in\bigcup_{j\in J}B_j\). This holds if and only if there is some \(j\in J\) for which \(f(x)\in B_j\). By the definition of preimage, this is equivalent to there being some \(j\in J\) for which \(x\in f^{-1}(B_j)\), which is equivalent to \(x\in\bigcup_{j\in J}f^{-1}(B_j)\).
For the intersection, \(x\in f^{-1}(\bigcap_{j\in J}B_j)\) if and only if \(f(x)\in\bigcap_{j\in J}B_j\). This holds if and only if \(f(x)\in B_j\) for every \(j\in J\). By the definition of preimage, that is equivalent to \(x\in f^{-1}(B_j)\) for every \(j\in J\), which is equivalent to \(x\in\bigcap_{j\in J}f^{-1}(B_j)\). Thus the two membership equivalences prove both equalities. If \(J=\varnothing\), the union is \(\varnothing\) and the intersection is \(Y\); their preimages are respectively \(\varnothing\) and \(X\). The union of no subsets of \(X\) is \(\varnothing\), and the intersection of no subsets of \(X\) is \(X\), so both identities also hold for the empty index set. \(\square\)
The same pointwise reasoning works no matter how many sets are indexed. For a union the relevant condition is “there exists an index,” and for an intersection it is “for every index.” Neither proof selects a finite list of sets, so neither identity depends on the family being finite.
Worked Example: A Function Between Finite Sets
Let \(X=\{a,b,c,d,e\}\), \(Y=\{0,1,2\}\), and define \(f:X\to Y\) by \(f(a)=0\), \(f(b)=1\), \(f(c)=1\), \(f(d)=2\), and \(f(e)=0\). Take \(B=\{0,2\}\) and \(C=\{1,2\}\). We compute the preimages directly from the function values.
The points with values in \(B\) are \(a,d,e\), so \(f^{-1}(B)=\{a,d,e\}\). The points with values in \(C\) are \(b,c,d\), so \(f^{-1}(C)=\{b,c,d\}\). Since \(B\cup C=\{0,1,2\}=Y\), its preimage is all of \(X\). On the other side, \(f^{-1}(B)\cup f^{-1}(C)=\{a,d,e\}\cup\{b,c,d\}=\{a,b,c,d,e\}=X\). This verifies the union identity for these sets.
The intersection is \(B\cap C=\{2\}\), whose preimage is \(f^{-1}(\{2\})=\{d\}\). The intersection of the two preimages is \(\{a,d,e\}\cap\{b,c,d\}=\{d\}\), as required. Finally, \(Y\setminus B=\{1\}\), so \(f^{-1}(Y\setminus B)=\{b,c\}\). Also \(X\setminus f^{-1}(B)=X\setminus\{a,d,e\}=\{b,c\}\). These computations check the complement identity as well.
Check: the only point in both \(f^{-1}(B)\) and \(f^{-1}(C)\) is \(d\), because \(f(d)=2\) lies in both \(B\) and \(C\). The points outside \(f^{-1}(B)\) are exactly \(b,c\), whose values are both \(1\), the only member of \(Y\setminus B\).
Preimages of Complements
A complement depends on its ambient set. Since \(B\subseteq Y\), its complement is \(Y\setminus B\). Since \(f^{-1}(B)\subseteq X\), the corresponding complement in the domain is \(X\setminus f^{-1}(B)\). The identity relates these two complements; it does not treat them as subsets of the same set.
Proof. Let \(x\in X\). By definition, \(x\in f^{-1}(Y\setminus B)\) if and only if \(f(x)\in Y\setminus B\). Since \(f(x)\in Y\), this holds if and only if \(f(x)\notin B\). The latter is equivalent to \(x\notin f^{-1}(B)\), by the definition of preimage. Because \(x\in X\), the condition \(x\notin f^{-1}(B)\) is exactly \(x\in X\setminus f^{-1}(B)\). The two sets therefore have precisely the same members. \(\square\)
The proof uses only the definition of preimage and the meaning of set complement. In particular, no assumption that \(f\) is one-to-one or onto is needed: for each \(x\in X\), either \(f(x)\) belongs to \(B\) or it does not.
Worked Example: A Square Function and a Complement
Let \(f:\mathbb{R}\to\mathbb{R}\) be \(f(x)=x^2\), and let \(B=(1,4]\). Find \(f^{-1}(B)\), then compute the preimage of \(Y\setminus B\) and compare it with the complement in \(X\). Here both \(X\) and \(Y\) are \(\mathbb{R}\) with their usual set structure; no topology is being used.
The condition for \(x\) to lie in \(f^{-1}(B)\) is \(1<x^2\leq 4\). The inequality \(x^2\leq4\) gives \(-2\leq x\leq2\), while \(x^2>1\) gives \(x<-1\) or \(x>1\). Combining the conditions gives \(f^{-1}(B)=[-2,-1)\cup(1,2]\). The endpoints reflect the original strictness: \(x=-1\) and \(x=1\) give \(x^2=1\), which is excluded, whereas \(x=-2\) and \(x=2\) give \(x^2=4\), which is included.
The complement of \(B\) in \(Y=\mathbb{R}\) is \(Y\setminus B=(-\infty,1]\cup(4,\infty)\). Its preimage consists of \(x\) satisfying \(x^2\leq1\) or \(x^2>4\), hence \(f^{-1}(Y\setminus B)=[-1,1]\cup(-\infty,-2)\cup(2,\infty)\). On the other hand, removing \([-2,-1)\cup(1,2]\) from \(X=\mathbb{R}\) leaves exactly \(X\setminus f^{-1}(B)=(-\infty,-2)\cup[-1,1]\cup(2,\infty)\). The two results agree.
Check: the four boundary values \(x=-2,-1,1,2\) give \(f(x)=4,1,1,4\), respectively. Values \(4\) lie in \(B\), while values \(1\) lie in its complement. Thus \(-2,2\) are absent from the complement preimage, and \(-1,1\) are present, matching the intervals computed above.
An Infinite Family of Sets
The arbitrary-family statement is useful even when each individual set has a simple description. The next example uses a countably infinite indexed family and tracks the endpoints carefully. In particular, a union of nested intervals and an intersection of nested intervals need not be obtained by treating every endpoint as though it were included.
Worked Example: Nested Intervals Under Translation
Let \(f:\mathbb{R}\to\mathbb{R}\) be \(f(x)=x+1\), and for each \(n\in\mathbb{N}=\{1,2,\dots\}\), let \(B_n=(-1/n,1/n)\). Compute the union and intersection of the sets \(B_n\), and compare their preimages with the corresponding unions and intersections of preimages.
For every \(n\geq1\), \(B_n\subseteq B_1=(-1,1)\), and \(B_1\) itself occurs in the family. Therefore \(\bigcup_{n\in\mathbb{N}}B_n=(-1,1)\). If a real number \(t\) belongs to every \(B_n\), then \(|t|<1/n\) for every positive integer \(n\). This forces \(t=0\): if \(t\ne0\), choose \(n\) large enough that \(1/n\leq |t|\), contradicting the strict inequality. Since \(0\in B_n\) for every \(n\), we have \(\bigcap_{n\in\mathbb{N}}B_n=\{0\}\).
To compute each preimage, solve \(-1/n<x+1<1/n\), obtaining \(f^{-1}(B_n)=(-1-1/n,-1+1/n)\). For \(n=1\) this interval is \((-2,0)\), and for each \(n\geq1\) it is contained in \((-2,0)\). Since the \(n=1\) interval is included in the family, the union of the preimages is \((-2,0)\). This equals \(f^{-1}((-1,1))\), found by solving \(-1<x+1<1\).
A point \(x\) belongs to every \(f^{-1}(B_n)\) exactly when \(x+1\) belongs to every \(B_n\). The latter intersection is \(\{0\}\), so \(x+1=0\), or \(x=-1\). Thus \(\bigcap_{n\in\mathbb{N}}f^{-1}(B_n)=\{-1\}=f^{-1}(\{0\})\). In the intervals themselves, \(-1\) lies strictly between \(-1-1/n\) and \(-1+1/n\) for every \(n\), so it is indeed included in the intersection.
A Common Mistake and Why the Identities Matter
Common pitfall: Do not replace a preimage of a union by an intersection of preimages. In the finite example, a mistaken calculation would give \(f^{-1}(B\cup C)=f^{-1}(B)\cap f^{-1}(C)=\{d\}\). But \(B\cup C=Y\), so the correct calculation is \(f^{-1}(B\cup C)=X=\{a,b,c,d,e\}\), which equals \(f^{-1}(B)\cup f^{-1}(C)\). The reason is the membership condition: to have \(f(x)\in B\cup C\), it is enough that \(f(x)\) lie in at least one of the sets, not both.
A second way to lose track of the complement identity is to use the wrong ambient set. The expression \(Y\setminus B\) is a subset of the codomain \(Y\), so its preimage is a subset of \(X\). The matching complement is therefore \(X\setminus f^{-1}(B)\), not a complement taken in \(Y\). Explicitly naming the ambient set prevents this confusion.
These identities matter because many properties of a function can be studied by asking which domain points map into a specified set in the codomain. Preimages translate set operations in the codomain into the same operations in the domain. Later, when topologies are introduced, this behavior makes preimages of open sets and closed sets central to the definition of continuity. The identities themselves, however, are purely set-theoretic and hold for every function.
Check Your Understanding
For each question, identify the ambient set for any complement and use the definition of preimage to justify your answer.
- Let \(f:X\to Y\) and \(B,C\subseteq Y\). Prove that \(f^{-1}(B\cup C)=f^{-1}(B)\cup f^{-1}(C)\) directly by testing membership of an arbitrary \(x\in X\).
- For \(f:\mathbb{R}\to\mathbb{R}\) given by \(f(x)=x^2\), compute \(f^{-1}([-1,4])\).
- For the same square function, compute \(f^{-1}(\mathbb{R}\setminus[0,1])\) and verify the complement identity.
- Explain why the arbitrary-intersection identity includes the case of an empty index set. What is the intersection of no subsets of \(X\)?
- Give a concrete example showing why \(f^{-1}(B\cup C)\) should not generally be replaced by \(f^{-1}(B)\cap f^{-1}(C)\).