Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Binary Word C L T

Definition
AnalyticCombinatorics_Ch9_LimitLaws_BinaryWordCLT

by FormallyCorrect · Oct 28, 2026 · Mathlib 777aaa6 (Lean v4.29.0-rc3)

analytic-combinatoricslean4limit-laws

The mathematical objects and operations are specified by the following source definitions.

abbrev Ω (n : ℕ) := Fin n → ℝ
def P (n : ℕ) : Measure (Ω n) :=
  Measure.pi (fun _ : Fin n => oneBitSignLaw)
def S (n : ℕ) (ω : Ω n) : ℝ :=
  ∑ i, ω i
def X (n : ℕ) (ω : Ω n) : ℝ :=
  (S n ω + n) / 2
def oneBitSignLaw : Measure ℝ :=
  ENNReal.ofReal (1 / 2 : ℝ) • (Measure.dirac (-1 : ℝ) + Measure.dirac (1 : ℝ))
Definition code
import Mathlib
import Mathlib.MeasureTheory.Function.ConvergenceInDistribution

set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3


/-!
# Binary word counts and the local quasi-powers interface

The one-bit uniform binary-word count has characteristic function zero at `π`.
Consequently it cannot satisfy a global exponential-form `hChar` assumption, whose
right hand side is a complex exponential and therefore never zero.

The binary-word central limit theorem below uses the faithful local interface from
`QuasiPowers.lean`.  We encode bits as signs `-1, 1`; the number of ones in a word is
`(sum of signs + n) / 2`, so the usual count normalization is pointwise equal to the
standardized sign sum.
-/

noncomputable section

open Complex Filter MeasureTheory ProbabilityTheory

open scoped Topology

namespace AnalyticCombinatorics
namespace Ch9
namespace LimitLaws

/-- The one-bit sign law, using `-1` for zero and `1` for one. -/
def oneBitSignLaw : Measure ℝ :=
  ENNReal.ofReal (1 / 2 : ℝ) • (Measure.dirac (-1 : ℝ) + Measure.dirac (1 : ℝ))

instance oneBitSignLaw_isProbabilityMeasure : IsProbabilityMeasure oneBitSignLaw := by
  rw [oneBitSignLaw]
  constructor
  simp [ENNReal.inv_two_add_inv_two]

/-- Binary words of length `n`, sign-coded as coordinates in `{-1, 1}`. -/
abbrev Ω (n : ℕ) := Fin n → ℝ

/-- Product measure for a uniform sign-coded binary word. -/
def P (n : ℕ) : Measure (Ω n) :=
  Measure.pi (fun _ : Fin n => oneBitSignLaw)

instance P_isProbabilityMeasure (n : ℕ) : IsProbabilityMeasure (P n) := by
  unfold P
  infer_instance

/-- Sum of signs in a sign-coded binary word. -/
def S (n : ℕ) (ω : Ω n) : ℝ :=
  ∑ i, ω i

/-- Number of ones in a sign-coded binary word. -/
def X (n : ℕ) (ω : Ω n) : ℝ :=
  (S n ω + n) / 2

end LimitLaws
end Ch9
end AnalyticCombinatorics
Source
https://github.com/xiangyazi24/AnalyticCombinatorics/blob/f6f3f1cebdae245a61d9d71e6b47c69fbd096fe3/AnalyticCombinatorics/Ch9/LimitLaws/BinaryWordCLT.lean. Source code: Apache-2.0; https://github.com/xiangyazi24/AnalyticCombinatorics/blob/f6f3f1cebdae245a61d9d71e6b47c69fbd096fe3/LICENSE

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