In mathematics, the cokernel of a linear mapping of vector spacesf : X → Y is the quotient space of the codomain of f by the image off. The dimension of the cokernel is called the corank of f. Cokernels are dual to the kernels of category theory, hence the name: the kernel is a subobject of the domain, while the cokernel is a quotient object of the codomain. Intuitively, given an equation f = y that one is seeking to solve, the cokernel measures the constraints that y must satisfy for this equation to have a solution – the obstructions to a solution – while the kernel measures the degrees of freedom in a solution, if one exists. This is elaborated in [|intuition], below. More generally, the cokernel of a morphismf : X → Y in some category is an object Q and a morphism q : Y → Q such that the composition q f is the zero morphism of the category, and furthermore q is universalwith respect to this property. Often the map q is understood, and Q itself is called the cokernel of f. In many situations in abstract algebra, such as for abelian groups, vector spaces or modules, the cokernel of the homomorphismf : X → Y is the quotient of Y by the image of f. In topological settings, such as with boundedlinear operators between Hilbert spaces, one typically has to take the closure of the image before passing to the quotient.
One can define the cokernel in the general framework of category theory. In order for the definition to make sense the category in question must have zero morphisms. The cokernel of a morphism f : X → Y is defined as the coequalizer of f and the zero morphism 0XY : X → Y. Explicitly, this means the following. The cokernel of f : X → Y is an object Q together with a morphism q : Y → Q such that the diagram
commutes. Moreover, the morphism q must be universal for this diagram, i.e. any other such q′: Y → Q′ can be obtained by composing q with a unique morphism u : Q → Q′:
As with all universal constructions the cokernel, if it exists, is unique up to a unique isomorphism, or more precisely: if q : Y → Q and q' : Y → Q' are two cokernels of f : X → Y, then there exists a unique isomorphism u : Q → Q' with q = uq. Like all coequalizers, the cokernel q : Y → Q is necessarily an epimorphism. Conversely an epimorphism is called normal if it is the cokernel of some morphism. A category is called conormal if every epimorphism is normal.
In a preadditive category, it makes sense to add and subtract morphisms. In such a category, the coequalizer of two morphisms f and g is just the cokernel of their difference: In an abelian category the image and coimage of a morphism f are given by In particular, every abelian category is normal. That is, every monomorphismm can be written as the kernel of some morphism. Specifically, m is the kernel of its own cokernel:
Intuition
The cokernel can be thought of as the space of constraints that an equation must satisfy, as the space of obstructions, just as the kernel is the space of solutions. Formally, one may connect the kernel and the cokernel of a map T: V → W by the exact sequence These can be interpreted thus: given a linear equation to solve,
the kernel is the space of solutions to the homogeneous equation, and its dimension is the number of degrees of freedom in a solution, if it exists;
the cokernel is the space of constraints that must be satisfied if the equation is to have a solution, and its dimension is the number of constraints that must be satisfied for the equation to have a solution.
The dimension of the cokernel plus the dimension of the image add up to the dimension of the target space, as the dimension of the quotient space is simply the dimension of the space minus the dimension of the image. As a simple example, consider the map T: R2 → R2, given by T =. Then for an equation T = to have a solution, we must have a = 0, and in that case the solution space is, or equivalently,,. The kernel may be expressed as the subspace ⊆ V: the value of x is the freedom in a solution. The cokernel may be expressed via the real valued map W: → : given a vector, the value of a is the obstruction to there being a solution. Additionally, the cokernel can be thought of as something that "detects" surjections in the same way that the kernel "detects" injections. A map is injectiveif and only if its kernel is trivial, and a map is surjective if and only if its cokernel is trivial, or in other words, if.