Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A scale-invariant first-digit distribution is Benford

Proved
BenfordLaw.benford_of_scale_invariant

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

benford-lawequidistributionleading-digits

Let XXX be a random variable on a probability space with X>0X > 0X>0 almost surely. Suppose the distribution of its first decimal digit does not depend on the unit of measurement, i.e. for every c>0c > 0c>0 and every digit ddd,

P(D10(cX)=d)=P(D10(X)=d).\mathbb P\big(D_{10}(cX) = d\big) = \mathbb P\big(D_{10}(X)=d\big).P(D10​(cX)=d)=P(D10​(X)=d).

Then the first digit follows Benford's law: for d∈{1,…,9}d\in\{1,\dots,9\}d∈{1,…,9},

P(D10(X)=d)=log⁡10 ⁣(1+1d).\mathbb P\big(D_{10}(X) = d\big) = \log_{10}\!\left(1+\frac1d\right).P(D10​(X)=d)=log10​(1+d1​).

This turns the informal "units do not matter" argument of the source into a theorem.

Preamble
import Mathlib
import Definitions.Def_BenfordLaw_Defs
Formal statement
namespace BenfordLaw

theorem benford_of_scale_invariant {Ω : Type*} [MeasurableSpace Ω]
    (P : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure P]
    (X : Ω → ℝ) (hXm : Measurable X) (hXpos : ∀ᵐ ω ∂P, 0 < X ω)
    (hinv : ∀ c : ℝ, 0 < c → ∀ d : ℕ,
      P {ω | leadingDigit 10 (c * X ω) = d} = P {ω | leadingDigit 10 (X ω) = d})
    (d : ℕ) (hd1 : 1 ≤ d) (hd9 : d ≤ 9) :
    (P {ω | leadingDigit 10 (X ω) = d}).toReal = benfordProb 10 d := by sorry

end BenfordLaw
Source
Wikipedia, "Benford's law" (https://en.wikipedia.org/wiki/Benford%27s_law), snapshot uploaded by the proposer, section "Invariance" ("When the distribution of the first digits of a data set is scale-invariant (independent of the units that the data are expressed in), it is always given by Benford's law", refs. Pinkham 1961, https://doi.org/10.1214/aoms/1177704862).
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Ω carry a σ\sigmaσ-algebra and a probability measure PPP, and let X:Ω→RX:\Omega\to\mathbb RX:Ω→R be measurable with X>0X>0X>0 PPP-a.e. Assume: for every real c>0c>0c>0 and every natural ddd (any ddd, including 000 and d≥10d \ge 10d≥10),

P{ω:⌊10{log⁡10(cX(ω))}⌋=d}=P{ω:⌊10{log⁡10X(ω)}⌋=d}P\{\omega : \lfloor 10^{\{\log_{10}(c X(\omega))\}}\rfloor = d\} = P\{\omega : \lfloor 10^{\{\log_{10} X(\omega)\}}\rfloor = d\}P{ω:⌊10{log10​(cX(ω))}⌋=d}=P{ω:⌊10{log10​X(ω)}⌋=d}

(equality in [0,∞][0,\infty][0,∞]). Then for every natural ddd with 1≤d≤91\le d\le 91≤d≤9, P{ω:⌊10{log⁡10X(ω)}⌋=d}P\{\omega : \lfloor 10^{\{\log_{10}X(\omega)\}}\rfloor = d\}P{ω:⌊10{log10​X(ω)}⌋=d}, as a real number, equals log⁡10(1+1/d)\log_{10}(1+1/d)log10​(1+1/d).

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