Images and Preimages of Sets

Suppose a function ff scrambles a set AA into a new set. We want to track what happens to entire subsets, not just single points. If SS is a subset of the domain, where does ff send it as a whole? If TT is a subset of the codomain, which inputs land inside TT? These questions define the direct image f[S]f[S] and the inverse image f−1[T]f^{-1}[T]. These are two of the most heavily used constructions in all of mathematics. The subtlety deserves careful treatment rather than being waved through. Images and preimages interact with unions and intersections in asymmetric ways. Preimages are extremely well-behaved: they commute perfectly with unions, intersections, and complements. Images are not: they commute with unions but only partially with intersections. The failure is exactly measured by whether ff is injective. Students who assume the two operations behave identically make a classically documented error. This article isolates precisely where the symmetry breaks and why. This material matters because f[⋅]f[\cdot] and f−1[⋅]f^{-1}[\cdot] are the basic vocabulary for describing how structure transports across a map. Continuity in analysis and topology is defined via preimages of open sets. Measurability is defined via preimages of measurable sets. The image of a set under a homomorphism is the natural object of study in algebra. Getting the union/intersection laws exactly right is a prerequisite for all of that. So is knowing which direction needs injectivity or surjectivity. We give the precise definitions and prove the full family of interaction laws, with hypotheses stated exactly. We show where the naive intersection law for images fails. We connect this machinery forward to counting arguments about Finite Sets and Counting. Those arguments rely on tracking images of subsets under injections and surjections.

Key takeaways
  • For f:A→Bf: A \to B and S⊆AS \subseteq A, the direct image is f[S]={f(x):x∈S}f[S] = \{f(x) : x \in S\}.
  • For T⊆BT \subseteq B, the inverse image (preimage) is f−1[T]={x∈A:f(x)∈T}f^{-1}[T] = \{x \in A : f(x) \in T\}.
  • Preimages always commute with unions, intersections, and complements — no hypotheses needed.
  • Images commute with unions always, but images only commute with intersections when ff is injective.
  • f[f−1[T]]⊆Tf[f^{-1}[T]] \subseteq T always, with equality iff T⊆ran⁡(f)T \subseteq \operatorname{ran}(f); S⊆f−1[f[S]]S \subseteq f^{-1}[f[S]] always, with equality iff ff is injective on the relevant set.
  • Key idea: preimages are "linear" with respect to set operations because they are defined by a logical condition (f(x)∈Tf(x) \in T), while images can merge distinct elements together, which is what breaks the intersection law.

Where this lives today

In topology and analysis, continuity of f:X→Yf: X \to Y is defined as: f−1[U]f^{-1}[U] is open in XX for every open U⊆YU \subseteq Y. The unconditional preimage laws proven above are exactly what make arbitrary unions and finite intersections of open sets pull back to open sets, which is the backbone of the definition of a topology and why continuous functions compose well. In measure theory and probability, a function is measurable precisely when preimages of measurable sets are measurable, and the σ\sigma-algebra axioms (closed under countable union, complement) transfer perfectly through f−1f^{-1} by the same laws, which is why random variables can be built by composing measurable functions. In algebra, the image f[H]f[H] of a subgroup HH under a group homomorphism ff is again a subgroup, and the preimage f−1[K]f^{-1}[K] of a subgroup KK is again a subgroup — both facts are proved by combining the definitions here with the homomorphism property, and the kernel f−1[{e}]f^{-1}[\{e\}] is the cornerstone of the First Isomorphism Theorem. In cryptography and computer science, hash functions and encryption maps are studied through exactly these lenses: a hash function's collision resistance is a statement about how badly the intersection law for images fails (many inputs colliding to one output), while a cipher's invertibility is precisely the injectivity hypothesis needed for the round-trip equalities to hold. In statistics, the preimage of an event under a statistic (a function of data) is used to compute probabilities of observed outcomes, relying on the preimage-complement and preimage-union laws to manipulate events. Finally, this machinery directly foreshadows Finite Sets and Counting: counting arguments constantly ask "how big is f[S]f[S]?" (images can only shrink or preserve cardinality, never grow it, and equality of cardinality forces injectivity on SS), and pigeonhole-style reasoning is essentially a cardinality refinement of the image–intersection failure exhibited above. Understanding images and preimages of sets is also a direct prerequisite for Cardinality of Sets, since injections and bijections are defined and compared using exactly the image/preimage vocabulary developed here, building on Composition of Functions to track how images transform under composed maps.

:::quiz[Let f:Z→Zf : \mathbb{Z} \to \mathbb{Z}, f(n)=n2f(n) = n^2. Let S1={−2,5}S_1 = \{-2, 5\} and S2={2,7}S_2 = \{2, 7\}. What is f[S1∩S2]f[S_1 \cap S_2]?]

  • {4}\{4\}
  • {4,25,49}\{4, 25, 49\}
  • ∅\varnothing ✓
  • {4,49}\{4, 49\}

:::quiz[Which single hypothesis on f:A→Bf: A \to B guarantees f[f−1[T]]=Tf[f^{-1}[T]] = T for every T⊆BT \subseteq B?]

  • ff is injective
  • ff is surjective ✓
  • ff is the identity function
  • AA and BB are finite with ∣A∣=∣B∣|A| = |B|

