A Lean 4 Formalization of Euclidean Domain Algorithms from a 1986 Icon Experimentation Package

๐Ÿ“… 2026-06-13
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
This work presents the first complete formal verification in Lean 4 of the informal Euclidean domain algorithms originally described in the 1986 ICON language. By separating concerns into mathematical definitions, computable implementations, and output formatting, the project constructs a computable mirror atop Mathlibโ€™s `EuclideanDomain` hierarchy and integrates a regression testing infrastructure to reproduce the original outputs. All 14 algorithms are formally specified, with core procedures such as integer GCD and the extended Euclidean algorithm accompanied by machine-checked correctness proofs. The formalization precisely delineates the boundaries between computability and mathematical correctness while fully replicating the benchmark results reported in Ericsonโ€™s technical report.
๐Ÿ“ Abstract
We describe a Lean 4 formalization of the algorithms and domain types from NYU Computer Science Technical Report \#232, \emph{An ICON Package for Experimenting with Euclidean Domains} (Ericson, 1986). The original system implemented Lipson's catalog of procedures over integers, rationals, modular rings, polynomial rings, and truncated power series via a custom runtime dispatch mechanism in Icon. The present work separates three concerns: mathematical definitions grounded in Mathlib's \texttt{EuclideanDomain} hierarchy, computable mirrors suitable for evaluation and regression testing, and report-formatting infrastructure that reproduces the 1986 benchmark output line-for-line. All fourteen application algorithms from Section 3 of the report are defined and typecheck without \texttt{sorry}; those grounded in Mathlib -- chiefly integer gcd and extended Euclid -- additionally carry machine-checked proofs. We classify each procedure by its epistemic status relative to Mathlib, enumerate the coherence obligations between the proof and computable layers, and state precisely what is theorem-backed versus regression-trusted. The formalization makes explicit the verification boundary that the 1986 package crossed only informally.
Problem

Research questions and friction points this paper is trying to address.

Euclidean Domain
Formalization
Verification
Lean 4
Algorithm Correctness
Innovation

Methods, ideas, or system contributions that make the work stand out.

Lean 4
Euclidean Domain
formal verification
Mathlib
regression testing