Tutorials › Topology (Undergraduate) › Why Images Do Not Preserve Complements

Sets, Functions and Relations for Topology · Tutorial 12 of 799

Why Images Do Not Preserve Complements

Learn why taking an image does not usually preserve complements, and how bijectivity makes the complement identity valid for every subset.

Beginner 9 min read

What You'll Learn

  • Distinguish the domain complement of a subset from the codomain complement of its image
  • Compute both sets for constant, non-surjective, and bijective maps
  • Prove the general inclusion involving the image of the whole domain
  • Identify the two conditions for complement equality at a particular subset
  • Prove that equality for every subset characterizes bijections
  • Recognize and correct a common error about images of complements

Two Complements, in Two Different Sets

For a function \(f:X\to Y\) and a subset \(A\subseteq X\), there are two natural sets to compare: the image of the part of the domain outside \(A\), and the part of the codomain outside the image of \(A\). They are \(f(X\setminus A)\) and \(Y\setminus f(A)\). The first records outputs that actually come from points outside \(A\); the second records all codomain elements that are not outputs of points in \(A\). These descriptions need not agree.

For clarity, the image of \(C\subseteq X\) is \(f(C)=\{f(x):x\in C\}\). The complement \(X\setminus A\) is taken in the domain, while \(Y\setminus f(A)\) is taken in the codomain. In particular, elements of \(Y\) that are not outputs of \(f\) can belong to \(Y\setminus f(A)\), but they cannot belong to \(f(X\setminus A)\).