:::quiz[Which of these correctly identifies the source of the failure of f[S1∩S2]=f[S1]∩f[S2]f[S_1 \cap S_2] = f[S_1] \cap f[S_2] in general?]

  • Unions of sets are not always well-defined
  • Existential quantifiers cannot be swapped past each other
  • Two distinct elements in S1∖S2S_1 \setminus S_2 and S2∖S1S_2 \setminus S_1 respectively can share the same image, without being in the intersection ✓
  • Preimages are not defined when ff is not injective

:::faq[Is it true that f[A∖S]=B∖f[S]f[A \setminus S] = B \setminus f[S] when ff is a bijection?] Yes, but only under the full bijection hypothesis (both injective and surjective), and it is worth proving rather than assuming. If ff is a bijection, f−1f^{-1} is an honest inverse function, and f[A∖S]={f(x):x∉S}f[A\setminus S] = \{f(x) : x \notin S\}. Injectivity ensures no element of f[S]f[S] can also arise from a point outside SS, and surjectivity ensures every point of B∖f[S]B \setminus f[S] is hit by some xx, which (by injectivity again) must lie outside SS. Both hypotheses are used essentially; the counterexample block above shows the identity fails outright once injectivity alone is dropped, and a similar example shows surjectivity alone is not sufficient either.

:::faq[Does f[S1]⊆f[S2]f[S_1] \subseteq f[S_2] follow from S1⊆S2S_1 \subseteq S_2?] Yes, and this monotonicity needs no hypothesis on ff. If y∈f[S1]y \in f[S_1], there is x∈S1x \in S_1 with f(x)=yf(x) = y; since S1⊆S2S_1 \subseteq S_2, also x∈S2x \in S_2, so y∈f[S2]y \in f[S_2]. The identical argument shows f−1[T1]⊆f−1[T2]f^{-1}[T_1] \subseteq f^{-1}[T_2] whenever T1⊆T2T_1 \subseteq T_2. Monotonicity is actually the easy half of the union and intersection laws: the union law's "⊆\subseteq" direction and the intersection law's inclusion (item 5) both follow immediately from monotonicity applied to each Si⊆⋃jSjS_i \subseteq \bigcup_j S_j or ⋂jSj⊆Si\bigcap_j S_j \subseteq S_i respectively.

:::faq[Can the fibers f−1[{y}]f^{-1}[\{y\}] for yy ranging over BB be used to reconstruct AA?] Yes: the collection of nonempty fibers {f−1[{y}]:y∈ran⁡(f)}\{f^{-1}[\{y\}] : y \in \operatorname{ran}(f)\} partitions AA into disjoint, nonempty blocks, one per value actually achieved. This follows directly from the preimage laws: fibers over distinct points are disjoint because f−1[{y1}]∩f−1[{y2}]=f−1[{y1}∩{y2}]=f−1[∅]=∅f^{-1}[\{y_1\}] \cap f^{-1}[\{y_2\}] = f^{-1}[\{y_1\} \cap \{y_2\}] = f^{-1}[\varnothing] = \varnothing when y1≠y2y_1 \ne y_2, using law (2). Their union is all of AA because every x∈Ax \in A lies in the fiber over f(x)f(x). This partition-by-fibers viewpoint is exactly the bridge used later to compare ∣A∣|A| and ∣ran⁡(f)∣|\operatorname{ran}(f)| in counting arguments.

Ask the tutor: Why does the preimage complement law hold with no hypotheses, while no version of a complement law holds for direct images even under injectivity alone?

DefinitionDirect image and inverse image

Let f:A→Bf : A \to B be a function, so dom⁡(f)=A\operatorname{dom}(f) = A and ran⁡(f)⊆B\operatorname{ran}(f) \subseteq B.

Direct image. For S⊆AS \subseteq A, the image of SS under ff is

f[S]={ y∈B:∃x∈S, f(x)=y }={f(x):x∈S}.f[S] = \{\, y \in B : \exists x \in S,\ f(x) = y \,\} = \{ f(x) : x \in S \}.

In particular f[A]=ran⁡(f)f[A] = \operatorname{ran}(f), and f[∅]=∅f[\varnothing] = \varnothing.

Inverse image (preimage). For T⊆BT \subseteq B, the preimage of TT under ff is

f−1[T]={ x∈A:f(x)∈T }.f^{-1}[T] = \{\, x \in A : f(x) \in T \,\}.

This is defined for every function ff and every subset T⊆BT \subseteq B — it requires no invertibility of ff at all. The notation f−1f^{-1} here denotes an operation on subsets of BB, not (necessarily) an inverse function; when ff happens to be a bijection, f−1[T]f^{-1}[T] agrees with the image of TT under the inverse function f−1:B→Af^{-1}: B \to A, which is why the same symbol is safely reused. For a single point y∈By \in B we write f−1[{y}]={x∈A:f(x)=y}f^{-1}[\{y\}] = \{x \in A : f(x) = y\}, the fiber of ff over yy.

Intuition

Think of ff as a machine with input bin AA and output bin BB. The direct image f[S]f[S] answers: "if I feed in exactly the elements of SS, what collection of outputs do I get?" It is a forward-looking, existential notion — an output yy belongs to f[S]f[S] if some element of SS produces it. This existential quantifier is precisely the source of all the trouble with intersections: two different elements x1∈S1x_1 \in S_1 and x2∈S2x_2 \in S_2 can both map to the same yy, so yy can appear in both f[S1]f[S_1] and f[S2]f[S_2] even though x1,x2x_1, x_2 need not both lie in S1∩S2S_1 \cap S_2. The preimage f−1[T]f^{-1}[T] answers a different, backward-looking question: "which inputs are guaranteed to land in TT?" This is a universal, pointwise membership test: x∈f−1[T]x \in f^{-1}[T] exactly when the single, well-defined value f(x)f(x) satisfies f(x)∈Tf(x) \in T. Because each xx has exactly one output f(x)f(x), testing membership in TT is a condition on xx alone, with no existential ambiguity — this is why preimages commute with all Boolean operations without any hypothesis on ff.

