In category theory, an **epimorphism** is a morphism *f* : *X* → *Y* that is right-cancellative in the sense that, for all objects *Z* and all morphisms *g*_{1}, *g*_{2}: *Y* → *Z*,

Epimorphisms are categorical analogues of onto or surjective functions (and in the category of sets the concept corresponds exactly to the surjective functions), but they may not exactly coincide in all contexts; for example, the inclusion is a ring epimorphism. The dual of an epimorphism is a monomorphism (i.e. an epimorphism in a category *C* is a monomorphism in the dual category *C*^{op}).

Many authors in abstract algebra and universal algebra define an **epimorphism** simply as an *onto* or surjective homomorphism. Every epimorphism in this algebraic sense is an epimorphism in the sense of category theory, but the converse is not true in all categories. In this article, the term "epimorphism" will be used in the sense of category theory given above. For more on this, see § Terminology below.

Every morphism in a concrete category whose underlying function is surjective is an epimorphism. In many concrete categories of interest the converse is also true. For example, in the following categories, the epimorphisms are exactly those morphisms that are surjective on the underlying sets:

**Set**: sets and functions. To prove that every epimorphism*f*:*X*→*Y*in**Set**is surjective, we compose it with both the characteristic function*g*_{1}:*Y*→ {0,1} of the image*f*(*X*) and the map*g*_{2}:*Y*→ {0,1} that is constant 1.**Rel**: sets with binary relations and relation-preserving functions. Here we can use the same proof as for**Set**, equipping {0,1} with the full relation {0,1}×{0,1}.**Pos**: partially ordered sets and monotone functions. If*f*: (*X*, ≤) → (*Y*, ≤) is not surjective, pick*y*_{0}in*Y*\*f*(*X*) and let*g*_{1}:*Y*→ {0,1} be the characteristic function of {*y*|*y*_{0}≤*y*} and*g*_{2}:*Y*→ {0,1} the characteristic function of {*y*|*y*_{0}<*y*}. These maps are monotone if {0,1} is given the standard ordering 0 < 1.**Grp**: groups and group homomorphisms. The result that every epimorphism in**Grp**is surjective is due to Otto Schreier (he actually proved more, showing that every subgroup is an equalizer using the free product with one amalgamated subgroup); an elementary proof can be found in (Linderholm 1970).**FinGrp**: finite groups and group homomorphisms. Also due to Schreier; the proof given in (Linderholm 1970) establishes this case as well.**Ab**: abelian groups and group homomorphisms.: vector spaces over a field*K*-Vect*K*and*K*-linear transformations.**Mod**-*R*: right modules over a ring*R*and module homomorphisms. This generalizes the two previous examples; to prove that every epimorphism*f*:*X*→*Y*in**Mod**-*R*is surjective, we compose it with both the canonical quotient map*g*_{1}:*Y*→*Y*/*f*(*X*) and the zero map*g*_{2}:*Y*→*Y*/*f*(*X*).**Top**: topological spaces and continuous functions. To prove that every epimorphism in**Top**is surjective, we proceed exactly as in**Set**, giving {0,1} the indiscrete topology, which ensures that all considered maps are continuous.**HComp**: compact Hausdorff spaces and continuous functions. If*f*:*X*→*Y*is not surjective, let*y*∈*Y*−*fX*. Since*fX*is closed, by Urysohn's Lemma there is a continuous function*g*_{1}:*Y*→ [0,1] such that*g*_{1}is 0 on*fX*and 1 on*y*. We compose*f*with both*g*_{1}and the zero function*g*_{2}:*Y*→ [0,1].

However, there are also many concrete categories of interest where epimorphisms fail to be surjective. A few examples are:

- In the category of monoids,
**Mon**, the inclusion map**N**→**Z**is a non-surjective epimorphism. To see this, suppose that*g*_{1}and*g*_{2}are two distinct maps from**Z**to some monoid*M*. Then for some*n*in**Z**,*g*_{1}(*n*) ≠*g*_{2}(*n*), so*g*_{1}(−*n*) ≠*g*_{2}(−*n*). Either*n*or −*n*is in**N**, so the restrictions of*g*_{1}and*g*_{2}to**N**are unequal. - In the category of algebras over commutative ring
**R**, take**R**[**N**] →**R**[**Z**], where**R**[**G**] is the group ring of the group**G**and the morphism is induced by the inclusion**N**→**Z**as in the previous example. This follows from the observation that**1**generates the algebra**R**[**Z**] (note that the unit in**R**[**Z**] is given by**0**of**Z**), and the inverse of the element represented by**n**in**Z**is just the element represented by −**n**. Thus any homomorphism from**R**[**Z**] is uniquely determined by its value on the element represented by**1**of**Z**. - In the category of rings,
**Ring**, the inclusion map**Z**→**Q**is a non-surjective epimorphism; to see this, note that any ring homomorphism on**Q**is determined entirely by its action on**Z**, similar to the previous example. A similar argument shows that the natural ring homomorphism from any commutative ring*R*to any one of its localizations is an epimorphism. - In the category of commutative rings, a finitely generated homomorphism of rings
*f*:*R*→*S*is an epimorphism if and only if for all prime ideals*P*of*R*, the ideal*Q*generated by*f*(*P*) is either*S*or is prime, and if*Q*is not*S*, the induced map Frac(*R*/*P*) → Frac(*S*/*Q*) is an isomorphism (EGA IV 17.2.6). - In the category of Hausdorff spaces,
**Haus**, the epimorphisms are precisely the continuous functions with dense images. For example, the inclusion map**Q**→**R**, is a non-surjective epimorphism.

