Skip to content

Preimages: Which Inputs Reach a Chosen Set?

Textbook

For a function $f:A\to B$ and a set $S\subseteq B$, the preimage is $f^{-1}(S):=\{x\in A\mid f(x)\in S\}$. It contains every input whose output belongs to $S$.

A preimage does not require an invertible function. For $f(x)=x^2$ on the reals, $f^{-1}(\{4\})=\{-2,2\}$. Here $f^{-1}$ takes a set and returns a set. An inverse function, when it exists, recovers a unique input from an output. A set of unreachable outputs has an empty preimage: $f^{-1}(\{-1\})=\varnothing$ for the same function.

The domain $A$ limits the search: the same formula on different domains can have different preimages. Restricting squaring to nonnegative inputs makes the preimage of $\{4\}$ contain only 2. Membership has two requirements: the input belongs to $A$, and its output belongs to the target set $S$. Unreachable members of $S$ do not manufacture additional inputs.

Definitions and further reading: Mathematics for Computer Science.

In plain language

A preimage resembles collecting all letters addressed to a selected set of cities. The cities define the output condition, while the result contains the original letters. Several letters to one city all remain included; the post office need not pick a single winner. If no letter matches, the preimage is empty, and no inverse function is required.

Example

For the illustrative function $f(x)=x^2$ and target set $S=\{4\}$, the example checks βˆ’2, 0, and 2. These candidates illustrate filtering; the full real solution set of $x^2=4$ is exactly βˆ’2 and 2.

Preimages: Which Inputs Reach a Chosen Set?

Input βˆ’2

The output is 4, so this input is retained.

Step 1 of 3: Input βˆ’2

Read all steps
  1. Input βˆ’2

    The output is 4, so this input is retained.

    State
    βˆ’2 β†’ 4included02
  2. Input 0

    Output 0 is outside the target set.

    State
    βˆ’2 β†’ 4included0 β†’ 0excluded2
  3. Input 2

    The positive input also qualifies; both inputs are retained.

    State
    βˆ’2 β†’ 4included0 β†’ 0excluded2 β†’ 4included

The demonstration checks three candidates, but an equation establishes completeness. From $x^2=4$ it follows that $(x-2)(x+2)=0$, so there are no other real solutions. Replacing the target set with $\{0,4\}$ adds 0 to the answer. The output condition changes, while the resulting set still contains inputs. Writing only 4 in that set would confuse the search target with the search result.

Related concepts: Inverse functions, Set-builder notation.

The original text of this free article is published under CC BY-NC-ND 4.0.

Previous / next

Previous
Inverse Functions: Recovering Inputs From Outputs
Next
Indicators: Turning Conditions Into Zero or One
  • Natural Numbers: Counting Discrete Objects

    Which values count discrete objects, and why the zero convention must be stated.

    Read article
    Math
  • Integers: Counting on Both Sides of Zero

    Positive and negative integers, zero, and the limits of integer division.

    Read article
    Math
  • Rational Numbers: Ratios of Integers

    Numbers as ratios of integers: equivalent fractions and the nonzero denominator requirement.

    Read article
    Math