Skip to main content

PLP: An introduction to mathematical proof

Section 10.3 Images and preimages of sets

When we defined the function \(f:A \to B\text{,}\) we said that if \(f(a)=b\) then we called \(b\) the image of \(a\) under \(f\text{.}\) This idea can be extended quite naturally to think of the image of a set of points. Also, given an element \(b \in B\text{,}\) we can ask for all the elements of \(A\) that map to it. This latter idea is not quite the inverse function, but it is getting close to it.
We should define these sets more precisely:

Definition 10.3.1. Image and preimage.

Let \(f: A \to B\) be a function, and let \(C \subseteq A\) and let \(D \subseteq B\text{.}\)
  • The set \(f(C) = \set{f(x) : x \in C}\) is the image of \(C\) in \(B\).
  • The set \(f^{-1}(D) = \set{ x \in A : f(x) \in D }\) is the preimage of \(D\) in \(A\) or \(f\)-inverse of \(D\).

Remark 10.3.2. Preimage of a single element.

Note that the preimage of a set containing a single element of \(B\) is a (possibly) set of elements of \(A\text{.}\) For example, consider the function \(f: \mathbb{R} \to \mathbb{R} \) defined by \(f(x)=x^2\text{.}\) Then
\begin{align*} f^{-1}(\set{0}) &= \set{0} & f^{-1}(\set{1}) &= \set{-1,1} & f^{-1}(\set{-1}) &= \es. \end{align*}
This shows that the preimage of a set containing a single element is a set that may contain zero, one, two or even more elements. Indeed, it is not hard to construct an example in which the preimage contains infinitely many elements. When our function satisfies very specific conditions, we can ensure that the preimage of a set containing a single element is always set containing a single element. Understanding those conditions is one of the main aims of this chapter and we’ll discuss it in detail in the next section. That, in turn, will help us to define the inverse function.
You will have noticed that in the preceding paragraph we have had to write “the preimage of a set containing a single element” several times. This becomes quite cumbersome. We will, from here, abuse the definition of the preimage a little to simplify our writing. In particular, we will often write “the preimage of an element \(x\)” to mean “the preimage of the set \(\set{x}\)”. While this is modestly incorrect, it does make the writing and reading easier.
The notation for preimage, \(f^{-1}\text{,}\) is somewhat unfortunate in that we use the same notation to mean the inverse-function. Additionally, it is regularly confused with
\begin{equation*} \left(f(x)\right)^{-1} = \dfrac{1}{f(x)} \end{equation*}
ie the reciprocal. Alas, we are stuck with this notation and must be careful to understand its meaning by context.
This is an important point, so we’ll make it a formal warning:

Warning 10.3.3.

Be careful with preimages:
  • The preimage \(f^{-1}\) is not the inverse function.
  • If certain special conditions are satisfied, then the inverse function exists and we use the same notation to denote that function.
Consequently, when you see \(f^{-1}\) you should think “preimage” and not “inverse function” unless we specifically know that the inverse exists.
After all those warnings and caveats, lets draw a schematic of images and preimages:
Notice in this figure that
  • we have drawn \(f(A)\) as a subset of \(B\) — in fact \(f(A)\) is exactly the range of \(f\) and so must be a subset of \(B\text{.}\)
  • we have drawn the preimage of \(D\) so that it looks like two copies of half of the set \(D\) — this is to emphasise the fact that not every element of \(B\) has to have a preimage in \(A\text{.}\) Further, a given point in \(B\) might have more than one preimage.
Our quick look at preimages of \(f(x)=x^2\) above illustrated this second point. That was a little brief, but the following example looks at this in more detail.

Example 10.3.4. Images and preimages.

Let \(f: \mathbb{R} \to \mathbb{R}\) be defined by \(f(x) = x^2\text{.}\) Find the following
  1. \(\displaystyle f([0,4])\)
  2. \(\displaystyle f( [-3,-1] \cup [1,2] )\)
  3. \(\displaystyle f^{-1}(\set{0})\)
  4. \(\displaystyle f^{-1}(\set{1})\)
  5. \(\displaystyle f^{-1}( [0,4] ) = [-2,2]\)
  6. \(\displaystyle f^{-1}( [1,4] ) = [-2,-1] \cup [1,2]\)
  7. \(\displaystyle f^{-1}(\set{-1})\)
  8. \(\displaystyle f^{-1}([-4,-1])\)