Figure
Fibers collapsing: why images fail to respect intersections
Domain A Codomain B S₁ S₂ x₁ x₂ (S₁∩S₂ = ∅ here) y = f(x₁) = f(x₂) S₁ ∩ S₂ = ∅ but y ∈ f[S₁] ∩ f[S₂]

The central theorem

TheoremInteraction of images and preimages with union, intersection, and complement

Let f:A→Bf : A \to B be a function. Let II be any nonempty index set, and suppose {Si}i∈I\{S_i\}_{i \in I} is a family of subsets of AA and {Ti}i∈I\{T_i\}_{i \in I} is a family of subsets of BB. Let T,T1,T2⊆BT, T_1, T_2 \subseteq B and S,S1,S2⊆AS, S_1, S_2 \subseteq A.

(Preimage laws — hold for every function ff, no hypotheses.) 1. f−1[⋃i∈ITi]=⋃i∈If−1[Ti]f^{-1}\left[\bigcup_{i \in I} T_i\right] = \bigcup_{i \in I} f^{-1}[T_i]. 2. f−1[⋂i∈ITi]=⋂i∈If−1[Ti]f^{-1}\left[\bigcap_{i \in I} T_i\right] = \bigcap_{i \in I} f^{-1}[T_i]. 3. f−1[B∖T]=A∖f−1[T]f^{-1}[B \setminus T] = A \setminus f^{-1}[T].

(Image laws.) 4. f[⋃i∈ISi]=⋃i∈If[Si]f\left[\bigcup_{i \in I} S_i\right] = \bigcup_{i \in I} f[S_i] — holds for every function ff, no hypotheses. 5. f[⋂i∈ISi]⊆⋂i∈If[Si]f\left[\bigcap_{i \in I} S_i\right] \subseteq \bigcap_{i \in I} f[S_i] — holds for every function ff; equality for all families {Si}\{S_i\} holds if and only if ff is injective. 6. If ff is injective, f[A∖S]⊆B∖f[S]f[A \setminus S] \subseteq B \setminus f[S] need not hold in general (only under further surjectivity assumptions); no clean complement law exists for images without extra hypotheses (see remark after the proof).

(Round-trip laws.) 7. S⊆f−1[f[S]]S \subseteq f^{-1}[f[S]] for every S⊆AS \subseteq A, with equality for all SS if and only if ff is injective. 8. f[f−1[T]]⊆Tf[f^{-1}[T]] \subseteq T for every T⊆BT \subseteq B, with equality for all TT if and only if ff is surjective.

Proof

We prove each item using direct set-membership chasing (the standard technique for these identities: show two sets are equal by showing each element of one lies in the other, using only the definitions of f[⋅]f[\cdot], f−1[⋅]f^{-1}[\cdot], and the logical meaning of ⋃\bigcup, ⋂\bigcap, complement).

(1) Preimage of a union.

x∈f−1[⋃i∈ITi]  ⟺  f(x)∈⋃i∈ITi  ⟺  ∃i∈I, f(x)∈Ti  ⟺  ∃i∈I, x∈f−1[Ti]  ⟺  x∈⋃i∈If−1[Ti].x \in f^{-1}\Big[\bigcup_{i\in I} T_i\Big] \iff f(x) \in \bigcup_{i \in I} T_i \iff \exists i \in I,\ f(x) \in T_i \iff \exists i \in I,\ x \in f^{-1}[T_i] \iff x \in \bigcup_{i \in I} f^{-1}[T_i].

Each step is a definitional unwinding or the definition of union as an existential quantifier; since the chain of iff's holds for arbitrary x∈Ax \in A, the two sets are equal.

(2) Preimage of an intersection.

x∈f−1[⋂i∈ITi]  ⟺  f(x)∈⋂i∈ITi  ⟺  ∀i∈I, f(x)∈Ti  ⟺  ∀i∈I, x∈f−1[Ti]  ⟺  x∈⋂i∈If−1[Ti].x \in f^{-1}\Big[\bigcap_{i\in I} T_i\Big] \iff f(x) \in \bigcap_{i \in I} T_i \iff \forall i \in I,\ f(x) \in T_i \iff \forall i \in I,\ x \in f^{-1}[T_i] \iff x \in \bigcap_{i \in I} f^{-1}[T_i].

Identical reasoning with ⋂\bigcap read as a universal quantifier. Note this requires no injectivity: the value f(x)f(x) is a single fixed element, and asking whether that single element lies in every TiT_i is unambiguous regardless of how ff behaves elsewhere.

(3) Preimage of a complement.

x∈f−1[B∖T]  ⟺  f(x)∈B∖T  ⟺  f(x)∉T  ⟺  x∉f−1[T]  ⟺  x∈A∖f−1[T].x \in f^{-1}[B \setminus T] \iff f(x) \in B \setminus T \iff f(x) \notin T \iff x \notin f^{-1}[T] \iff x \in A \setminus f^{-1}[T].

