# Subcategory

<https://en.wikipedia.org/wiki/Subcategory>

A subcategory `𝒟` of a category `𝒞` is defined by restricting the collection of objects in `𝒞` to a subcollection of objects in `𝒟` and the collection of morphisms in `𝒞` to a subcollection of morphisms in `𝒟` subject to the requirement that `𝒟` contains:

* domain and codomain of any morphism in `𝒟`,&#x20;
* the identity morphism of any object in `𝒟`, and&#x20;
* the composite of any composable pair of morphisms in `𝒟`.

For example, there is a subcategory `CRing ⊂ Ring` of commutative unital rings. Both of these form subcategories of the category `Rng` of not-necessarily unital rings and homomorphisms that need not preserve the multiplicative unit.

Any category `𝒞` contains a maximal groupoid, the subcategory containing all of the objects and only those morphisms that are isomorphisms.

A subcategory `S` of a category `C` is a category whose objects are objects in `C` and whose morphisms are morphisms in `C`, with the same identities and composition of morphisms.

Intuitively, a subcategory of `C` is a category obtained from `C` by removing some objects and arrows.

A category `C` whose objects and arrows are subclasses of those of a category `A`, and whose source, target, identities and compositions are those of `A` is said to be a *subcategory* of `A`.

A subcategory `C` of a category `A` is said to be a **full subcategory** when, for all pairs of objects `A` and `B` in `C`, if `f : A → B` is an arrow in `A` then it is also an arrow in `C`. A full subcategory of a category `A` is determined by objects alone.
