Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Proposition 1.22 -- the time reversal of a chain

Open
MarkovMixing.time_reversal

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

markov-chainsmixing-timesprobability

For an irreducible chain with stationary distribution π\piπ, the time reversal P^(x,y)=π(y)P(y,x)/π(x)\hat P(x,y)=\pi(y)P(y,x)/\pi(x)P^(x,y)=π(y)P(y,x)/π(x) is a stochastic matrix, π\piπ is stationary for P^\hat PP^, and started from π\piπ the reversed chain traverses every trajectory with the same probability as the original chain traverses the reversed trajectory:

π(x0)P(x0,x1)⋯P(xt−1,xt)=π(xt)P^(xt,xt−1)⋯P^(x1,x0).\pi(x_0)P(x_0,x_1)\cdots P(x_{t-1},x_t)=\pi(x_t)\hat P(x_t,x_{t-1})\cdots\hat P(x_1,x_0).π(x0​)P(x0​,x1​)⋯P(xt−1​,xt​)=π(xt​)P^(xt​,xt−1​)⋯P^(x1​,x0​).
Preamble
import Definitions.Def_mm_path
Formal statement
namespace MarkovMixing

/-- **Proposition 1.22** (LPW): for an irreducible chain with stationary
distribution `π`, the time reversal `P̂` is a stochastic matrix, `π` is
stationary for `P̂`, and started from `π` the chain run through `P̂` traverses
every trajectory with the same probability as the original chain traverses the
reversed trajectory. -/
theorem time_reversal {V : Type*} [Fintype V] [DecidableEq V]
    (P : Matrix V V ℝ) (hP : IsStochastic P) (hirr : Irreducible P)
    (π : V → ℝ) (hπ : IsStationary P π) :
    IsStochastic (timeReversal P π) ∧ IsStationary (timeReversal P π) π ∧
    ∀ (t : ℕ) (ω : Fin (t + 1) → V),
      π (ω 0) * pathWeight P ω =
        π (ω (Fin.last t)) * pathWeight (timeReversal P π) (fun i => ω i.rev) := 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 1.6, Proposition 1.22, p. 15
Read-back

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

Let VVV be an arbitrary finite type (possibly empty) with decidable equality, let PPP be a V×VV \times VV×V matrix of real numbers, and assume: (i) PPP is stochastic in the sense that every entry satisfies P(x,y)≥0P(x,y) \ge 0P(x,y)≥0 and every row sums to one, ∑yP(x,y)=1\sum_y P(x,y) = 1∑y​P(x,y)=1; (ii) PPP is 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 (the value t=0t = 0t=0 is allowed, in which case P0P^0P0 is the identity matrix, so this condition is automatic when x=yx = yx=y) with (Pt)(x,y)>0(P^t)(x,y) > 0(Pt)(x,y)>0; and (iii) π:V→R\pi : V \to \mathbb{R}π:V→R is a stationary distribution for PPP, meaning π(x)≥0\pi(x) \ge 0π(x)≥0 for all xxx, ∑xπ(x)=1\sum_x \pi(x) = 1∑x​π(x)=1, and the row-vector identity πP=π\pi P = \piπP=π holds, i.e. ∑xπ(x) P(x,y)=π(y)\sum_x \pi(x)\,P(x,y) = \pi(y)∑x​π(x)P(x,y)=π(y) for every yyy. Define the time-reversal matrix P^\hat PP^ entrywise by

P^(x,y)=π(y) P(y,x)π(x),\hat P(x,y) = \frac{\pi(y)\,P(y,x)}{\pi(x)},P^(x,y)=π(x)π(y)P(y,x)​,

where the division is the total real division that returns 000 when the denominator π(x)\pi(x)π(x) is zero (positivity of π\piπ is not a hypothesis, so entries with π(x)=0\pi(x) = 0π(x)=0 are literally 000). The theorem then asserts the conjunction of three claims: (1) P^\hat PP^ is stochastic (all entries nonnegative and every row of P^\hat PP^ sums to one); (2) π\piπ is a stationary distribution for P^\hat PP^ (again in the sense: π\piπ is nonnegative, sums to one, and πP^=π\pi \hat P = \piπP^=π); and (3) for every natural number t≥0t \ge 0t≥0 and every function ω\omegaω from {0,1,…,t}\{0, 1, \dots, t\}{0,1,…,t} to VVV (an arbitrary sequence of t+1t+1t+1 states, with no requirement that consecutive states be reachable),

π(ω0)⋅∏i=0t−1P(ωi,ωi+1)  =  π(ωt)⋅∏i=0t−1P^(ωt−i,ωt−i−1),\pi(\omega_0) \cdot \prod_{i=0}^{t-1} P(\omega_i, \omega_{i+1}) \;=\; \pi(\omega_t) \cdot \prod_{i=0}^{t-1} \hat P(\omega_{t-i}, \omega_{t-i-1}),π(ω0​)⋅i=0∏t−1​P(ωi​,ωi+1​)=π(ωt​)⋅i=0∏t−1​P^(ωt−i​,ωt−i−1​),

that is, the probability weight of the path ω0,…,ωt\omega_0, \dots, \omega_tω0​,…,ωt​ under PPP started from π\piπ equals the weight of the reversed path ωt,ωt−1,…,ω0\omega_t, \omega_{t-1}, \dots, \omega_0ωt​,ωt−1​,…,ω0​ under P^\hat PP^ started from π\piπ — here the path weight of a sequence under a matrix is the product of the matrix entries along its consecutive steps, which is the empty product 111 when t=0t = 0t=0, making the t=0t = 0t=0 case the trivial identity π(ω0)=π(ω0)\pi(\omega_0) = \pi(\omega_0)π(ω0​)=π(ω0​). If VVV is empty, all three claims hold vacuously (though hypothesis (i) and (iii) are then also vacuous or degenerate: the row-sum and total-mass conditions quantify over no elements or sum over an empty set, and ∑xπ(x)=1\sum_x \pi(x) = 1∑x​π(x)=1 with empty VVV would read 0=10 = 10=1, making the hypotheses unsatisfiable in that case).

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 contributeLaunch a missionPropose a formalization projectFAQ

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 works
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me