Projective object

In category theory, the notion of a projective object generalizes the notion of a projective module. Projective objects in abelian categories are used in homological algebra. The dual notion of a projective object is that of an injective object.
Definition.
An object formula_1 in a category formula_2 is "projective" if for any epimorphism formula_3 and morphism formula_4, there is a morphism formula_5 such that formula_6, i.e. the following diagram commutes:
That is, every morphism formula_7 factors through every epimorphism formula_8.
If "C" is locally small, i.e., in particular formula_9 is a set for any object "X" in "C", this definition is equivalent to the condition that the hom functor (also known as corepresentable functor)
preserves epimorphisms.
Projective objects in abelian categories.
If the category "C" is an abelian category such as, for example, the category of abelian groups, then "P" is projective if and only if 
is an exact functor, where Ab is the category of abelian groups.
An abelian category formula_12 is said to have "enough projectives" if, for every object formula_13 of formula_12, there is a projective object formula_1 of formula_12 and an epimorphism from "P" to "A" or, equivalently, a short exact sequence
The purpose of this definition is to ensure that any object "A" admits a projective resolution, i.e., a (long) exact sequence
where the objects formula_19 are projective. 
Projectivity with respect to restricted classes.
 discusses the notion of projective (and dually injective) objects relative to a so-called bicategory, which consists of a pair of subcategories of "injections" and "surjections" in the given category "C". These subcategories are subject to certain formal properties including the requirement that any surjection is an epimorphism. A projective object (relative to the fixed class of surjections) is then an object "P" so that Hom("P", −) turns the fixed class of surjections (as opposed to all epimorphisms) into surjections of sets (in the usual sense).
Examples.
The statement that all sets are projective is equivalent to the axiom of choice.
The projective objects in the category of abelian groups are the free abelian groups.
Let formula_20 be a ring with identity. Consider the (abelian) category formula_20-Mod of left formula_20-modules. The projective objects in formula_20-Mod are precisely the projective left R-modules. Consequently, formula_20 is itself a projective object in formula_20-Mod. Dually, the injective objects in formula_20-Mod are exactly the injective left R-modules.
The category of left (right) formula_20-modules also has enough projectives. This is true since, for every left (right) formula_20-module formula_29, we can take formula_30 to be the free (and hence projective) formula_20-module generated by a generating set formula_32 for formula_29 (we can in fact take formula_32 to be formula_29). Then the canonical projection formula_36 is the required surjection.
The projective objects in the category of compact Hausdorff spaces are precisely the extremally disconnected spaces. This result is due to , with a simplified proof given by .
In the category of Banach spaces and contractions (i.e., functionals whose norm is at most 1), the epimorphisms are precisely the maps with dense image. shows that the zero space is the only projective object in this category. There are non-trivial spaces, though, which are projective with respect to the class of surjective contractions. In the category of normed vector spaces with contractions (and surjective maps as "surjections"), the projective objects are precisely the formula_37-spaces.