1 Stirling complexes

1.1 Motivation

Consider the situation where n unique resources need to be distributed among m locations. Clearly, subject to the only condition that \(n\ge m\), this can be done in many different ways. Specifically, the number of solutions is equal to \(m!\genfrac\rbrace \lbrace {0.0pt}1{n}{m}\), where \(\genfrac\rbrace \lbrace {0.0pt}1{n}{m}\) is the Stirling number of the second kind, which is a classical combinatorial function, counting the number of ways n objects can be partitioned into m non-empty groups, see Graham et al. (1994); Knuth (1997); Stirling (1749).

Imagine furthermore, that the locations, to which the resources are distributed, are connected by a tree network, and that each resource can be shifted from its location to a neighboring one. Simultaneous multiple shifts of different resources are allowed, as long as at any point of this shifting procedure there remain some resources, which are not being moved, in each node. We would like to model this situation by introducing a higher-dimensional parameter space which encodes the interplay of such shifts. In what follows we introduce a family of combinatorial cubical complexes, which fulfill this task. We shall call these complexes the Stirling complexes.

In recent years topology has increasingly been used in applications, most notably in data analysis, see Carlsson (2009) and the references therein. The idea of using higher-dimensional cell complexes to record transformations of combinatorial objects has been a further major thread in the tapestry of applied topology. For instance, a family of prodsimplicial complexes has been constructed in Babson and Kozlov (2006), see also Babson , Kozlov (2007); Kozlov (2007, 2008), to find topological obstructions to graph colorings, a famously notorious problem. Another example is provided by the so-called protocol complexes, which have been introduced as a part of the topological approach to questions in theoretical distributed computing, see Herlihy et al. (2014) and the numerous references therein. Optimally, such constructions provide deeper insight into the original combinatorial questions, yielding at the same time interesting, often highly symmetric families of combinatorial cell complexes.

In what follows, we shall use standard facts and terminology of graph theory, as well as algebraic topology. If the need arises, the reader is invited to consult Harary (1969) for graph theory, and Fomenko et al. (1986); Fulton (1995); Greenberg and Harper (1981); Hatcher (2002); Kozlov (2008, 2020); Munkres (1984) for algebraic topology.

1.2 Definition of the Stirling complexes

Let m be an arbitrary integer, \(m\ge 2\), and let T be an arbitrary tree on m vertices, labeled with numbers 1 through m. This tree models our network.

Assume furthermore we have \(n\ge m\). We can view T as a 1-dimensional simplicial complex, which leads us to considering the cubical complex \(T^n\). Let us make the following observations about this complex.

  • The cubes of \(T^n\) are indexed by the n-tuples \(c=(c_1,\dots ,c_n)\), where each \(c_i\) is either a vertex or an edge of T.

  • The dimension of c is equal to the number of \(c_i\)’s which are edges. Accordingly, the vertices of \(T^n\) are indexed by the n-tuples of the vertices of T, the dimension of \(T^n\) is equal to n, and the top-dimensional cubes are indexed by the n-tuples of the edges.

  • The boundary cubes of c are obtained by replacing edges in the indexing n-tuple with adjacent vertices. The number of replaced edges is precisely the codimension of the corresponding boundary cube.

We are now ready to define our main objects of study.

Definition 1.1

Given a tree T with \(m\ge 2\) vertices, and a positive integer n, the Stirling complex \(\mathcal {S}tr(T,n)\) is the subcomplex of \(T^n\) consisting of all n-tuples \(c=(c_1,\dots ,c_n)\), such that each vertex of T occurs as an entry in c at least once.

Since the condition of Definition 1.1 is preserved by taking the boundary, the Stirling complexes are well-defined. The following facts hold for Stirling complexes.

  • If \(n<m\), the condition in Definition 1.1 cannot be fulfilled, so \(\mathcal {S}tr(T,n)\) is empty in this case.

  • The complex \(\mathcal {S}tr(T,m)\) consists of m! vertices, indexed by all permutations of the set \([m]=\{1,\dots ,m\}\).

  • In general, the vertices of \(\mathcal {S}tr(T,n)\) are indexed by all ways to partition the set [n] into m labeled parts. Accordingly, the number of vertices of \(\mathcal {S}tr(T,n)\) is equal to \(m!\genfrac\rbrace \lbrace {0.0pt}1{n}{m}\).

  • The dimension of \(\mathcal {S}tr(T,n)\) is equal to \(n-m\), since this is the maximal number of resources which can be assigned to the edges of T.

For each \(0\le d\le n-m\), the Stirling complex \(\mathcal {S}tr(T,n)\) has \(\left( {\begin{array}{c}n\\ d\end{array}}\right) (m-1)^dm!\genfrac\rbrace \lbrace {0.0pt}1{n-d}{m}\) cubes of dimension d. To see this, first choose d resources among n, then assign each resource to one of the \(m-1\) edges, and then finally distribute the rest of the resources to the nodes, so that no node is left empty. This gives us the following formula for the Euler characteristic:

$$\begin{aligned} \chi (\mathcal {S}tr(T,n))=\sum _{d=0}^{n-m}(-1)^d\left( {\begin{array}{c}n\\ d\end{array}}\right) (m-1)^dm!\genfrac\rbrace \lbrace {0.0pt}0{n-d}{m}. \end{aligned}$$
(1.1)

