The notion of nerve is part of a notion of pairs of adjoint functors. For the general abstract theory behind this see
As soon as any locally small category $C$ comes equipped with a cosimplicial object
that we may think of as determining a realization of the standard $n$-simplex in $C$, we make every object of $C$ probeable by simplices in that there is now a way to find the set
of ways to map the $n$-simplex into a given object $A$.
These collections of sets evidently organize into a simplicial set
This simplicial set is called the nerve of $A$ (with respect to the chosen realization of the standard simplicies in $C$).
There are various obvious generalizations of this procedure, some of which are described below.
(notice that for the moment the following gives just one particular case of the more general notion of nerve)
Let $S$ be one of the categories of geometric shapes for higher structures, such as the globe category $G$, the simplex category $\Delta$, the cube category $\Box$, the cycle category $\Lambda$ of Connes, or certain category $\Omega$ related to trees whose corresponding presheaves are dendroidal sets.
If $C$ is any locally small category or, more generally, a $V$-enriched category equipped with a functor
we obtain a functor
from $C$ to globular sets or simplicial sets or cubical sets, respectively, (or the corresponding $V$-objects) given on an object $c \in C$ by
This $N_i(c)$ is the nerve of $c$ with respect to the chosen $i : S \to V$. In other words, $N = i^* \circ Y$ where $Y: C \to [C^{op}, V]$ is the curried Hom functor; if $V=\mathsf{Sets}$ then $Y$ is the Yoneda embedding.
Typically, one wants that $i$ is dense functor, i.e. that every object $c$ of $C$ is canonically a colimit of a diagram of objects in $M$, more precisely,
which is equivalent to the requirement that the corresponding nerve functor is fully faithful (in other words, if $i$ is inclusion then $S$ is a left adequate subcategory of $C$ in terminology of [Isbell 1960]). The nerve functor may be viewed as a singular functor? of the functor $i$.
For fixing notation, recall that
A small category $\mathcal{C}_\bullet$ is
a pair of sets $\mathcal{C}_0 \in Set$ (the set of objects) and $\mathcal{C}_1 \in Set$ (the set of morphisms)
equipped with functions
where the fiber product on the left is that over $\mathcal{C}_1 \stackrel{t}{\to} \mathcal{C}_0 \stackrel{s}{\leftarrow} \mathcal{C}_1$,
such that
$i$ takes values in endomorphisms;
$\circ$ defines a partial composition operation which is associative and unital for $i(\mathcal{C}_0)$ the identities; in particular
$s (g \circ f) = s(f)$ and $t (g \circ f) = t(g)$.
For $\mathcal{C}_\bullet$ a small category, def. 1, its simplicial nerve $N(\mathcal{C}_\bullet)_\bullet$ is the simplicial set with
the set of sequences of composable morphisms of length $n$, for $n \in \mathbb{N}$;
with face maps
being
for $n = 0$, $d_0= target:arr(\mathcal{C})\to ob(\mathcal{C})$, whilst $d_1$ is similarly the domain / source function;
for $n \geq 1$
the two outer face maps $d_0$ and $d_n$ are given by forgetting the first and the last morphism in such a sequence, respectively;
the $n-1$ inner face maps $d_{0 \lt k \lt n}$ are given by composing the $k$th morphism with the $k+1$st in the sequence.
The degeneracy maps
are given by inserting an identity morphism on $x_k$.
Spelling this out in more detail: write
for the set of sequences of $n$ composable morphisms. Given any element of this set and $0 \lt k \lt n$, write
for the composition of the two morphism that share the $i$th vertex.
With this, face map $d_k$ acts simply by “removing the index $k$”:
Similarly, writing
for the identity morphism on the object $x_k$, then the degeneracy map acts by “repeating the $k$th index”
This makes it manifest that these functions organise into a simplicial set.
More abstractly, this construction is described as follows. Recall that
The simplex category $\Delta$ is equivalent to the full subcategory
of Cat on non-empty finite linear orders regarded as categories, meaning that the object $[n] \in Obj(\Delta)$ may be identified with the category $[n] = \{0 \to 1 \to 2 \to \cdots \to n\}$. The morphisms of $\Delta$ are all functors between these total linear categories.
For $\mathcal{C}$ a small category its nerve $N(\mathcal{C})$ is the simplicial set give by
where Cat is regarded as a 1-category with objects locally small categories, and morphisms being functors between these.
So the set $N(\mathcal{C})_n$ of $n$-simplices of the nerve is the set of functors $\{0 \to 1 \to \cdots \to n\} \to \mathcal{C}$. This is clearly the same as the set of sequences of composable morphisms in $D$ of length $n$:
The collection of all functors between linear orders
is generated from those that map almost all generating morphisms $k \to k+1$ to another generating morphism, except at one position, where they
map a single generating morphism to the composite of two generating morphisms
map one generating morphism to an identity morphism
It follows that, for instance
for $(d_0 \stackrel{f_1}{\to} d_1, d_1 \stackrel{f_2}{\to} d_2, d_2 \stackrel{f_3}{\to} d_3) \in N(D)_3$ the image under $d_1 := N(\mathcal{C})(\delta_1) : N(\mathcal{C})_3 \to N(\mathcal{C})_2$ is obtained by composing the first two morphisms in this sequence: $(d_0 \stackrel{f_2 \circ f_1}{\to} d_2, d_2 \stackrel{f_3}{\to} d_3) \in N(\mathcal{C})_2$
for $(d_0 \stackrel{f_1}{\to} d_1) \in N(\mathcal{C})_1$ the image under $s_1 := N(\mathcal{C})(\sigma_1) : N(\mathcal{C})_1 \to N(\mathcal{C})_2$ is obtained by inserting an identity morphism: $(d_0 \stackrel{f_1}{\to} d_1, d_1 \stackrel{Id_{d_1}}{\to} d_1) \in N(\mathcal{C})_2$.
In this way, generally the face and degeneracy maps of the nerve of a category come from composition of morphisms and from inserting identity morphisms.
In particular in light of their generalization to nerves of higher categories, discussed below, the cells in the nerve $N(\mathcal{C})$ have the following interpretation:
$N(\mathcal{C})_0 = \{d | d \in Obj(\mathcal{C})\}$ is the collection of objects of $\mathcal{C}$;
$N(\mathcal{C})_1 = Mor(\mathcal{C}) = \{d \stackrel{f}{\to} d' | f \in Mor(D)\}$ is the collection of morphisms of $D$;
$N(\mathcal{C})_2 = \left\{ \left. \array{ && d_1 \\ & {}^{f_1}\nearrow &\Downarrow^{\exists !}& \searrow^{f_2} \\ d_0 &&\stackrel{f_2 \circ f_1}{\to}&& d_2 } \right| (f_1, f_2) \in Mor(D) {}_t \times_s Mor(D) \right\}$ is the collection of composable morphisms in $\mathcal{C}$: the 2-cell itself is to be read as the composition operation, which is unique for an ordinary category (there is just one way to compose to morphisms);
$N(\mathcal{C})_3 = \left\{ \left. \array{ d_1 &\stackrel{f_2}{\to}& d_2 \\ {}^{f_1}\uparrow & {}^{f_2 \circ f_1}\nearrow & \downarrow^{f_3} \\ d_0 &\stackrel{f_3\circ (f_2\circ f_1)}{\to}& d_3 } \;\;\;\;\;\stackrel{\exists !}{\Rightarrow} \;\;\;\;\; \array{ d_1 &\stackrel{f_2}{\to}& d_2 \\ {}^{f_1}\uparrow & \searrow^{f_3\circ f_2} & \downarrow^{f_3} \\ d_0 &\stackrel{(f_3\circ f_2) \circ f_1}{\to}& d_3 } \right| (f_3,f_2, f_1) \in Mor(D) {}_t \times_s Mor(D) {}_t \times_s Mor(D) \right\}$ is the collection of triples of composable morphisms, to be read as the unique associators that relate one way to compose three morphisms using the above 2-cells to the other way.
(bar construction)
Let $A$ be a monoid (for instance a group) and write $\mathbf{B} A$ for the corresponding one-object category with $Mor(\mathbf{B} A) = A$. Then the nerve $N(\mathbf{B} A)$ of $\mathbf{B}A$ is the simplicial set which is the usual bar construction of $A$
In particular, when $A = G$ is a discrete group, then the geometric realization $|N(\mathbf{B} G)|$ of the nerve of $\mathbf{B}G$ is the classifying topological space $\cdots \simeq B G$ for $G$-principal bundles.
The following lists some characteristic properties of simplicial sets that are nerves of categories.
A simplicial set is the nerve of a category precisely if it satisfies the Segal condition.
See at Segal condition for more on this.
A simplicial set is the nerve of a small category precisely if all inner horns have unique fillers.
See inner fibration for details on this.
A simplicial set is the nerve of a groupoid precisely if all horns have unique fillers.
The nerve $N(C)$ of a category is 2-coskeletal.
Hence all horn inclusions $\Lambda[n]_i \hookrightarrow \Delta[n]$ have unique fillers for $n \gt 3$, and all boundary inclusions $\partial \Delta[n] \hookrightarrow \Delta[n]$ have unique fillers for $n \geq 3$.
Here the point as compared to the previous statements is that in particular all the outer horns have fillers for $n \gt 3$.
The nerve $N(C)$ of a small category is a Kan complex precisely if $C$ is a groupoid.
The existence of inverse morphisms in $D$ corresponds to the fact that in the Kan complex $N(D)$ the “outer” horns
have fillers
(even unique fillers, due to the above).
It suggests the sense that a Kan complex models an ∞-groupoid. The possible lack of uniqueness of fillers in general gives the ‘weakness’ needed, whilst the lack of a coskeletal property requirement means that the homotopy type it represents has enough generality, not being constrained to be a 1-type.
So functors between locally small categories are in bijection with morphisms of simplicial sets between their nerves.
A simplicial set $S$ is the nerve of a locally small category $C$ precisely if it satisfies the Segal conditions: precisely if all the commuting squares
are pullback diagrams.
Unwrapping this definition inductively in $(n+m)$, this says that a simplicial set is the nerve of a category if and only if all its cells in degree $\geq 2$ are unique compositors, associators, pentagonators, etc of composition of 1-morphisms. No non-trivial such structure cells appear and no further higher cells appear.
This characterization of categories in terms of nerves directly leads to the model of (∞,1)-category in terms of complete Segal spaces by replacing in the above discussion sets by topological spaces (or something similar, like Kan complexes) and pullbacks by homotopy pullbacks.
For 2-categories modeled as bicategories the nerve operation is called the Duskin nerve.
A simplicial set is the Duskin nerve of a bigroupoid precisely if it is a 2-hypergroupoid: a Kan complex such that the horn fillers in dimension $\geq 3$ are unique .
This is theorem 8.6 in (Duskin)
For a 2-category, regarded as a Cat-internal category one can apply the nerve operation for categories in stages, to obtain the double nerve.
Let $Ch_+$ be the category of chain complexes of abelian groups.
Then there is a cosimplicial chain complex
given by sending the standard $n$-simplex $\Delta[n]$ first to the free simplicial group $F(\Delta[n])$ over it and then that to the normalized Moore complex. This is a small version of the ordinary homology chain complex of the standard $n$-simplex.
The nerve induced by this cosimplicial object was first considered in
The nerve/realization adjunction induced from this is the Dold–Kan correspondence. See there for more details.
Often the operation of taking the nerve of a (higher) category is followed by forming the geometric realization of the corresponding cellular set.
For many purposes it is convenient to conceive categories and especially ∞-categories entirely in terms of their nerves: those simplicial sets that arise as certain nerves are usually characterized by certain properties. So one can turn this around and define an ∞-category as a simplicial set with certain properties. This is the strategy of a geometric definition of higher category. Examples for this are complicial sets, Kan complexes, quasi-categories, simplicial T-complexes,…
A variant of the nerve construction can also be applied internally within a category, to any internal category, see the discussion at internal category.
W. G. Dwyer, D. M. Kan, Singular functors and realization functors, Nederl. Akad. Wetensch. Indag. Math. 46 (1984), no. 2, 147–153. pdf
John Isbell, Adequate subcategories, Illinois J. Math. 4, 541–552 (1960)
Tom Leinster, Higher operads, higher categories , London Mathematical Society Lecture Note Series, 298. Cambridge Univ. Press 2004. xiv+433 pp. ISBN: 0-521-53215-9, arXiv:math.CT/0305049
Ross Street, The algebra of oriented simplexes, J. Pure Appl. Algebra 49 (1987), no. 3, 283–335.
Paul Bressler, Alexander Gorokhovsky, Ryszard Nest, Boris Tsygan, Formality for algebroids I: Nerves of two-groupoids, arxiv/1211.6603
The notion of the nerve of a category seems to be due to Grothendieck, which is in turn based on the nerve of a covering from 1926 work of P. S. Alexandroff?. One of the first papers to consider the properties of the nerve and to apply it to problems in algebraic topology was
Many of the later developments can already be seen there in ‘embryonic’ form.