- The paper introduces a Lean 4 formalization of chip-firing and the combinatorial Riemann–Roch theorem for finite graphs.
- The methodology leverages inductive proofs, recursion, and acyclic orientations to establish essential lemmas and dualities.
- The work bridges combinatorial graph theory with algebraic geometry, laying the groundwork for extending formalized Brill–Noether results.
Overview
The paper "Formalizing chip-firing and Riemann--Roch for graphs in Lean 4" (2606.16679) presents a comprehensive formalization, implemented in Lean 4, of the combinatorial Riemann--Roch theorem for finite graphs. This theorem, due to Baker and Norine, establishes a deep analogy between the chip-firing dynamics on graphs and classical results from algebraic geometry underlying compact Riemann surfaces. The paper rigorously develops the necessary graph-theoretical structures, algorithms, and proofs to verify the Riemann--Roch theorem and its corollaries in a machine-checkable manner. The implementation strategically leverages the Lean theorem prover’s capabilities for inductive arguments, recursion, and abstraction, with substantial integration of Mathlib.
The authors develop custom Lean 4 types encapsulating divisors, configurations, graph orientations, and their respective operations. A finite, connected loopless multigraph G=(V,E) is modeled, with interactions abstracted through its adjacency matrix. Divisors on G are elements of the free abelian group $\Div(G)$, interpreted as integer-valued chip allocations over V. Linear equivalence of divisors is operationalized via the subgroup of principal divisors, corresponding to chip-firing sequences.
Configurations, particularly superstable configurations, are crucial for tracking chip redistribution with respect to a marked sink vertex q. The paper makes practical representational choices in Lean, enforcing nonnegativity and efficient conversion between divisors and configurations. The Baker--Norine rank function r(D) is defined nonconstructively in Lean via the axiom of choice, given its NP-hard computability, yet its properties are rigorously captured via auxiliary interface lemmas.
Proof Strategy for the Riemann--Roch Theorem
The central result formalized is the Riemann--Roch theorem for graphs:
r(D)−r(K−D)=deg(D)+1−g
for any divisor D on a connected graph G of genus g and canonical divisor G0. The formalization follows the combinatorial proof strategy from Corry and Perkinson, progressing through the establishment of a duality of maximal unwinnable divisors ("moderators"), and leveraging symmetry properties of acyclic graph orientations.
Key lemmas prove:
- An essential bound on G1 in terms of G2 (Lemma~\ref{lem:RRineq}).
- The construction and properties of moderators, showing every maximal unwinnable divisor is linearly equivalent to a moderator, and G3.
- The existence and uniqueness of G4-reduced representatives in every divisor class, crucial for canonical forms.
Algorithmic and Inductive Components
The authors provide formal inductive proofs for existence and uniqueness of G5-reduced divisors, using recursion to concentrate chip "debt" and iteratively apply chip-firing moves. The implementation closely mimics algorithmic processes, but remains abstract due to computational hardness. Dhar's burning algorithm is formally encapsulated, producing a canonical "burn list" corresponding to the order in which vertices "catch on fire," yielding acyclic orientations. This ties chip-firing combinatorics directly to acyclic orientation spaces, establishing bijections essential for maximal superstable configurations and moderator construction.
Orientations, Superstable Configurations, and Duality
A core achievement is the explicit formalization of the bijection between acyclic orientations with unique source G6 and maximal superstable configurations. Moderators are defined as divisors arising from these orientations, and the formalization verifies their degree, unwinnability, and duality under G7. The symmetry is realized concretely through reversing acyclic orientations, and the relationship is exact in Lean syntax.
Lean manages subtleties such as sum manipulations, abelian group structures, and multi-level mappings between divisors and configurations. The formalization also demonstrates that every unwinnable divisor admits a reduction to a moderator via effective adjustments, tracked precisely by firing sequences.
Implications and Future Directions
The work makes formal graph-theoretic Brill--Noether theory within reach, including the tropical proof techniques for Brill--Noether theorems using chains of loops. The repository explicitly states four key conjectures of Baker as formalization challenges for later work: maximal gonality existence, Brill--Noether generality, the (open) gonality conjecture, and the (open) Brill--Noether conjecture for graphs.
The practical integration of chip-firing formalizations into the Mathlib ecosystem is an important, attainable milestone, potentially enabling downstream formal proofs in combinatorics, algebraic geometry, and tropical mathematics. The approach suggests that Lean's inductive and recursive reasoning aligns well with the inherently combinatorial structure of chip-firing, and the explicit abstraction of moderators and configurations provides a robust basis for further formalization and verification.
Conclusion
This formalization establishes a rigorous, extensible foundation for the combinatorial Riemann--Roch theorem in Lean 4 (2606.16679), encompassing all technical aspects required for machine verification. The design choices and inductive strategies highlight the suitability of Lean for deep combinatorial arguments and graph-theoretic analogues of algebraic geometry. With explicit formal statements for ongoing conjectures and challenges, the repository stands as a critical resource for formal mathematics, advancing both theoretical understanding and practical verification capabilities for chip-firing, divisor theory, and tropical correspondence in graphs. Future developments will likely target algorithmic realization of rank computations, formalization of Brill--Noether phenomena, and broader integration into formalized mathematical libraries.