(The step f(x)∉T  ⟺  x∉f−1[T]f(x) \notin T \iff x \notin f^{-1}[T] uses the definition of f−1[T]f^{-1}[T] directly.)

(4) Image of a union.

y∈f[⋃i∈ISi]  ⟺  ∃x∈⋃i∈ISi, f(x)=y  ⟺  ∃i∈I, ∃x∈Si, f(x)=yy \in f\Big[\bigcup_{i \in I} S_i\Big] \iff \exists x \in \bigcup_{i \in I} S_i,\ f(x) = y \iff \exists i \in I,\ \exists x \in S_i,\ f(x) = y
  ⟺  ∃i∈I, y∈f[Si]  ⟺  y∈⋃i∈If[Si].\iff \exists i \in I,\ y \in f[S_i] \iff y \in \bigcup_{i \in I} f[S_i].

The middle step swaps the order of two existential quantifiers (∃x∈⋃iSi\exists x \in \bigcup_i S_i becomes ∃i,∃x∈Si\exists i, \exists x \in S_i), which is always logically valid — swapping two ∃\exists's never changes truth value, unlike swapping ∃\exists and ∀\forall. This is exactly why no hypothesis on ff is needed here, in contrast to (5) below.

(5) Image of an intersection — inclusion always, equality iff injective. Inclusion. Suppose y∈f[⋂i∈ISi]y \in f\big[\bigcap_{i \in I} S_i\big]. Then there is x∈⋂i∈ISix \in \bigcap_{i\in I} S_i with f(x)=yf(x) = y. For every i∈Ii \in I we have x∈Six \in S_i, hence y=f(x)∈f[Si]y = f(x) \in f[S_i]. Since this holds for every ii, y∈⋂i∈If[Si]y \in \bigcap_{i \in I} f[S_i]. This shows

f[⋂i∈ISi]⊆⋂i∈If[Si]f\Big[\bigcap_{i \in I} S_i\Big] \subseteq \bigcap_{i \in I} f[S_i]

for every function ff and every family {Si}\{S_i\}; no hypothesis was used. Injective ⇒\Rightarrow equality, for all families. Suppose ff is injective. Let y∈⋂i∈If[Si]y \in \bigcap_{i \in I} f[S_i]; we must produce a single x∈⋂i∈ISix \in \bigcap_{i \in I} S_i with f(x)=yf(x) = y. Fix any i0∈Ii_0 \in I (nonempty index set). Since y∈f[Si0]y \in f[S_{i_0}], there is x0∈Si0x_0 \in S_{i_0} with f(x0)=yf(x_0) = y. We claim x0∈Six_0 \in S_i for every i∈Ii \in I. Fix i∈Ii \in I; since y∈f[Si]y \in f[S_i], there is xi∈Six_i \in S_i with f(xi)=yf(x_i) = y. Then f(x0)=y=f(xi)f(x_0) = y = f(x_i), and injectivity of ff gives x0=xi∈Six_0 = x_i \in S_i. As ii was arbitrary, x0∈⋂i∈ISix_0 \in \bigcap_{i \in I} S_i, and f(x0)=yf(x_0) = y, so y∈f[⋂i∈ISi]y \in f\big[\bigcap_{i \in I} S_i\big]. Combined with the inclusion above, equality holds. Failure of equality for some family when ff is not injective. Suppose ff is not injective: there exist a≠ba \ne b in AA with f(a)=f(b)=:yf(a) = f(b) =: y. Take I={1,2}I = \{1,2\}, S1={a}S_1 = \{a\}, S2={b}S_2 = \{b\}. Then S1∩S2=∅S_1 \cap S_2 = \varnothing, so f[S1∩S2]=∅f[S_1 \cap S_2] = \varnothing. But f[S1]={y}=f[S2]f[S_1] = \{y\} = f[S_2], so f[S1]∩f[S2]={y}≠∅f[S_1] \cap f[S_2] = \{y\} \ne \varnothing. Thus equality fails for this particular family, showing that injectivity is not merely sufficient but (via this counterexample construction) necessary for the universal statement "equality holds for all families of subsets." This establishes the "if and only if" in (5): equality for every family is equivalent to injectivity of ff.

(6) No general complement law for images. We justify the claim by example rather than by a false general proof (a genuine "no-go" statement needs a witness). Let A={1,2}A = \{1, 2\}, B={0,1}B = \{0, 1\}, and f(1)=f(2)=0f(1) = f(2) = 0 (not injective). Let S={1}S = \{1\}, so A∖S={2}A \setminus S = \{2\}. Then f[S]={0}f[S] = \{0\}, so B∖f[S]={1}B \setminus f[S] = \{1\}. But f[A∖S]=f[{2}]={0}f[A \setminus S] = f[\{2\}] = \{0\}, which is not a subset of {1}\{1\}. So even the inclusion f[A∖S]⊆B∖f[S]f[A\setminus S] \subseteq B \setminus f[S] fails without injectivity, and one checks similarly that assuming injectivity alone (without surjectivity) is not enough to force f[A∖S]=B∖f[S]f[A \setminus S] = B \setminus f[S] in general (if ff is injective but not surjective, points of B∖ran⁡(f)B \setminus \operatorname{ran}(f) lie in B∖f[S]B \setminus f[S] for every SS, yet can never be produced as f(x)f(x) for x∈A∖Sx \in A \setminus S, unless one restricts attention to B=ran⁡(f)B = \operatorname{ran}(f)). Hence no clean, hypothesis-free complement law exists for direct images; this is listed for completeness, in contrast to the unconditional preimage complement law (3).