Solution.
It will help to make a quick sketch of \(y=f(x)=x^2\) and think about the various intervals in the domain and co-domain. That \(f(x)\) is decreasing for \(x\lt 0\) and increasing for \(x \gt 0\) does make this exercise a little easier.
  1. The interval \(0 \leq x \leq 4\) maps to \(0 \leq x^2 \leq 16\text{.}\) So \(f([0,4])=[0,16]\)
  2. The interval \(-3 \leq x \leq -1\) maps to \(1 \leq x^2 \leq 9\text{,}\) and the interval \(1 \leq x \leq 2\) maps to \(1 \leq x^2 \leq 4\text{.}\) Hence the points in the union \([-3,-1] \cup [1,2]\) map to the interval \([1,9] \cup [1,4] = [1,9]\text{.}\) Hence \(f( [-3,-1] \cup [1,2] ) = [1,9]\text{.}\)
  3. To find the preimage of \(\set{0}\text{,}\) we need to solve \(f(x)=x^2=0\text{.}\) This only has a single solution, namely \(x=0\text{,}\) and so \(f^{-1}(\set{0})= \set{0}\)
  4. To find the preimage of \(\set{1}\text{,}\) we need to solve \(f(x)=x^2=1\text{.}\) This only two solutions, namely \(x= \pm 1\text{,}\) and so \(f^{-1}(\set{1})= \set{-1,1}\)
  5. The interval \(0 \leq x^2 \leq 4\) is mapped to by any number in the interval \(-2 \leq x \leq 2\text{.}\) So \(f^{-1}([0,4])=[-2,2]\text{.}\)
    We can check this by looking at the above plot, but also by considering \(f([-2,0] \cup [0,2])\text{.}\) The interval \(0 \leq x \leq 2\) maps to \(0 \leq x^2 \leq 4\) and \(-2 \leq x \leq 0\) maps to the same, \(0 \leq x^2 \leq 4\text{.}\)
  6. The interval \(1 \leq x^2 \leq 4\) is mapped to by any number in the interval \(1 \leq x \leq 2\) or any number in \(-2 \leq x \leq -1\text{.}\) So \(f^{-1}([1,4])=[-2,-1]\cup[1,2]\text{.}\)
    Again, we can check this by looking at the above plot, but also by considering \(f([-2,-1] \cup [1,2])\text{.}\) The interval \(1\leq x \leq 2\) mapes to \(1 \leq x^2 \leq 4\text{,}\) and \(-2 \leq x \leq -1\) maps to the same.
  7. To find the preimage of \(\set{-1}\text{,}\) we need to solve \(f(x)=x^2=-1\text{.}\) This has no solutions 130 , so \(f^{-1}(\set{-1})=\es \)
  8. To find the preimage of \(-4 \leq x^2 \leq -1\text{,}\) we should recall that the square of any real number is non-negative. So there are no values of \(x\) that map into that interval. Thus \(f^{-1}([-4,-1])=\es\text{.}\)
This example shows that the preimage of a single element 131  in the co-domain can be empty, or can contain a single element, or can contain multiple elements. As noted above, we want to understand what conditions we can impose on a function so that the preimage of a single point 132  in the co-domain always contains exactly one point in the domain. This will allow us to properly define inverse functions — that is if \(f(x)=y\) then how do we define a new function \(g\) so that \(g(y)=x\text{.}\)
Before we get to inverses we can do some more exploring of images and preimages. Since these are really operations on sets, we can (and should) ask ourselves how do these new things we can do to sets interact with the other things we can do to sets. So we now explore some of the relationships between subsets and their images and preimages, and also the interplay between functions, unions, intersections and differences.
For example — it is clearly  133  the case that if \(C_1 \subseteq C_2 \subseteq A\) then \(f(C_1) \subseteq f(C_2)\text{.}\) Similarly if \(D_1 \subseteq D_2 \subseteq B\) then \(f^{-1}(D_1) \subseteq f^{-1}(D_2)\text{.}\) While we’ve said “clearly”, we should really state results carefully and make them a result and prove them. We’ll follow this up with a more important result which we’ll call a theorem.
We prove each inclusion in turn.
  • Let \(b \in f(C_1)\text{.}\) Then (by the definition of image) there is some \(a \in C_1\) so that \(f(a)=b\text{.}\) But since \(C_1 \subseteq C_2\text{,}\) we know that \(a \in C_2\text{.}\) Hence \(b=f(a) \in f(C_2)\) as required.
  • Let \(a \in f^{-1}(D_1)\text{.}\) Then (by definition of preimage) \(f(a) \in D_1\text{.}\) But since \(D_1 \subseteq D_2\text{,}\) we know \(f(a) \in D_2\text{.}\) Then, by the definition of preimage, we know that \(a \in f^{-1}(D_2)\text{.}\)
