# Overcategory

In mathematics, specifically category theory, an overcategory (also called a slice category), as well as an undercategory (also called a coslice category), 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 $X$ in some category ${\mathcal {C}}$. There is a dual notion of undercategory, which is defined similarly.

## Definition

Let ${\mathcal {C}}$ be a category and $X$ a fixed object of ${\mathcal {C}}$$^{pg59}$. The overcategory (also called a slice category) ${\mathcal {C}}/X$ is an associated category whose objects are pairs $(A,\pi )$ where $\pi :A\to X$ is a morphism in ${\mathcal {C}}$. Then, a morphism between objects $f:(A,\pi )\to (A',\pi ')$ is given by a morphism $f:A\to A'$ in the category ${\mathcal {C}}$ such that the following diagram commutes
   ${\begin{matrix}A&\xrightarrow {f} &A'\\\pi \downarrow {\text{ }}&{\text{ }}&{\text{ }}\downarrow \pi '\\X&=&X\end{matrix}}$
There is a dual notion called the undercategory (also called a coslice category) $X/{\mathcal {C}}$ whose objects are pairs $(B,\psi )$ where $\psi :X\to B$ is a morphism in ${\mathcal {C}}$. Then, morphisms in $X/{\mathcal {C}}$ are given by morphisms $g:B\to B'$ in ${\mathcal {C}}$ such that the following diagram commutes
   ${\begin{matrix}X&=&X\\\psi \downarrow {\text{ }}&{\text{ }}&{\text{ }}\downarrow \psi '\\B&\xrightarrow {g} &B'\end{matrix}}$
These two notions have generalizations in 2-category theory and higher category theory$^{pg43}$, with definitions either analogous or essentially the same.

## Properties

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

## Examples
### Overcategories on a site

Recall that a site ${\mathcal {C}}$ is a categorical generalization of a topological space first introduced by Grothendieck. One of the canonical examples comes directly from topology, where the category ${\text{Open}}(X)$ whose objects are open subsets $U$ of some topological space $X$, and the morphisms are given by inclusion maps. Then, for a fixed open subset $U$, the overcategory ${\text{Open}}(X)/U$ is canonically equivalent to the category ${\text{Open}}(U)$ for the induced topology on $U\subseteq X$. This is because every object in ${\text{Open}}(X)/U$ is an open subset $V$ contained in $U$.

### Category of algebras as an undercategory

The category of commutative $A$-algebras is equivalent to the undercategory $A/{\text{CRing}}$ for the category of commutative rings. This is because the structure of an $A$-algebra on a commutative ring $B$ is directly encoded by a ring morphism $A\to B$. If we consider the opposite category, it is an overcategory of affine schemes, ${\text{Aff}}/{\text{Spec}}(A)$, or just ${\text{Aff}}_{A}$.

### Overcategories of spaces

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 $S$, ${\text{Sch}}/S$. Fiber products in these categories can be considered intersections (e.g. the scheme-theoretic intersection), given the objects are subobjects of the fixed object.