Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The transition matrix is stochastic

Proved
BitcoinSelfishMining.P_row_sum

by pitimespi · Oct 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

bitcoineyal-sirerformal-verificationgame-theorymarkov-chainmathlibminingselfish-mining

For all real α,γ\alpha, \gammaα,γ and every state sss: stateSum (fun t => P α γ s t) = 1. Each row of the chain sums to one (the three outcome probabilities sum to 1 for any α,γ\alpha, \gammaα,γ).

Preamble
import Definitions.Def_BitcoinSelfishMining
Formal statement
theorem BitcoinSelfishMining.P_row_sum (α γ : ℝ) (s : BitcoinSelfishMining.State) :
    BitcoinSelfishMining.stateSum (fun t => BitcoinSelfishMining.P α γ s t) = 1 := by sorry
Source
I. Eyal, E. G. Sirer, Majority is not Enough: Bitcoin Mining is Vulnerable, Financial Cryptography 2014, arXiv:1311.0243, Section 4 (Figure 1, equations (7)-(11)): https://arxiv.org/abs/1311.0243
Read-back

What the Lean code literally says, in plain math · claude-fable-5-1 (independent sub-agent, blind: Lean code + auditor instructions only)

Read-back: BitcoinSelfishMining.P_row_sum

For every real number α\alphaα and every real number γ\gammaγ (no constraints whatsoever: they may be negative, larger than 111, etc.), and for every state sss of the type State ={zero,tie}∪{leadn:n∈N}= \{\mathrm{zero}, \mathrm{tie}\} \cup \{\mathrm{lead}_n : n \in \mathbb{N}\}={zero,tie}∪{leadn​:n∈N}, the following real number equals 111:

Pα,γ(s,zero)+Pα,γ(s,tie)+∑n=0∞′ Pα,γ(s,leadn)  =  1.P_{\alpha,\gamma}(s,\mathrm{zero}) + P_{\alpha,\gamma}(s,\mathrm{tie}) + \sum_{n=0}^{\infty}{}'\, P_{\alpha,\gamma}(s,\mathrm{lead}_n) \;=\; 1 .Pα,γ​(s,zero)+Pα,γ​(s,tie)+n=0∑∞​′Pα,γ​(s,leadn​)=1.

Here Pα,γ(s,t)P_{\alpha,\gamma}(s,t)Pα,γ​(s,t) is the custom one-step weight from sss to ttt, defined as the three-term sum over the outcomes o∈{pool,honestOnPool,honestOnOthers}o \in \{\mathrm{pool}, \mathrm{honestOnPool}, \mathrm{honestOnOthers}\}o∈{pool,honestOnPool,honestOnOthers} of pα,γ(o)p_{\alpha,\gamma}(o)pα,γ​(o) when step(s,o)=t\mathrm{step}(s,o) = tstep(s,o)=t and 000 otherwise, where pα,γ(pool)=αp_{\alpha,\gamma}(\mathrm{pool}) = \alphapα,γ​(pool)=α, pα,γ(honestOnPool)=(1−α)γp_{\alpha,\gamma}(\mathrm{honestOnPool}) = (1-\alpha)\gammapα,γ​(honestOnPool)=(1−α)γ, pα,γ(honestOnOthers)=(1−α)(1−γ)p_{\alpha,\gamma}(\mathrm{honestOnOthers}) = (1-\alpha)(1-\gamma)pα,γ​(honestOnOthers)=(1−α)(1−γ), and step\mathrm{step}step is the deterministic table: zero→poollead0\mathrm{zero} \xrightarrow{\mathrm{pool}} \mathrm{lead}_0zeropool​lead0​, zero→otherzero\mathrm{zero} \xrightarrow{\text{other}} \mathrm{zero}zeroother​zero; tie→anyzero\mathrm{tie} \xrightarrow{\text{any}} \mathrm{zero}tieany​zero; lead0→poollead1\mathrm{lead}_0 \xrightarrow{\mathrm{pool}} \mathrm{lead}_1lead0​pool​lead1​, lead0→othertie\mathrm{lead}_0 \xrightarrow{\text{other}} \mathrm{tie}lead0​other​tie; lead1→poollead2\mathrm{lead}_1 \xrightarrow{\mathrm{pool}} \mathrm{lead}_2lead1​pool​lead2​, lead1→otherzero\mathrm{lead}_1 \xrightarrow{\text{other}} \mathrm{zero}lead1​other​zero; leadn+2→poolleadn+3\mathrm{lead}_{n+2} \xrightarrow{\mathrm{pool}} \mathrm{lead}_{n+3}leadn+2​pool​leadn+3​, leadn+2→otherleadn+1\mathrm{lead}_{n+2} \xrightarrow{\text{other}} \mathrm{lead}_{n+1}leadn+2​other​leadn+1​ ("other" meaning either honest outcome).

The left-hand side is the custom stateSum of the function t↦Pα,γ(s,t)t \mapsto P_{\alpha,\gamma}(s,t)t↦Pα,γ​(s,t): the value at zero\mathrm{zero}zero, plus the value at tie\mathrm{tie}tie, plus Mathlib's tsum over n∈Nn\in\mathbb{N}n∈N of the values at leadn\mathrm{lead}_nleadn​ (a tsum is 000 for a non-summable family). For each fixed sss, by the table above at most two indices nnn give a non-zero term Pα,γ(s,leadn)P_{\alpha,\gamma}(s,\mathrm{lead}_n)Pα,γ​(s,leadn​), so the tail family has finite support and its tsum is an ordinary finite sum. Written out per case, the assertion is:

  • s=zeros = \mathrm{zero}s=zero: [(1−α)γ+(1−α)(1−γ)]+0+α=1\big[(1-\alpha)\gamma + (1-\alpha)(1-\gamma)\big] + 0 + \alpha = 1[(1−α)γ+(1−α)(1−γ)]+0+α=1;
  • s=ties = \mathrm{tie}s=tie: [α+(1−α)γ+(1−α)(1−γ)]+0+0=1\big[\alpha + (1-\alpha)\gamma + (1-\alpha)(1-\gamma)\big] + 0 + 0 = 1[α+(1−α)γ+(1−α)(1−γ)]+0+0=1;
  • s=lead0s = \mathrm{lead}_0s=lead0​: 0+[(1−α)γ+(1−α)(1−γ)]+α=10 + \big[(1-\alpha)\gamma + (1-\alpha)(1-\gamma)\big] + \alpha = 10+[(1−α)γ+(1−α)(1−γ)]+α=1;
  • s=lead1s = \mathrm{lead}_1s=lead1​: [(1−α)γ+(1−α)(1−γ)]+0+α=1\big[(1-\alpha)\gamma + (1-\alpha)(1-\gamma)\big] + 0 + \alpha = 1[(1−α)γ+(1−α)(1−γ)]+0+α=1;
  • s=leadn+2s = \mathrm{lead}_{n+2}s=leadn+2​: 0+0+[α+(1−α)γ+(1−α)(1−γ)]=10 + 0 + \big[\alpha + (1-\alpha)\gamma + (1-\alpha)(1-\gamma)\big] = 10+0+[α+(1−α)γ+(1−α)(1−γ)]=1.

Because α\alphaα and γ\gammaγ are arbitrary reals, the statement includes, e.g., α=5\alpha = 5α=5 or γ=−3\gamma = -3γ=−3; it is a purely algebraic identity about these sums, with no probabilistic hypotheses.

Human review
  • Endorsed by Shuze Chen · Oct 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by pitimespi · Oct 29, 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, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me