Cosheaves: The Dual Perspective on Graph Data
Published:
Sheaves vs Cosheaves: The Duality
Sheaf F: data flows from larger to smaller via restriction maps F_{v▷e} : F(v) → F(e). The question is whether global data on nodes is consistent when restricted to edges.
Cosheaf G: data flows from smaller to larger via corestriction maps G_{e▷v} : G(e) → G(v). The question is whether local data on edges can be consistently extended to nodes.
Formally, a cosheaf on a graph G assigns:
- A vector space G(v) ≅ ℝ^d to each node v
- A vector space G(e) ≅ ℝ^d to each edge e
- A corestriction map G_{e▷v} : G(e) → G(v) for each incident pair (v, e)
The coboundary operator becomes a boundary operator:
This is the transpose/dual of δ₀ — it maps edge-level data to node-level data by “extending” along corestriction maps.
Cosheaf Homology vs Sheaf Cohomology
Sheaf cohomology:
Cosheaf homology:
The roles are reversed: H₀ of a cosheaf measures the “cokernel” (how much node space is NOT reachable from edge data), while H₁ measures consistent edge cycles.
| For the constant cosheaf (G_{e▷v} = I): H₀ = ℝ^d (one component per connected component), H₁ = ℝ^{d · ( | E | − | V | +1)} (one d-dimensional cycle per independent cycle of G). |
The Cosheaf Laplacian
The cosheaf Laplacian is:
Note: this is the down-Laplacian Δ₁ = δ₀ δ₀ᵀ acting on edges, when the cosheaf maps are the transposes of the sheaf maps.
The node-level operator ∂₀ᵀ ∂₀ is the up-Laplacian on nodes — the adjoint of the cosheaf Laplacian.
The Sheaf-Cosheaf Duality
For any sheaf F on a graph G, the dual cosheaf F* is defined by:
- F(v) = F(v), F(e) = F(e) (dual vector spaces)
- G_{e▷v} = (F_{v▷e})ᵀ (transpose of restriction maps)
Under this duality:
- Sheaf cohomology H(G, F) ↔ Cosheaf homology H(G, F*)
- The sheaf Laplacian Δ_F ↔ The cosheaf Laplacian of F*
For finite-dimensional vector spaces over ℝ, F ≅ F* (via the standard inner product), so sheaves and cosheaves are “the same” in the vector space setting — the distinction is in how the maps are oriented.
When Cosheaves Are Natural
Sheaves are natural when: data is a field or section — something you observe at each point and which restricts consistently to smaller regions. Examples: temperature readings (restrict to subset of sensors), functions on a manifold (restrict to submanifold).
Cosheaves are natural when: data is a distribution or measure — something you aggregate from smaller regions to larger ones. Examples: flow on roads (aggregate from roads to intersections), probability distributions (extend from local regions to global), signals that integrate over regions.
Sheaf-Cosheaf Pairs in Neural Networks
A more expressive framework uses both sheaves and cosheaves simultaneously:
- A sheaf F (restriction maps) to encode node-to-edge relationships
- A cosheaf G (corestriction maps) to encode edge-to-node relationships
- Combined diffusion using both Δ_F and L_G
This gives a bipartite message-passing scheme where information flows down (node → edge via F) and up (edge → node via G) independently, with different maps for each direction.
Relation to HetGNN: Heterogeneous GNNs with separate message functions for each edge direction (in vs out) are a special case of sheaf-cosheaf pairs.
Computing Cosheaf Homology for Graph Learning
The key quantity for cosheaf-based GNNs is the null space of the cosheaf Laplacian ker(∂₀ᵀ ∂₀) = ker(∂₀ᵀ) — the “cosection” space of nodes whose data is orthogonal to all edge extensions.
For the constant cosheaf: ker(∂₀ᵀ) = ker(δ₀) = span{1_N} — constant node assignments. This is the same as the standard GCN null space.
For non-trivial cosheaf maps: ker(∂₀ᵀ) can be larger or smaller — analogous to the sheaf null space. Cosheaf GNNs can avoid oversmoothing via the same null space argument as sheaf GNNs.
References
- Curry, J. (2014). Sheaves, Cosheaves and Applications. PhD Thesis, Penn 2014 (rigorous treatment of cosheaves, their homology, and duality with sheaves — chapters 2 and 4 are the key references).
- Ghrist, R., & Robinson, M. (2011). Euler Characteristic Gauss-Bonnet Formula and Applications to Sheaves on Graphs. Preprint (Euler characteristic and duality for sheaves and cosheaves on graphs).
- Hansen, J., & Gebhart, T. (2020). Sheaf Neural Networks. NeurIPS 2020 GRL+ Workshop (briefly discusses the cosheaf dual perspective; focuses on the sheaf side for the neural network architecture).
