A Prime-Generated Formalization of Nagata’s Factoriality Theorem in Lean 4

Arthur F. Ramos, Ruy J. G. B. de Queiroz, Anjolina G. de Oliveira · 2026

Read A Prime-Generated Formalization of Nagata’s Factoriality Theorem in Lean 4 by Arthur F. Ramos, Ruy J. G. B. de Queiroz, Anjolina G. de Oliveira (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-05238.txt.

Introduction

Ramos, de Queiroz, and de Oliveira present Lean 4 work on Nagata's factoriality theorem. If R is a domain and S has S-inverse-R a UFD, then R is a UFD. The hypothesis, that every element of S is a finite product of primes in S, replaces a condition. It is packaged for Localization S and through IsLocalization formulations. They formalize two proofs that polynomial rings over UFDs are UFDs: via localization at powers of X and at primes to fractions. They also obtain the corollary for two variables.

Catalog record

CREATORArthur F. Ramos, Ruy J. G. B. de Queiroz, Anjolina G. de Oliveira
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE62899
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2604.05238

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

A Prime-Generated Formalization of Nagata’s Factoriality Theorem in Lean 4 Arthur F. Ramos, Ruy J. G. B. de Queiroz, Anjolina G. de Oliveira Abstract We present, to our knowledge, the first public Lean 4 / Mathlib formalization of Nagata’s factoriality theorem: if R R is a noetherian domain and S ⊆ R S\subseteq R is a prime-generated submonoid such that S − 1 ​ R S^{-1}R is a UFD, then R R is a UFD. The development is organized around reusable transfer lemmas and packages the theorem both for the concrete type Localization S and at the abstract IsLocalization level. As applications, we formalize two structurally distinct Nagata-based proofs that R ⁡ [ X ] R[X] is a UFD whenever R R is a noetherian UFD: one via Laurent-polynomial localization at powers of X X , and one via localization at the constant primes and comparison with Frac ⁡ ( R ) ​ [ X ] \operatorname{Frac}(R)[X] . The formalization also replaces a degenerate “prime-or-unit” variant by the mathematically correct prime-generated hypothesis exposed by the proof effort, and it yields the iterated polynomial corollary R ​ [ X ] ​ [ Y ] R[X][Y] . Keywords. Formalized mathematics, Lean 4, Mathlib, commutative algebra, localization, unique factorization domains, Nagata’s theorem. MSC2020. Primary 03B35; Secondary 13A05, 13B30. 1 Introduction Nagata’s factoriality theorem is a classical tool in commutative algebra that recovers unique factorization in a base ring from unique factorization in a suitable localization. In a standard textbook presentation [ 12 , 14 , 9 , 5 ] , the theorem states that if R is a noetherian integral domain, S\subseteq R is a multiplicative set whose elements factor into primes in R , and the localization S^{-1}R is a UFD, then R itself is a UFD. The argument connects localization, irreducibility, primality, and noetherianity in a way that is both algebraically instructive and technically nontrivial. The theorem occupies a distinctive position in the landscape of formalization targets. It is short enough to be self-contained—the informal proof fits comfortably on a single page—yet it requires careful coordination of several pieces of algebraic infrastructure: localization of rings at a submonoid, transfer of divisibility across the localization map, interaction between irreducibility and primality in integral domains, and the characterization of UFDs as noetherian domains in which every irreducible is prime. It is also a gateway result: one of its immediate applications is to prove that R[X] is a UFD whenever R is, via localization at powers of the indeterminate. Motivation and scope. We describe a Lean 4 formalization, built on Mathlib [ 7 ] , that packages a complete proof of Nagata’s theorem together with a worked application establishing unique factorization for polynomial rings. The formalization grew out of an attempt to close a gap in Mathlib’s coverage of classical factoriality results: while the library provides extensive infrastructure for unique factorization, localization, and polynomial algebra, no Nagata-style transfer theorem was available. Nagata’s theorem is an attractive formalization target for several reasons. It is compact enough to be self-contained in a modest development, yet it forces nontrivial interaction between three pillars of commutative algebra: localization, the noetherian condition, and unique factorization. The proof demands transfer lemmas that move divisibility, irreducibility, and primality across the localization map—exactly the kind of multi-step reasoning where formalization provides high assurance. Moreover, its immediate corollary for polynomial rings makes it a practically useful building block. During the formalization we found that an earlier prime-or-unit version of the statement collapses for submonoids with more than one non-unit prime generator. The present development therefore adopts the mathematically correct prime-generated hypothesis and rebuilds the supporting machinery around that formulation. Section 2 explains the algebraic issue, and Section 8 returns to the proof-engineering lesson. Contributions. The main contributions are: 1. To the best of our knowledge, the first public formalization of Nagata’s factoriality theorem, stated under the correct prime-generated hypothesis on the multiplicative set (§ 3 ). 2. A reusable theorem surface that combines concrete Localization S statements, abstract IsLocalization formulations, and packaged entry points for prime-generator closures (§ 3 ). 3. Two structurally distinct Nagata-based routes to the polynomial UFD theorem—via Laurent localization and via the fraction field—together with an iterated polynomial corollary obtained by reusing the same package (§ 7 ). The development also shows how formalization can sharpen hypothesis design: the shift from prime-or-unit to prime-generated was not cosmetic, but required to state the theorem at the right level of generality. Outline. Section 2 reviews the mathematical background. Section 3 gives the formal statement. Section 4 describes the proof architecture. Section 5 presents the key Lean declarations verbatim. Section 6 discusses file organization and API design. Section 7 presents the two main applications. Section 8 draws proof-engineering and mathematical lessons. Section 9 surveys related work. Section 10 discusses prospective Mathlib contributions. Section 11 describes the artifact. Section 12 concludes. 2 Mathematical background We briefly recall the algebraic ingredients that enter the Nagata argument, with an emphasis on the points most relevant to formalization. 2.1 Localization at a multiplicative submonoid Let R be a commutative ring and S\subseteq R a multiplicative submonoid (i.e., 1\in S and S is closed under multiplication). The localization of R at S , written S^{-1}R , is the ring of fractions a/s with a\in R and s\in S , subject to the equivalence relation a/s=b/t iff there exists u\in S with u(at-bs)=0 . When R is an integral domain and 0\notin S , the relation simplifies to at=bs . The ring homomorphism \iota\colon R\to S^{-1}R sending a\mapsto a/1 is injective precisely when S consists of non-zero-divisors, which is automatic for a domain with 0\notin S . Every s\in S becomes a unit in S^{-1}R since (s/1)\cdot(1/s)=1 . This is the key property that the Nagata argument exploits: denominators from S can be “cleared” in S^{-1}R . 2.2 Unique factorization domains A commutative integral domain R is a unique factorization domain (UFD) if every nonzero non-unit element can be written as a finite product of irreducible elements, and this factorization is essentially unique (up to reordering and multiplication by units). An equivalent characterization, which is the one used in our formalization, is: Proposition 2.1 . A commutative integral domain R is a UFD if and only if: 1. R is a well-founded divisibility monoid ( i.e., every element admits a factorization into irreducibles ) , and 2. every irreducible element of R is prime. Condition (1) is automatic in any noetherian domain, since the ascending chain condition prevents infinite chains of proper divisors. The Nagata argument therefore reduces to establishing condition (2): every irreducible is prime. 2.3 The classical Nagata argument Let R be a noetherian integral domain, S\subseteq R a submonoid whose elements factor into primes, and suppose S^{-1}R is a UFD. We must show that every irreducible p\in R is prime. Two cases arise. Case 1: p divides some s\in S . Because s factors as a product of primes belonging to S and p is irreducible, p must be associate to one of those prime factors, hence prime. Case 2: p does not divide any element of S . Then the image p/1 in S^{-1}R is not a unit and remains irreducible. Since S^{-1}R is

Read the complete text