of S). (Note that rings need not be unital for the kernel definition). To some extent, this can be thought of as a special case of the situation for modules, since these are all bimodules over a ring R: R itself; any two-sided ideal of R (such as ker f); any quotient ring of R (such as R/(ker f)); and the codomain of any ring homomorphism whose domain is R (such as S, the codomain of f). However, the isomorphism theorem gives a stronger result, because ring isomorphisms preserve multiplication while module isomorphisms (even between rings) in general do not. This example captures the essence of kernels in general Mal'cev algebras. Monoid homomorphisms Let M and N be monoids and let f be a monoid homomorphism from M to N. Then the kernel of f is the subset of the direct product consisting of all those ordered pairs of elements of M whose components are both mapped by f to the same element in N. The kernel is usually denoted (or a variation thereof). In symbols: Since f is a function, the elements of the form must belong to the kernel. The homomorphism f is injective if and only if its kernel is only the diagonal set . It turns out that is an equivalence relation on M, and in fact a congruence relation. Thus, it makes sense to speak of the quotient monoid . The first isomorphism theorem for monoids states that this quotient monoid is naturally isomorphic to the image of f (which is a submonoid of N; for the congruence relation). This is very different in flavour from the above examples. In particular, the preimage of the identity element of N is not enough to determine the kernel of f. Universal algebra All the above cases may be unified and generalized in universal algebra. General case Let A and B be algebraic structures of a given type and let f be a homomorphism of that type from A to B. Then the kernel of f is the subset of the direct product A × A consisting of all those ordered pairs of elements of A whose components are both mapped by f to the same element in B. The kernel is usually denoted (or a variation). In symbols: Since f is a function, the elements of the form (a, a) must belong to the kernel. The homomorphism