Interactive

Functions on a 3-Element Set

There are $3^3 = 27$ functions $f : \{a, b, c\} \to \{a, b, c\}$. Select a property to filter them, or group them by type.

View
Properties
Match
Display

The $27$ functions at coordinates $(f(a), f(b), f(c))$ in a $3 \times 3 \times 3$ cube. Drag or press Spin to rotate; click a point to inspect.

Definitions

Bijective
A function is injective if $f(x) = f(y)$ implies $x = y$, and surjective if every $y$ has some $x$ with $f(x) = y$. A function that is both injective and surjective is bijective. On any finite set, all three conditions coincide.
Constant
A function is constant if $f(x)$ is the same value for every $x$. The image is a single element.
Idempotent
A function is idempotent if $f \circ f = f$. Equivalently, $f$ fixes every point of its image.
Involution
A function is an involution if $f \circ f = \mathrm{id}$. In other words, $f$ is its own inverse.
Fixed point
A function has a fixed point if $f(x) = x$ for some $x$. At least one input is sent to itself.
Image size $|\mathrm{Im}(f)|$
The number of distinct output values of $f$. Functions with the same image size appear in the same row of the 2D layout.

Notes

Types. Two functions are the same type if one becomes the other by relabeling $a, b, c$ (replacing $f$ by $\sigma \circ f \circ \sigma^{-1}$). The $27$ functions fall into $\mathbf{7}$ types. Functions in the same type share the same properties, so Group by type highlights entire pods at once.

Injective = surjective = bijective. On a finite set, injective and surjective are equivalent, so both reduce to bijective: the six permutations. The three conditions coincide here, hence a single Bijective toggle.

Edges. An edge connects two functions that agree on two inputs and differ on the third. In 3D these are the grid lines of the cube; in 2D they are drawn faint. With Group by type on, two types are connected if any member of one is adjacent to any member of the other.