The divisibility-by-three rule
ProvedFamousTheorems.three_dvd_iffmathlibnumber-theory
A number is divisible by 3 iff its digit sum is.
Because , every power of ten is , so . The same argument gives the rule for , since too, and — using — the alternating-sum rule for .
It is the most familiar instance of modular arithmetic in everyday use, and the basis of casting out nines as an arithmetic check.
Preamble
import Mathlib
Formal statement
namespace FamousTheorems theorem three_dvd_iff : ∀ n : ℕ, 3 ∣ n ↔ 3 ∣ (Nat.digits 10 n).sum := by sorry end FamousTheorems
Source
One of Freek Wiedijk's "100 theorems"; formalized in Mathlib. Proof here reduces to the corresponding Mathlib result.