Dice Question Streamline Icon: https://streamlinehq.com

Generalizing Mathlib’s Graph structure to hypergraphs

Determine how to extend the Mathlib Graph structure, which currently uses a vertex carrier set and a binary incidence predicate IsLink: β → α → α → Prop, to support hypergraphs, for example by redefining the incidence predicate as IsLink: β → Set α → Prop.

Information Square Streamline Icon: https://streamlinehq.com

Background

The paper advocates representing graphs with carrier sets for vertices (and edges for multigraphs) to avoid frequent coercions that arise when modifying graphs (e.g., deletions, contractions, subdivisions). The presented Graph structure uses a vertexSet : Set α and a binary incidence predicate IsLink : β → α → α → Prop, together with symmetry and uniqueness conditions.

To support graphic matroids and broader graph-theoretic developments, the authors consider whether and how this design should be adapted for hypergraphs, where edges can be incident to more than two vertices. They suggest that one natural avenue is to generalize the incidence predicate to relate an edge to a set of vertices but explicitly mark this as unresolved.

References

As for hypergraphs, we would likely have to generalize the definition of Graph in some way, perhaps by having the IsLink relation defined as β → Set α → Prop. This is still an open question.

Structuring Definitions in Mathematical Libraries (2509.10828 - Gusakov et al., 13 Sep 2025) in Section III-D (Graphs), final paragraph