Interactive

Functions on a Three-Element Set

33 = 27 functions f : {a, b, c} → {a, b, c}. Select a property to filter them, or group them by type.

View
Properties
Match
/ 27 functions
Display

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

Definitions

Injective (one-to-one)
f(x) = f(y) forces x = y; no two inputs share an output.
Surjective (onto)
every element is f(x) for some x; the image is all of X.
Bijective (permutation)
both injective and surjective. On a finite set these three coincide.
Constant
f(x) is the same element for every x, so the image has size one.
Idempotent (retraction)
f ∘ f = f; equivalently, f fixes every point of its image.
Involution
f ∘ f = id, so f is its own inverse (the identity and the three transpositions).
Fixed point
some x with f(x) = x.
Image size |Im(f)|
how many distinct values f takes; the rows 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 σ∘f∘σ-1). The 27 functions fall into 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.