Recipe
Compute the image or preimage of a set under a function
Use when: you're given a function f and a subset of its domain or codomain, and asked for f(S) or f^{-1}(T)
Goal: the exact set f(S) or f^{-1}(T), built element by element
Taught in Images and preimages of sets
Quick recipe
-
1
An image starts from a subset of the domain and moves forward; a preimage starts from a subset of the codomain and moves backward.
- given a subset S of the domain — compute the image f(S) using the next step.
- given a subset T of the codomain — compute the preimage f^{-1}(T) using the step after that.
Why: the two computations scan opposite ends of the function's arrows, so misreading which one is asked leads to checking the wrong elements entirely.
-
2
Go through each element of S in turn, compute its output under f, and gather the results into one set with no repeats.
Example
For f(1)=a, f(2)=a, f(3)=b and S=\{1,2,3\}: the outputs are a, a, b, so f(S) = \{a,b\}, with a listed once.
Why: the image is defined as exactly the set of outputs reachable from S, and a set never lists a repeated element twice.
-
3
Check every element of the domain, not just T's own elements, and keep an input only if its output lies inside T.
Example
For f(4)=c, f(5)=c, and T=\{c\}: checking all five domain elements, only 4 and 5 have outputs in T, so f^{-1}(\{c\}) = \{4,5\}.
Why: preimage is defined by where an input's output lands, not by any property visible in the input itself, so every domain element needs checking.
Common mistakes
- Computing an image by scanning the codomain instead of the domain, or a preimage by scanning the domain instead of the codomain.
- Listing an output more than once in an image, when a set only lists each element a single time.
- Checking only the elements already inside T when computing a preimage, instead of the whole domain.
- Assuming f^{-1}(f(S)) always equals S back, when it can pick up extra elements that share an output with S.