Manuscript Offprint

arXiv:2610.02500

Proving at Scale for Universal Algebra

João Araújo, Jan Hůla, Mikoláš Janota, Edmond W. H. Lee, Bartosz Naskręcki

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We introduce SEMIBASE, a project that computes and formally certifies finite identity bases for small semigroups. Deciding finite basability is undecidable for finite algebras and remains open for finite semigroups. The task requires a proof that a candidate basis is complete, or a proof that none exists, rather than a single first-order validity query. LLM-guided agents search for these proofs; a referee agent rebuilds them from source, and the Lean kernel checks the resulting corpus in a final audit. Humans choose targets and approve final outcomes. We certify every semigroup of order at most 6: all 1,309 semigroups of order at most 5 and all 15,973 of order 6, including proofs that the four known nonfinitely based semigroups have no finite basis. The bases for order 6 define 505 distinct varieties, whose inclusion order Vampire determines except for four pairs. The resulting catalogue is a machine-checked account of results scattered across the literature and a tested foundation for order 7.

1 Introduction

Tarski [1968] asks the following question about a given finite algebra: can all identities that hold in it be described by a finite set of identities? Consider, for example, the group Z2Z_2 with addition modulo 2. In addition to the group axioms, it satisfies the identity x+x=0x + x = 0. It also satisfies x+x+x+x=0x + x + x + x = 0, but this is a simple consequence of the former; in fact, every identity of the group follows from it. The group Z2Z_2 therefore has a finite basis consisting of a single identity, assuming the group axioms. Oates and Powell [1964] show that finite groups always have a finite basis. McKenzie [1996] shows that given a finite algebra as input, deciding whether it has a finite basis is undecidable.

The project SEMIBASE tackles the finite-basis problem for finite semigroups, a setting that has been studied extensively; see the surveys of Volkov [2001] and Araújo et al. [2023]. The smallest nonfinitely based semigroups have 6 elements; in fact, there are only 4 distinct nonfinitely based semigroups of that order as shown by Lee et al. [2012]. A complete catalogue of nonfinitely based semigroups of order 7 is not yet known. In general, it is not known whether the existence of a finite basis is decidable, but it is believed to be undecidable. This provides a setting for our project to explore the frontiers of what is known about small semigroups.

The project is building a catalogue in which each covered semigroup is equipped with either a certified finite basis or a certified proof that it does not have one. Proofs are carried out in Lean 4 [Moura and Ullrich, 2021]. Currently, the project covers all 1,309 semigroups of order at most 5 and all 15,973 semigroups of order 6. The work was done by language-model agents. At our direction they wrote

Preprint.

Table 1: Number of distinct semigroups per order, and how many of them are nilpotent.

OrderSemigroupsNilpotent3-nilpotent
1110
2410
31821
4126108
51,1609384
615,9732,8132,660
7836,021616,830609,797

the scripted pipeline that settled most of the catalogue; they proposed candidate bases and searched for counter-models to them, wrote the proofs shared by families of semigroups and the generators of the individual proofs, and ran every build. Humans chose which semigroups to attack, approved changes to the repository and restarted stalled agents, with about 1,100 prompts over three months (Appendix C). Mathematicians working on the finite basis problem stay in the loop [Avigad, 2026].

To our knowledge, SEMIBASE is unique in using an autonomous, agent-driven workflow to pursue a systematic classification of finite identity bases for small semigroups. A useful comparison is the Equational Theories Project (ETP), a large-scale, machine-assisted study of equational reasoning whose results are checked in Lean. ETP determined the implication relations among laws on magmas by combining human-generated proofs and constructions with automated theorem provers and other computational tools [Bolan et al., 2025]. Subsequent experiments showed that Vampire proves every valid implication in this benchmark and refute the vast majority of the invalid ones [Janota, 2025]. The projects differ primarily in how their search spaces are organized. ETP studies a fixed finite graph of implications between individual laws, whereas SEMIBASE organizes instances by finite semigroup and asks whether the semigroup's full equational theory has a finite basis. This requires producing a candidate basis and certifying its completeness, or proving that no finite basis exists. COPRA [Thakur et al., 2023] runs a language model inside a backtracking proof search and retrieves lemmas from a library, and LEGO-Prover [Wang et al., 2023] grows its own library of verified lemmas; our family proofs and shared library play the role of such a library at the scale of a catalogue. Studies of language models as proof checkers find their verdicts sensitive to the prompt and to the form of the proof [Naik et al., 2026, Mazdarani and Toxtli, 2026]. Our referee agent is therefore not trusted to verify: it triages work and settles disputes, but a class is accepted only when the Lean kernel re-checks its proof in the whole-corpus audit.

Our contributions are the following. (i) Lean proofs, rebuilt from source in a single audit, that each semigroup of order at most 6 has a finite basis or, for four semigroups of order 6, none; to our knowledge this is the first machine-checked account of a classification that so far existed only across the literature [Lee and Zhang, 2015, Araújo et al., 2023]. (ii) The inclusion order of the 505 varieties generated by the finitely based semigroups of order 6, computed with Vampire [Bártek et al., 2025] up to four open cases, and 289 hard unit-equality problems met on the way, prepared for the TPTP library [Sutcliffe, 2017]. (iii) A description of the agent workflow and its acceptance procedure, with measured effort, failure rates and the case where the agents stalled.

References (33)