Skip to content

Sets, Functions, and Maps

A set is a collection of objects, and a function is a rule that assigns to each element of one set exactly one element of another set. This is the minimal grammar behind vector spaces, operators, wavefunctions, time evolution, coordinate changes, and probability assignments.

The point is not to make quantum mechanics look set-theoretic. The point is to know what a statement such as A:H→HA:\mathcal H\to\mathcal H actually commits you to: a domain, a codomain, and a rule.

If XX is a set and xx is one of its elements, write

x∈X.x\in X.

If every element of SS is also an element of XX, write S⊆XS\subseteq X and call SS a subset of XX. The empty set is written ∅\varnothing.

Common sets include

SymbolMeaning
N\mathbb Nnatural numbers, with the starting convention stated when needed
Z\mathbb Zintegers
R\mathbb Rreal numbers
C\mathbb Ccomplex numbers
H\mathcal HHilbert space

Sets can be built from conditions. For example,

S={x∈R:x2<1}S = \{x\in\mathbb R: x^2<1\}

is the open interval (−1,1)(-1,1).

A function from XX to YY is written

f:X→Y.f:X\to Y.

The set XX is the domain, and YY is the codomain. For each x∈Xx\in X, the function assigns a single element f(x)∈Yf(x)\in Y.

The codomain is part of the data. The two functions

f:R→R,f(x)=x2,f:\mathbb R\to\mathbb R, \qquad f(x)=x^2,

and

g:R→[0,∞),g(x)=x2,g:\mathbb R\to[0,\infty), \qquad g(x)=x^2,

have the same formula but different codomains. That difference affects whether the map is onto.

If S⊆XS\subseteq X, the image of SS under f:X→Yf:X\to Y is

f(S)={f(x)∈Y:x∈S}.f(S) = \{f(x)\in Y: x\in S\}.

If T⊆YT\subseteq Y, the preimage of TT is

f−1(T)={x∈X:f(x)∈T}.f^{-1}(T) = \{x\in X: f(x)\in T\}.

The notation f−1(T)f^{-1}(T) for a preimage does not require ff to have an inverse function. It means all points in the domain that land in TT.

For example, if f:R→Rf:\mathbb R\to\mathbb R is f(x)=x2f(x)=x^2, then

f−1({1})={−1,1}.f^{-1}(\{1\}) = \{-1,1\}.

A function f:X→Yf:X\to Y is:

  • injective if different inputs always give different outputs;
  • surjective if every element of YY is hit by at least one input;
  • bijective if it is both injective and surjective.

Equivalently, ff is injective when

f(x1)=f(x2)⟹x1=x2,f(x_1)=f(x_2) \quad\Longrightarrow\quad x_1=x_2,

and surjective when for every y∈Yy\in Y there exists at least one x∈Xx\in X with

f(x)=y.f(x)=y.

A bijection has a genuine inverse function

f−1:Y→Xf^{-1}:Y\to X

that reverses the assignment.

If

f:X→Y,g:Y→Z,f:X\to Y, \qquad g:Y\to Z,

then the composition g∘f:X→Zg\circ f:X\to Z is defined by

(g∘f)(x)=g(f(x)).(g\circ f)(x) = g(f(x)).

The order matters: g∘fg\circ f means apply ff first and then gg.

Each set has an identity map

id⁡X:X→X,id⁡X(x)=x.\operatorname{id}_X:X\to X, \qquad \operatorname{id}_X(x)=x.

For a bijection f:X→Yf:X\to Y, the inverse satisfies

f−1∘f=id⁡X,f∘f−1=id⁡Y.f^{-1}\circ f=\operatorname{id}_X, \qquad f\circ f^{-1}=\operatorname{id}_Y.

Quantum mechanics constantly uses maps:

MapWhat it does
ψ:R3→C\psi:\mathbb R^3\to\mathbb Cassigns a complex amplitude to each position
A:H→HA:\mathcal H\to\mathcal Hrepresents a linear operator in a simplified finite-dimensional setting
U(t):H→HU(t):\mathcal H\to\mathcal Hevolves closed-system states in time
ρ↦UρU†\rho\mapsto U\rho U^\daggerevolves density operators unitarily
∣ψ⟩↦∣ψ⟩⟨ψ∣\lvert\psi\rangle\mapsto \lvert\psi\rangle\langle\psi\rvertsends a normalized state vector to its rank-one density operator

Some maps are linear, some are nonlinear, some preserve inner products, and some are only defined on a suitable domain. Those extra properties are not automatic; they must be stated.

Let

f:R→[0,∞),f(x)=x2.f:\mathbb R\to[0,\infty), \qquad f(x)=x^2.

This map is surjective because every y∈[0,∞)y\in[0,\infty) has at least one real square root. It is not injective because

f(1)=f(−1)=1f(1)=f(-1)=1

while 1≠−11\ne -1.

If instead the domain is restricted to [0,∞)[0,\infty),

h:[0,∞)→[0,∞),h(x)=x2,h:[0,\infty)\to[0,\infty), \qquad h(x)=x^2,

then hh is bijective and has inverse

h−1(y)=y.h^{-1}(y)=\sqrt y.

The formula x2x^2 did not change; the domain did. This is why mathematical statements must keep track of domains.

  • Treating a formula as a complete function without specifying its domain and codomain.
  • Confusing the preimage notation f−1(T)f^{-1}(T) with an inverse function.
  • Assuming a map is invertible because it is useful.
  • Forgetting that composition order matters.
  • Treating every physics map as linear.
  • Ignoring domains when discussing differential operators or unbounded operators.
  • P. R. Halmos, Naive Set Theory, Springer, 1974.
  • S. Axler, Linear Algebra Done Right, 3rd ed., Springer, 2015.
  • G. Strang, Linear Algebra and Its Applications, 4th ed., Brooks/Cole, 2006.
  • B. C. Hall, Quantum Theory for Mathematicians, Springer, 2013.
  1. Let f:R→Rf:\mathbb R\to\mathbb R be f(x)=x2f(x)=x^2. Is ff injective? Is it surjective?
Solution

It is not injective because f(1)=f(−1)f(1)=f(-1) while 1≠−11\ne -1. It is not surjective onto R\mathbb R because no real input maps to a negative real number.

  1. For the same function f:R→Rf:\mathbb R\to\mathbb R, compute f−1({4})f^{-1}(\{4\}).
Solution

The preimage is

f−1({4})={−2,2}.f^{-1}(\{4\}) = \{-2,2\}.

This is a preimage of a set, not an inverse function evaluated at 44.

  1. Let f:X→Yf:X\to Y and g:Y→Zg:Y\to Z. Which function is applied first in g∘fg\circ f?
Solution

The function ff is applied first:

(g∘f)(x)=g(f(x)).(g\circ f)(x)=g(f(x)).