Let C be a category. In order to define a kernel in the general category-theoretical sense, C needs to have zero morphisms[?]. In that case, if f: A → B is an arbitrary morphism in C, then a kernel of f is an equaliser[?] of f and the zero morphism from A to B. In symbols:
To be more explicit, a kernel of f is any morphism k: K → A such that:
Note that in many concrete contexts, one would refer to the object K as the "kernel", rather than the morphism k. In those situations, K would be a subset of A, and that would be sufficient to reconstruct k as an inclusion map[?]; in the nonconcrete case, in contrast, we need the morphism k to describe how K is to be interpreted as a subobject[?] of A. One may prefer to think of the kernel as the pair (K,k) rather than as simply K or k alone.
While a category cannot have kernels unless it has zero morphisms, there is no guarantee that a category with zero morphisms must have kernels.
Kernels are familiar in many categories from abstract algebra, such as the category of groups or the category of (left) modules over a fixed ring (including vector spaces over a fixed field). To be explicit, if f: A → B is a homomorphism in one of these categories, and K is its kernel in the usual algebraic sense, then K is a subalgebra of A and the inclusion homomorphism from K to A is a kernel in the categorical sense.
Note that in the category of monoids, category-theoretic kernels exist just as for groups, but these kernels don't carry sufficient information for algebraic purposes. Therefore, the notion of kernel studied in monoid theory is slightly different. Conversely, in the category of rings, there are no kernels in the category-theoretic sense; indeed, this category does not even have zero morphisms. Nevertheless, there is still a notion of kernel studied in ring theory. See Relationship to algebraic kernels below for the resolution of this paradox.
As mentioned above, a kernel is a type of binary equaliser, or difference kernel[?]. Conversely, in a preadditive category, every binary equaliser can be constructed as a kernel. To be specific, the equaliser of the morphisms f and g is the kernel of the difference g − f. In symbols:
Every kernel, like any other equaliser, is a monomorphism. Conversely, a monomorphism is called normal if it is the kernel of some morphism. A category is called normal if every monomorphism is normal.
Abelian categories, in particular, are always normal. In this situation, the kernel of the cokernel[?] of any morphism (which always exists in an abelian category) turns out to be the image[?] of that morphism; in symbols:
Universal algebra defines a notion of kernel for homomorphisms between two algebraic structures of the same kind. This concept of kernel measures how far the given homomorphism is from being injective. There is some overlap between this algebraic notion and the categorical notion of kernel since both generalize the situation of groups and modules mentioned above. In general, however, the universal-algebraic notion of kernel is more like the category-theoretic concept of kernel pair[?]. In particular, kernel pairs can be used to interpret kernels in monoid theory or ring theory in category-theoretic terms.