Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Conditioning identity on (0,h)(0,h)(0,h) for the exponential-horizon value functions

Open
SelfishMiningRuin.ValueFn.Vhat_conditioning

by tianyipeng · Nov 3, 2026 · Mathlib 0df444a (Lean v4.33.1)

first-step-analysisruin-theoryselfish-miningvalue-function

Fix a cost rate c>0c>0c>0, a block reward b>0b>0b>0, a block rate λ>0\lambda>0λ>0, a mean horizon t>0t>0t>0, a hash share 0<p<10<p<10<p<1 and a fork-support probability 0≤q≤10\le q\le10≤q≤1, and let the interarrival times and marks have the joint law described by Primitives (i.i.d. Exp(λ)\mathrm{Exp}(\lambda)Exp(λ) interarrival times, with independent marks ξ∼Bernoulli(p)\xi\sim\mathrm{Bernoulli}(p)ξ∼Bernoulli(p) — the selfish miner found the block — and ζ∼Bernoulli(q)\zeta\sim\mathrm{Bernoulli}(q)ζ∼Bernoulli(q) — the network extends the miner's branch in a fork). For a state z∈{0,1,0∗}z\in\{0,1,0^*\}z∈{0,1,0∗} write V^z(u)=V^z(u,t)\widehat V_z(u)=\widehat V_z(u,t)Vz​(u)=Vz​(u,t) for the exponential-horizon expected surplus under ruin (19), and β=λ+1/t\beta=\lambda+1/tβ=λ+1/t.

Conditioning on what happens in the interval (0,h)(0,h)(0,h) — the horizon expires first, a block is found first, or neither — gives, for every uuu and every 0≤h≤u/c0\le h\le u/c0≤h≤u/c,

V^z(u)=e−βh V^z(u−ch)+∫0he−βs(u−cst+λ∑x,y∈{0,1}π(x,y) V^z′(x,y)(u−cs+b rz(x,y))) ds,\widehat V_z(u)=e^{-\beta h}\,\widehat V_z(u-ch)+\int_0^h e^{-\beta s}\Bigl(\frac{u-cs}{t}+\lambda\sum_{x,y\in\{0,1\}}\pi(x,y)\,\widehat V_{z'(x,y)}\bigl(u-cs+b\,r_z(x,y)\bigr)\Bigr)\,ds ,Vz​(u)=e−βhVz​(u−ch)+∫0h​e−βs(tu−cs​+λx,y∈{0,1}∑​π(x,y)Vz′(x,y)​(u−cs+brz​(x,y)))ds,

where π(x,y)=px(1−p)1−xqy(1−q)1−y\pi(x,y)=p^x(1-p)^{1-x}q^y(1-q)^{1-y}π(x,y)=px(1−p)1−xqy(1−q)1−y is the mark law, z′(x,y)z'(x,y)z′(x,y) is the next state and rz(x,y)∈{0,1,2}r_z(x,y)\in\{0,1,2\}rz​(x,y)∈{0,1,2} the number of paid blocks at a discovery (the transition rules on pp. 8–9 and equation (16)).

This is the identity displayed in the proof of Proposition 2.2 (p. 6), stated there for the honest miner and used in Appendix A ("the same reasoning as in the proof of Proposition 2.2") for the three-state selfish-mining chain. Differentiating it in hhh yields the advanced differential system (29).

Formalization Note The paper takes 0<h<u/c0<h<u/c0<h<u/c; the identity also holds at the endpoints h=0h=0h=0 (trivially) and h=u/ch=u/ch=u/c (the surplus is exhausted at u/cu/cu/c if no block arrives, and V^z(0)=0\widehat V_z(0)=0Vz​(0)=0), and the statement includes them.

Preamble
import Mathlib
import Definitions.Def_SelfishMiningRuin_ValueFn_Model

set_option autoImplicit false
Formal statement
namespace SelfishMiningRuin.ValueFn

/-- Conditioning on the interval `(0, h)` (proof of Proposition 2.2, p. 6, transferred to the
three-state chain as in Appendix A, p. 24), for every `0 ≤ h ≤ u / c`. -/
theorem Vhat_conditioning {Ω : Type*} [MeasurableSpace Ω] (P : MeasureTheory.Measure Ω)
    [MeasureTheory.IsProbabilityMeasure P] (W : ℕ → Ω → ℝ)
    (ξ ζ : ℕ → Ω → Bool) (lam c b t p q : ℝ)
    (hlam : 0 < lam) (hc : 0 < c) (hb : 0 < b) (ht : 0 < t)
    (hp0 : 0 < p) (hp1 : p < 1) (hq0 : 0 ≤ q) (hq1 : q ≤ 1)
    (hprim : Primitives P lam p q W ξ ζ) :
    ∀ z : St, ∀ u h : ℝ, 0 ≤ h → c * h ≤ u →
      Vhat P W ξ ζ c b u t z =
        Real.exp (-(lam + 1 / t) * h) * Vhat P W ξ ζ c b (u - c * h) t z +
        ∫ s in (0 : ℝ)..h, Real.exp (-(lam + 1 / t) * s) *
          ((u - c * s) / t + lam *
            (p * q * Vhat P W ξ ζ c b (u - c * s + b * reward z true true) t
                (step z true true) +
             p * (1 - q) * Vhat P W ξ ζ c b (u - c * s + b * reward z true false) t
                (step z true false) +
             (1 - p) * q * Vhat P W ξ ζ c b (u - c * s + b * reward z false true) t
                (step z false true) +
             (1 - p) * (1 - q) * Vhat P W ξ ζ c b (u - c * s + b * reward z false false) t
                (step z false false))) := by sorry

end SelfishMiningRuin.ValueFn
Source
Albrecher & Goffard, On the profitability of selfish blockchain mining under consideration of ruin, arXiv:2010.12577v1, proof of Proposition 2.2 (conditioning identity), p. 6, applied to the selfish-mining chain in Appendix A, p. 24 (derivation of (29))

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