Markov Chains and Mixing Times I: Existence and Uniqueness of the Stationary DistributionTextbook
Markov Chains and Mixing Times I: Existence and Uniqueness of the Stationary Distribution
Motivation
Finite Markov chains are the basic model for memoryless random dynamics: card shuffles, random walks on graphs and groups, Monte Carlo samplers, and queueing systems are all chains on a finite state space. The single most used fact about them is that an irreducible chain has exactly one stationary distribution — a probability vector with — and that this is strictly positive and encodes the long-run behaviour of the chain through the return-time identity . Every later result in the theory of mixing times (convergence theorems, coupling bounds, spectral methods, cutoff) is a statement about the distance of the chain from this , so nothing in the subject can be formalized before this mission is.
This mission is the first in a series formalizing D. A. Levin, Y. Peres and E. L. Wilmer, Markov Chains and Mixing Times (AMS, 2009), covering Chapters 1–2: the basic vocabulary of finite chains (stochastic matrices, irreducibility, period, reversibility, time reversal, random walks on graphs and groups) and the classical examples of Chapter 2 (gambler's ruin, coupon collecting, the reflection principle for simple random walk on ). Later missions in the series build on the definitions published here.
Setting
A chain on a finite state space is presented by its transition matrix, a matrix with nonnegative entries whose rows sum to . A distribution is a row vector with nonnegative entries summing to ; one step of the chain carries to , and the -step transition probabilities are the entries of the matrix power .
The chain is irreducible if for all states there is a with . The period of a state is where , and the chain is aperiodic if every state has period . A distribution is stationary if , and and are in detailed balance (the chain is reversible) if for all .
Trajectory events over a finite horizon are finite sums of path weights: a length- trajectory is a function , with weight conditional on its starting state. The tail probability of the first hitting time is the sum of the weights of the trajectories from that avoid at times , and expectations of hitting times are recovered by the tail-sum formula , formalized as a tsum over .
Formalization targets
Goal
This is Corollary 1.17 of the book. It asserts only existence and uniqueness, leaving the finer structure of to the milestones; it is the weakest statement on which the rest of the series can stand, which is why it is the goal.
Milestones toward and around the goal
The milestone list follows the book's own route: well-definedness of the period (Lemma 1.6), positivity of some matrix power for irreducible aperiodic chains (Proposition 1.7), finiteness of expected hitting times (Lemma 1.13), existence of a positive stationary distribution together with
(Proposition 1.14), constancy of harmonic functions (Lemma 1.16), stationarity from detailed balance (Proposition 1.19), the stationary and reversible measure of simple random walk on a graph (Examples 1.12 and 1.20), the time reversal and its path-reversal identity (Proposition 1.22), and the random walks on finite groups of Section 2.6 (Propositions 2.12–2.14). From Chapter 2 the list adds the gambler's ruin formulas and (Proposition 2.1), the coupon collector expectation and tail bound (Propositions 2.3 and 2.4), and the reflection principle and the bound for simple random walk on (Lemma 2.18 and Theorem 2.17).
Significance
The result itself. Existence and uniqueness of is the pivot on which the entire quantitative theory turns: it defines the target of convergence, and the identity ties the stationary measure to return times, which later missions use for hitting-time and cover-time results. Detailed balance is the practical tool by which stationary measures of graph and group walks are computed, and the Chapter 2 examples (gambler's ruin, coupon collecting, reflection) are the standard building blocks reused throughout the book — the coupon collector bound, for instance, is exactly the estimate behind the analysis of the top-to-random shuffle in a later mission of this series.
Formalizing it. Mathlib currently has no theory of finite Markov chains: no stochastic-matrix predicate, no stationary distribution, no periodicity, no hitting times. Everything proved in this mission is new formal mathematics, and the definition layer published here (mm_basic, mm_path, mm_classical) is the shared foundation that all twelve subsequent missions of the series import. All results are classical and have textbook proofs; none has a machine-checked proof.
Difficulty
The delicate point is the existence proof. The natural first idea — extract from an eigenvector of for eigenvalue , or invoke a fixed-point theorem — either does not give positivity and nonnegativity without further work, or uses compactness machinery (Brouwer) that is unavailable. The book's proof instead builds and verifies by reindexing trajectory sums; formalizing it requires managing infinite series of path sums (summability from the geometric tail bound of Lemma 1.13, exchanging tsum with finite sums, splitting a trajectory at its last step). The uniqueness half is linear algebra via constancy of harmonic functions (Lemma 1.16), which is elementary but requires a maximum-principle argument over a finite state space. The reflection principle and Theorem 2.17 are finite combinatorics on paths — the bijection is easy to describe and fiddly to implement.
Formalization scope
States form a Fintype with decidable equality; chains are Matrix V V ℝ with the row-stochasticity predicate IsStochastic; distributions are functions V → ℝ with the predicate IsDist. Everything is distribution-side: no probability space or measure theory is used. The period is formalized as , which equals when and takes the junk value otherwise. Expectations of hitting times are tsums of tail probabilities, with the usual junk value for non-summable families — the statements are arranged (e.g. multiplicatively, ) so that junk values cannot make them vacuously true. Existence statements carry a Nonempty V hypothesis; irreducibility on the empty space is vacuous, and without nonemptiness the goal would be false, not trivial. The coupon collector and the walk on are presented directly by their driving randomness (uniform draws Fin t → Fin n, uniform sign strings Fin r → Bool), so those probabilities are elementary counting; in particular the reflection principle is stated as an equality of cardinalities of sets of sign strings — this is equivalent to the probabilistic statement because all strings are equally likely.
Contributions welcome beyond the milestone list: simp lemmas for the definition layer, the taboo-matrix representation of avoidance probabilities (useful for Lemma 1.13), and any interface lemmas connecting pathWeight sums to matrix powers — these will be reused by every later mission in the series.
Selected references
- D. A. Levin, Y. Peres, E. L. Wilmer, Markov Chains and Mixing Times, American Mathematical Society, 2009. https://documents.epfl.ch/groups/i/ip/ipg/www/2013-2014/Random_Walks/markovmixing.pdf
- J. R. Norris, Markov Chains, Cambridge University Press, 1998. https://doi.org/10.1017/CBO9780511810633
- D. Aldous, J. A. Fill, Reversible Markov Chains and Random Walks on Graphs, 2002 (unfinished monograph). https://www.stat.berkeley.edu/~aldous/RWG/book.html