(7) Round trip S⊆f−1[f[S]]S \subseteq f^{-1}[f[S]], equality iff injective. Inclusion, always. Let x∈Sx \in S. Then f(x)∈f[S]f(x) \in f[S] by definition of image, and hence x∈f−1[f[S]]x \in f^{-1}[f[S]] by definition of preimage. This uses no hypothesis on ff. Injective ⇒\Rightarrow equality for all SS. Suppose ff injective and let x∈f−1[f[S]]x \in f^{-1}[f[S]]. Then f(x)∈f[S]f(x) \in f[S], so there is s∈Ss \in S with f(s)=f(x)f(s) = f(x). Injectivity gives x=s∈Sx = s \in S. Hence f−1[f[S]]⊆Sf^{-1}[f[S]] \subseteq S, and with the inclusion above, equality holds. Equality for all SS ⇒\Rightarrow injective (contrapositive). Suppose ff is not injective, so there are a≠ba \ne b with f(a)=f(b)f(a) = f(b). Let S={a}S = \{a\}. Then f[S]={f(a)}f[S] = \{f(a)\}, and f−1[f[S]]={x∈A:f(x)=f(a)}⊇{a,b}f^{-1}[f[S]] = \{x \in A : f(x) = f(a)\} \supseteq \{a, b\}, which strictly contains S={a}S = \{a\} since b≠ab \ne a also lies in it. So equality fails for this SS. This proves the converse, establishing the biconditional.

(8) Round trip f[f−1[T]]⊆Tf[f^{-1}[T]] \subseteq T, equality iff surjective. Inclusion, always. Let y∈f[f−1[T]]y \in f[f^{-1}[T]]. Then y=f(x)y = f(x) for some x∈f−1[T]x \in f^{-1}[T], meaning f(x)∈Tf(x) \in T. Since y=f(x)y = f(x), y∈Ty \in T. No hypothesis used. Surjective ⇒\Rightarrow equality for all TT. Suppose ff surjective and let y∈Ty \in T. Since ff is surjective, there is x∈Ax \in A with f(x)=y∈Tf(x) = y \in T, so x∈f−1[T]x \in f^{-1}[T], and hence y=f(x)∈f[f−1[T]]y = f(x) \in f[f^{-1}[T]]. Combined with the inclusion, T⊆f[f−1[T]]T \subseteq f[f^{-1}[T]], giving equality. Equality for all TT ⇒\Rightarrow surjective (contrapositive). Suppose ff is not surjective, so there is b∈B∖ran⁡(f)b \in B \setminus \operatorname{ran}(f). Let T={b}T = \{b\}. Then f−1[T]=∅f^{-1}[T] = \varnothing (no xx maps to bb), so f[f−1[T]]=∅≠{b}=Tf[f^{-1}[T]] = \varnothing \ne \{b\} = T. Equality fails for this TT, proving the converse. This completes the proof of all parts. ■\blacksquare

∎

Worked examples

Example 1 (a genuinely non-injective, non-surjective map, tracking all six operations). Let A={1,2,3,4,5}A = \{1,2,3,4,5\} and B={a,b,c,d,e,f}B = \{a,b,c,d,e,f\}, and define f:A→Bf: A \to B by

f(1)=a,f(2)=b,f(3)=b,f(4)=c,f(5)=a.f(1) = a,\quad f(2) = b,\quad f(3) = b,\quad f(4) = c,\quad f(5) = a.

So ran⁡(f)={a,b,c}\operatorname{ran}(f) = \{a,b,c\}; ff is neither injective (e.g. f(2)=f(3)f(2)=f(3)) nor surjective (e.g. d,e,f∉ran⁡(f)d,e,f \notin \operatorname{ran}(f)). Take S1={1,2,3}S_1 = \{1,2,3\} and S2={2,4,5}S_2 = \{2,4,5\}. Images. f[S1]={f(1),f(2),f(3)}={a,b}f[S_1] = \{f(1),f(2),f(3)\} = \{a,b\}. f[S2]={f(2),f(4),f(5)}={b,c,a}={a,b,c}f[S_2] = \{f(2),f(4),f(5)\} = \{b,c,a\} = \{a,b,c\}. Union law (item 4). S1∪S2={1,2,3,4,5}=AS_1 \cup S_2 = \{1,2,3,4,5\} = A, so f[S1∪S2]=f[A]={a,b,c}f[S_1 \cup S_2] = f[A] = \{a,b,c\}. On the other hand f[S1]∪f[S2]={a,b}∪{a,b,c}={a,b,c}f[S_1] \cup f[S_2] = \{a,b\} \cup \{a,b,c\} = \{a,b,c\}. These agree, confirming (4). Intersection law (item 5), strict inclusion this time. S1∩S2={2}S_1 \cap S_2 = \{2\}, so f[S1∩S2]={f(2)}={b}f[S_1 \cap S_2] = \{f(2)\} = \{b\}. But f[S1]∩f[S2]={a,b}∩{a,b,c}={a,b}f[S_1] \cap f[S_2] = \{a,b\} \cap \{a,b,c\} = \{a,b\}. Indeed