Definition: A function \(f:X\to Y\) is injective if \(f(x)=f(x')\) implies \(x=x'\); it is surjective if \(f(X)=Y\); and it is bijective if it is both injective and surjective.

What Can Be Said in General?

Proposition: For every function \(f:X\to Y\) and every \(A\subseteq X\), \[ f(X)\setminus f(A)\subseteq f(X\setminus A). \]

Proof. Let \(y\in f(X)\setminus f(A)\). Since \(y\in f(X)\), there is some \(x\in X\) with \(f(x)=y\). Since \(y\notin f(A)\), this \(x\) cannot lie in \(A\): if it did, \(y=f(x)\) would belong to \(f(A)\). Thus \(x\in X\setminus A\), so \(y=f(x)\in f(X\setminus A)\). This proves the inclusion. \(\square\)

The proposition is about \(f(X)\setminus f(A)\), not necessarily \(Y\setminus f(A)\). If \(f\) is not surjective, the latter set may contain elements outside \(f(X)\). Even when \(f\) is surjective, the inclusion can be strict: an output may come both from a point in \(A\) and from a point outside \(A\). The next examples separate these two reasons for failure.

Worked Example: A Collision from a Nonconstant Map

Let \(X=\{1,2,3\}\), \(Y=\{a,b\}\), and define \(f:X\to Y\) by \(f(1)=a\), \(f(2)=a\), and \(f(3)=b\). Take \(A=\{1\}\).

First, \(X\setminus A=\{2,3\}\). The values of \(f\) on these two points are \(f(2)=a\) and \(f(3)=b\), so \(f(X\setminus A)=\{a,b\}\). Next, \(f(A)=\{f(1)\}=\{a\}\), and therefore \(Y\setminus f(A)=\{a,b\}\setminus\{a\}=\{b\}\). Hence \(f(X\setminus A)=\{a,b\}\ne\{b\}=Y\setminus f(A)\).

The output \(a\) appears on both sides of the domain split: \(f(1)=a\) with \(1\in A\), but \(f(2)=a\) with \(2\notin A\). So it is excluded from \(Y\setminus f(A)\), yet included in \(f(X\setminus A)\).

Check: \(f(X)=\{a,b\}\), so \(f(X)\setminus f(A)=\{a,b\}\setminus\{a\}=\{b\}\), which is contained in \(f(X\setminus A)=\{a,b\}\), as the proposition requires.

Worked Example: A Constant Map

Let \(X=\{p,q\}\), \(Y=\{0,1\}\), and let \(f(p)=0\) and \(f(q)=0\). Take \(A=\{p\}\). Then \(X\setminus A=\{q\}\), so \(f(X\setminus A)=\{f(q)\}=\{0\}\). Also \(f(A)=\{f(p)\}=\{0\}\), giving \(Y\setminus f(A)=\{0,1\}\setminus\{0\}=\{1\}\). Thus the two sets are \(\{0\}\) and \(\{1\}\), respectively, and are unequal.

Here the constant output \(0\) comes from both domain points, including the point outside \(A\), while \(1\) is never an output at all. That is why \(0\) occurs in the image of the domain complement and \(1\) occurs in the codomain complement.

Check: \(f(X)=\{0\}\), so \(f(X)\setminus f(A)=\{0\}\setminus\{0\}=\varnothing\), which is contained in \(f(X\setminus A)=\{0\}\).

Worked Example: An Injective Map That Is Not Surjective

Let \(X=\{1,2\}\), \(Y=\{a,b,c\}\), and define \(f(1)=a\), \(f(2)=b\). Take \(A=\{1\}\). Since \(X\setminus A=\{2\}\), we get \(f(X\setminus A)=\{b\}\). Since \(f(A)=\{a\}\), we get \(Y\setminus f(A)=\{a,b,c\}\setminus\{a\}=\{b,c\}\). The sets differ because \(c\) is not an output of \(f\).

This example has no collision: each output comes from just one domain point. The failure comes instead from the missing codomain element \(c\). It belongs to the codomain complement but cannot be an image of any point in \(X\setminus A\).

Check: \(f(X)=\{a,b\}\), so \(f(X)\setminus f(A)=\{a,b\}\setminus\{a\}=\{b\}\), equal to \(f(X\setminus A)=\{b\}\).

When Does Equality Hold?

For one particular subset \(A\), equality has two separate requirements. First, no output from outside \(A\) can also be the output of a point in \(A\). Second, every codomain element outside \(f(A)\) must actually be reached by a point outside \(A\).

Proposition: For a function \(f:X\to Y\) and \(A\subseteq X\), \[ f(X\setminus A)=Y\setminus f(A) \] if and only if both of the following hold: \[ f^{-1}(f(A))\subseteq A \qquad\text{and}\qquad Y\setminus f(A)\subseteq f(X). \]

Proof. Suppose first that \(f(X\setminus A)=Y\setminus f(A)\). If \(x\in f^{-1}(f(A))\), then \(f(x)\in f(A)\). If \(x\notin A\), then \(f(x)\in f(X\setminus A)=Y\setminus f(A)\), contradicting \(f(x)\in f(A)\). Hence \(x\in A\), proving \(f^{-1}(f(A))\subseteq A\). Also every element of \(Y\setminus f(A)=f(X\setminus A)\) belongs to \(f(X)\), proving the second condition.

Conversely, suppose both conditions hold. If \(y\in f(X\setminus A)\), then \(y=f(x)\) for some \(x\notin A\). If \(y\) belonged to \(f(A)\), then \(x\in f^{-1}(f(A))\subseteq A\), a contradiction. Thus \(y\in Y\setminus f(A)\). This gives \(f(X\setminus A)\subseteq Y\setminus f(A)\). Now let \(y\in Y\setminus f(A)\). The second condition gives \(y\in f(X)\), so \(y=f(x)\) for some \(x\in X\). If \(x\in A\), then \(y\in f(A)\), which is impossible. Therefore \(x\in X\setminus A\), and \(y\in f(X\setminus A)\). This proves the reverse inclusion and the equality. \(\square\)

The first condition rules out collisions across the split between \(A\) and \(X\setminus A\). It does not require that \(f\) be injective everywhere: two points both in \(A\), for example, may have the same output without violating it. The second condition rules out missing outputs in the part of the codomain being compared.

Worked Example: A Bijection Preserves Complements

Let \(X=\{1,2,3\}\), \(Y=\{a,b,c\}\), and define \(f(1)=b\), \(f(2)=a\), \(f(3)=c\). This map is bijective: its three inputs have three distinct outputs, and those outputs are all of \(Y\). Take \(A=\{1,3\}\). Then \(X\setminus A=\{2\}\), so \(f(X\setminus A)=\{f(2)\}=\{a\}\). Also \(f(A)=\{f(1),f(3)\}=\{b,c\}\), so \(Y\setminus f(A)=\{a,b,c\}\setminus\{b,c\}=\{a\}\). The two sets agree.

Check: the points outside \(A\) are exactly \(\{2\}\), and the codomain element outside \(f(A)=\{b,c\}\) is exactly \(a=f(2)\). Thus both calculations give \(\{a\}\).

Theorem: A function \(f:X\to Y\) satisfies \(f(X\setminus A)=Y\setminus f(A)\) for every subset \(A\subseteq X\) if and only if \(f\) is bijective.

Proof. Suppose \(f\) is bijective and let \(A\subseteq X\). If \(y\in f(X\setminus A)\), then \(y=f(x)\) for some \(x\notin A\). If \(y\in f(A)\), then \(y=f(a)\) for some \(a\in A\). Injectivity would imply \(x=a\), contradicting \(x\notin A\). Therefore \(f(X\setminus A)\subseteq Y\setminus f(A)\). Conversely, if \(y\in Y\setminus f(A)\), surjectivity gives \(y=f(x)\) for some \(x\in X\). This \(x\) cannot lie in \(A\), since that would give \(y\in f(A)\). Thus \(x\in X\setminus A\), so \(y\in f(X\setminus A)\). Equality follows for every \(A\).

Now suppose the equality holds for every subset \(A\subseteq X\). Taking \(A=\varnothing\) gives \(f(X)=Y\), because \(f(\varnothing)=\varnothing\) and \(X\setminus\varnothing=X\). Hence \(f\) is surjective. To prove injectivity, let \(x,x'\in X\) satisfy \(f(x)=f(x')\). If \(x\ne x'\), take \(A=\{x\}\). Then \(x'\in X\setminus A\), so \(f(x')\in f(X\setminus A)\). But \(f(x')=f(x)\in f(A)\), whereas the assumed equality gives \(f(X\setminus A)=Y\setminus f(A)\). No element can belong to both \(f(A)\) and \(Y\setminus f(A)\), a contradiction. Thus \(x=x'\), and \(f\) is injective. The argument also covers an empty domain: the equality for \(A=\varnothing\) forces \(Y=f(X)=\varnothing\), so the unique map from the empty set to the empty set is bijective. \(\square\)

A Common Mistake and a Reliable Test

Common pitfall. A tempting but incorrect calculation is to write \(f(X\setminus A)=Y\setminus f(A)\) simply by “taking images of both sides” of \(X\setminus A\). The example with \(X=\{1,2,3\}\), \(Y=\{a,b\}\), \(f(1)=a\), \(f(2)=a\), \(f(3)=b\), and \(A=\{1\}\) gives a direct correction: \(f(X\setminus A)=\{a,b\}\), while \(Y\setminus f(A)=\{b\}\). The image operation does not remove the output \(a\) from the first set just because \(a\) also occurs as the image of a point in \(A\).

When comparing these sets, compute them separately: first list the domain points outside \(A\) and take their outputs; then find \(f(A)\) and remove those outputs from all of \(Y\). Keep track of whether the issue is a shared output or an element of \(Y\) that is not in \(f(X)\). For a bijection neither issue occurs, and the theorem proves the equality for every subset.

SituationWhat can prevent equality?Result
A point outside \(A\) shares an output with a point in \(A\)The shared output lies in \(f(X\setminus A)\) and in \(f(A)\)Equality fails
An element of \(Y\setminus f(A)\) is not in \(f(X)\)That element cannot lie in \(f(X\setminus A)\)Equality fails
\(f\) is bijectiveNeither obstruction occurs for any \(A\subseteq X\)Equality holds for every \(A\)

Check Your Understanding

For each question, keep the domain complement and codomain complement distinct.

  1. Let \(f:\{u,v,w\}\to\{r,s\}\) be given by \(f(u)=r\), \(f(v)=s\), \(f(w)=s\). For \(A=\{u\}\), compute \(f(X\setminus A)\) and \(Y\setminus f(A)\).
  2. Give a reason why a non-surjective map can fail the complement identity even when it is injective.
  3. For a fixed subset \(A\), state the two conditions equivalent to \(f(X\setminus A)=Y\setminus f(A)\).
  4. Use the theorem to explain why a bijection satisfies the complement identity for every subset, not just one chosen subset.
  5. If the identity holds for every \(A\subseteq X\), what choices of \(A\) establish surjectivity and help establish injectivity?