Proposition 2.1 -- gambler's ruin
OpenMarkovMixing.gamblers_ruinFor the fair unit-bet gambler absorbed at and , started from fortune : the probability of reaching before is , and the expected absorption time is . Both quantities are expressed by tail/first-passage sums over trajectories of the explicit gambler's chain.
import Definitions.Def_mm_classical
namespace MarkovMixing
/-- **Proposition 2.1** (LPW), gambler's ruin: for fair unit bets absorbed at
`0` and `n`, started from `k` the probability of reaching `n` before `0` is
`k/n`, and the expected absorption time is `k(n-k)`. -/
theorem gamblers_ruin (n : ℕ) (hn : 0 < n) (k : Fin (n + 1)) :
hitBeforeProb (gamblersChain n) k (Fin.last n) 0 = (k.val : ℝ) / n ∧
expSetHitTime (gamblersChain n) k {0, Fin.last n} =
(k.val : ℝ) * ((n : ℝ) - (k.val : ℝ)) := by
sorry
end MarkovMixing
Read-back
What the Lean code literally says, in plain math · claude-fable-5
For every natural number with and every state in the finite set , the theorem asserts the conjunction of two identities about the "gambler's ruin" transition matrix on the -element state space , defined entrywise by: if the current state is or , then and all other entries in that row are (both endpoints are absorbing); otherwise (for ) the entry is when or , and for every other . First conjunct: the quantity "probability of hitting before starting from ", defined as the infinite series , where is the finite sum, over all sequences of states satisfying (i) , (ii) , (iii) for every index , and (iv) for every index , including , of the path weight (an empty product, equal to , when ), equals the real number (real division; here , so this is ordinary division). Note that when the length-zero path contributes at , and when condition (iv) excludes every path, so the series is identically . Second conjunct: the quantity "expected hitting time of the set starting from ", defined as the infinite series , where is the finite sum, over all sequences of states satisfying and for every index , including , of the same path weight , equals the real number (an ordinary product of reals; since here, is the usual nonnegative difference). Note that when every term of this series vanishes, so the left side is . In both conjuncts the infinite series over is interpreted with the convention that a series which fails to converge (is not summable) is assigned the value ; when the series converges, the value is its ordinary sum.
Confirmed by the mission captain (proposal self-audit).