In what follows, we shall derive a better formula for \(\chi (\mathcal {S}tr(T,n))\).

1.3 Examples

To acquaint ourselves with the Stirling complexes, let us consider a few further examples.

Example 1

The first interesting example is \(\mathcal {S}tr(T,m+1)\). The dimension of this Stirling complex is 1, so it is a graph. The numerical data of this graph is the following.

  • The number of vertices of \(\mathcal {S}tr(T,m+1)\) is

    $$\begin{aligned} m!\genfrac\rbrace \lbrace {0.0pt}0{m+1}{m}=m!\left( {\begin{array}{c}m+1\\ 2\end{array}}\right) =\frac{m}{2}(m+1)!. \end{aligned}$$

    The vertices of \(\mathcal {S}tr(T,m+1)\) are indexed by the \((m+1)\)-tuples of the vertices of T, with one vertex repeating twice and all other vertices occurring exactly once.

  • As a graph \(\mathcal {S}tr(T,m+1)\) has \((m-1)(m+1)!\) edges; the edges are indexed by \((m+1)\)-tuples consisting of one edge and m vertices of T, with each vertex repeating exactly once.

Accordingly, the Euler characteristic of this Stirling complex is given by

$$\begin{aligned} \chi (\mathcal {S}tr(T,m+1))=-\dfrac{1}{2}(m-2)(m+1)!. \end{aligned}$$

It is easy to see using a direct argument that \(\mathcal {S}tr(T,m+1)\) is always connected. Therefore it is homotopy equivalent to a wedge of \(\dfrac{1}{2}(m-2)(m+1)!+1\) circles.

Consider now the special case when \(m=4\). Let \(T_1\) be the tree with one vertex of degree 3 and 3 leaves. Let \(T_2\) be the string with 3 edges: it has 2 vertices of degree 2 and 2 leaves. Both \(\mathcal {S}tr(T_1,5)\) and \(\mathcal {S}tr(T_2,5)\) are connected and have 240 vertices and 360 edges. However, these two graphs are different: \(\mathcal {S}tr(T_1,5)\) has 60 vertices with valency 6, and the rest of the vertices with valency 2, whereas all vertices of \(\mathcal {S}tr(T_2,5)\) have valency 2 or 4. We see therefore that, while topology of \(\mathcal {S}tr(T_1,5)\) and \(\mathcal {S}tr(T_2,5)\) is the same, the spaces themselves depend on the actual tree structure of \(T_1\) and \(T_2\).

Example 2

Next, consider the cubical complexes \(\mathcal {S}tr(T,m+2)\), for \(m\ge 2\). These are 2-dimensional. The number of vertices is given by

$$\begin{aligned} f_0:=m!\genfrac\rbrace \lbrace {0.0pt}1{m+2}{m}=m!\frac{1}{24}m(m+1)(m+2)(3m+1)= m(3m+1)\frac{(m+2)!}{24}. \end{aligned}$$

The number of edges is given by

$$\begin{aligned} f_1:=(m+2)(m-1)\frac{m}{2}(m+1)!=12m(m-1)\frac{(m+2)!}{24}. \end{aligned}$$

Finally, the number of squares is given by

$$\begin{aligned} f_2:=\left( {\begin{array}{c}m+2\\ 2\end{array}}\right) (m-1)^2m!=12(m-1)^2\frac{(m+2)!}{24}. \end{aligned}$$

So,

$$\begin{aligned} \chi (\mathcal {S}tr(T,m+2))=f_0+f_2-f_1=(3m^2-11m+12)\frac{(m+2)!}{24}. \end{aligned}$$

Example 3

Switching to considering the small values of m. Set \(m:=2\), so T is just an edge. The complex \(\mathcal {S}tr(T,n)\) is a cubical subdivision of the \((n-2)\)-dimensional sphere. \(\mathcal {S}tr(T,3)\) is a hexagon. \(\mathcal {S}tr(T,4)\) is a rhombic dodecahedron, whose f-vector is (14, 24, 12) (Fig. 1).

In general the f-vector of \(\mathcal {S}tr(T,n)\), when T is a single edge, is \((f_0,\dots ,f_{n-2})\), where

$$\begin{aligned} f_k=\left( {\begin{array}{c}n\\ k\end{array}}\right) (2^{n-k}-2),\text { for }k=0,\dots ,n-2. \end{aligned}$$
Fig. 1
figure 1

Examples of \(\mathcal {S}tr(T,n)\), when T is an edge

The cubical complex \(\mathcal {S}tr(T,n)\) can be obtained by starting with an n-cube K and then deleting two opposite vertices a and b, together with all smaller cubes in K containing a or b. The author is not aware whether there exists some established terminology for these complexes, beyond the cases \(n=3\) and \(n=4\).

2 The topology of the Stirling complexes

2.1 The formulation of the main theorem

Somewhat surprisingly, our main theorem implies that the homotopy type of the Stirling complexes \(\mathcal {S}tr(T,n)\) only depends on n and on the number of vertices in T, not on the actual tree structure.

Theorem 2.1

