Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Example 1.1, (1.9), p. 698 — the Metropolis chain for the binomial distribution is the kernel (1.9) and is reversible

Proved
LogSobolevMC.Metropolis.example_1_1

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

binomial-distributionmarkov-chainsmetropolis-algorithmp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1reversibility

Let n≥1n\ge 1n≥1, X={0,…,n}\mathcal X=\{0,\dots,n\}X={0,…,n}, π(x)=2−n(nx)\pi(x)=2^{-n}\binom nxπ(x)=2−n(xn​), and let MMM be the Metropolis chain built from the nearest-neighbour walk KKK (with holding 1/21/21/2 at 000 and nnn) and π\piπ: M(x,y)=K(x,y)min⁡{1,π(y)/π(x)}M(x,y)=K(x,y)\min\{1,\pi(y)/\pi(x)\}M(x,y)=K(x,y)min{1,π(y)/π(x)} for y≠xy\ne xy=x and M(x,x)=1−∑y≠xM(x,y)M(x,x)=1-\sum_{y\ne x}M(x,y)M(x,x)=1−∑y=x​M(x,y). Then MMM is a Markov kernel, it is given by

M(x,y)={12,y=x+1, 0≤x≤n−12, or y=x−1, n+12≤x≤n,x2(n−x+1),y=x−1, 1≤x≤n+12,n−x2(x+1),y=x+1, n−12≤x≤n−1,n−2x+12(n−x+1),y=x, 0≤x≤n−12,2x−n+12(x+1),y=x, n+12≤x≤n,2n+2,y=x=n2 (n even),M(x,y)=\begin{cases}\tfrac12, & y=x+1,\ 0\le x\le \tfrac{n-1}2,\ \text{or } y=x-1,\ \tfrac{n+1}2\le x\le n,\\[2pt] \dfrac{x}{2(n-x+1)}, & y=x-1,\ 1\le x\le\tfrac{n+1}2,\\[2pt] \dfrac{n-x}{2(x+1)}, & y=x+1,\ \tfrac{n-1}2\le x\le n-1,\\[2pt] \dfrac{n-2x+1}{2(n-x+1)}, & y=x,\ 0\le x\le\tfrac{n-1}2,\\[2pt] \dfrac{2x-n+1}{2(x+1)}, & y=x,\ \tfrac{n+1}2\le x\le n,\\[2pt] \dfrac{2}{n+2}, & y=x=\tfrac n2\ (n\text{ even}),\end{cases}M(x,y)=⎩⎨⎧​21​,2(n−x+1)x​,2(x+1)n−x​,2(n−x+1)n−2x+1​,2(x+1)2x−n+1​,n+22​,​y=x+1, 0≤x≤2n−1​, or y=x−1, 2n+1​≤x≤n,y=x−1, 1≤x≤2n+1​,y=x+1, 2n−1​≤x≤n−1,y=x, 0≤x≤2n−1​,y=x, 2n+1​≤x≤n,y=x=2n​ (n even),​

and M(x,y)=0M(x,y)=0M(x,y)=0 when ∣x−y∣≥2|x-y|\ge 2∣x−y∣≥2; moreover π(x)M(x,y)=π(y)M(y,x)\pi(x)M(x,y)=\pi(y)M(y,x)π(x)M(x,y)=π(y)M(y,x) for all x,yx,yx,y.

This identifies the abstract Metropolis construction with the explicit chain (1.9) studied in the paper, and records the reversibility that makes π\piπ stationary.

Formalization Note Each case of the display is a separate implication; the bounds such as x≤(n−1)/2x\le (n-1)/2x≤(n−1)/2 are compared in R\mathbb RR. The "000 otherwise" clause, implicit on the page, is stated for y∉{x−1,x,x+1}y\notin\{x-1,x,x+1\}y∈/{x−1,x,x+1}.

Preamble
import Mathlib
import Definitions.Def_mm_basic
import Definitions.Def_LogSobolevMC_Metropolis_Chains
Formal statement
namespace LogSobolevMC.Metropolis

/-- Example 1.1, (1.9), p. 698: the standard Metropolis construction on the nearest-neighbour
walk gives the six-case kernel (1.9) (and `M(x, y) = 0` for `|x − y| ≥ 2`), and
`π(x)M(x, y) = π(y)M(y, x)` for the binomial distribution `π`. -/
theorem example_1_1 (n : ℕ) (hn : 1 ≤ n) :
    MarkovMixing.IsStochastic (binomMetropolis n) ∧
    (∀ x y : Fin (n + 1),
      (((y : ℕ) = (x : ℕ) + 1 ∧ 2 * ((x : ℕ) : ℝ) ≤ (n : ℝ) - 1) ∨
        ((y : ℕ) + 1 = (x : ℕ) ∧ (n : ℝ) + 1 ≤ 2 * ((x : ℕ) : ℝ))) →
      binomMetropolis n x y = 1 / 2) ∧
    (∀ x y : Fin (n + 1),
      (y : ℕ) + 1 = (x : ℕ) → 1 ≤ ((x : ℕ) : ℝ) → 2 * ((x : ℕ) : ℝ) ≤ (n : ℝ) + 1 →
      binomMetropolis n x y = ((x : ℕ) : ℝ) / (2 * ((n : ℝ) - ((x : ℕ) : ℝ) + 1))) ∧
    (∀ x y : Fin (n + 1),
      (y : ℕ) = (x : ℕ) + 1 → (n : ℝ) - 1 ≤ 2 * ((x : ℕ) : ℝ) → ((x : ℕ) : ℝ) ≤ (n : ℝ) - 1 →
      binomMetropolis n x y = ((n : ℝ) - ((x : ℕ) : ℝ)) / (2 * (((x : ℕ) : ℝ) + 1))) ∧
    (∀ x : Fin (n + 1), 2 * ((x : ℕ) : ℝ) ≤ (n : ℝ) - 1 →
      binomMetropolis n x x =
        ((n : ℝ) - 2 * ((x : ℕ) : ℝ) + 1) / (2 * ((n : ℝ) - ((x : ℕ) : ℝ) + 1))) ∧
    (∀ x : Fin (n + 1), (n : ℝ) + 1 ≤ 2 * ((x : ℕ) : ℝ) →
      binomMetropolis n x x =
        (2 * ((x : ℕ) : ℝ) - (n : ℝ) + 1) / (2 * (((x : ℕ) : ℝ) + 1))) ∧
    (∀ x : Fin (n + 1), 2 * (x : ℕ) = n →
      binomMetropolis n x x = 2 / ((n : ℝ) + 2)) ∧
    (∀ x y : Fin (n + 1), x ≠ y → (y : ℕ) ≠ (x : ℕ) + 1 → (y : ℕ) + 1 ≠ (x : ℕ) →
      binomMetropolis n x y = 0) ∧
    MarkovMixing.DetailedBalance (binomMetropolis n) (binomPi n) := by sorry

end LogSobolevMC.Metropolis
Source
Diaconis and Saloff-Coste, Logarithmic Sobolev inequalities for finite Markov chains, Ann. Appl. Probab. 6 (1996), p. 698, Example 1.1, (1.9)
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 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