Now, while the above proof is not terribly technical, it does require us to know the definitions of image and preimage and to understand how to manipulate them. Even though the statement we have just proved is (arguably) obvious 134 , its proof is not so trivial.
So what does this theorem tell us? It says that preimages play very nicely with set operations — they are well-behaved:
  • The preimage of the intersection is the intersection of the preimages
  • The preimage of the union is the union of the preimages
It also tells us that images are mostly well-behaved:
  • The image of the union is the union of the images
  • The image of the intersection is a subset of the intersection of the images.
Of course, we should prove these results. We’ll do some in the text and leave some of them as exercises. We’ll prove (iii) first and then (vi) and leave (i) until last. In the authors’ experience, people find (i) quite confusing, so we will tackle it after we’ve warmed up on the other two.
  • Proof of (iii):
    We need to show that if an element is in the set on the left then it is in the set on the right. Let \(b \in f(C_1 \cap C_2\)). Hence there is \(a \in C_1 \cap C_2\) such that \(f(a) = b\text{.}\) This means that \(a \in C_1\) and \(a \in C_2\text{.}\) It follows that \(f(a) = b \in f(C_1)\) and \(f(a) = b \in f(C_2)\text{,}\) and hence \(b \in f(C_1) \cap f(C_2)\text{.}\)
    The converse is false: \(f(C_1) \cap f(C_2) \not\subseteq f(C_1 \cap C_2)\) — another good exercise for the reader.
  • Proof of (vi):
    Let \(a \in f^{-1}(D_1 \cup D_2)\) and so \(f(a) \in D_1 \cup D_2\text{.}\) This means that \(f(a) \in D_1\) or \(f(a) \in D_2\text{.}\) If \(f(a) \in D_1\) it follows that \(a \in f^{-1}(D_1)\text{.}\) Similarly if \(f(a) \in D_2\) then \(a \in f^{-1}(D_2)\text{.}\) Since \(a\) lies in one of these two sets, it follows that \(a \in f^{-1}(D_1) \cup f^{-1}(D_2)\text{.}\)
    Let \(a \in f^{-1}(D_1) \cup f^{-1}(D_2)\text{.}\) Then \(a\) is an element of one of these two sets. If \(a \in f^{-1}(D_1)\text{,}\) then \(f(a) \in D_1\text{.}\) Similarly if \(a \in f^{-1}(D_2)\) then \(f(a) \in D_2\text{.}\) In either case \(f(a) \in D_1 \cup D_2\) and so \(a \in f^{-1} ( D_1 \cup D_2 )\text{.}\)
  • Proof of (i):
    Let \(x \in C\text{.}\) We need to show that \(x \in f^{-1}( f(C) )\text{.}\) So what is this set — by the definition it is \(\{a \in A : f(a) \in f(C) \}\text{.}\) Since \(x \in C\) we have, by definition, \(f(x) \in f(C)\text{.}\) Since \(f(x) \in f(C)\) it follows that \(x \in f^{-1}(f(C))\text{.}\)
    Note that the converse of this statement is false: \(f^{-1}(f(C)) \not\subseteq C\text{.}\) This makes a good exercise. We also note that (ii) follows a similarly flavoured argument and is another good exercise for the reader.
To be more precise, it has no solutions over the reals, which is the domain of the function.
Recall that we are abusing the definition of preimage here; we really mean “the preimage of a set containing a single element”.
Another similar abuse of the definition of preimage in order to keep the language flowing.
This is always a dangerous word when writing mathematics, and the authors include it here as an example of what, perhaps, one should not do. One person’s “clearly” is another persons “3 hours of confusion”.
“Obvious” is another dangerous word, and is a good example of emotive conjugation. “I found it obvious” but “they spent 4 days trying to work out what was going on”. This sort of thing often arises in the descriptions that people give their own actions compared with the descriptions of others. The interested reader should search-engine their way to the BBC series “Yes Prime Minister” which has the following example: “I give confidential press briefings; you leak; he’s being charged under section 2A of the Official Secrets Act.”