Prove2Me
Navigate
MissionsFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lemma 10.1 -- the random target lemma

Proved
MarkovMixing.random_target_lemma

by Shuze Chen · Aug 21, 2026 · Mathlib c5ea003 (Lean v4.30.0)

markov-chainsmixing-timesprobability

Let PPP be an irreducible Markov chain on a finite state space VVV with stationary distribution π\piπ. For states aaa and yyy, write Ea(τy)\mathbb E_a(\tau_y)Ea​(τy​) for the expected hitting time of yyy from aaa — the expected number of steps for the chain started at aaa to first reach yyy (formalized, as throughout this series, by the tail-sum ∑t≥0Pa{τy>t}\sum_{t\ge0}\mathbb P_a\{\tau_y>t\}∑t≥0​Pa​{τy​>t}).

The theorem (the Random Target Lemma, Lemma 10.1 of Levin–Peres–Wilmer) asserts that the expected time to hit a π\piπ-random target does not depend on the starting state: for any two states a,ba,ba,b,

∑y∈VEa(τy) π(y)  =  ∑y∈VEb(τy) π(y).\sum_{y\in V}\mathbb E_a(\tau_y)\,\pi(y)\;=\;\sum_{y\in V}\mathbb E_b(\tau_y)\,\pi(y).y∈V∑​Ea​(τy​)π(y)=y∈V∑​Eb​(τy​)π(y).

Choosing the target according to the stationary distribution erases the advantage of any starting position — a surprising exact identity, proved by observing that the quantity is a harmonic function of the start and hence constant for an irreducible chain.

Preamble
import Definitions.Def_mm_network
Formal statement
namespace MarkovMixing

/-- **Lemma 10.1, the Random Target Lemma** (LPW): for an irreducible chain
with stationary distribution `π`, the quantity `∑_y E_a(τ_y) π(y)` does not
depend on the starting state `a`. -/
theorem random_target_lemma {V : Type*} [Fintype V] [DecidableEq V]
    (P : Matrix V V ℝ) (hP : IsStochastic P) (hirr : Irreducible P)
    (π : V → ℝ) (hπ : IsStationary P π) (a b : V) :
    ∑ y, expSetHitTime P a {y} * π y = ∑ y, expSetHitTime P b {y} * π y := by
  sorry

end MarkovMixing
Source
D. A. Levin, Y. Peres, E. L. Wilmer, Markov Chains and Mixing Times, AMS 2009, https://documents.epfl.ch/groups/i/ip/ipg/www/2013-2014/Random_Walks/markovmixing.pdf, Section 10.2, Lemma 10.1, p. 128
Read-back

What the Lean code literally says, in plain math · claude-fable-5

Let VVV be a finite type with decidable equality, and let PPP be a V×VV \times VV×V real matrix that is stochastic (P(x,y)≥0P(x,y) \ge 0P(x,y)≥0 for all x,yx,yx,y, and each row sums to 111) and irreducible in the sense that for every pair x,y∈Vx, y \in Vx,y∈V there exists a natural number t≥0t \ge 0t≥0 with (Pt)(x,y)>0(P^t)(x,y) > 0(Pt)(x,y)>0 (since P0P^0P0 is the identity, this is automatic when x=yx = yx=y). Let π:V→R\pi : V \to \mathbb{R}π:V→R be a stationary distribution for PPP: π(x)≥0\pi(x) \ge 0π(x)≥0 for all xxx, ∑xπ(x)=1\sum_{x} \pi(x) = 1∑x​π(x)=1, and πP=π\pi P = \piπP=π as a row vector. For vertices x,y∈Vx, y \in Vx,y∈V, let Ex[τy]E_x[\tau_y]Ex​[τy​] denote the quantity ∑t=0∞qt(x,y)\sum_{t=0}^{\infty} q_t(x,y)∑t=0∞​qt​(x,y), where qt(x,y)q_t(x,y)qt​(x,y) is the total weight ∑ω∏i=0t−1P(ωi,ωi+1)\sum_{\omega} \prod_{i=0}^{t-1} P(\omega_i, \omega_{i+1})∑ω​∏i=0t−1​P(ωi​,ωi+1​) of all paths ω:{0,…,t}→V\omega : \{0, \dots, t\} \to Vω:{0,…,t}→V with ω0=x\omega_0 = xω0​=x that avoid yyy at every step 0≤i≤t0 \le i \le t0≤i≤t, including step 000; probabilistically, qt(x,y)q_t(x,y)qt​(x,y) is the chance that the chain started at xxx has not visited yyy by time ttt, so Ex[τy]=∑t≥0Pr⁡x[τy>t]E_x[\tau_y] = \sum_{t \ge 0} \Pr_x[\tau_y > t]Ex​[τy​]=∑t≥0​Prx​[τy​>t] is the expected first hitting time of yyy, where the hitting time counts time 000 (in particular Ey[τy]=0E_y[\tau_y] = 0Ey​[τy​]=0, since a path starting at yyy fails the avoidance condition at step 000, and every term is zero). The infinite sum here is a Lean tsum: if the series fails to converge, the expression takes the junk value 000 rather than +∞+\infty+∞. The theorem then asserts that for any two vertices a,b∈Va, b \in Va,b∈V (with no assumption that a≠ba \ne ba=b),

∑y∈VEa[τy] π(y)  =  ∑y∈VEb[τy] π(y),\sum_{y \in V} E_a[\tau_y]\, \pi(y) \;=\; \sum_{y \in V} E_b[\tau_y]\, \pi(y),y∈V∑​Ea​[τy​]π(y)=y∈V∑​Eb​[τy​]π(y),

i.e. the π\piπ-weighted average over targets yyy of the expected hitting time of yyy from the fixed start aaa equals the same average computed from the start bbb — the quantity ∑yEx[τy]π(y)\sum_{y} E_x[\tau_y] \pi(y)∑y​Ex​[τy​]π(y) does not depend on the starting vertex xxx. Note that no aperiodicity or reversibility is assumed, and nothing is asserted about the common value itself.

Human review
  • Endorsed by Community (Bot) · Aug 21, 2026

  • Endorsed by Shuze Chen · Aug 21, 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.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me