Documentation

CslibFrontier.Probability.MarkovChain.RandomWalk

Hitting times of the simple random walk on a graph #

The simple random walk on a finite graph G moves from x to a uniformly random neighbor of x (Cslib.Probability.MarkovChain.randomWalk): its transition probabilities are P x y = 1 / deg x for adjacent x, y and 0 otherwise (randomWalk_apply). An isolated vertex keeps the walk in place, so randomWalk G is a Markov chain for every graph, and the expected hitting and return times of Cslib.Probability.MarkovChain.hittingTime apply.

The degrees form a stationary measure: ∑ x, deg x * P x y = deg y (sum_degree_mul_randomWalk). Since ∑ x, deg x = 2 |E|, Kac's formula gives deg v * E_v[τ⁺_v] = 2 |E| in a connected graph (degree_mul_returnTime_randomWalk), that is, E_v[τ⁺_v] = 2 |E| / deg v when deg v > 0. On a single vertex deg v = 0 and the walk stays put (randomWalk_apply_of_degree_eq_zero), so E_v[τ⁺_v] = 1 while 2 |E| / deg v = 0 in ℝ≥0∞. For deg v > 0, conditioning on the first step gives E_v[τ⁺_v] = 1 + (1 / deg v) ∑_{u ~ v} E_u[τ_v], so the expected hitting times of v from its neighbors sum to 2 |E| - deg v (degree_add_sum_hittingTime_randomWalk). In particular, for every edge {u, v}, E_u[τ_v] ≤ 2 |E| - deg v ≤ 2 |E| (hittingTime_randomWalk_add_degree_le, hittingTime_randomWalk_le_of_adj). This is the endpoint of Exercise 6.19 of Goldreich's draft, which completes the proof of his Proposition 6.13 Goldreich, Exercise 6.19. The proof here goes through Kac's formula and the neighbor sum Levin and Peres, Section 10.6; Goldreich's guideline instead counts traversals of the stationary walk and takes a commute-time limit. By the triangle inequality for hitting times, E_u[τ_v] ≤ ℓ · 2 |E| along any walk of length ℓ from u to v (hittingTime_randomWalk_le_length_mul, hittingTime_randomWalk_le_dist_mul).

Main definitions #

Main results #

References #

The simple random walk on G: from x, move to a uniformly random neighbor of x. An isolated vertex keeps the walk in place.

theorem Cslib.Probability.MarkovChain.randomWalk_apply {V : Type u_1} [Fintype V] {G : SimpleGraph V} [DecidableRel G.Adj] {x : V} (hx : 0 < G.degree x) (y : V) :
((randomWalk G).step x) y = if G.Adj x y then (↑(G.degree x))⁻¹ else 0

The transition probabilities of the simple random walk from a vertex with a neighbor.

theorem Cslib.Probability.MarkovChain.randomWalk_apply_of_degree_eq_zero {V : Type u_1} [Fintype V] {G : SimpleGraph V} [DecidableRel G.Adj] [DecidableEq V] {x : V} (hx : G.degree x = 0) (y : V) :
((randomWalk G).step x) y = if y = x then 1 else 0

From an isolated vertex the simple random walk stays put.

theorem Cslib.Probability.MarkovChain.randomWalk_apply_of_adj {V : Type u_1} [Fintype V] {G : SimpleGraph V} [DecidableRel G.Adj] {x y : V} (h : G.Adj x y) :
((randomWalk G).step x) y = (↑(G.degree x))⁻¹
theorem Cslib.Probability.MarkovChain.randomWalk_apply_of_not_adj {V : Type u_1} [Fintype V] {G : SimpleGraph V} [DecidableRel G.Adj] {x y : V} (hx : 0 < G.degree x) (h : ¬G.Adj x y) :
((randomWalk G).step x) y = 0
theorem Cslib.Probability.MarkovChain.sum_degree_mul_randomWalk {V : Type u_1} [Fintype V] {G : SimpleGraph V} [DecidableRel G.Adj] (y : V) :
∑ x : V, ↑(G.degree x) * ((randomWalk G).step x) y = ↑(G.degree y)

The degrees form a stationary measure of the simple random walk.

In a connected graph, the expected hitting time of any vertex is finite.

Expected return time of the simple random walk on a connected graph: deg v * E_v[τ⁺_v] = 2 |E|, by Kac's formula for the stationary measure given by the degrees.

theorem Cslib.Probability.MarkovChain.degree_add_sum_hittingTime_randomWalk {V : Type u_1} [Fintype V] {G : SimpleGraph V} [DecidableRel G.Adj] [DecidableEq V] (hG : G.Connected) {v : V} (hv : 0 < G.degree v) :
↑(G.degree v) + ∑ u ∈ G.neighborFinset v, (randomWalk G).hittingTime v u = 2 * ↑G.edgeFinset.card

In a connected graph, the expected hitting times of v from its neighbors sum to 2 |E| - deg v.

Goldreich, Exercise 6.19. For an edge {u, v} of a connected graph G = (V, E), the expected number of steps of the random walk from u to reach v satisfies E_u[τ_v] + deg v ≤ 2 |E|.

Goldreich, Exercise 6.19. For an edge {u, v} of a connected graph G = (V, E), E_u[τ_v] ≤ 2 |E|.

Along a walk of length ℓ from u to v in a connected graph, E_u[τ_v] ≤ ℓ · 2 |E|.

In a connected graph, E_u[τ_v] ≤ dist(u, v) · 2 |E|.

Degree-stationary distribution and lazy spectral mixing #

noncomputable def Cslib.Probability.MarkovChain.degreeStationary {V : Type u_1} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] (hG : G ≠ ⊥) :
PMF V

The degree-proportional stationary distribution π(v) = deg(v) / (2 |E|) of the simple random walk on a finite graph G ≠ ⊥ ([LP17], Section 1.5, (1.20)).

The simple random walk on G ≠ ⊥ satisfies detailed balance with respect to degreeStationary G hG ([LP17], Section 1.5).

Lazy random-walk total-variation contraction on a connected nontrivial graph: d(t) ≤ (1 / 2) √(2 |E| - 1) · (1 - γ / 2)^t.

theorem Cslib.Probability.MarkovChain.mixingTime_lazy_randomWalk_le {V : Type u_1} [Fintype V] {G : SimpleGraph V} [DecidableRel G.Adj] [Nontrivial V] (hconn : G.Connected) (hG : G ≠ ⊥) (hgap : 0 < (randomWalk G).spectralGap (degreeStationary G hG)) {ε : ℝ} (hε : 0 < ε) :

Lazy random-walk mixing-time bound on a connected nontrivial graph: t_mix(ε) ≤ ⌈2 γ⁻¹ ((1 / 2) log(2 |E|) + log(1 / (2 ε)))⌉₊.