f[S1∩S2]={b}⊊{a,b}=f[S1]∩f[S2],f[S_1 \cap S_2] = \{b\} \subsetneq \{a,b\} = f[S_1] \cap f[S_2],

a strict inclusion, exactly as predicted since ff is not injective: the element aa appears in both f[S1]f[S_1] and f[S2]f[S_2] via different preimages (1∈S11 \in S_1 and 5∈S25 \in S_2, with f(1)=f(5)=af(1)=f(5)=a, but 1∉S21 \notin S_2 and 5∉S15 \notin S_1, so 1,5∉S1∩S21,5 \notin S_1 \cap S_2). Round trip forward (item 7). Take S={2}S = \{2\}. Then f[S]={b}f[S] = \{b\}, and f−1[f[S]]=f−1[{b}]={2,3}f^{-1}[f[S]] = f^{-1}[\{b\}] = \{2,3\} (both 2 and 3 map to bb). Indeed S={2}⊊{2,3}=f−1[f[S]]S = \{2\} \subsetneq \{2,3\} = f^{-1}[f[S]], strict because ff is not injective and 33 "rides along" with 22. Round trip backward (item 8). Take T={b,d}T = \{b, d\} (d∉ran⁡(f)d \notin \operatorname{ran}(f)). Then f−1[T]={x:f(x)∈{b,d}}={2,3}f^{-1}[T] = \{x : f(x) \in \{b,d\}\} = \{2,3\} (nothing maps to dd). So f[f−1[T]]=f[{2,3}]={b}f[f^{-1}[T]] = f[\{2,3\}] = \{b\}. Indeed {b}⊊{b,d}=T\{b\} \subsetneq \{b,d\} = T, strict because ff is not surjective (dd is never hit, so it can never re-enter the image after being "filtered" by the preimage). Preimage complement law (item 3), a direct check. Let T={a,c}T = \{a,c\}, so B∖T={b,d,e,f}B \setminus T = \{b,d,e,f\}. We compute f−1[T]={x:f(x)∈{a,c}}={1,4,5}f^{-1}[T] = \{x : f(x) \in \{a,c\}\} = \{1,4,5\}, so A∖f−1[T]={2,3}A \setminus f^{-1}[T] = \{2,3\}. Directly, f−1[B∖T]={x:f(x)∈{b,d,e,f}}={2,3}f^{-1}[B\setminus T] = \{x : f(x) \in \{b,d,e,f\}\} = \{2,3\} (since only 2,3↦b2,3 \mapsto b, and nothing maps to d,e,fd,e,f). Both computations give {2,3}\{2,3\}, confirming (3) concretely.

Example 2 (an infinite setting: f:Z→Zf: \mathbb{Z} \to \mathbb{Z}, f(n)=n2f(n) = n^2, illustrating the theorem with infinite index families). Let f:Z→Zf : \mathbb{Z} \to \mathbb{Z}, f(n)=n2f(n) = n^2. This ff is neither injective (since f(−2)=f(2)=4f(-2) = f(2) = 4) nor surjective (negative integers and non-squares are missed). For each k≥1k \ge 1 let Sk={−k,k}S_k = \{-k, k\} (so f[Sk]={k2}f[S_k] = \{k^2\}), and consider the family {Sk}k=1∞\{S_k\}_{k=1}^{\infty}. Union law. ⋃k=1∞Sk=Z∖{0}\bigcup_{k=1}^\infty S_k = \mathbb{Z} \setminus \{0\}. Then

f[⋃k=1∞Sk]=f[Z∖{0}]={1,4,9,16,… }={k2:k≥1},f\Big[\bigcup_{k=1}^\infty S_k\Big] = f[\mathbb{Z}\setminus\{0\}] = \{1,4,9,16,\dots\} = \{k^2 : k \ge 1\},