Assume T is a tree with m vertices, \(m\ge 2\), and n is an integer, \(n\ge m\). The cubical complex \(\mathcal {S}tr(T,n)\) is homotopy equivalent to a wedge of \((n-m)\)-dimensional spheres.

Let f(mn) denote the number of these spheres. Then f(mn) is given by the following formula

$$\begin{aligned} f(m,n)= & {} (m-1)^n-\left( {\begin{array}{c}m\\ 1\end{array}}\right) (m-2)^n+\left( {\begin{array}{c}m\\ 2\end{array}}\right) (m-3)^n+\dots \nonumber \\&+(-1)^{m-1}\left( {\begin{array}{c}m\\ m-3\end{array}}\right) 2^n+(-1)^m\left( {\begin{array}{c}m\\ m-2\end{array}}\right) . \end{aligned}$$
(2.1)

In particular, we have \(f(2,n)=1\), confirming our observation that \(\mathcal {S}tr(T,n)\) is a sphere in this case. Further values of \(f(-,-)\) are

$$\begin{aligned} f(3,n)&=2^n-3, \\ f(4,n)&=3^n-4\cdot 2^n+6. \end{aligned}$$

Table 1 gives the values of f(mn) for small m and n.

Table 1 The values of f(mn)

It is interesting to think about the implications of Theorem 2.1 for the original problem of resource distribution. Clearly, the fact that \(\mathcal {S}tr(T,n)\) is connected, when \(n>m\), means that, starting from any distribution one can get to any other one by moving the resources. When \(n>m+1\), the space \(\mathcal {S}tr(T,n)\) is simply connected. This means that when two distributions are fixed, any two redistribution schemes from the first distribution to the second one, are homotopic, i.e., there is a simultaneous redistribution scheme, connecting the two. Even higher connectivity of \(\mathcal {S}tr(T,n)\) means the presence of these higher-dimensional redistribution schemes. Finally, the fact that the homotopy of \(\mathcal {S}tr(T,n)\) is not trivial in the top dimension means that in this dimension there is a number of fundamentally different higher-dimensional redistribution schemes. The number f(mn) tells us, in a certain sense, just how many of these different schemes there are.

Let us make a few comments on the numerical side. First, by Euler-Poincaré formula, Eq. 1.1 could be used instead of Eq. 2.1, although the latter is clearly simpler.

Second, let \(\mathtt{{SF}}(m,n)\) denote the number of surjective functions from [n] to [m]. We have \(\mathtt{{SF}}(m,n)=m!\genfrac\rbrace \lbrace {0.0pt}1{n}{m}\). We can then rewrite Eq. 2.1 as follows.

Proposition 2.2

For all \(n\ge m\ge 2\), we have

$$\begin{aligned} f(m,n)=\mathtt{{SF}}(m-1,n)-\mathtt{{SF}}(m-2,n)+\dots +(-1)^m\mathtt{{SF}}(1,n). \end{aligned}$$
(2.2)

Proof

As a simple corollary of the principle of inclusion-exclusion we have the following well-known formula

$$\begin{aligned} \mathtt{{SF}}(a,b)=a^b-\left( {\begin{array}{c}a\\ a-1\end{array}}\right) (a-1)^b+\dots +(-1)^{a-1}\left( {\begin{array}{c}a\\ 1\end{array}}\right) . \end{aligned}$$
(2.3)

Substituting the right hand side of Eq. 2.3 into Eq. 2.2, and using the Pascal triangle addition rule for the binomial coefficients, shows that it is equivalent to Eq. 2.1. \(\square \)

Finally, for future reference, we record the following fact.

Proposition 2.3

We have

$$\begin{aligned} \sum _{\alpha =1}^{m-1}(-1)^{m+\alpha +1}\left( {\begin{array}{c}m\\ \alpha +1\end{array}}\right) \alpha ^m=m!-1. \end{aligned}$$

Proof

This follows from the following well-known polynomial identity

$$\begin{aligned}m!=\sum _{k=0}^m\left( {\begin{array}{c}m\\ k\end{array}}\right) (-1)^k(x-k)^m,\end{aligned}$$

where x is a variable, by substituting \(x:=m+1\). \(\square \)

Proposition 2.3 shows that Eq. 2.1 holds for \(m=n\).

2.2 Relaxing the occupancy requirement

Our proof of Theorem 2.1 proceeds by induction. As it often happens in such situations, it is opportune to deal with a more general class of complexes. In our case, we relax the requirement that each node must have at least one allocated resource.

Definition 2.4

For any cell c of \(T^n\), we define

$$\begin{aligned} \mathrm{supp}\,c=\{v\in V(T)\,|\,\exists k\in [n],\text { such that }c_k=v\}\subseteq V(T). \end{aligned}$$

Let S be an arbitrary subset of the vertex set of T. We define \(\mathcal {S}tr(T,S,n)\) to be the subcomplex of \(T^n\), consisting of all cells c whose support contains S.

Note, that whenever \(b,c\in T^n\) are cubes, such that \(b\subseteq c\), we have \(\mathrm{supp}\,c\subseteq \mathrm{supp}\,b\). In other words, the support of a cell c either stays the same or increases when taking the boundary. This implies that the cubical complex \(\mathcal {S}tr(T,S,n)\) is well-defined.

