# Grothendieck construction

The Grothendieck construction (named after Alexander Grothendieck) is a construction used in the mathematical field of category theory. It is a fundamental construction in the theory of descent, in the theory of stacks, and in fibred category theory. In categorical logic, the construction is used to model the relationship between a type theory and a logic over that type theory, and allows for the translation of concepts from indexed category theory into fibred category theory, such as Lawvere's concept of hyperdoctrine.
The Grothendieck construction was first studied for the special case presheaves of sets by Mac Lane, where it was called the category of elements.

## Motivation

If $\left\{A_{i}\right\}_{i\in I}$ is a family of sets indexed by another set, one can form the disjoint union or coproduct
   ∐$_{i∈I}$A$_i${\textstyle \coprod _{i\in I}A_{i}},
which is the set of all ordered pairs $(i,a)$ such that $a\in A_{i}$. The disjoint union set is naturally equipped with a "projection" map
   $\pi :\coprod _{i\in I}A_{i}\to I$
defined by
   $\pi (i,a)=i$.
From the projection $\pi$ it is possible to reconstruct the original family of sets $\left\{A_{i}\right\}_{i\in I}$ up to a canonical bijection, as for each $i\in I,A_{i}\cong \pi ^{-1}(\{i\})$ via the bijection $a\mapsto (i,a)$. In this context, for $i\in I$, the preimage $\pi ^{-1}(\{i\})$ of the singleton set $\{i\}$ is called the "fiber" of $\pi$ over $i$, and any set $B$ equipped with a choice of function $f:B\to I$ is said to be "fibered" over $I$. In this way, the disjoint union construction provides a way of viewing any family of sets indexed by $I$ as a set "fibered" over $I$, and conversely, for any set $f:B\to I$ fibered over $I$, we can view it as the disjoint union of the fibers of $f$. Jacobs has referred to these two perspectives as "display indexing" and "pointwise indexing".
The Grothendieck construction generalizes this to categories. For each category ${\mathcal {C}}$, family of categories $\{F(c)\}_{c\in {\mathcal {C}}}$ indexed by the objects of ${\mathcal {C}}$ in a functorial way, the Grothendieck construction returns a new category ${\mathcal {E}}$ fibered over ${\mathcal {C}}$ by a functor $\pi$ whose fibers are the categories $\{F(c)\}_{c\in {\mathcal {C}}}$.

## Definition

Let $F\colon {\mathcal {C}}\rightarrow \mathbf {Cat}$ be a functor from any small category to the category of small categories. The Grothendieck construction for $F$ is the category $\Gamma (F)$ (also written $\textstyle \int _{\textstyle {\mathcal {C}}}F$, $\textstyle {\mathcal {C}}\int F$ or $F\rtimes {\mathcal {C}}$), with
* objects being pairs $(c,x)$, where $c\in \operatorname {obj} ({\mathcal {C}})$ and $x\in \operatorname {obj} (F(c))$; and
* morphisms in $\operatorname {hom} _{\Gamma (F)}((c_{1},x_{1}),(c_{2},x_{2}))$ being pairs $(f,g)$ such that $f:c_{1}\to c_{2}$ in ${\mathcal {C}}$, and $g:F(f)(x_{1})\to x_{2}$ in $F(c_{2})$.
Composition of morphisms is defined by $(f,g)\circ (f',g')=(f\circ f',g\circ F(f)(g'))$.

## Example

If $G$ is a group, then it can be viewed as a category, ${\mathcal {C}}_{G},$ with one object and all morphisms invertible. Let $F:{\mathcal {C}}_{G}\to \mathbf {Cat}$ be a functor whose value at the sole object of ${\mathcal {C}}_{G}$ is the category ${\mathcal {C}}_{H},$ a category representing the group $H$ in the same way. The requirement that $F$ be a functor is then equivalent to specifying a group homomorphism $\varphi :G\to \operatorname {Aut} (H),$ where $\operatorname {Aut} (H)$ denotes the group of automorphisms of $H.$ Finally, the Grothendieck construction, $F\rtimes {\mathcal {C}}_{G},$ results in a category with one object, which can again be viewed as a group, and in this case, the resulting group is (isomorphic to) the semidirect product $H\rtimes _{\varphi }G.$