Formalizing Gröbner Basis Theory in Lean
Junyu Guo, Hao Shen, Junqi Liu, Lihong Zhi
TL;DR
This work presents a Lean 4 formalization of Gröbner basis theory built on Mathlib, extending to polynomial rings indexed by arbitrary types and to infinite-variable settings. It introduces a degree-with-bottom construction to fix zero-polynomial ambiguities, formalizes polynomial division and remainder, and develops the full Gröbner basis apparatus including Buchberger's criterion and reduced bases, with both finite and infinite-variable results. A key contribution is the finite–infinite variable bridge, using monomial-order embeddings and filter-based liminf constructions to characterize infinite Gröbner bases via finite reductions. The resulting framework provides a robust, reusable foundation for certified algebraic geometry and future formalizations in Lean, enabling reliable verification of polynomial-algebra algorithms in both finite and infinite contexts.
Abstract
We present a formalization of Gröbner basis theory in Lean 4, built on top of Mathlib's infrastructure for multivariate polynomials and monomial orders. Our development covers the core foundations of Gröbner basis theory, including polynomial division with remainder, Buchberger's criterion, and the existence and uniqueness of reduced Gröbner bases. We develop the theory uniformly for polynomial rings indexed by arbitrary types, enabling the treatment of Gröbner bases in rings with infinitely many variables. Furthermore, we connect the finite and infinite settings by showing that infinite-variable reduced Gröbner bases can be characterized via reduced Gröbner bases on finite-variable subrings through monomial-order embeddings and filter-based limit constructions.