Extreme values for S give us two special cases:

  • For \(S=V(T)\), we have \(\mathcal {S}tr(T,S,n)=\mathcal {S}tr(T,n)\);

  • For \(S=\emptyset \), we have \(\mathcal {S}tr(T,S,n)=T^n\), which is contractible as a topological space.

Rather than attacking Theorem 2.1 directly, we shall prove the following, more general result.

Theorem 2.5

The complex \(\mathcal {S}tr(T,S,n)\) is homotopy equivalent to a wedge of \((n-|S|)\)-dimensional spheres. The number of spheres is f(|S|, n).

Clearly, Theorem 2.1 is a special case of Theorem 2.5, where \(S=V(T)\).

Before proceeding with the proof of Theorem 2.5, let us note that both Definition 1.1 and Definition 2.4 can be verbatim generalized to the case where T is an arbitrary undirected graph, not necessarily a tree, possibly containing multiple edges and loops. Following the research in this paper, the case \(\mathcal {S}tr(G,n)\) was considered where G is a graph with 2 vertices and 2 edges connecting these two vertices. This is the same as considering \(\mathcal {S}tr(C_k,S,n)\), where \(C_k\) is an arbitrary cycle and S is a set with 2 vertices, and gives a family of cubical complexes parameterized by n. The homology of the spaces in this family has been recently computed in Kozlov and Configuration spaces of labeled points on a circle with two anchors, Topology Appl. 315, (2022).

3 Homotopy colimits

3.1 The diagrams of topological spaces

Our strategy to prove Theorem 2.5 is to decompose the spaces \(\mathcal {S}tr(T,S,n)\) into simpler pieces and then to manipulate this decomposition, while preserving the homotopy type of the total space. Although there are different ways to formulate our argument, we find it handy to phrase it using the language of homotopy colimits. Let us introduce the corresponding terminology, see also Bousfield , Kan (1972); Hatcher (2002); Vogt (1973).

We assume that the reader is familiar with basic category theory, MacLane (1998); Mitchell (1965). Recall, that given a poset P, we can always view P as a category so that

  • The objects of that category are precisely the elements of P;

  • For any two elements \(p,q\in P\), such that \(p\ge q\), there exists a unique morphism from p to q.

The composition rule in this category is clearly uniquely defined, since there is at most one morphism between any two objects.

Recall that \(\mathbf {Top}\) denotes the category of topological spaces and continuous maps.

Definition 3.1

Assume, we are given a poset P, and we view it as a category. A functor from P to \(\mathbf {Top}\) is called a diagram of topological spaces over P.

Specifically, a diagram \({\mathcal D}\) is a collection of topological spaces \({\mathcal D}(p)\), where \(p\in P\), together with continuous maps \({\mathcal D}_{p,q}:{\mathcal D}(p)\rightarrow {\mathcal D}(q)\), where \(p>q\). These maps are subject to the condition \({\mathcal D}_{q,r}\circ {\mathcal D}_{p,q}={\mathcal D}_{p,r}\), whenever \(p>q>r\).

3.2 Homotopy colimits of diagrams over \(P^T\)

Let T be a an arbitrary tree with m vertices, where \(m\ge 2\). We assume that the vertices are indexed by the set \([m]=\{1,\dots ,m\}\). A poset \(P^T\) is defined as follows:

  • The elements of \(P^T\) are indexed by the vertices and the edges of T;

  • The partial order on \(P^T\) given by saying that each edge is larger than its adjacent vertices.

This poset has \(2m-1\) elements. The elements indexed by the vertices are minimal, while the elements indexed by the edges are maximal, and each one is larger than exactly 2 minimal elements.

A diagram \({\mathcal D}\) of topological spaces over \(P^T\) is then given by the following data, subject to no further conditions:

  • Spaces \({\mathcal D}(v)\) for all vertices of T;

  • Spaces \({\mathcal D}(e)\) for all edges of T;

  • Continuous maps \({\mathcal D}_{e,v}:{\mathcal D}(e)\rightarrow {\mathcal D}(v)\), whenever v is a vertex adjacent to the edge e.

Definition 3.2

Assume \({\mathcal D}\) is a diagram of topological spaces over a poset \(P^T\). We define the homotopy colimit of \({\mathcal D}\), denoted \(\mathtt{hocolim}\,{\mathcal D}\), as the quotient space

$$\begin{aligned} \mathtt{hocolim}\,{\mathcal D}=\left( \coprod _{v\in V(T)} {\mathcal D}(v) \coprod _{e\in E(T)}({\mathcal D}(e)\times [0,1])\right) /\sim , \end{aligned}$$

where the equivalence relation \(\sim \) is generated by \((x,0)\sim {\mathcal D}_{e,v}(x)\), and \((x,1)\sim {\mathcal D}_{e,w}(x)\), whenever \(x\in {\mathcal D}(e)\), \(e=(v,w)\), \(v<w\).

Let us mention that the notion of homotopy colimit can be defined more generally, including homotopy colimits of diagrams of topological spaces over arbitrary posets. Here, we restrict ourselves to Definition 3.2, which will be sufficient for our purposes.

3.3 Homotopy independence of the homotopy colimits of diagrams of CW complexes over \(P^T\)

