Function composition is not always commutative. The reversed function composition may be undefined when the necessary domain of a function and codomain do not match. A counterexample using functions avoids that issue: let and . Then
Both function compositions exist, and their values differ at every real .
There are ordered selections without replacement. Each unordered -element subset occurs in exactly orders, so the binomial coefficient is
One precise specification of its domain, codomain, and map is
Here , and includes the single empty selection. The actual values on are positive, so is also a valid codomain. For fixed , one can instead use the function with .
For , the adjacent binomial coefficients obey
Since and , the sign is determined by the numerator:
The printed codomain is inconsistent with the displayed map: , and when is odd, . With the usual extension for , is a function , and for ; the positive range above remains unchanged. Without that extension, the natural domain is .[ref]
The image of a function is
The function is surjective, or onto, exactly when every equals for at least one , equivalently . It is injective, or one-to-one, exactly when
Thus surjectivity concerns whether the entire codomain is reached; injectivity concerns whether distinct inputs have distinct outputs.
Not injective; surjective. The equal values disprove injectivity. For any , take . This lies in the stated domain of a function, and
Consequently every member of the codomain has a preimage.
Preimage 2026-10-14
For a function and a subset , its preimage is
It is a subset of the original domain of a function. The notation does not require an inverse function: the preimage of a singleton set can have no members, one member, or many members. In the finite example, , and . The preimage of a singleton set is also its fiber of a function.
For subsets , preimages preserve both unions and intersections:
For the intersection, the same input belongs precisely when its single output belongs to both and . There is no opportunity to choose different witnesses, which is what made the image counterexample fail. The identities also hold for arbitrary families of output subsets.
In the finite example, choose and . Then
The intersection of the two preimages is exactly the same set . Complements are preserved with respect to the appropriate source and target sets:
For example, the unused output three contributes no extra input: with , both sides of the complement identity are . See Lebl, Proposition 0.3.15: preimages of unions, intersections and complements.
This makes preimages useful for transporting conditions. The solution set of is , and a zero set is a preimage of zero. Requiring two output conditions takes the intersection of their preimages. In topology, a continuous function pulls every open set back to an open set; a measurable function pulls the specified measurable sets in its codomain back to measurable sets in its domain of a function. These definitions use preimages because their set operations remain consistent even when the function is noninjective.
Real-valued function Created 2026-09-24 Updated 2026-10-14
Restriction (mathematics) 2026-10-14
For a function and a subset , its restriction keeps the same values but allows only inputs in . Restricting the domain of a function can remove collisions and permit an inverse function, as the nonnegative quadratic function example shows. This changes the allowed inputs; it is different from keeping the inputs and changing the codomain.
Scalar-valued function Created 2026-10-18 Updated 2026-10-20
A scalar-valued function is a function whose codomain is a field, typically the real numbers or complex numbers. Its output is a single scalar, while its input can belong to an arbitrary set. For example, the square of the norm of a vector is real-valued. In a relativistic application, being scalar-valued alone does not establish Lorentz invariance: the transformation of the input and of the complete quantity must also be specified.
Self-map 2026-10-14
A self-map is a function whose domain of a function and codomain are the same set. It need not be a bijection: a constant function on a two-element set is a self-map that merges its inputs. Self-maps can always be composed with one another, and all self-maps of a specified set form its full transformation monoid.