Prove2Me
Navigate
MissionsFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Proposition 9.1 -- existence and uniqueness of harmonic extensions

Proved
MarkovMixing.harmonic_extension

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

markov-chainsmixing-timesprobability

Let PPP be an irreducible Markov chain on a finite state space VVV. A function h:V→Rh:V\to\mathbb Rh:V→R is harmonic at xxx when it satisfies the mean-value property h(x)=∑yP(x,y) h(y)h(x)=\sum_yP(x,y)\,h(y)h(x)=∑y​P(x,y)h(y). Fix a nonempty set of states BBB and boundary data f:B→Rf:B\to\mathbb Rf:B→R, write τB\tau_BτB​ for the first time the chain visits BBB, and let Px{XτB=y}\mathbb P_x\{X_{\tau_B}=y\}Px​{XτB​​=y} denote the probability that the chain started at xxx first enters BBB at the state yyy. Define the harmonic extension of fff as its expected boundary value at the first visit,

h(x)=Ex[f(XτB)]=∑y∈Bf(y) Px{XτB=y}.h(x)=\mathbb E_x\bigl[f(X_{\tau_B})\bigr]=\sum_{y\in B}f(y)\,\mathbb P_x\{X_{\tau_B}=y\}.h(x)=Ex​[f(XτB​​)]=y∈B∑​f(y)Px​{XτB​​=y}.

The theorem (Proposition 9.1 of Levin–Peres–Wilmer) asserts:

  1. hhh agrees with fff on BBB;
  2. hhh is harmonic at every state outside BBB;
  3. hhh is the unique such function: any ggg that agrees with fff on BBB and is harmonic off BBB equals hhh everywhere.

This is the discrete Dirichlet problem: boundary data on BBB extends in exactly one way to a function harmonic off BBB, and the extension is probabilistic. Voltages in the electrical dictionary are exactly such extensions.

Preamble
import Definitions.Def_mm_network
Formal statement
namespace MarkovMixing

/-- **Proposition 9.1** (LPW): for an irreducible chain and a nonempty set
`B` of states with boundary data `f`, the function
`h(x) = E_x f(X_{τ_B}) = ∑_{y ∈ B} f(y) P_x{X_{τ_B} = y}` is the unique
extension of `f` that agrees with `f` on `B` and is harmonic off `B`. -/
theorem harmonic_extension {V : Type*} [Fintype V] [DecidableEq V]
    (P : Matrix V V ℝ) (hP : IsStochastic P) (hirr : Irreducible P)
    (B : Finset V) (hB : B.Nonempty) (f : V → ℝ) :
    (∀ x ∈ B, (∑ y ∈ B, f y * firstHitAtProb P x B y) = f x) ∧
    HarmonicOn P (fun x => ∑ y ∈ B, f y * firstHitAtProb P x B y)
      {x : V | x ∉ B} ∧
    ∀ g : V → ℝ, (∀ x ∈ B, g x = f x) → HarmonicOn P g {x : V | x ∉ B} →
      g = fun x => ∑ y ∈ B, f y * firstHitAtProb P x B y := 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 9.2, Proposition 9.1, p. 116
Read-back

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

Read-back: harmonic_extension

Let VVV be a finite type with decidable equality, and let PPP be a V×VV \times VV×V real matrix assumed stochastic (P(x,y)≥0P(x,y) \ge 0P(x,y)≥0 for all x,yx,yx,y, and ∑y∈VP(x,y)=1\sum_{y \in V} P(x,y) = 1∑y∈V​P(x,y)=1 for every xxx) and irreducible in the bundle's sense: for all x,y∈Vx, y \in Vx,y∈V there exists some t∈Nt \in \mathbb{N}t∈N (with t=0t = 0t=0 allowed, in which case P0P^0P0 is the identity matrix) such that the (x,y)(x,y)(x,y) entry of PtP^tPt is strictly positive. Let BBB be a nonempty finite subset of VVV (which forces VVV nonempty), and let f:V→Rf : V \to \mathbb{R}f:V→R be a completely arbitrary function. Define the candidate extension h:V→Rh : V \to \mathbb{R}h:V→R by