The above differs from the case of monomorphisms where it is more frequently true that monomorphisms are precisely those whose underlying functions are injective.

As for examples of epimorphisms in non-concrete categories:

- If a monoid or ring is considered as a category with a single object (composition of morphisms given by multiplication), then the epimorphisms are precisely the right-cancellable elements.
- If a directed graph is considered as a category (objects are the vertices, morphisms are the paths, composition of morphisms is the concatenation of paths), then
*every*morphism is an epimorphism.

Every isomorphism is an epimorphism; indeed only a right-sided inverse is needed: if there exists a morphism *j* : *Y* → *X* such that *fj* = id_{Y}, then *f*: *X* → *Y* is easily seen to be an epimorphism. A map with such a right-sided inverse is called a **split epi**. In a topos, a map that is both a monic morphism and an epimorphism is an isomorphism.

The composition of two epimorphisms is again an epimorphism. If the composition *fg* of two morphisms is an epimorphism, then *f* must be an epimorphism.

As some of the above examples show, the property of being an epimorphism is not determined by the morphism alone, but also by the category of context. If *D* is a subcategory of *C*, then every morphism in *D* that is an epimorphism when considered as a morphism in *C* is also an epimorphism in *D*. However the converse need not hold; the smaller category can (and often will) have more epimorphisms.

As for most concepts in category theory, epimorphisms are preserved under equivalences of categories: given an equivalence *F* : *C* → *D*, a morphism *f* is an epimorphism in the category *C* if and only if *F*(*f*) is an epimorphism in *D*. A duality between two categories turns epimorphisms into monomorphisms, and vice versa.

The definition of epimorphism may be reformulated to state that *f* : *X* → *Y* is an epimorphism if and only if the induced maps

are injective for every choice of *Z*. This in turn is equivalent to the induced natural transformation

being a monomorphism in the functor category **Set**^{C}.

Every coequalizer is an epimorphism, a consequence of the uniqueness requirement in the definition of coequalizers. It follows in particular that every cokernel is an epimorphism. The converse, namely that every epimorphism be a coequalizer, is not true in all categories.

In many categories it is possible to write every morphism as the composition of an epimorphism followed by a monomorphism. For instance, given a group homomorphism *f* : *G* → *H*, we can define the group *K* = im(*f*) and then write *f* as the composition of the surjective homomorphism *G* → *K* that is defined like *f*, followed by the injective homomorphism *K* → *H* that sends each element to itself. Such a factorization of an arbitrary morphism into an epimorphism followed by a monomorphism can be carried out in all abelian categories and also in all the concrete categories mentioned above in § Examples (though not in all concrete categories).

Among other useful concepts are *regular epimorphism*, *extremal epimorphism*, *immediate epimorphism*, *strong epimorphism*, and *split epimorphism*.

- An epimorphism is said to be
**regular**if it is a coequalizer of some pair of parallel morphisms. - An epimorphism is said to be
**extremal**^{[1]}if in each representation , where is a monomorphism, the morphism is automatically an isomorphism. - An epimorphism is said to be
**immediate**if in each representation , where is a monomorphism and is an epimorphism, the morphism is automatically an isomorphism. - An epimorphism is said to be
**strong**^{[1]}^{[2]}if for any monomorphism and any morphisms and such that , there exists a morphism such that and . - An epimorphism is said to be
**split**if there exists a morphism such that (in this case is called a right-sided inverse for ).

There is also the notion of **homological epimorphism** in ring theory. A morphism *f*: *A* → *B* of rings is a homological epimorphism if it is an epimorphism and it induces a full and faithful functor on derived categories:
D(*f*) : D(*B*) → D(*A*).

A morphism that is both a monomorphism and an epimorphism is called a bimorphism. Every isomorphism is a bimorphism but the converse is not true in general. For example, the map from the half-open interval [0,1) to the unit circle S^{1} (thought of as a subspace of the complex plane) that sends *x* to exp(2πi*x*) (see Euler's formula) is continuous and bijective but not a homeomorphism since the inverse map is not continuous at 1, so it is an instance of a bimorphism that is not an isomorphism in the category **Top**. Another example is the embedding **Q** → **R** in the category **Haus**; as noted above, it is a bimorphism, but it is not bijective and therefore not an isomorphism. Similarly, in the category of rings, the map **Z** → **Q** is a bimorphism but not an isomorphism.

Epimorphisms are used to define abstract quotient objects in general categories: two epimorphisms *f*_{1} : *X* → *Y*_{1} and *f*_{2} : *X* → *Y*_{2} are said to be *equivalent* if there exists an isomorphism *j* : *Y*_{1} → *Y*_{2} with *j* *f*_{1} = *f*_{2}. This is an equivalence relation, and the equivalence classes are defined to be the quotient objects of *X*.

The companion terms *epimorphism* and *monomorphism* were first introduced by Bourbaki. Bourbaki uses *epimorphism* as shorthand for a surjective function. Early category theorists believed that epimorphisms were the correct analogue of surjections in an arbitrary category, similar to how monomorphisms are very nearly an exact analogue of injections. Unfortunately this is incorrect; strong or regular epimorphisms behave much more closely to surjections than ordinary epimorphisms. Saunders Mac Lane attempted to create a distinction between *epimorphisms*, which were maps in a concrete category whose underlying set maps were surjective, and *epic morphisms*, which are epimorphisms in the modern sense. However, this distinction never caught on.

It is a common mistake to believe that epimorphisms are either identical to surjections or that they are a better concept. Unfortunately this is rarely the case; epimorphisms can be very mysterious and have unexpected behavior. It is very difficult, for example, to classify all the epimorphisms of rings. In general, epimorphisms are their own unique concept, related to surjections but fundamentally different.