How to detect if a simplicial set is the nerve of a groupoid? I have the following question.
Suppose I have a simplicial set. Is there a way to detect if it actually is isomorphic to a nerve of a groupoid?
I've seen the fact that if you have a nerve $\mathcal{N}$ of a groupoid $\mathcal{G}$ then all homotopy groups $\pi_n(\mathcal{N})$ for $n\geq 2$ must vanish. Is the converse true? I don't think so, but I don't know how to check that.
Though I would like some other way of detecting nerves of groupoids. The reason is, I have a simplicial set, and I want to make a conclusion about its homotopy groups using the fact that it is a nerve of a groupoid (I don't know this fact yet).
I am a complete novice in the field, so my question might be very easy.
Thank you very much for your help!
 A: I am a novice too, but I think that an equivalent perspective (which is the first I met) is far more enlightening than the Kan condition. Maybe it is the right moment to check if I'm right: things can't be so simple! :)
Start with your favourite small category $\bf C$. Denote its set of objects as ${\bf C}_0$.
Now consider the set of arrows $X\to Y$; denote this set as ${\bf C}_1$, and notice that it naturally comes equipped with two maps $s,t\colon {\bf C}_1\rightrightarrows {\bf C}_0$ sending an arrow to its source/target.
So far, so good. But now notice that the set ${\bf C}_2$ of composable pairs of arrows,
$$
X\to Y\to Z
$$
arises as the set-theoretic pullback
$$
\begin{array}{ccc}
{\bf C}_2 &\to& {\bf C}_1 \\
\downarrow && \downarrow s\\
{\bf C}_1 &\underset{t}{\to}& {\bf C}_0
\end{array}
$$
namely ${\bf C}_2\cong {\bf C}_1\times_{{\bf C}_0}{\bf C}_1$. This is pretty easy: a pair is composable iff it is such that the source of the first equals the target of the second.
In the same vein, I invite you to prove that the set of $n$-tuples of composable arrows in $\bf C$ is exactly the n-fold pullback ${\bf C}_1\times_{{\bf C}_0}\cdots\times_{{\bf C}_0}{\bf C}_1$.
Again, it is pretty easy to see.
Now it turns out that having this property is exactly what you need to ensure that a simplicial set is the nerve of some category; it is called the Segal condition.
A: This result has a long history. 
Keith Dakin in his 1976 thesis defined the notion of simplicial $T$-complex as a simplicial set with in each dimension $n \geqslant 1$ a set $T_n$ of elements called thin such that 


*

*Degenerate elements are thin. 

*Every horn has a unique thin filler. 

*If all but possibly one face of a thin element are thin, then so also is the remaining face. 
Such a $T$-complex is of rank $\leqslant n$ if all elements of dimension $>n$ are thin. 
Keith showed that simplicial $T$-complexes of rank 1 are equivalent to groupoids, and those of rank 2 are equivalent to crossed modules (over groupoids). The story was completed by Nick Ashley in 1978 who showed that simplicial $T$-complexes are equivalent to crossed complexes. Full references are given on the nlab. The corresponding result for groupoids  had an earlier airing in the paper:
Levi, F. W. Darstellung der Komposition in einer Gruppe als Relation. Arch. Math. (Basel) 8 (1957), 169–170. 
Update: I recommend you draw a diagram of a 3-simplex, label all the edges, interpret "thin" for a 2-simplex to mean "commutative boundary", and then consider the third axiom for thin elements in relation to associativity. This connection of the tetrahedron with associativity is well known in homological algebra. 
A: The answer is sort of well known. A simplicial set $X$ is the nerve of a groupoid if and only if any $n$-horn has a unique filler for all $n\geq 2$. The horn $\Lambda^k[n]$ is the simplicial subset of $\Delta[n]$ obtained by removing the non-degenerate $n$-simplex of $\Delta[n]$ and it's $k^{\text{th}}$ face. The previous statement means that any map $\Lambda^k[n]\rightarrow X$ extends to $\Delta[n]$ in a unique way, for all $n\geq 2$ and $0\leq k\leq n$. Alternatively, a simplicial set $X$ is the nerve of a groupoid if and only if it is a Kan complex and $\pi_n(X)=0$ for all $n\geq 2$. The nerve of the category with only one object and endomorphism monoid $\mathbb N$ has trivial homotopy groups in dimensions $\geq 2$ but it is not the nerve of a groupoid (it is not a Kan complex).
