In mathematics, specifically category theory, an overcategory (and undercategory) is a distinguished class of categories used in multiple contexts, such as with covering spaces (espace etale). They were introduced as a mechanism for keeping track of data surrounding a fixed object in some category . There is a dual notion of undercategory, which is defined similarly.

Let be a category and a fixed object of ^{[1]}^{pg 59}. The **overcategory** (also called a **slice category**) is an associated category whose objects are pairs where is a morphism in . Then, a morphism between objects is given by a morphism in the category such that the following diagram commutes

There is a dual notion called the **undercategory** (also called a **coslice category**) whose objects are pairs where is a morphism in . Then, morphisms in are given by morphisms in such that the following diagram commutes

These two notions have generalizations in 2-category theory^{[2]} and higher category theory^{[3]}^{pg 43}, with definitions either analogous or essentially the same.

Many categorical properties of are inherited by the associated over and undercategories for an object . For example, if has finite products and coproducts, it is immediate the categories and have these properties since the product and coproduct can be constructed in , and through universal properties, there exists a unique morphism either to or from . In addition, this applies to limits and colimits as well.

Recall that a site is a categorical generalization of a topological space first introduced by Grothendieck. One of the canonical examples comes directly from topology, where the category whose objects are open subsets of some topological space , and the morphisms are given by inclusion maps. Then, for a fixed open subset , the overcategory is canonically equivalent to the category for the induced topology on . This is because every object in is an open subset contained in .

The category of commutative -algebras is equivalent to the undercategory for the category of commutative rings. This is because the structure of an -algebra on a commutative ring is directly encoded by a ring morphism . If we consider the opposite category, it is an overcategory of affine schemes, , or just .

Another common overcategory considered in the literature are overcategories of spaces, such as schemes, smooth manifolds, or topological spaces. These categories encode objects relative to a fixed object, such as the category of schemes over , . Fiber products in these categories can be considered intersections, given the objects are subobjects of the fixed object.