Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Uniform {log⁡bX}\{\log_b X\}{logb​X} implies the first-digit law

Proved
BenfordLaw.benford_of_uniform_log_mantissa

by Lucas · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

benford-lawequidistributionleading-digits

Let b≥2b\ge2b≥2 and let XXX be a random variable on a probability space (Ω,F,P)(\Omega,\mathcal F,\mathbb P)(Ω,F,P) such that X>0X > 0X>0 almost surely and the fractional part {log⁡bX}\{\log_b X\}{logb​X} is uniformly distributed on [0,1)[0,1)[0,1). Then for every digit d∈{1,…,b−1}d\in\{1,\dots,b-1\}d∈{1,…,b−1},

P(Db(X)=d)=log⁡b ⁣(1+1d).\mathbb P\big(D_b(X) = d\big) = \log_b\!\left(1+\frac1d\right).P(Db​(X)=d)=logb​(1+d1​).

This is the derivation of Benford's law from its strong form stated in the source.

Formalization Note. The hypothesis is HasUniformLogMantissa b P X; it includes measurability of XXX and forces P\mathbb PP to be a probability measure. The probability is stated as (P {ω | leadingDigit b (X ω) = d}).toReal.

Preamble
import Mathlib
import Definitions.Def_BenfordLaw_Defs
Formal statement
namespace BenfordLaw

theorem benford_of_uniform_log_mantissa {Ω : Type*} [MeasurableSpace Ω]
    (b : ℕ) (hb : 2 ≤ b) (P : MeasureTheory.Measure Ω) (X : Ω → ℝ)
    (hX : HasUniformLogMantissa b P X) (d : ℕ) (hd1 : 1 ≤ d) (hdb : d < b) :
    (P {ω | leadingDigit b (X ω) = d}).toReal = benfordProb b d := by sorry

end BenfordLaw
Source
Wikipedia, "Benford's law" (https://en.wikipedia.org/wiki/Benford%27s_law), snapshot uploaded by the proposer, section "Definition" ("this is the distribution expected if the logarithms of the numbers ... are uniformly and randomly distributed"; "Benford's law is sometimes stated in a stronger form ...").
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) - non-blind, same agent as the drafter

Non-blind read-back — not independent testimony. This read-back was written by the same agent (Aristotle, by Harmonic) that drafted the Lean statement, with full knowledge of the source article and of the intended meaning. It is not a blind audit by an independent reader, and no reviewer should treat it as one. Please compare it against the Lean code yourself.

Let Ω\OmegaΩ be any type with a σ\sigmaσ-algebra, PPP any measure on it, X:Ω→RX:\Omega\to\mathbb RX:Ω→R, and bbb a natural number with b≥2b\ge2b≥2. Assume HasUniformLogMantissa(b,P,X)\mathrm{HasUniformLogMantissa}(b,P,X)HasUniformLogMantissa(b,P,X): XXX is measurable, X>0X>0X>0 PPP-a.e., and the pushforward of PPP under ω↦{log⁡bX(ω)}\omega\mapsto\{\log_b X(\omega)\}ω↦{logb​X(ω)} is Lebesgue measure on [0,1)[0,1)[0,1). Then for every natural ddd with 1≤d<b1\le d<b1≤d<b,

P({ω:⌊b{log⁡bX(ω)}⌋=d}) (converted from [0,∞] to R)=log⁡b(1+1/d).P\big(\{\omega : \lfloor b^{\{\log_b X(\omega)\}}\rfloor = d\}\big) \text{ (converted from } [0,\infty] \text{ to } \mathbb R) = \log_b(1+1/d).P({ω:⌊b{logb​X(ω)}⌋=d}) (converted from [0,∞] to R)=logb​(1+1/d).

The conversion maps ∞\infty∞ to 000, but the measure here is at most 111.

Human review
  • Endorsed by Shuze Chen · Oct 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 10, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me