h(x)=∑y∈Bf(y) PBhit(x,y),h(x) = \sum_{y \in B} f(y)\, \mathbb{P}^{\mathrm{hit}}_B(x, y),h(x)=y∈B∑​f(y)PBhit​(x,y),

where PBhit(x,y)\mathbb{P}^{\mathrm{hit}}_B(x, y)PBhit​(x,y) (the bundle's firstHitAtProb) unfolds as follows: it is Lean's tsum over all t∈Nt \in \mathbb{N}t∈N — equal to the limit when the series is summable and defined as 000 when it is not — of the total weight ∑ω∏i=0t−1P(ωi,ωi+1)\sum_\omega \prod_{i=0}^{t-1} P(\omega_i, \omega_{i+1})∑ω​∏i=0t−1​P(ωi​,ωi+1​) over paths ω:{0,…,t}→V\omega : \{0, \dots, t\} \to Vω:{0,…,t}→V satisfying ω0=x\omega_0 = xω0​=x, ωi∉B\omega_i \notin Bωi​∈/B for every index i<ti < ti<t (the constraint covers the start but not the final index), and ωt=y\omega_t = yωt​=y. Since here yyy ranges over BBB, for x∉Bx \notin Bx∈/B this is the summed weight over all lengths of walks that stay outside BBB strictly before their final step and first enter BBB at yyy; for x∈Bx \in Bx∈B only the length-000 path can satisfy the constraints (any longer path violates ω0∉B\omega_0 \notin Bω0​∈/B), so PBhit(x,y)\mathbb{P}^{\mathrm{hit}}_B(x,y)PBhit​(x,y) is 111 if x=yx = yx=y and 000 otherwise, making h(x)=f(x)h(x) = f(x)h(x)=f(x) definitionally forced on BBB. The theorem asserts, for every such PPP, BBB, fff, the conjunction of three claims:

  1. Boundary agreement: for every x∈Bx \in Bx∈B, ∑y∈Bf(y) PBhit(x,y)=f(x)\sum_{y \in B} f(y)\, \mathbb{P}^{\mathrm{hit}}_B(x, y) = f(x)∑y∈B​f(y)PBhit​(x,y)=f(x) — i.e. h=fh = fh=f on BBB (by the degenerate-case analysis above this conjunct's content reduces to the length-000 path bookkeeping).

  2. Harmonicity off BBB: hhh is harmonic on the complement of BBB, meaning for every x∈Vx \in Vx∈V with x∉Bx \notin Bx∈/B,

h(x)=∑y∈VP(x,y) h(y),h(x) = \sum_{y \in V} P(x,y)\, h(y),h(x)=y∈V∑​P(x,y)h(y),

the sum running over all of VVV. (If B=VB = VB=V this conjunct is vacuous.)

  1. Uniqueness: for every function g:V→Rg : V \to \mathbb{R}g:V→R, if g(x)=f(x)g(x) = f(x)g(x)=f(x) for all x∈Bx \in Bx∈B and ggg is harmonic on {x:x∉B}\{x : x \notin B\}{x:x∈/B} in the same sense (g(x)=∑yP(x,y)g(y)g(x) = \sum_{y} P(x,y) g(y)g(x)=∑y​P(x,y)g(y) for every x∉Bx \notin Bx∈/B), then ggg equals hhh as a function on all of VVV, i.e. g(x)=∑y∈Bf(y) PBhit(x,y)g(x) = \sum_{y \in B} f(y)\, \mathbb{P}^{\mathrm{hit}}_B(x,y)g(x)=∑y∈B​f(y)PBhit​(x,y) for every x∈Vx \in Vx∈V.

Note that fff is quantified over all real-valued functions on VVV (its values off BBB are irrelevant to hhh but unconstrained), and no aperiodicity or reversibility is assumed.

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 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.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me