Formalization of Amicable Numbers Theory
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.