Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Kac's lemma

Proved
MarkovMixing.kac_lemma

by Shuze Chen · Aug 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

markov-chainsmixing-timesprobability

Let PPP be an irreducible Markov chain on a countable state space VVV (nonnegative entries, rows summing to one as convergent series, every state reaching every other), and suppose π\piπ is a stationary distribution for it: nonnegative, summing to one, with ∑xπ(x)P(x,y)=π(y)\sum_x\pi(x)P(x,y)=\pi(y)∑x​π(x)P(x,y)=π(y) for every yyy. For a nonempty set of states SSS and x∈Sx\in Sx∈S, the first return time to SSS is τS+=min⁡{t≥1:Xt∈S}\tau^+_S=\min\{t\ge1:X_t\in S\}τS+​=min{t≥1:Xt​∈S}, with expectation given by the tail-sum formula Ex(τS+)=∑t≥0Px{τS+>t}\mathbb E_x(\tau^+_S)=\sum_{t\ge0}\mathbb P_x\{\tau^+_S>t\}Ex​(τS+​)=∑t≥0​Px​{τS+​>t}.

The theorem (Kac's lemma, Lemma 21.13 of Levin–Peres–Wilmer) asserts the exact identity

∑x∈Sπ(x) Ex(τS+)  =  1,\sum_{x\in S}\pi(x)\,\mathbb E_x\bigl(\tau^+_S\bigr)\;=\;1,x∈S∑​π(x)Ex​(τS+​)=1,

the series over SSS converging to exactly 111.

Started from stationarity conditioned on being in SSS, the expected time to return to SSS is exactly 1/π(S)1/\pi(S)1/π(S) — and for a singleton, Ex(τx+)=1/π(x)\mathbb E_x(\tau^+_x)=1/\pi(x)Ex​(τx+​)=1/π(x): stationary mass is inverse return time. The identity is a mass-transport double count — every time-step of the stationary chain is the kkk-th step of exactly one excursion from SSS — and it is the quantitative link between stationary distributions and return times that drives the positive-recurrence theory of this mission.

Preamble
import Definitions.Def_mm_countable
Formal statement
namespace MarkovMixing

/-- **Lemma 21.13 (Kac)** (LPW): for an irreducible chain with stationary
distribution `π` and any nonempty set `S` of states,
`∑_{x ∈ S} π(x) E_x(τ⁺_S) = 1`. -/
theorem kac_lemma {V : Type*} [Countable V] [DecidableEq V]
    (P : V → V → ℝ) (hP : IsStochasticC P) (hirr : IrreducibleC P)
    (π : V → ℝ) (hπ : IsStationaryC P π) (S : Set V) (hS : S.Nonempty) :
    HasSum (fun x : S => π x.1 * expSetReturnC P x.1 S) 1 := 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 21.3, Lemma 21.13, Eq. (21.5), p. 280

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me