Formalization of Amicable Numbers Theory

📅 2026-01-12
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work presents the first complete formalization of amicable number theory in Lean 4, addressing a longstanding gap in formal proof systems. It introduces rigorous definitions of proper divisors, the sum-of-divisors function, and amicable pairs, and formally verifies Thābit’s formula, Euler’s generalization, and—novelly—the Borho–Hoffmann multiplication method, the latter constituting its first machine-checked proof. The development extends to sociable and betrothed numbers, culminating in a modular 2,076-line codebase comprising 139 theorems. Leveraging tactics such as zify and ring, the framework supports reasoning about divisor sums, multiplicativity, and coprimality, enabling the verification of Poulet’s fifth-order sociable cycle, classical amicable pairs, and a lower bound (>10⁶⁵) for coprime amicable pairs. The library is structured for seamless integration into Mathlib.

Technology Category

Application Category

📝 Abstract
This paper presents a formalization of the theory of amicable numbers in the Lean~4 proof assistant. Two positive integers $m$ and $n$ are called an amicable pair if the sum of proper divisors of $m$ equals $n$ and the sum of proper divisors of $n$ equals $m$. Our formalization introduces the proper divisor sum function $\propersum(n) = \sigma(n) - n$, defines the concepts of amicable pairs and amicable numbers, and computationally verifies historically famous amicable pairs. Furthermore, we formalize basic structural theorems, including symmetry, non-triviality, and connections to abundant/deficient numbers. A key contribution is the complete formal proof of the classical Th\={a}bit formula (9th century), using index-shifting and the \texttt{zify} tactic. Additionally, we provide complete formal proofs of both Th\={a}bit's rule and Euler's generalized rule (1747), two fundamental theorems for generating amicable pairs. A major achievement is the first complete formalization of the Borho-Hoffmann breeding method (1986), comprising 540 lines with 33 theorems and leveraging automated algebra tactics (\texttt{zify} and \texttt{ring}) to verify complex polynomial identities. We also formalize extensions including sociable numbers (aliquot cycles), betrothed numbers (quasi-amicable pairs), parity constraint theorems, and computational search bounds for coprime pairs ($>10^{65}$). We verify the smallest sociable cycle of length 5 (Poulet's cycle) and computationally verify specific instances. The formalization comprises 2076 lines of Lean code organized into Mathlib-candidate and paper-specific modules, with 139 theorems and all necessary infrastructure for divisor sum multiplicativity and coprimality reasoning.
Problem

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

amicable numbers
formalization
Thābit formula
sociable numbers
divisor sum
Innovation

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

formalization
amicable numbers
Lean 4
Borho-Hoffmann method
Thābit formula
🔎 Similar Papers
No similar papers found.
Zhipeng Chen
Zhipeng Chen
Ph.D student, GSAI, Renmin University of China
Natural Language ProcessingPre-trained Language ModelLarge Language Model
H
Haolun Tang
School of Electronics and Information, Shanghai Dianji University, Shanghai 201306, China
J
Jingyi Zhan
School of Electronics and Information, Shanghai Dianji University, Shanghai 201306, China