7 Sheaf Cohomology, Laplacians, and Harmonic Extensions
Purpose. Develops the spectral viewpoint: the sheaf Laplacian \(\mathcal{L}_\mathcal{F} = \delta^T\delta\), the Hodge theorem, relative cohomology, and the harmonic-extension principle. This chapter is the direct prerequisite for Proposition 3.4 and Theorem 4.1 of [1].
7.1 Motivating example
Return to the path graph with two pinned ends from Ch. 2 — but now let the stalks be multidimensional and the restriction maps be arbitrary matrices. The pinned dynamics now drive a vector at each interior vertex toward consistency with its neighbors, where “consistency” means agreement after passing through the restriction maps. The unique equilibrium of this process is the harmonic extension of the boundary data.
The whole machinery of Ch. 2 — Laplacian, Dirichlet energy, Dirichlet problem, exponential convergence — extends to sheaves with almost no change. The only difference is that the coboundary \(\delta\) now involves restriction maps, and the spectral gap depends on those maps. This chapter develops the theory; Ch. 6 runs the dynamics.
7.2 Key concepts and results
- Coboundary \(\delta\) as a block matrix; sheaf Laplacian \(\mathcal{L}_\mathcal{F} = \delta^T\delta\).
- The Hodge theorem: \(\ker\mathcal{L}_\mathcal{F} = \ker\delta = H^0(G;\mathcal{F})\) (global sections).
- Relative cohomology \(H^0(G,U;\mathcal{F})\) with respect to a boundary set \(U\).
- When is \(H^0(G,U;\mathcal{F}) = 0\)? (Equivalently: when is the restricted Laplacian positive definite?)
- Unique harmonic extension under vanishing relative cohomology.
7.3 Intuition
In Ch. 2, the key fact was: “on a connected graph with at least one pinned vertex, the restricted Laplacian \(L[\Omega,\Omega]\) is positive definite.” This forced the harmonic extension to exist and be unique. The sheaf generalization is: “when the relative cohomology \(H^0(G,U;\mathcal{F})\) vanishes, the restricted sheaf Laplacian is positive definite.”
For the neural sheaf, the vanishing of \(H^0\) is not proved by connectivity alone — it is proved by a specific algebraic property of the restriction maps (the unitriangular structure of \(\delta_\Omega\), Lemma 3.2 of [1]). The key geometric message is the same: the boundary conditions force a unique equilibrium.
The Hodge theorem is the statement that global sections are exactly the “frequency zero” modes of the sheaf — the kernel of the Laplacian. Everything else can be expressed as a “gradient” (\(\delta^T c\) for some 1-cochain \(c\)) or a “curl” (\(\delta h\) for some 0-cochain \(h\)). For graphs, the curl part is trivial and the decomposition simplifies to the statement used in the convergence proofs.
7.4 Formal development
The sheaf Laplacian
Definition 7.1 Definition 5.1 (Sheaf Laplacian). For a cellular sheaf \(\mathcal{F}\) on a graph \(G\) with coboundary \(\delta : C^0(G;\mathcal{F}) \to C^1(G;\mathcal{F})\), the sheaf Laplacian is \[\mathcal{L}_\mathcal{F} = \delta^T \delta : C^0(G;\mathcal{F}) \to C^0(G;\mathcal{F}).\]
\(\mathcal{L}_\mathcal{F}\) is positive semidefinite by construction: \(\langle x, \mathcal{L}_\mathcal{F} x\rangle = \|\delta x\|^2 \geq 0\). Its local action at vertex \(v\) is \[(\mathcal{L}_\mathcal{F} x)_v = \sum_{e:\, v \leq e} \mathcal{F}_{v \leq e}^T \bigl(\mathcal{F}_{v \leq e}\, x_v - \mathcal{F}_{w \leq e}\, x_w\bigr),\] where \(w\) denotes the other endpoint of edge \(e\). Each vertex \(v\) is updated using only its own data and the data at neighboring vertices \(w\) — the dynamics are local in the graph-theoretic sense.
Explicit block structure. Ordering the stalk dimensions \(d_v = \dim\mathcal{F}(v)\), the \((v,v)\) block of \(\mathcal{L}_\mathcal{F}\) is \(\sum_{e:\, v \leq e} \mathcal{F}_{v \leq e}^T \mathcal{F}_{v \leq e}\) (a sum of positive semidefinite matrices), and the off-diagonal \((v,w)\) block is \(-\mathcal{F}_{v \leq e}^T \mathcal{F}_{w \leq e}\) for the unique edge \(e = \{v,w\}\) (zero if there is no such edge).
For the constant sheaf \(\underline{\mathbb{R}}\), all stalks are \(\mathbb{R}\) and all restriction maps are \(\pm1\), so \(\mathcal{L}_{\underline{\mathbb{R}}} = L\) recovers the ordinary graph Laplacian.
The Hodge theorem for sheaves
Theorem 7.1 Theorem 5.2 (Hodge theorem for sheaves, [2]). For any cellular sheaf \(\mathcal{F}\) on a graph \(G\), \[\ker\mathcal{L}_\mathcal{F} = \ker\delta = H^0(G;\mathcal{F}),\] where \(H^0(G;\mathcal{F}) = \ker\delta\) is the zeroth sheaf cohomology (the space of global sections).
Proof. \(x \in \ker\mathcal{L}_\mathcal{F}\) iff \(\langle x, \mathcal{L}_\mathcal{F} x\rangle = \|\delta x\|^2 = 0\) iff \(\delta x = 0\) iff \(x \in \ker\delta\). \(\square\)
Theorem 5.2 is the sheaf version of the statement “harmonic functions on a connected graph are constants.” Here, global sections play the role of constants. The dimension \(\dim H^0(G;\mathcal{F})\) counts the number of independent global sections; it equals the multiplicity of the eigenvalue 0 in the spectrum of \(\mathcal{L}_\mathcal{F}\).
Relative cohomology
When a boundary subset \(U \subseteq V\) is pinned to fixed data, the relevant question is not whether global sections exist but whether sections that vanish on \(U\) exist.
Definition 7.2 Definition 5.3 (Relative cohomology). The zeroth relative cohomology with respect to a boundary set \(U \subseteq V\) is \[H^0(G,U;\mathcal{F}) = \{x \in \ker\delta : x|_U = 0\}.\]
\(H^0(G,U;\mathcal{F}) = 0\) means: the only global section that vanishes on \(U\) is the zero section. Equivalently, any consistent assignment on the interior \(\Omega = V \setminus U\) extends to a consistent assignment on all of \(G\) that is uniquely determined by the boundary data — the harmonic extension is unique.
Restricted Laplacian and harmonic extension
Write the sheaf Laplacian in blocks: \[\mathcal{L}_\mathcal{F} = \begin{pmatrix} \mathcal{L}_\mathcal{F}[U,U] & \mathcal{L}_\mathcal{F}[U,\Omega] \\ \mathcal{L}_\mathcal{F}[\Omega,U] & \mathcal{L}_\mathcal{F}[\Omega,\Omega] \end{pmatrix}.\] The restricted Laplacian \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\) governs the interior dynamics; \(\mathcal{L}_\mathcal{F}[\Omega,U]\) encodes the boundary forcing.
Theorem 7.2 Theorem 5.4 (Unique harmonic extension). If \(H^0(G,U;\mathcal{F}) = 0\), then \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\) is positive definite and there exists a unique 0-cochain \(x^* \in C^0(G;\mathcal{F})\) satisfying \(x^*|_U = u\) and \((\mathcal{L}_\mathcal{F} x^*)_v = 0\) for all \(v \in \Omega\). This harmonic extension minimizes the total discrepancy \(\|\delta x\|^2\) subject to the boundary conditions.
Proof. The condition \((\mathcal{L}_\mathcal{F} x^*)_\Omega = 0\) with \(x^*|_U = u\) is equivalent to \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\, x^*|_\Omega = -\mathcal{L}_\mathcal{F}[\Omega,U]\, u\). If \(H^0(G,U;\mathcal{F}) = 0\), then \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\) is positive definite (because any nonzero \(\omega \in \ker\mathcal{L}_\mathcal{F}[\Omega,\Omega]\) would extend to a nonzero global section vanishing on \(U\)). Positive definiteness implies unique solvability. The minimum-discrepancy characterization follows from the fact that \(\|\delta x\|^2 = \langle x, \mathcal{L}_\mathcal{F} x\rangle\) is strictly convex on the affine subspace \(\{x : x|_U = u\}\). \(\square\)
Theorem 5.4 is Theorem 2.5 of [1]. The paper cites it as “U-restricted dynamics, [3] Theorem 5.1.” In Ch. 8, we will verify that the neural sheaf has \(H^0(G,U;\mathcal{F}) = 0\) by the unitriangular factorization argument (Lemma 3.2 of that paper). Theorem 5.4 then gives the harmonic extension (= forward pass output) for free.
Spectral gap of the restricted Laplacian
Definition 7.3 Definition 5.5. The spectral gap of the restricted sheaf Laplacian is \(\lambda_{\min}(\mathcal{L}_\mathcal{F}[\Omega,\Omega])\), the smallest eigenvalue of \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\).
If \(H^0(G,U;\mathcal{F}) = 0\), then \(\lambda_{\min}(\mathcal{L}_\mathcal{F}[\Omega,\Omega]) > 0\) and the restricted dynamics (Ch. 6) converge at rate \(\alpha\lambda_{\min}\). For the neural sheaf, [1] define \[\lambda^* = \alpha \min_R \lambda_{\min}(\mathcal{L}_{\mathcal{F}_R}[\Omega,\Omega]) > 0,\] where the minimum is over all activation patterns \(R\) (of which there are finitely many). This uniform lower bound on the convergence rate is why the heat equation converges despite the ReLU switching.
7.5 Worked example: the discourse sheaf on a path
Return to the three-agent discourse sheaf from Ch. 4 (Example 4.4): path \(v_1 - e_{12} - v_2 - e_{23} - v_3\), stalks \(\mathbb{R}^2\), edge stalks \(\mathbb{R}\), with restrictions \(\mathcal{F}_{v_1 \leq e_{12}} = (1,0)\), \(\mathcal{F}_{v_2 \leq e_{12}} = (0,1)\), \(\mathcal{F}_{v_2 \leq e_{23}} = (1,0)\), \(\mathcal{F}_{v_3 \leq e_{23}} = (0,1)\).
Coboundary. With 0-cochains \(x = (x_{v_1}, x_{v_2}, x_{v_3}) \in (\mathbb{R}^2)^3\) and 1-cochains \(y = (y_{e_{12}}, y_{e_{23}}) \in \mathbb{R}^2\): \[\delta = \begin{pmatrix} -\mathcal{F}_{v_1 \leq e_{12}} & \mathcal{F}_{v_2 \leq e_{12}} & 0 \\ 0 & -\mathcal{F}_{v_2 \leq e_{23}} & \mathcal{F}_{v_3 \leq e_{23}} \end{pmatrix} = \begin{pmatrix} -(1,0) & (0,1) & 0 \\ 0 & -(1,0) & (0,1) \end{pmatrix}.\]
Sheaf Laplacian. \(\mathcal{L}_\mathcal{F} = \delta^T\delta\) is a \(6\times6\) matrix (two \(\mathbb{R}^2\) blocks per vertex). Computing explicitly: \[\mathcal{L}_\mathcal{F} = \begin{pmatrix} \begin{pmatrix}1&0\\0&0\end{pmatrix} & \begin{pmatrix}0&-1\\0&0\end{pmatrix} & 0 \\ \begin{pmatrix}0&0\\-1&0\end{pmatrix} & \begin{pmatrix}1&0\\0&1\end{pmatrix} & \begin{pmatrix}0&0\\0&-1\end{pmatrix} \\ 0 & \begin{pmatrix}0&0\\0&-1\end{pmatrix} & \begin{pmatrix}0&0\\0&1\end{pmatrix} \end{pmatrix}.\]
Global sections. \(x \in \ker\delta\) requires \(x^{(2)}_{v_2} = x^{(1)}_{v_1}\) and \(x^{(2)}_{v_3} = x^{(1)}_{v_2}\), a 3-dimensional space. The eigenvalue 0 has multiplicity 3, consistent with Theorem 5.2.
Pinned dynamics. Pin \(v_1\) and \(v_3\) (to \(u_1 \in \mathbb{R}^2\) and \(u_3 \in \mathbb{R}^2\)). The restricted Laplacian \(\mathcal{L}_\mathcal{F}[\{v_2\},\{v_1,v_3\}]\) is the \(2\times2\) block \(\begin{pmatrix}1&0\\0&1\end{pmatrix} = I_2\), which is positive definite. By Theorem 5.4, there is a unique harmonic extension — the unique \(x_{v_2}\) consistent with both neighbors.
Solving: \(I_2 \cdot x_{v_2} = \frac{1}{2}\bigl((0,x^{(2)}_{v_1}) + (x^{(1)}_{v_3}, 0)\bigr) + \text{boundary terms}\). The harmonic extension picks out the “right” components of each neighbor’s opinion as the intermediate agent’s opinion.
7.6 Exercises
5.1 (Warm-up — sheaf Laplacian on the constant sheaf). Verify that \(\mathcal{L}_{\underline{\mathbb{R}}} = L\) (the ordinary graph Laplacian) for any graph \(G\).
5.2 (Positive definite vs. positive semidefinite). Give an example of a sheaf \(\mathcal{F}\) on a connected graph \(G\) for which \(\mathcal{L}_\mathcal{F}\) is positive definite (not just semidefinite). (Hint: what restriction maps can make all cochains have nonzero discrepancy?)
5.3 (Relative cohomology). For the discourse sheaf of Example 4.4, pin vertex \(v_1\). Show that \(H^0(G,\{v_1\};\mathcal{F}) = 0\) and find the harmonic extension of arbitrary boundary data \(u_{v_1} \in \mathbb{R}^2\).
5.4 (Spectral gap and restriction maps). Consider a sheaf on the single edge \(v \to w\) with \(\mathcal{F}(v) = \mathcal{F}(w) = \mathbb{R}^n\) and \(\mathcal{F}(e) = \mathbb{R}^k\). The restriction maps are \(A : \mathbb{R}^n \to \mathbb{R}^k\) (from \(v\)) and \(B : \mathbb{R}^n \to \mathbb{R}^k\) (from \(w\)). Pin \(v\) to boundary data \(u\). Show that the restricted Laplacian (acting on \(\mathcal{F}(w) = \mathbb{R}^n\)) is \(B^T B\), and find conditions on \(B\) for it to be positive definite.
5.5 (Unitriangular structure preview). Let \(G\) be the path \(v_0 - e_1 - v_1 - e_2 - v_2\) with stalks \(\mathcal{F}(v_0) = \mathcal{F}(e_1) = \mathcal{F}(e_2) = \mathbb{R}^2\) and \(\mathcal{F}(v_1) = \mathcal{F}(v_2) = \mathbb{R}^2\). Choose restriction maps so that \(\delta_\Omega\) (the restriction of \(\delta\) to the free coordinates \(v_1, v_2\), with \(v_0\) pinned) is the matrix \(\begin{pmatrix}I & 0 \\ -A & I\end{pmatrix}\) for some \(A \in \mathbb{R}^{2\times2}\). Show \(\det\delta_\Omega = 1\) regardless of \(A\) and conclude \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\) is positive definite. This is the one-layer case of Lemma 3.2 in [1].
5.6 (Project — spectral analysis). For the neural sheaf with a trained [2, 30, 1] network, compute the spectrum of \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\) for 50 random inputs. Reproduce Figure 15a from [1]: the Fiedler eigenvector concentrates its energy on the output pre-activation stalk \(z^{(k+1)}\). See lab-05-sheaf-laplacian.
7.7 Coding lab
lab-05-sheaf-laplacian — Implement the sheaf Laplacian \(\mathcal{L}_\mathcal{F} = \delta^T\delta\) from the coboundary matrix built in Lab 04. For the path sheaf, verify the block-tridiagonal structure of \(\mathcal{L}_\mathcal{F}\) (equation (A.1.36) from [1], Appendix A). Compute eigenvalues and eigenvectors. For a randomly initialized [2, 4, 1] network, compute the restricted Laplacian \(\mathcal{L}_\mathcal{F}[\Omega,\Omega]\), verify positive definiteness (all eigenvalues \(> 0\)), and check that \(\det\mathcal{L}_\mathcal{F}[\Omega,\Omega] = 1\) (as predicted by Lemma 3.2). Visualize the Fiedler eigenvector energy per stalk.
7.8 Further reading
The spectral theory of sheaf Laplacians and the Hodge theorem on graphs is developed in [2]. The relative cohomology perspective and the harmonic extension result (Theorem 5.4 = [3] Theorem 5.1) are in [3]. For the categorical and higher-dimensional generalization, see [4]. The Hodge Laplacian on simplicial complexes (the generalization of the graph Laplacian to higher-order data) is surveyed in [5].
7.9 FAQ / common misconceptions
Q: Is the sheaf Laplacian the same as the graph Laplacian? No, in general. \(\mathcal{L}_\mathcal{F} = \delta^T\delta\) has the same form as \(L = \delta^T\delta\), but the coboundary \(\delta\) for a sheaf involves the restriction maps \(\mathcal{F}_{v \leq e}\), which can be arbitrary matrices. When all stalks are \(\mathbb{R}\) and all restrictions are \(\pm1\), \(\mathcal{L}_\mathcal{F} = L\).
Q: When can \(H^0(G,U;\mathcal{F}) \neq 0\)? If \(U\) does not “see” some part of the sheaf — for example, if some interior vertex’s stalk is entirely in the kernel of all adjacent restriction maps — then there can be nonzero sections that vanish on \(U\). For the neural sheaf with generic weights, this cannot happen (Lemma 3.2 of [1] rules it out by the unit-determinant argument). For architectures with skip connections or shared parameters, positive definiteness must be verified separately (see §7 of that paper).
Q: Why is the minimum eigenvalue across all activation patterns the right convergence rate? Because the sheaf switches between activation patterns during the heat equation trajectory. Within each pattern, the convergence rate is \(\alpha\lambda_{\min}(\mathcal{L}_{\mathcal{F}_R}[\Omega,\Omega])\) for that pattern \(R\). The slowest rate (minimum over all patterns) gives a uniform lower bound on how fast the energy decreases in the worst case. Since there are finitely many patterns, this minimum is positive.