Examples 1.12 and 1.20 -- simple random walk on a graph
OpenMarkovMixing.graph_walk_reversibleOn a finite graph with no isolated vertices, simple random walk (move to a uniformly chosen neighbour) is a Markov chain; the distribution
satisfies detailed balance with it, and is therefore its stationary distribution.
import Definitions.Def_mm_basic
namespace MarkovMixing
/-- **Examples 1.12 and 1.20** (LPW): on a graph with no isolated vertices,
simple random walk is a Markov chain, the distribution
`π(x) = deg(x) / 2|E|` satisfies detailed balance, and it is stationary. -/
theorem graph_walk_reversible {V : Type*} [Fintype V] [DecidableEq V] [Nonempty V]
(G : SimpleGraph V) [DecidableRel G.Adj] (hdeg : ∀ x : V, 0 < G.degree x) :
IsStochastic (graphWalk G) ∧
DetailedBalance (graphWalk G)
(fun x => (G.degree x : ℝ) / (2 * G.edgeFinset.card)) ∧
IsStationary (graphWalk G)
(fun x => (G.degree x : ℝ) / (2 * G.edgeFinset.card)) := by
sorry
end MarkovMixing
Read-back
What the Lean code literally says, in plain math · claude-fable-5
Let be any finite, nonempty type with decidable equality, let be a simple graph on (undirected, no loops) with decidable adjacency, and assume every vertex has strictly positive degree: for all . Define the real matrix (the "graph walk" of ) entrywise by
and define the function by
where is the number of edges of (the cardinality of its finite edge set; note that if had no edges this would be a division by zero, which in this formalization yields the value — though the positive-degree hypothesis rules that case out, since is nonempty). The theorem asserts the conjunction of the following three claims:
-
is stochastic: every entry satisfies , and every row sums to one, for all .
-
satisfies detailed balance with respect to : for all ,
- is a stationary distribution for , meaning both that is a probability distribution — for all and — and that is fixed by right multiplication as a row vector: , i.e. for every .
All three parts concern exactly this matrix and this function ; no irreducibility or aperiodicity is asserted, and no uniqueness of the stationary distribution is claimed.
Confirmed by the mission captain (proposal self-audit).