and ⋃k=1∞f[Sk]=⋃k=1∞{k2}={k2:k≥1}\bigcup_{k=1}^\infty f[S_k] = \bigcup_{k=1}^\infty \{k^2\} = \{k^2 : k \ge 1\}. These match exactly, confirming (4) in an infinite setting. Intersection failing, infinite version. Let S1={−1,3}S_1 = \{-1, 3\} and S2={1,3}S_2 = \{1, 3\} (asymmetric, sharing only the point 33 in a nontrivial way but also each containing a point whose image collides with the other's). Then S1∩S2={3}S_1 \cap S_2 = \{3\}, so f[S1∩S2]={9}f[S_1 \cap S_2] = \{9\}. But f[S1]={1,9}f[S_1] = \{1, 9\} and f[S2]={1,9}f[S_2] = \{1,9\}, so f[S1]∩f[S2]={1,9}f[S_1] \cap f[S_2] = \{1,9\}. Indeed

f[S1∩S2]={9}⊊{1,9}=f[S1]∩f[S2],f[S_1 \cap S_2] = \{9\} \subsetneq \{1,9\} = f[S_1] \cap f[S_2],

because −1∈S1-1 \in S_1 and 1∈S21 \in S_2 collide under ff (both square to 11) without −1-1 or 11 lying in the intersection S1∩S2S_1 \cap S_2 — the mechanism from the general proof of item (5), realized concretely. Preimage of an intersection, done correctly (contrast). Let T1={0,1,4,9,16,… }T_1 = \{0,1,4,9,16,\dots\} (all squares, including 00) and T2={n∈Z:n≥5}T_2 = \{n \in \mathbb{Z} : n \ge 5\}. Then T1∩T2={9,16,25,… }T_1 \cap T_2 = \{9, 16, 25, \dots\} (squares that are at least 55), so

f−1[T1∩T2]={n∈Z:n2≥9}={n:∣n∣≥3}.f^{-1}[T_1 \cap T_2] = \{ n \in \mathbb{Z} : n^2 \ge 9\} = \{n : |n| \ge 3\}.

On the other hand f−1[T1]=Zf^{-1}[T_1] = \mathbb{Z} (every integer squares to something in T1T_1, since T1T_1 contains all perfect squares) and f−1[T2]={n:n2≥5}={n:∣n∣≥3}f^{-1}[T_2] = \{n : n^2 \ge 5\} = \{n : |n| \ge 3\} (since 22=4<52^2 = 4 < 5 but 32=9≥53^2 = 9 \ge 5). So

f−1[T1]∩f−1[T2]=Z∩{n:∣n∣≥3}={n:∣n∣≥3},f^{-1}[T_1] \cap f^{-1}[T_2] = \mathbb{Z} \cap \{n : |n|\ge 3\} = \{n : |n| \ge 3\},

which matches f−1[T1∩T2]f^{-1}[T_1 \cap T_2] exactly, confirming (2) holds with no injectivity assumption whatsoever — even though this very same ff badly violates the analogous law for images.

CounterexampleWhy injectivity is needed for the image–intersection law

The theorem states f[⋂iSi]=⋂if[Si]f\big[\bigcap_{i} S_i\big] = \bigcap_i f[S_i] for all families if and only if ff is injective. To see the hypothesis is essential — not just convenient — drop injectivity and watch equality fail, using a clean minimal example. Let A={1,2}A = \{1, 2\}, B={p}B = \{p\}, and define f:A→Bf : A \to B by f(1)=f(2)=pf(1) = f(2) = p (the unique constant function to a one-point set; certainly not injective since 1≠21 \ne 2 but f(1)=f(2)f(1) = f(2)). Let S1={1}S_1 = \{1\} and S2={2}S_2 = \{2\}. These are disjoint: S1∩S2=∅S_1 \cap S_2 = \varnothing. Compute the left side:

f[S1∩S2]=f[∅]=∅.f[S_1 \cap S_2] = f[\varnothing] = \varnothing.

Compute the right side:

f[S1]={p},f[S2]={p},f[S1]∩f[S2]={p}∩{p}={p}.f[S_1] = \{p\}, \qquad f[S_2] = \{p\}, \qquad f[S_1] \cap f[S_2] = \{p\} \cap \{p\} = \{p\}.

So f[S1∩S2]=∅≠{p}=f[S1]∩f[S2]f[S_1 \cap S_2] = \varnothing \ne \{p\} = f[S_1] \cap f[S_2]: the inclusion from item (5) is present (∅⊆{p}\varnothing \subseteq \{p\}) but strict, and equality genuinely fails. The single feature of ff responsible is that two distinct domain points, one from each set, were identified by ff — precisely the phenomenon that injectivity forbids. This is not a pathology of infinite sets or of a poorly chosen ff; it is the smallest possible witness, occurring already with ∣A∣=2|A| = 2, ∣B∣=1|B|=1. Contrast this with preimages: for this same non-injective ff, one can check directly that f−1[T1∩T2]=f−1[T1]∩f−1[T2]f^{-1}[T_1 \cap T_2] = f^{-1}[T_1] \cap f^{-1}[T_2] still holds for every T1,T2⊆BT_1, T_2 \subseteq B (there are only two subsets of B={p}B = \{p\} to check, ∅\varnothing and {p}\{p\}, and both cases are immediate from the definitions). This side-by-side failure/success is the entire content of the asymmetry between images and preimages.

Scope, edge cases & common traps

SituationWhat happensHypothesis needed
f−1f^{-1} applied to ∪,∩,c\cup, \cap, {}^cAlways commutes exactlyNone — holds for every function
f[⋅]f[\cdot] applied to ∪\cupAlways commutes exactlyNone
f[⋅]f[\cdot] applied to ∩\capOnly ⊆\subseteq in generalEquality (for all families)   ⟺  \iff ff injective
f[⋅]f[\cdot] applied to complementNo general law at allFails even with one-sided hypotheses alone
S⊆f−1[f[S]]S \subseteq f^{-1}[f[S]]Always trueEquality (for all SS)   ⟺  \iff ff injective
f[f−1[T]]⊆Tf[f^{-1}[T]] \subseteq TAlways trueEquality (for all TT)   ⟺  \iff ff surjective
f[∅]f[\varnothing], f−1[∅]f^{-1}[\varnothing]Both always equal ∅\varnothingNone
f−1[B]f^{-1}[B]Always equals AA (whole domain)None
f[A]f[A]Equals ran⁡(f)\operatorname{ran}(f), may be a proper subset of BBNone; this is exactly the definition of surjectivity failing

:::warning[The classic error: assuming f[S1∩S2]=f[S1]∩f[S2]f[S_1 \cap S_2] = f[S_1] \cap f[S_2] in general] The single most common mistake is to treat images as if they distribute over intersection the same way preimages do, silently assuming injectivity without stating it. The correct universally valid statement is only the inclusion f[S1∩S2]⊆f[S1]∩f[S2]f[S_1 \cap S_2] \subseteq f[S_1] \cap f[S_2]; equality requires injectivity and must be justified, never asserted "by symmetry" with the (unconditional) preimage law. A related quantifier trap: "ff injective on S1∪S2S_1 \cup S_2" is what is really needed locally, but it suffices to assume ff injective on all of AA, which is the clean global hypothesis stated in the theorem.

The mathematician behind it

Origins · 1 minRichard Dedekind and how this was discovered
RD
Richard Dedekind
1831–1916 · Late 19th-century Germany, foundations of arithmetic and set theory

Dedekind, working alongside Cantor in the emerging language of set theory, was among the first to treat "mapping" (Abbildung) as a rigorous mathematical object subject to precise laws, rather than an informal procedure. His 1888 monograph Was sind und was sollen die Zahlen? ("What are numbers and what should they be?") develops the algebra of images and preimages of sets under mappings as basic tools, using them to define injective and surjective maps and to build the natural numbers via chains and simply infinite systems. The union/intersection laws for images and preimages, and the special role of injectivity in the intersection law, appear there in essentially the modern form, decades before the Zermelo–Fraenkel axiomatization made "set" and "function" fully precise.

History
- 1872 — Dedekind publishes Stetigkeit und irrationale Zahlen, developing rigorous treatment of real numbers via cuts, using mapping ideas informally.
- 1888 — Dedekind's Was sind und was sollen die Zahlen? formalizes mappings between sets and states basic image/preimage laws, including injectivity's role.
- 1895–1897 — Cantor's Beiträge zur Begründung der transfiniten Mengenlehre systematizes set operations that underlie modern union/intersection notation.
- 1908 — Zermelo axiomatizes set theory, giving ∪\cup, ∩\cap, and set-builder notation the precise footing needed to state these laws unambiguously.
- 1930s–1960s — Bourbaki and subsequent textbook authors (Halmos's Naive Set Theory, 1960) codify f[S]f[S] and f−1[T]f^{-1}[T] notation and the standard theorem list used in modern courses.
Why do preimages behave better than images with respect to set operations?

Because f−1[T]={x∈A:f(x)∈T}f^{-1}[T] = \{x \in A : f(x) \in T\} is defined by a single, unambiguous condition on each individual xx: does the one value f(x)f(x) lie in TT? Testing this condition against a union or intersection of target sets reduces immediately to an "or" or "and" of true/false statements about that one fixed element f(x)f(x), and set union/intersection are themselves built from "or"/"and." No information is lost. Images, by contrast, are defined by an existential quantifier over the source set (y∈f[S]y \in f[S] iff some x∈Sx \in S has f(x)=yf(x)=y), and existentials do not distribute over "and" the way they distribute over "or" — this asymmetry in first-order logic is the entire reason images fail the intersection law while preimages do not.

What happens to the theorem's laws when the index set II is empty?

Convention matters here, and it is worth being explicit: ⋃i∈∅Ti=∅\bigcup_{i \in \varnothing} T_i = \varnothing by convention (an empty union of subsets of BB contributes nothing), while ⋂i∈∅Ti\bigcap_{i \in \varnothing} T_i is conventionally taken to be the ambient set BB (an empty intersection is "everything," since the universal quantifier over an empty index set is vacuously true for every element). Both preimage laws (1) and (2) remain correct under these conventions: f−1[∅]=∅f^{-1}[\varnothing] = \varnothing and f−1[B]=Af^{-1}[B] = A, matching ⋃i∈∅f−1[Ti]=∅\bigcup_{i\in\varnothing} f^{-1}[T_i] = \varnothing and ⋂i∈∅f−1[Ti]=A\bigcap_{i \in \varnothing} f^{-1}[T_i] = A. The theorem statement assumed II nonempty specifically to avoid needing to fuss over this convention in the intersection-of-images proof, where a genuine element x0x_0 had to be exhibited.

Why does the article insist on "for all families {Si}\{S_i\}" when stating the injectivity biconditional?

Because for a specific pair S1,S2S_1, S_2, equality f[S1∩S2]=f[S1]∩f[S2]f[S_1 \cap S_2] = f[S_1]\cap f[S_2] can hold by coincidence even if ff is not globally injective — for instance if S1∩S2=∅S_1 \cap S_2 = \varnothing and f[S1],f[S2]f[S_1], f[S_2] also happen to be disjoint. What characterizes injectivity is that equality holds no matter which subsets are chosen. Stating the biconditional with the correct quantifier order ("ff injective   ⟺  \iff for all S1,S2S_1,S_2, equality holds," not "there exist S1,S2S_1, S_2 with equality") is essential; getting this quantifier order backwards is a classic logical error that this article's proof of item (5) is specifically structured to avoid, by exhibiting one universal counterexample family whenever injectivity fails.

How does this connect to composition of functions?

If g:A→Bg: A \to B and f:B→Cf: B \to C, then for S⊆AS \subseteq A, one can check directly from the definitions that (f∘g)[S]=f[g[S]](f \circ g)[S] = f[g[S]], and for T⊆CT \subseteq C, (f∘g)−1[T]=g−1[f−1[T]](f \circ g)^{-1}[T] = g^{-1}[f^{-1}[T]] — note the order reversal in the preimage formula, mirroring how composition itself reverses when passing to preimages. These composition identities, built on top of Composition of Functions, are proved by the same membership-chasing technique used throughout this article, and they are exactly what makes the preimage-continuity definition well-behaved under composing continuous functions in topology.

Before this

Where this leads