1. Paths and universal properties
For $A\xrightarrow f C\xleftarrow g B$, a path-space model of $A\times_C^hB$ is the space of triples $(a,\gamma,b)$ with $\gamma(0)=f(a)$ and $\gamma(1)=g(b)$. It is the pullback of the endpoint fibration $C^I\to C^2$ along $(f,g)$, since constant paths factor the diagonal by an equivalence followed by this fibration [1, 2].
In an $\infty$-category, maps from any $T$ into a pullback are pairs of maps together with a homotopy between their composites. Dually, maps from a pushout are pairs of maps and a homotopy on the overlap. Both descriptions are natural equivalences of mapping spaces, so Yoneda identifies the objects. All constructions below are derived. CW models suffice for the geometric examples. The surface calculation specializes the classical count [7] and gives the stabilizer of each type of component.
2. Paths and fibers
Example 1. Prescribed endpoints. Two points $x,y:*\to X$ give $$ *\times_X^h *\simeq P_{x,y}X =\{\gamma\in X^I\mid\gamma(0)=x,\ \gamma(1)=y\}. $$ For $x=y$, this is the based loop space $\Omega_x X$, pointed by the constant path. For distinct path components it is empty. A chosen path $u:x\to y$ identifies $P_{x,y}X$ with $\Omega_x X$ up to equivalence by appending $u$ to a loop. Appending the reverse of $u$ gives a homotopy inverse. This identification depends on $u$ [1, 2].
Example 2. Free and twisted loops. For parallel maps $f,g:X\to Y$, the homotopy equalizer is the space of pairs $(x,\gamma:f(x)\to g(x))$. This follows by pulling the endpoint fibration of $Y$ back along $(f,g)$. For $f=g=\mathrm{id}_X$ the endpoints coincide, so $\gamma$ factors through the circle $I/\partial I$. With $\Delta:X\to X^2$ on both sides this gives $$ LX:=\operatorname{Map}(S^1,X)\simeq X\times^h_{X^2}X. $$ For $f=\mathrm{id}_X$ and $g=u$, a self-map, the same calculation gives the twisted loop space $L_uX$ of paths $\gamma$ with $\gamma(1)=u(\gamma(0))$. The evaluation $LX\to X$ has fiber $\Omega_xX$ over $x$ [1, Ex. 3.2.11].
Example 3. Winding number and delooping. The covering $p:\mathbb R\to S^1$, $t\mapsto e^{2\pi it}$, is a fibration. Since $\mathbb R$ contracts to $0$, it gives a fibration replacement of the basepoint map. Thus $\Omega_1 S^1\simeq p^{-1}(1)=\mathbb Z$. Explicitly, lift a loop from $0$ and take its endpoint $n$. Linear interpolation in $\mathbb R$ from that lift to $t\mapsto nt$ contracts the entire winding-number component. For a discrete group $G$, the universal principal bundle $EG\to BG$ has contractible total space. Choosing a lift of the basepoint identifies its fiber with $G$ and gives $\Omega BG\simeq G$ [4, Thms. 7.11 and 11.1].
Example 4. The second fiber. Given a pointed map $f:(E,e)\to(B,b)$, let $F=E\times_B^h *$. Pasting the defining squares gives $$ \operatorname{hofib}_e(F\to E) \simeq *\times_E^h(E\times_B^h *) \simeq \Omega_b B . $$ The leftward extension $\Omega B\to F\to E\to B$ follows. Another application gives $\Omega E$ as the next fiber. The computation uses finite limits and the pointing, so it holds in every pointed $\infty$-category with finite limits [3, Lemma 8.4.4].
Example 5. Loops on a cube. A based loop in $\Omega X$ is a square in $X$ with all four edges equal to the basepoint. Repeating the same argument gives cubical maps $I^n\to X$ constant on $\partial I^n$. Since $I^n/\partial I^n\cong S^n$ for $n\ge1$, currying gives $\Omega^n X\simeq\operatorname{Map}_*(S^n,X)$. For every pointed test space $T$, the left adjoint is $T\mapsto T\wedge S^n$. In particular, iterated looping preserves all small homotopy limits [1, §1.2] [2].
3. Gluing domains and extending maps
Example 6. A cone specifies a nullhomotopy. For a based map $f:A\to B$, form its reduced homotopy cofiber $C_f=B\amalg_A^h *$ in pointed spaces. A map out of $C_f$ specifies a based map $v:B\to Z$ and a based nullhomotopy of $vf$. Equivalently, $$ \operatorname{Map}_*(C_f,Z)\simeq\operatorname{hofib}_{0}(f^*), $$ where $f^*:\operatorname{Map}_*(B,Z)\to\operatorname{Map}_*(A,Z)$ and $0$ is the constant map. For $B=*$ the cofiber is the reduced suspension. The nullhomotopy assigns a based loop in $Z$ to each point of $A$, giving $\operatorname{Map}_*(\Sigma A,Z)\simeq\operatorname{Map}_*(A,\Omega Z)$ [1, §§1.2, 3.6].
Example 7. Loops on a bouquet. Set $W_r=\bigvee_{j=1}^r S^1$ and choose the common vertex. A based map out of this coproduct is a tuple of based maps from its summands. Hence $\operatorname{Map}_*(W_r,X)\simeq(\Omega X)^r$. Without a pointing on the map one first specifies the image $x$ of the common vertex and then chooses $r$ loops at $x$. This is a family over $X$ whose fiber can have nontrivial monodromy, as Example 11 illustrates [1, §3.6].
Example 8. One attaching word specifies one nullhomotopy. Represent a word $w$ of the free group on $r$ generators by a based map $S^1\to W_r$. Attaching a disk gives the homotopy pushout $$ \begin{matrix} S^1&\xrightarrow{\ w\ }&W_r\\ \big\downarrow&&\big\downarrow\\ D^2&\longrightarrow&K_w . \end{matrix} $$ Precomposition with the attaching map gives word evaluation $$ w_X:(\Omega X)^r\longrightarrow\Omega X. $$ A tuple together with a chosen filling determines a point of $\operatorname{hofib}_{e}(w_X)$, where $e$ is the constant loop. Thus this homotopy fiber is $\operatorname{Map}_*(K_w,X)$. For the torus, $w=[a,b]=aba^{-1}b^{-1}$. Even for constant generator loops the space of fillings is $\Omega^2X$. Taking $X=K(\mathbb Z,2)$ gives a distinct filling class for each integer. The existence of a filling alone would identify all these choices [1, 5].
Example 9. Gluing two intervals computes free loops. Glue two copies of $I$ along their two endpoints. The endpoint inclusions are cofibrations, so this pushout computes the homotopy pushout $S^1$. Mapping into $X$ gives a pullback of the two restriction maps $X^I\to X^{\partial I}$. The inclusion of constant paths identifies both maps, up to equivalence, with $\Delta:X\to X^2$. This recovers Example 2 from a decomposition of the domain. For $X=S^1$ there is also an explicit splitting. A loop $\gamma$ determines its initial value $z$ and the based loop $t\mapsto z^{-1}\gamma(t)$. Multiplication by $z$ gives the inverse. Consequently $LS^1\simeq S^1\times\mathbb Z$ [1, 4].
4. Groupoids from paths and relations
For a discrete group $G$, use $BG$ both for its one-object groupoid and for the corresponding homotopy type. Write $D//G$ for the homotopy type of the action groupoid of a $G$-set $D$. The objects are elements of $D$. An arrow $d\to d'$ is a group element $k$ with $kd=d'$. Each transitive component is equivalent to the one-object groupoid of the stabilizer of a representative [6, 11].
Example 10. Framed and unframed local systems. Let $K$ be a connected pointed CW complex. A principal $G$-local system is classified by a map $K\to BG$. Since $BG$ is a $1$-type, mapping into it factors through the fundamental groupoid of $K$. Restriction to the chosen vertex gives an equivalent one-object source with automorphism group $\pi_1K$. A functor to $BG$ is a homomorphism $\rho:\pi_1K\to G$. A natural isomorphism from $\rho$ to $\rho'$ is an element $k$ with $\rho'(\alpha)=k\rho(\alpha)k^{-1}$ for every $\alpha$. Thus $$ \operatorname{Map}(K,BG)\simeq \operatorname{Hom}(\pi_1K,G)//G . $$ A framing at the basepoint chooses a point in the principal fiber. It identifies the based mapping space with the discrete set of homomorphisms. In the unframed component of $\rho$, the automorphism group is the centralizer $C_G(\operatorname{im}\rho)$ [5, §1.B] [6, §1.6].
Example 11. The components of free loops on a classifying space. For $K=S^1$, a homomorphism from $\mathbb Z$ is determined by one element $a\in G$. Therefore $$ LBG\simeq\coprod_{[a]} B C_G(a), $$ where the index consists of conjugacy classes. For $S_3$ the three summands are $BS_3$, $BC_2$, and $BC_3$. This also identifies the monodromy from Example 7 for a single circle: changing the chosen frame conjugates the based loop. Here and below $C_m$ denotes a cyclic group of order $m$ [6].
Example 12. Double cosets. Let $H,K\le G$. An object of the pullback $BH\times_{BG}^h BK$ is an isomorphism in $BG$. Choose its direction from the $K$-object to the $H$-object and write it as $g\in G$. A change of frames $(h,k)$ sends $g$ to $hgk^{-1}$. Its stabilizer projects isomorphically to $H\cap gKg^{-1}$. Hence $$ BH\times^h_{BG}BK\simeq \coprod_{[g]\in H\backslash G/K} B(H\cap gKg^{-1}). $$ For $G=S_3$ and $H=K=\langle(12)\rangle$, the identity double coset has two elements and stabilizer $C_2$. The other has four elements and trivial stabilizer. The pullback is $BC_2\amalg *$. This is the weak pullback of groupoids evaluated on these inclusions [11].
Example 13. A surface relation. Let $M_g$ be a closed connected orientable surface of genus $g$ with a chosen vertex. Its usual cell decomposition has $2g$ generating circles and one two-cell attached along the ordered product $\prod_{i=1}^{g}[a_i,b_i]$. Let $R_g(G)$ be the set of tuples in $G^{2g}$ whose product of commutators is the identity. Then $$ \operatorname{Map}(M_g,BG)\simeq R_g(G)//G . $$ In Example 8 the target of the word map is now $\Omega BG\simeq G$, which is homotopy-discrete. Each tuple satisfying the relation has a contractible space of fillings. Forgetting the frame then gives simultaneous conjugation, by Example 10. For the torus the tuples are commuting pairs, and the component at $(a,b)$ is $B(C_G(a)\cap C_G(b))$. The genus-zero empty tuple gives $BG$ [5, 6, 7].
5. A calculation in every genus
Example 14. Surface local systems for $S_3$. The commutator distribution in $S_3$ determines the components and their automorphism groups in all genera.
Let $N_g=|R_g(S_3)|$. Among the 36 ordered pairs in $S_3^2$, the number that commute is the sum of the centralizer orders over all elements, namely $6+3\cdot2+2\cdot3=18$. Every commutator lies in the alternating subgroup $A_3$. The two nonidentity elements of $A_3$ are conjugate, so each occurs as a commutator nine times. Given a tuple of $g$ pairs, a further handle therefore completes its commutator product to the identity in 18 ways if the product is already the identity and in nine ways otherwise. Hence $$ \begin{aligned} N_0&=1,\\ N_{g+1}&=18N_g+9(36^g-N_g),\\ N_g&=(36^g+2\cdot9^g)/3 . \end{aligned} $$ Induction gives the last line. It agrees with the classical character formula for irreducible dimensions $1,1,2$ [7, Cor. 1].
The trivial assignment gives one component $BS_3$. For each of the three subgroups of order two there are $4^g-1$ tuples generating it. Conjugation permutes the three subgroups transitively, and their normalizers act trivially on them. This gives $4^g-1$ components of type $BC_2$. In the unique subgroup of order three there are $9^g-1$ nontrivial tuples. Simultaneous inversion pairs them without fixed points, giving $(9^g-1)/2$ components of type $BC_3$. Every remaining tuple generates $S_3$ and has trivial centralizer, so its orbit has six elements.
Consequently, if $mD$ denotes the disjoint union of $m$ copies of $D$, the full mapping space has decomposition $$ \begin{aligned} \operatorname{Map}(M_g,BS_3)\simeq {}& BS_3\ \amalg\ (4^g-1)BC_2\\ &{}\amalg\ \tfrac{9^g-1}{2}BC_3\ \amalg\ s_g *,\\ s_g={}&(N_g-3\cdot4^g-9^g+3)/6 . \end{aligned} $$ In genus two, for instance, there are 486 framed local systems and 116 unframed components. Table 1 gives their stabilizers.
| Domain | Framed | Components | $S_3$ | $C_2$ | $C_3$ | $1$ |
|---|---|---|---|---|---|---|
| $W_2$ | 36 | 11 | 1 | 3 | 4 | 3 |
| $M_0$ | 1 | 1 | 1 | 0 | 0 | 0 |
| $M_1$ | 18 | 8 | 1 | 3 | 4 | 0 |
| $M_2$ | 486 | 116 | 1 | 15 | 40 | 60 |
| $M_3$ | 16038 | 2948 | 1 | 63 | 364 | 2520 |
Table 1. The four rightmost columns count components by automorphism group. Attaching the torus two-cell to $W_2$ removes exactly the three components of noncommuting pairs.
An independent check of the total number of components uses Burnside's lemma. A transposition fixes $2^{2g}$ tuples, because its centralizer is abelian of order two. A three-cycle fixes $3^{2g}$ by the same argument. Averaging fixed-tuple counts gives $(N_g+3\cdot4^g+2\cdot9^g)/6$. The accompanying program independently enumerates the tuples, orbits, and stabilizers in Table 1.
6. Lifts, sections, and descent
Example 15. Lifts as sections. For $p:E\to B$ and $u:T\to B$, a homotopy lift consists of $v:T\to E$ together with a path from $pv$ to $u$ in $\operatorname{Map}(T,B)$. Equivalently it is a section of the pullback family $u^*E\to T$. With $p_*$ denoting postcomposition on mapping spaces, $$ \operatorname{hofib}_{u}(p_*)\simeq\Gamma_T(u^*E). $$ This follows by applying the pullback universal property to the identity of $T$. For the double cover $z\mapsto z^2$ of the circle, the map $u(z)=z^n$ lifts exactly when $n$ is even. For even $n$ its two lifts correspond to the two initial values. Their section space is discrete since the fibers of the cover are discrete [5, §1.3].
Example 16. Sections and dependent products. A $T$-family of sections of $p:E\to B$ is a map $T\times B\to E$ over $B$. Thus $E\mapsto\Gamma_B(E)$ is right adjoint to forming the trivial family over $B$. More generally, for $p:E\to B$ in an $\infty$-topos, composition defines $\Sigma_p$, pullback defines $p^*$, and the dependent product $\Pi_p$ satisfies $$ \Sigma_p\dashv p^*\dashv\Pi_p . $$ For $D\to E$, the fiber of $\Pi_pD$ at $b$ is the section object of $D|_{E_b}\to E_b$. In a general topos the internal section object of $E\to B$ is $\Pi_{B\to1}E$. Its global points form the external space of sections. These right adjoints preserve small limits in their respective slices [2, 9, 10].
Example 17. Homotopy fixed points. A discrete group action on $X$ gives a family $EG\times_G X\to BG$. Pulling a section back to $EG$ gives a $G$-equivariant map $EG\to X$, and such a map descends to a section. The space of sections is $X^{hG}=\lim_{BG}X$, the right adjoint to the trivial-action functor. For a trivial action, factorization through $BG$ gives $X^{hG}\simeq\operatorname{Map}(BG,X)$. For a $\mathbb Z$-action generated by a homeomorphism $u$, take $E\mathbb Z=\mathbb R$ with generator $t\mapsto t+1$. An equivariant map satisfies $F(t+1)=u(F(t))$ and is determined by its restriction to $I$. This identifies $X^{h\mathbb Z}$ with the twisted loop space in Example 2. For $u(z)=-z$ on $S^1$, $F(t)=e^{\pi it}$ gives a homotopy fixed point although the generator has no fixed point [8].
Example 18. Base change for dependent products. Take $v:B'\to B$ and form the pullback square $$ \begin{matrix} E'&\xrightarrow{\ q\ }&E\\ {\scriptstyle p'}\!\big\downarrow&&\big\downarrow\!{\scriptstyle p}\\ B'&\xrightarrow{\ v\ }&B . \end{matrix} $$ For $D\to E$ the Beck–Chevalley equivalence is $$ v^*\Pi_pD\simeq\Pi_{p'}q^*D . $$ To see it, test with $T\to B'$. Maps from $T$ into the left side correspond by adjunction to maps $p^*\Sigma_v T\to D$ over $E$. Pullback pasting identifies the source with $\Sigma_q(p'^*T)$, since both have total object $E\times_B T$. Applying the adjunctions again gives maps from $T$ into the right side. Naturality in $T$ proves the equivalence [9, 10] [12, §4.2].
Example 19. A diagonal detects a subobject. A map $p:E\to B$ in an $\infty$-topos is a monomorphism precisely when $E\to E\times_BE$ is an equivalence. To test this, work in the slice over $B$. For each $T\to B$ the induced map is the diagonal $D\to D\times D$ of $D=\operatorname{Map}_{/B}(T,E)$. If the diagonal is an equivalence, either projection is its inverse up to homotopy. Given $d\in D$, the fiber of that projection over $d$ is $D$, hence contractible. Conversely, empty and contractible spaces have invertible diagonals. This characterizes a $(-1)$-truncated map on every test object [9, §5.5.6]. For a proper subgroup $H<G$, the fiber of $BH\to BG$ is the discrete coset set $G/H$ with more than one point. The inclusion of groups therefore induces a $0$-truncated map that fails this diagonal test.
Example 20. Čech descent for sections. For an effective epimorphism $U\to B$ in an $\infty$-topos put $U_n=U^{\times_B(n+1)}$. Its augmented Čech nerve has colimit $B$. For a family $D\to B$, applying the external mapping-space functor of the slice to this colimit gives $$ \Gamma_B(D)\simeq \lim_{[n]\in\Delta}\Gamma_{U_n}(D|_{U_n}). $$ Here $\Gamma$ denotes the space of sections. Each term is $\operatorname{Map}_{/B}(U_n,D)$ by Example 15. The limit, also called the totalization, includes compatibility on triple and all higher overlaps. For $*\to BG$, the terms of the Čech nerve are $G^n$ and its realization is $BG$. A trivial family with fiber $X$ thus gives $\operatorname{Map}(BG,X)$ as the totalization of the spaces $\operatorname{Map}(G^n,X)$ [8, 9].
The cover hypothesis can be tested on a two-point space. For the inclusion of one point $*\to\{0,1\}$, every Čech term is a point. For a constant two-element fiber, the totalization has two elements while the space of global sections has four. The missing component accounts exactly for the second independent choice [9, §6.2.3].
7. Scope and evidence
The surface groupoid calculation uses a discrete structure group. Descent uses an effective epimorphism. The recurrence applies in all genera, and the source package independently checks the table for genera zero through three. Prepared anonymously at the commissioning author's request with OpenAI ChatGPT assistance in exposition, source review, typesetting, and enumeration.
References
1. Munson and Volić. Cubical Homotopy Theory. Cambridge, 2015. 2. Lurie. Kerodon. Loops, pullbacks, adjoint preservation. 3. The Univalent Foundations Program. Homotopy Type Theory, 2013. 4. Mitchell. Notes on principal bundles and classifying spaces, 2011. 5. Hatcher. Algebraic Topology. Cambridge, 2002. 6. Brown. Groupoids and crossed objects in algebraic topology, 2008. 7. Klug. Counting homomorphisms from surface groups to finite groups. Canad. Math. Bull. 68 (2025), 141–153. 8. Lurie. Elliptic Cohomology III, 2019, §3.2. 9. Lurie. Higher Topos Theory. Princeton, 2009. 10. Schreiber. Differential cohomology in a cohesive infinity-topos, 2013. 11. Baez, Hoffnung and Walker. Higher-Dimensional Algebra VII. Theory Appl. Categ. 24 (2010), 489–553. 12. Anonymous. Higher Fibrations, Adjunctions, and Indexed Algebra. Higher Categorical Semantics, November 19, 2026. Editorially reviewed.