From now on, we assume that the spaces \({\mathcal D}(p)\) are CW complexes, for all \(p\in P^T\), and the maps \({\mathcal D}_{e,v}\) are cellular. The next proposition says that changing these maps up to homotopy does not change the homotopy type of the homotopy colimit.

Proposition 3.3

Assume \({\mathcal D}\) and \({\mathcal E}\) are diagrams of CW complexes over \(P^T\), such that

  1. (1)

    \({\mathcal D}(p)={\mathcal E}(p)\), for all \(p\in P^T\);

  2. (2)

    The maps \({\mathcal D}_{e,v}\) and \({\mathcal E}_{e,v}\) are homotopic, whenever e is an edge of T, and v is a vertex adjacent to e.

Then \(\mathtt{hocolim}\,{\mathcal D}\) and \(\mathtt{hocolim}\,{\mathcal E}\) are homotopy equivalent.

Proof

Since T is finite, it is enough to consider the case where \({\mathcal D}_{e,v}\) and \({\mathcal E}_{e,v}\) coincide, for all, but one single instance of an edge e and a vertex v.

Fig. 2
figure 2

Decomposition of the tree T

Decompose the tree T into a union of trees \(T'\) and \(T''\), such that the intersection of \(T'\) and \(T''\) is vertex v, v is a leaf of \(T'\), and \(T'\) contains the edge e, see Fig. 2. Let \({\mathcal D}'\) be the diagram of CW complexes on \(P^{T'}\), which is a restriction of \({\mathcal D}\) with a slight change at v. Specifically, it is defined as follows:

  • for any vertex \(w\in V(T')\), we have \({\mathcal D}'(w):={\left\{ \begin{array}{ll} {\mathcal D}(w),&{}\text { if } w\ne v; \\ {\mathcal D}(e),&{}\text { otherwise.} \end{array}\right. }\)

  • \({\mathcal D}'(r)={\mathcal D}(r)\), for all \(r\in E(T')\);

  • for any edge \(r\in E(T')\) and an adjacent vertex w, we have

    $$\begin{aligned}{\mathcal D}'_{r,w}={\left\{ \begin{array}{ll} {\mathcal D}_{r,w},&{}\text { if } (r,w)\ne (e,v);\\ \text {id}_{{\mathcal D}(e)},&{}\text { otherwise.} \end{array}\right. }. \end{aligned}$$

Let \({\mathcal D}''\) be the restriction of \({\mathcal D}\) to \(P^{T''}\).

Set \(X:=\mathtt{hocolim}\,{\mathcal D}'\), \(Y:=\mathtt{hocolim}\,{\mathcal D}''\), \(A:={\mathcal D}'(v)={\mathcal D}(e)\). Note that X and Y are CW complexes, and A is a CW subcomplex of X. Set \(f:={\mathcal D}_{e,v}\) and \(g:={\mathcal E}_{e,v}\). Clearly, \(\mathtt{hocolim}\,{\mathcal D}\) is obtained from Y by attaching X over f, whereas \(\mathtt{hocolim}\,{\mathcal E}\) is obtained from Y by attaching X over g. We assumed that f is homotopic to G. It is then a general fact, see e.g. Hatcher (2002), that the homotopy type of the adjunction space does not change, when the attachment map is replaced by a homotopic one. This implies that \(\mathtt{hocolim}\,{\mathcal D}\) and \(\mathtt{hocolim}\,{\mathcal E}\) are homotopy equivalent. \(\square \)

3.4 Special homotopy colimits

As above, let T be an arbitrary tree with at least 2 vertices. Let us fix a nonempty subset \(S\subseteq V(T)\). Assume we have a diagram of CW complexes over \(P^T\) satisfying the following conditions:

  • \({\mathcal D}(v)\) are single points, for all \(v\in S\);

  • \({\mathcal D}(e)=X\), for all \(e\in E(T)\), and \({\mathcal D}(v)=X\), for any \(v\notin S\), where X is some fixed CW complex;

  • the maps \({\mathcal D}_{e,v}\) are identity maps, for all \(v\notin S\).

Proposition 3.4

Under the conditions above, the homotopy colimit of \({\mathcal D}\) is homotopy equivalent to the wedge of \(|S|-1\) copies of \(\mathtt{susp}\,X\).

Proof

The proof is by induction on the number of vertices of T.

The induction base is when \(m=2\). We have two cases.

Case 1 If \(S=1\), then \(\mathtt{hocolim}\,{\mathcal D}\) is a cone over X, hence contractible.

Case 2 If \(S=2\), then \(\mathtt{hocolim}\,{\mathcal D}\) is obtained by taking a cylinder over X and shrinking each of the end copies of X to a point. This is precisely the suspension space \(\mathtt{susp}\,X\).

From now on we can assume \(m\ge 3\). We break our argument in the following cases.

Case 1 Assume there exists an internal vertex \(v\in T\), such that \(v\in S\). Let \(e_1,\dots ,e_k\) be the edges adjacent to v, \(k\ge 2\).

Cutting T at v will decompose T into the trees \(T_1,\dots ,T_k\), v is a leaf in each of them, and \(e_i\) is adjacent to v in \(T_i\), for all \(i=1,\dots ,k\); see Figure 3. Let \({\mathcal D}_i\) be the restriction of \({\mathcal D}\) to \(T_i\), for \(i=1,\dots ,k\).

Fig. 3
figure 3

Cutting the tree T at v

Each homotopy colimit \(\mathtt{hocolim}\,{\mathcal D}_i\) has a marked point \(x_i\) corresponding to the copy of \({\mathcal D}(v)\). The homotopy colimit \(\mathtt{hocolim}\,{\mathcal D}\) is obtained by gluing the homotopy colimits \(\mathtt{hocolim}\,{\mathcal D}_i\) together along these points, for \(i=1,\dots ,k\). Accordingly, we see that

$$\begin{aligned} \mathtt{hocolim}\,{\mathcal D}\cong \vee _{i=1}^k\mathtt{hocolim}\,{\mathcal D}_i. \end{aligned}$$
(3.1)

Set \(S_i:=S\cap V(T_i)\). The vertex v is in S, so \(v\in S_i\), for all i. This means that \(S\setminus v=\coprod _{i=1}^k(S_i\setminus v)\), and hence \(|S|-1=\sum _{i=1}^k(|S_i|-1)\). Since each \(T_i\) has fewer vertices than T, we know by the induction assumption that \(\mathtt{hocolim}\,{\mathcal D}_i\) is homotopy equivalent to \(|S_i|-1\) copies of \(\mathtt{susp}\,X\). Accordingly, (3.1) implies that \(\mathtt{hocolim}\,{\mathcal D}\) is homotopy equivalent to a wedge of \(|S|-1\) copies of \(\mathtt{susp}\,X\).

Case 2. All the vertices in S are leaves of T, and there exists a further leaf \(w\notin S\).

Assume w is connected to the vertex u. Since \(m\ge 3\) and all the vertices in S are leaves, we must have \(u\notin S\). Let \(T'\) be the tree obtained from T by deleting w and the adjacent edge. Let \({\mathcal D}'\) be the restriction of \({\mathcal D}\) to \(T'\). By induction assumption \(\mathtt{hocolim}\,{\mathcal D}'\) is homotopy equivalent to a wedge of \(|S|-1\) copies of \(\mathtt{susp}\,X\). The space \(\mathtt{hocolim}\,{\mathcal D}\) is obtained from \(\mathtt{hocolim}\,{\mathcal D}'\) by attaching a cylinder with base X at one of its ends. Clearly \(\mathtt{hocolim}\,{\mathcal D}'\) is a strong deformation of \(\mathtt{hocolim}\,{\mathcal D}\), so the latter is also homotopy equivalent to a wedge of \(|S|-1\) copies of \(\mathtt{susp}\,X\).

Case 3. The set S is precisely the set of all leaves of T.

Since \(m\ge 3\), we have at least 3 leaves. Fix \(v\in S\). Say v is connected to w by an edge. We have \(w\notin S\). Let \(T'\) be the tree obtained from T by deleting v, and let \({\mathcal D}'\) be the restriction of \({\mathcal D}\) to \(T'\). The topological space \(\mathtt{hocolim}\,{\mathcal D}\) is obtained from \(\mathtt{hocolim}\,{\mathcal D}'\) by attaching a cone over \(X={\mathcal D}(w)\). Let \(u\in S\) be any other leaf of T, \(u\ne v\). There is a unique path inside of \(T'\) connecting w with u. The homotopy colimit of the restriction of \({\mathcal D}\) to that path is a cone with apex at \({\mathcal D}(u)\) and base at \({\mathcal D}(w)\). This cone lies inside \(\mathtt{hocolim}\,T'\), therefore the inclusion map \({\mathcal D}(w)\hookrightarrow \mathtt{hocolim}\,{\mathcal D}'\) is trivial. It follows that, up to homotopy equivalence, attaching a cone over \({\mathcal D}(w)\) to \(\mathtt{hocolim}\,{\mathcal D}'\) is the same as wedging \(\mathtt{hocolim}\,{\mathcal D}'\) with \(\mathtt{susp}\,X\). The result now follows by induction. \(\square \)

Let us now consider a little more general diagrams. These satisfy the same conditions outside of S, however, for any \(v\in S\), the spaces \({\mathcal D}(v)\) are now arbitrary connected CW complexes, and each \({\mathcal D}_{e,v}\) maps everything to some point in \({\mathcal D}(v)\), whenever e is an adjacent edge. In this case, Proposition 3.4 can be generalized as follows.

Proposition 3.5

Under the conditions above the homotopy colimit of \({\mathcal D}\) is homotopy equivalent to the wedge

$$\begin{aligned} \vee _{v\in S}{\mathcal D}(v)\vee _\Omega \mathtt{susp}\,X, \end{aligned}$$

where \(|\Omega |=|S|-1\).

Proof

For each \(v\in V(T)\) we select a base point \(x_v\in {\mathcal D}(v)\). Since \({\mathcal D}(v)\) is connected, any continuous map \(\varphi :Y\rightarrow {\mathcal D}(v)\), mapping everything to a point, is homotopic to a map \(\psi :Y\rightarrow {\mathcal D}(v)\) mapping everything to the base point \(x_v\). By Proposition 3.3 we can therefore assume that each map \({\mathcal D}_{e,v}\) maps everything to \(x_v\), whenever \(v\in S\) and e is an adjacent edge, without changing the homotopy type of \(\mathtt{hocolim}\,{\mathcal D}\).

Let \({\mathcal D}'\) be the diagram which we obtain from \({\mathcal D}\) by replacing each \({\mathcal D}(v)\) by a point, for \(v\in S\). Clearly, the homotopy colimit \(\mathtt{hocolim}\,{\mathcal D}\) is obtained from \(\mathtt{hocolim}\,{\mathcal D}'\) be wedging it with all the \({\mathcal D}(v)\), for \(v\in S\). The result follows from Proposition 3.4. \(\square \)

4 Structural decomposition of Stirling complexes and consequences

4.1 Representing stirling complexes as homotopy colimits

Let us fix n and S. We define a diagram \({\mathcal D}\) of topological spaces over \(P^T\) as follows:

  • For each vertex \(v\in V(T)\), we set \({\mathcal D}(v)\) to be the subcomplex of \(\mathcal {S}tr(T,S,n)\), consisting of all cells c, such that \(c_n=v\);

  • For each edge \(e\in E(T)\), we set \({\mathcal D}(e)\) to be the Stirling complex \(\mathcal {S}tr(T,S,n-1)\);

  • Finally, for each edge \(e\in E(T)\), \(e=(v,w)\), we define the map \({\mathcal D}_{e,v}:{\mathcal D}(e)\rightarrow {\mathcal D}(v)\) by setting \(c_n:=v\).

Fig. 4
figure 4

\(\mathcal {S}tr(T,S,n)\) as \(\mathtt{hocolim}\,{\mathcal D}\)

Proposition 4.1

The homotopy colimit \(\mathtt{hocolim}\,{\mathcal D}\) is homeomorphic to the cubical complex \(\mathcal {S}tr(T,S,n)\) (Fig. 4).

Proof

Whenever \(e=(v,w)\) is an edge of T, let \(B_e\) denote the subcomplex of \(\mathcal {S}tr(T,S,n)\) consisting of all cells \(c\in \mathcal {S}tr(T,S,n)\) such that one of the following holds

  1. (1)

    \(c_n=e\);

  2. (2)

    \(c_n=v\), and there exists \(1\le k\le n-1\), such that \(c_k=v\);

  3. (3)

    \(c_n=w\), and there exists \(1\le k\le n-1\), such that \(c_k=w\).

It is easy to see that this set of cells is closed under taking the boundary, hence the subcomplex \(B_e\) is well-defined. Furthermore, the complex \(\mathcal {S}tr(T,S,n)\) is the union of the subcomplexes \({\mathcal D}(v)\), for \(v\in V(T)\), and \(B_e\), for \(e\in E(T)\). To see this just take any cube \((c_1,\dots ,c_n)\) and sort it according to the value of \(c_n\).

Recording the value of \(c_n\) separately, we can see that, as a cubical complex, each \(B_e\) is isomorphic to the direct product of \(\mathcal {S}tr(T,S,n-1)\) with the closed interval [0, 1]. This can be seen as a cylinder with base \(\mathcal {S}tr(T,S,n-1)\). The entire complex \(\mathcal {S}tr(T,S,n)\) is obtained by taking the disjoint union of \({\mathcal D}(v)\), for \(v\in V(T)\), and connecting them by these cylinders. For each cylinder \(B_e\), \(e=(v,w)\), its bases are identified with corresponding subcomplexes of \({\mathcal D}(v)\) and \({\mathcal D}(w)\) by assigning \(c_n:=v\) or \(c_n:=w\). These are precisely the maps \({\mathcal D}_{e,v}\) and \({\mathcal D}_{e,w}\). Comparing this gluing procedure with the definition of \(\mathtt{hocolim}\,{\mathcal D}\) we see that we obtain a homeomorphic space. \(\square \)

4.2 The proof of the main theorem

We are now ready to show our main result.

Theorem 2.5

First, when \(|S|=n\), the complex \(\mathcal {S}tr(T,S,n)\) is a disjoint union of n! points. This can be viewed as a wedge of \(n!-1\) copies of a 0-dimensional sphere, so the result follows from Proposition 2.3.

Assume from now on that \(n\ge |S|+1\). By Proposition 4.1 we can replace \(\mathcal {S}tr(T,S,n)\) by \(\mathtt{hocolim}\,{\mathcal D}\). Consider now a map \({\mathcal D}_{e,v}:{\mathcal D}(e)\rightarrow {\mathcal D}(v)\). By induction, we know that \({\mathcal D}(e)=\mathcal {S}tr(T,S,n-1)\) is homotopy equivalent to a wedge of spheres of dimension \(n-1-|S|\). We make 2 observations.

  1. (1)

    If \(v\notin S\), the cubical complex \({\mathcal D}(v)\) is isomorphic to \(\mathcal {S}tr(T,S,n-1)\), and the map \({\mathcal D}_{e,v}\) is the identity map.

  2. (2)

    If \(v\in S\), the cubical complex \({\mathcal D}(v)\) is isomorphic to \(\mathcal {S}tr(T,S\setminus v,n-1)\). This is because we know that \(c_n=v\), so there is no need to request that v is occupied by some other resource. By induction assumption, the space \(\mathcal {S}tr(T,S\setminus v,n-1)\) is homotopy equivalent to a wedge of spheres of dimension \(n-1-(|S|-1)=n-|S|\). In particular, it is \((n-|S|-1)\)-connected. Therefore, the map \({\mathcal D}_{e,v}\) is homotopic to a trivial map, which takes everything to a point.

We now apply Proposition 3.3 to shift our consideration to the diagram \({\mathcal D}'\), which is obtained from \({\mathcal D}\) by replacing the maps \({\mathcal D}_{e,v}\) by trivial ones, whenever \(v\in S\). This diagram has the same homotopy type as \({\mathcal D}\). On the other hand, it now satisfies the conditions of Proposition 3.5, where the connectivity of the spaces \({\mathcal D}(v)\) is a consequence of the fact that \(n\ge |S|+1\). It follows from that proposition that

$$\begin{aligned} \mathtt{hocolim}\,{\mathcal D}\simeq \vee _{v\in S}{\mathcal D}(v)\vee _\Omega \mathtt{susp}\,\mathcal {S}tr(T,S,n-1), \end{aligned}$$

where \(|\Omega |=|S|-1\).

Counting spheres on both sides, we obtain the recursive formula

$$\begin{aligned} f(|S|,n)=(|S|-1)f(|S|,n-1)+|S|f(|S|-1,n-1). \end{aligned}$$

The validity of the formula Eq. 2.1 now follows from Proposition 4.3. \(\square \)

Remark 4.2

After this paper was submitted for publication, a shorter proof of Theorem 2.5 was found by one of the referees. It is included in the appendix.

Proposition 4.3

Let \(\Gamma =\{(m,n)\in {\mathbb Z}\times {\mathbb Z}\,|\,n\ge m\ge 2\}\). Assume we have a function \(f:\Gamma \rightarrow {\mathbb Z}\), which satisfies the following:

  1. (1)

    For all \(n>m\ge 3\) we have recursive formula

    $$\begin{aligned} f(m,n)=(m-1)f(m,n-1)+m f(m-1,n-1); \end{aligned}$$
    (4.1)
  2. (2)

    We have the boundary conditions \(f(2,n)=1\), \(f(m,m)=m!-1\).

Then for all \((m,n)\in \Gamma \), the value f(mn) is given by Eq. 2.1, which we rewrite as

$$\begin{aligned} f(m,n)=\sum _{\alpha =1}^{m-1}(-1)^{m+\alpha +1}\left( {\begin{array}{c}m\\ \alpha +1\end{array}}\right) \alpha ^n. \end{aligned}$$
(4.2)

Proof

Clearly, the recursive rule Eq. 4.1 together with the boundary conditions defines the values of the function of the function \(f(-,-)\) uniquely. Therefore, to show that f is given by the formula Eq. 4.2 we just need to know that this formula satisfies our boundary conditions and the recursion.

Substituting \(m=2\) into Eq. 4.2 immediately yields 1 on the right hand side, as there is only one summand, with \(\alpha =1\). The case \(m=n\) follows from Proposition 2.3.

To show that Eq. 2.1 satisfies the recursion Eq. 4.1 we need to check that

$$\begin{aligned}&\sum _{\alpha =1}^{m-1}(-1)^{m+\alpha +1}\left( {\begin{array}{c}m\\ \alpha +1\end{array}}\right) \alpha ^n=\\&(m-1)\sum _{\alpha =1}^{m-1}(-1)^{m+\alpha +1}\left( {\begin{array}{c}m\\ \alpha +1\end{array}}\right) \alpha ^{n-1}+ m\sum _{\alpha =1}^{m-2}(-1)^{m+\alpha }\left( {\begin{array}{c}m-1\\ \alpha +1\end{array}}\right) \alpha ^{n-1}. \end{aligned}$$

We do that simply by comparing the coefficients of \(\alpha ^{n-1}\) on each side of Eq. . For \(\alpha =m-1\), the coefficient on each side is \(m-1\). For \(\alpha =1,\dots ,m-2\), we need to show that

$$\begin{aligned} (-1)^{m+\alpha +1}\left( {\begin{array}{c}m\\ \alpha +1\end{array}}\right) \alpha =(m-1)(-1)^{m+\alpha +1}\left( {\begin{array}{c}m\\ \alpha +1\end{array}}\right) +m(-1)^{m+\alpha }\left( {\begin{array}{c}m-1\\ \alpha +1\end{array}}\right) . \end{aligned}$$

This follows from the formula

$$\begin{aligned} (m-\alpha -1)\left( {\begin{array}{c}m\\ \alpha +1\end{array}}\right) =m\left( {\begin{array}{c}m-1\\ \alpha +1\end{array}}\right) . \end{aligned}$$

\(\square \)

We finish with an open question.

Open Question 1

Let T be a tree with a single internal vertex of valency r, where \(r\ge 2\), and let n be any integer, \(n\ge r+1\). The symmetric group \({\mathcal S}_r\) acts on T by permuting its r leaves. This induces an \({\mathcal S}_r\)-action on the Stirling complex \(\mathcal {S}tr(T,n)\), and hence also an \({\mathcal S}_r\)-action on \(H_{n-r-1}(\mathcal {S}tr(T,n);{\mathbb R})\). It would be interesting to decompose this representation of \({\mathcal S}_r\) into irreducible ones.