Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Leading digits of Zipf (s=1s=1s=1) data follow Benford's law

Proved
ZipfLaw.zipf_one_leadingDigit_benford

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

harmonic-numberspower-lawzipf-law

Let KNK_NKN​ be a random rank drawn from the Zipf distribution with s=1s=1s=1 on {1,…,N}\{1,\dots,N\}{1,…,N}, P(KN=k)=1HN k\mathbb P(K_N=k)=\frac{1}{H_N\,k}P(KN​=k)=HN​k1​. For every digit d∈{1,…,9}d\in\{1,\dots,9\}d∈{1,…,9}, the probability that the leading decimal digit of KNK_NKN​ equals ddd tends to the Benford probability:

lim⁡N→∞∑1≤k≤ND10(k)=d1HN k=log⁡10 ⁣(1+1d).\lim_{N\to\infty}\sum_{\substack{1\le k\le N\\ D_{10}(k)=d}}\frac{1}{H_N\,k}=\log_{10}\!\left(1+\frac1d\right).N→∞lim​1≤k≤ND10​(k)=d​∑​HN​k1​=log10​(1+d1​).

Formalization Note. The source's sentence does not say which numbers' leading digits are meant; this item reads it as the leading digits of the ranks kkk when kkk occurs with Zipf (s=1s=1s=1) frequency ∝1/k\propto 1/k∝1/k. (The other reading, the leading digits of the values C/kC/kC/k for k=1,…,Nk = 1, \dots, Nk=1,…,N counted once each, is the reciprocal sequence, which does not satisfy Benford's law.)

Preamble
import Mathlib
import Definitions.Def_ZipfLaw_Defs
Formal statement
namespace ZipfLaw

theorem zipf_one_leadingDigit_benford (d : ℕ) (hd1 : 1 ≤ d) (hd9 : d ≤ 9) :
    Filter.Tendsto
      (fun N : ℕ => ∑ k ∈ (Finset.Icc 1 N).filter (fun k => leadingDigit k = d), zipfPMF N 1 k)
      Filter.atTop (nhds (Real.logb 10 (1 + 1 / (d : ℝ)))) := by sorry

end ZipfLaw
Source
Wikipedia, "Zipf's law" (https://en.wikipedia.org/wiki/Zipf%27s_law), snapshot uploaded by the proposer, section "Related laws" ("The leading digits of data satisfying Zipf's law with s = 1, satisfy Benford's law").
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.

For every natural ddd with 1≤d≤91\le d\le91≤d≤9: as N→∞N\to\inftyN→∞ (naturals),

∑k∈{1,…,N}leadingDigit(k)=dzipfPMF(N,1,k)⟶log⁡10(1+1/d),\sum_{\substack{k\in\{1,\dots,N\}\\ \mathrm{leadingDigit}(k)=d}}\mathrm{zipfPMF}(N,1,k)\longrightarrow\log_{10}(1+1/d),k∈{1,…,N}leadingDigit(k)=d​∑​zipfPMF(N,1,k)⟶log10​(1+1/d),

where leadingDigit(k)=kdiv⁡10⌊log⁡10k⌋\mathrm{leadingDigit}(k)=k\operatorname{div}10^{\lfloor\log_{10}k\rfloor}leadingDigit(k)=kdiv10⌊log10​k⌋ (natural numbers) and zipfPMF(N,1,k)=1/(k HN)\mathrm{zipfPMF}(N,1,k)=1/(k\,H_N)zipfPMF(N,1,k)=1/(kHN​) for 1≤k≤N1\le k\le N1≤k≤N.

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