TITLE: When does a map of spaces deloop a closed subgroup inclusion?
QUESTION [7 upvotes]: I believe Kan showed that any connected CW complex is the delooping of a topological group. I'm interested in the relative question:
Question: Let $Y \to X$ be a map of connected CW complexes. Under what conditions does there exists a topological group $G$ and a closed subgroup $H \subseteq G$ such that $BH \to BG$ is homotopy equivalent to $Y \to X$? I'd also be interested in removing the connectedness assumption and asking about realization as the delooping of a closed subgroupoid of a groupoid.
I have a sneaking suspicion that any map can be so realized. For instance, if $X = BG$ for $G$ finite, you might think that $H$ has to be a subgroup of $G$, but I think this is not so -- for instance, you could realize various larger groups as subgroups of $G \times \mathbb R^\infty$.
If it simplifies things to assume, say, that $X$ deloops a compact group, or even a compact Lie group or a finite group, I'd love to hear about it.
Motivation: In equivariant homotopy theory, most concepts are native to homotopy theory, except for closed subgroups and homogeneous spaces. It would be nice to understand their origins purely homotopy-theoretically.

REPLY [5 votes]: Actually, this turns out to be easier than I thought, using the nice description of Kan's loop group functor $G$ by Danny Stevenson here. The answer is indeed that any map of connected spaces is the delooping of a closed subgroup inclusion.
It suffices to find a simplicial model of $Y \to X$ such that $GY \to GX$ is an injection of simplicial sets. If $X$ is a simplicial set with one vertex, then Stevenson gives the formula
$$G(X)_n = \pi_1(Dec_n X / X_{n +1})$$
Here $Dec$ is the decalage construction, with $Dec_n X = X_{\bullet + n +1}$. Now, $Dec_n X$ deformation retracts via an extra degeneracy onto $X_n$, i.e. it is homotopically discrete. The map $X_{n+1} \to Dec_n X$ is a cofibration, so its cofiber $Dec_n X / X_{n+1}$ is a homotopy cofiber. This is the homotopy cofiber of a map of discrete spaces, so we easily compute that $Dec_n X / X_{n+1} = \vee^{X_{n+1} / X_n} S^1$ (where $X_{n+1} / X_n$ just denotes a quotient of sets). Thus 
$$\pi_1(Dec_n X / X_{n+1}) = \langle X_{n+1} / X_n \rangle$$
is the free group on the set of nondegenerate 1-simplicies of $Dec_n X$. Crucially, this formula is functorial in $X$. Therefore, it suffices to find a simplicial model of $Y \to X$ such that

$Y$ and $X$ each have only one vertex.
$Y \to X$ is injective.
$Y \to X$ sends nondegenerate simplices to nondegenerate simplices.

But (1) and (2) are easy to arrange (first obtain (1) by choosing fibrant models for $X$ and $Y$ and then throwing away all but one vertex; then the injective model of $Y \to X$ produced by the small object argument will still have property (1)). Moreover, (2) implies (3).