Codomain Created 2026-10-14 Updated 2026-10-14
The codomain of a function is its specified target set. The image of a function is a subset of the codomain, and equals it precisely for a surjective function. Changing a codomain can change whether the same input-output rule is surjective, as the quadratic function examples under function show.
For a surjective function and a function , there is a unique function with if and only if is constant on each fiber of a function of . Define to be the common value on ; it is well-defined and unique because that fiber is nonempty. This uniquely specified value requires no simultaneous arbitrary choices.
For a concrete example, restrict the codomain of the finite function above to its image of a function , making surjective. Define , and . Then on gives : knowing the output of is enough to compute . If instead , no such can exist, because must be the same value.
The surjectivity assumption supplies uniqueness on the full target. If the original unused target value three were retained, the factorization would impose no condition on , and different extensions could agree on every actual input. Thus factorization through a surjection formalizes when a compressed description retains all information needed for a later calculation.
// Target: combinatorics.bigb
Function Created 2026-09-24 Updated 2026-10-31
A function assigns exactly one output in the specified codomain to each input in its domain of a function . Its rule may be a formula, a finite table, or another unambiguous assignment. The outputs actually reached form its image of a function . A codomain states where outputs are allowed; the image of a function records where they actually land. Oscar Levin's introduction makes this distinction explicit. [ref].
For example, , , has the entire real line as its domain of a function and codomain, but its image of a function is . Both and give the output : several inputs sharing an output is permitted. Assigning two distinct outputs to one input is not permitted. A partial function can be undefined at some elements of a larger specified source set; an ordinary function on must be defined at every element of .
Three properties describe how a function uses its target. An injective function never sends distinct inputs to the same output. A surjective function reaches every member of its specified codomain. A bijection does both, pairing each source element with exactly one target element. These are different requirements, as finite arrow diagrams show.
Figure 1.
Injective, surjective and bijective functions have different output patterns
. Every source element has exactly one outgoing arrow. Left: an injective function from three elements to four leaves one target unused. Middle: a surjective function from four elements to three reaches every target but merges two inputs. Right: a bijection pairs three source elements with three targets, allowing every arrow to be reversed uniquely. Details.
The chosen codomain matters even when the formula does not change. The function from to is not surjective, whereas the same rule from to is surjective. Both fail injectivity. Further restricting the domain of a function to makes it a bijection onto , with square root as its inverse function.
Functions make transformations composable: if and , their function composition is . Identifying each intermediate codomain prevents attempting to feed an output into a rule that is not defined there. When a transformation is a bijection, an inverse function recovers the original input without ambiguity. This is useful whenever information must be transported or a calculation reversed.
Let be a natural transformation of categorical presheaves. If every is a surjective function, and satisfy , then at every . Surjectivity gives for all , hence . Thus is an epimorphism.
Conversely suppose is outside the image of some . Construct the pushout witness for failure of pointwise surjectivity explicitly: at each take
Restrictions send to ; naturality of ensures that every generating identification is respected. Thus is a categorical presheaf, and the two inclusions are natural transformations with .
All identifications concern the same element in its two copies, so an element outside the image is never identified with its other copy. Consequently , proving is not an epimorphism. Therefore
This is the pointwise epimorphism in a functor category criterion. It requires neither a componentwise choice of preimages nor a natural section.
An injective function satisfies for all . A surjective function satisfies: for every , some has . The following arguments apply to function composition with the stated domains and codomains.
We first justify the relevant pointwise epimorphism in a functor category criterion. A componentwise surjective function gives an epimorphism, because equality of two composites can be cancelled at each component. Conversely, for a natural transformation , form the pointwise pushout . Restrictions of preserve the identifications imposed by , so these pointwise sets and restrictions form a categorical presheaf. The two inclusions satisfy . If is epic, . At an object , an element outside the image of would retain two distinct copies in , contradicting this equality. Thus every is surjective.
Apply this criterion to at . Surjectivity of supplies with . Conversely, if , then , making a split epimorphism and hence an epimorphism. Therefore
Let be the set of all functions from the -element domain to the -element codomain, and let consist of the functions which omit codomain element . A function is surjective precisely when it lies outside .
For of size , the intersection consists of maps taking all their values in the remaining elements, so it has members. There are choices of . Applying the complement form of the inclusion-exclusion principle gives
When , every fibre of a surjective function has at least one member, and the fibres partition an -element domain. Thus every fibre has exactly one member and the function is a bijection. The count of these bijections is by the successive distinct-image choices from part (a). Hence
In the Category of sets, an epimorphism is exactly a surjective function. A surjective function is right-cancellable. If misses , the constant-zero function and the function that is one at and zero elsewhere are distinct maps with equal composites with .
If every is surjective, equality for natural transformations gives for every . Thus is an epimorphism in the functor category.
For the converse, construct the pointwise amalgamated double
where exactly the two copies of each element of are identified; different elements of remain different. Define . Naturality of implies that takes its image into the image at the target, so this formula is well-defined and gives a functor. The maps form natural transformations , with .
If is an epimorphism, . Since the two copies of an element outside would be distinct, every element must lie in that image. Hence is epic if and only if every component is epic. This proves the pointwise epimorphism in a functor category criterion directly, including the needed existence and naturality of the separating functor.
Suppose were a surjective function. Form the subset
Since belongs to the power set, surjectivity would give for some . But then holds if and only if , a contradiction. Thus no such function is surjective, and in particular there is no bijection from to its power set. This is Cantor theorem; the argument also applies when is empty.
For infinite binary sequences, use the bijection
with , taking . Conversely, a subset determines its sequence of membership indicators. The power set is infinite, since it contains all singletons, and Cantor theorem rules out a bijection with . Hence it is an uncountable set, as is the set of infinite binary sequences. Equivalently, a proposed enumeration is defeated by the sequence , which differs from its th listed sequence at position . This is the Cantor diagonal argument.
Again let with , and enumerate . For each infinite binary sequence , define a function by
The first values make every a surjective function, while the remaining values recover uniquely. Hence is an injective function from the uncountable set of binary sequences into . This proves is an uncountable set, an instance of uncountability of surjections onto a nontrivial finite set.
Use the well-order of the natural numbers to list in increasing order. Define recursively
The remaining set is nonempty because is infinite and only a finite set has been removed. Each chosen value is larger than the preceding one, so is an injective function.
To prove it is a surjective function, fix . If were never selected, every selected minimum would be at most . This would put infinitely many distinct values into the finite set , a contradiction. Hence
The increasing enumeration of an infinite subset of natural numbers uses no arbitrary choice: each next element is the uniquely determined minimum.
For each positive integer , the positive elements of form an infinite set, and the preceding increasing enumeration gives a bijection on these positive elements. The positive integers have a unique decomposition with , so these sets are disjoint and exhaust the positive integers.
The printed natural numbers include . The trailing-zero count of the representation of is not needed: shift the positive partition down by one and put
Uniqueness of the trailing-zero count proves the injective function property, and the decomposition of proves the surjective function property. An explicit decimal trailing-zero pairing function, using the increasing enumeration from the previous part, is
Indeed, the bracket enumerates , exactly the positive integers not divisible by . This handles both the positive index and the element without silently changing the PDF's convention.
To enumerate the rational numbers, first enumerate the integers by , , for . The function maps onto , and composing with gives a surjective function from . Choosing the first index representing each rational number gives an injective function . Thus is countably infinite; its infinitude follows because it contains all integers.
True. Choose a basis of . By surjective function, choose with . Define the linear map by and extend by linearity. Then on every basis vector, and therefore
This constructs a right inverse and does not require to be injective. If is the zero vector space, the unique zero map is the required right inverse.
False. Take , , , , and . Then is a direct sum, but , so their intersection is not zero. Their ordinary sum is , as always follows from surjective function and ; the failure is precisely the direct sum assertion.
Write . The covariant Yoneda lemma gives the natural bijection
whose inverse sends to the natural transformation with component . This also identifies the two variables' naturality.
To prove that is a projective object in a category, let be an epimorphism in the functor category and . By pointwise epimorphism in a functor category, lift through the surjective function . The Yoneda lemma turns this lift into with .
For a small category, the set of pairs with indexes the canonical map
It is natural, and every is the image of . Thus it is an epimorphism, establishing the projective cover of a set-valued functor by representables construction. Here cover means a projective presentation; no minimality is asserted.
For the equivalence's first step, if is a monomorphism, then , the map , is injective for every . Hence every representable functor is a monofunctor. Conversely, injectivity of every is exactly left cancellation against every , so it implies that is a monomorphism. Therefore
For every , invariance gives
Thus is nonempty, so is a surjective function. A surjection from a finite set to itself is a bijection. Therefore
This is the finite full-support measure-preserving map is bijective principle.
Suppose for contradiction that the continuous image of a connected space is disconnected. Then there are disjoint nonempty sets , open in the subspace topology on , with . By continuity, and are disjoint open subsets of ; by surjectivity both are nonempty, and their union is . This is a separation of a topological space of , contradicting that is a connected space. Hence is connected.
For , define by . If , then in particular
so . Thus is injective. Since a finite-dimensional vector space and its dual space have the same dimension, is also surjective and hence an isomorphism. This is the finite-dimensional real case of the Riesz representation theorem.
The adjoint operator of is the unique linear map satisfying
for every and . In the stated orthonormal bases, if and denote coordinate columns, then
Therefore the matrix of is the matrix transpose .
For ,
Hence . Taking orthogonal complements in the finite-dimensional space proves the image-kernel orthogonality for an adjoint
Put . For any ,
This is minimized at exactly when , equivalently when . Thus the normal equation for a linear inverse problem is
For the given linear least-squares problem,
The normal equations and have the unique solution
Let be a cardinal number of . If forcing collapsed , some condition would force a surjective function for an ordinal . Replacing by its ground-model cardinality lets us assume that is a cardinal.
For each , choose in a maximal antichain in a forcing order deciding . The chain condition for forcing makes its size less than , so the set of possible values of has size below . This is the possible-values lemma for chain-condition forcing. Every interpreted range is contained in . If , the fact that is a regular cardinal gives ; if , infinite cardinal arithmetic gives . Either way cannot contain the range of a surjection onto , a contradiction. By cardinal preservation by chain-condition forcing, preserves every cardinal at least .
The rank of a matrix is the dimension of its column space, equivalently the dimension of the image of a linear map represented by the matrix. For , the rank-nullity theorem gives
An injective endomorphism of a finite-dimensional vector space is surjective, hence invertible. By the adjugate matrix identity
is invertible when ; conversely, multiplicativity of the determinant shows that an invertible has nonzero determinant. Therefore
Let be the matrix unit with its only nonzero entry at . The following matrices are all nonsingular:
Indeed, is an elementary shear when , while is diagonal with one diagonal entry equal to two. Their linear span contains every except initially , because , and it then contains
Thus spans the -dimensional space and, having members, is a basis. This also covers , when .
Now let be a nonsingular zero-one matrix. If it had fewer than zero entries, at least two rows would contain no zero at all. Those two rows would both be the all-one row, contradicting linear independence. Hence every such matrix has at most
ones. The bound is attained. Let be the all-one matrix and set
where there are initial diagonal ones. If and , the first row equations give , while the last gives . Hence every , so is nonsingular and has exactly ones. Therefore