Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Theorem 1, p. 10 — the discounted residual cost after the next payment

Proved
LNChannels.Exact.last_term

by mikedeng1 · Oct 15, 2026 · Mathlib 0df444a (Lean v4.33.1)

exponential-distributionp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1payment-channelsprobability

Let τλ2\tau^{\lambda_2}τλ2​ and τλ1\tau^{\lambda_1}τλ1​ be independent exponential random variables with rates λ2>0\lambda_2>0λ2​>0 and λ1>0\lambda_1>0λ1​>0, let τ=τλ2∧τλ1\tau=\tau^{\lambda_2}\wedge\tau^{\lambda_1}τ=τλ2​∧τλ1​ and r>0r>0r>0. Starting from balance n∈Zn\in\mathbb Zn∈Z, the balance after the next payment is n+1n+1n+1 if τλ2\tau^{\lambda_2}τλ2​ rings first (node 2 pays) and n−1n-1n−1 otherwise. Then for every function J:Z→RJ:\mathbb Z\to\mathbb RJ:Z→R,

E[e−rτJ(Xt+τ)∣Xt=n]=J(n+1)λ2r+λ2+λ1+J(n−1)λ1r+λ2+λ1.E\big[e^{-r\tau}J(X_{t+\tau})\mid X_t=n\big]=J(n+1)\frac{\lambda_2}{r+\lambda_2+\lambda_1}+J(n-1)\frac{\lambda_1}{r+\lambda_2+\lambda_1}.E[e−rτJ(Xt+τ​)∣Xt​=n]=J(n+1)r+λ2​+λ1​λ2​​+J(n−1)r+λ2​+λ1​λ1​​.

These are the second and third coefficients of the first-step equation (15).

Formalization Note The conditional expectation given Xt=nX_t=nXt​=n is written as the unconditional expectation of e−rτJ(n±1)e^{-r\tau}J(n\pm1)e−rτJ(n±1), where the sign is chosen by the event {τλ2<τλ1}\{\tau^{\lambda_2}<\tau^{\lambda_1}\}{τλ2​<τλ1​}; a tie τλ2=τλ1\tau^{\lambda_2}=\tau^{\lambda_1}τλ2​=τλ1​ is sent to n−1n-1n−1 and has probability zero. The paper factors the expectation as E[e−rτ] P(τ=τλ2)E[e^{-r\tau}]\,P(\tau=\tau^{\lambda_2})E[e−rτ]P(τ=τλ2​); the statement is the joint expectation, and no independence of τ\tauτ from the identity of the first clock is assumed. Laws are expMeasure via push-forwards, independence is IndepFun, and integrability is part of what is to be proved.

Preamble
import Mathlib

set_option autoImplicit false

open MeasureTheory ProbabilityTheory
Formal statement
namespace LNChannels.Exact

/-- Proof of Theorem 1, p. 10, "the last term equals": for independent exponential clocks
`τ^{λ₂}`, `τ^{λ₁}` and `τ = τ^{λ₂} ∧ τ^{λ₁}`, the balance moves from `n` to `n + 1` if
`τ^{λ₂}` rings first and to `n − 1` otherwise, and for every `J : ℤ → ℝ`
`E[e^{−rτ} J(X_{t+τ}) | X_t = n] = J(n + 1) λ₂/(r + λ₂ + λ₁) + J(n − 1) λ₁/(r + λ₂ + λ₁)`. -/
theorem last_term {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P]
    (τ₁ τ₂ : Ω → ℝ) (lam₁ lam₂ r : ℝ) (hlam₁ : 0 < lam₁) (hlam₂ : 0 < lam₂) (hr : 0 < r)
    (hτ₁ : Measurable τ₁) (hτ₂ : Measurable τ₂)
    (hlaw₁ : P.map τ₁ = expMeasure lam₁) (hlaw₂ : P.map τ₂ = expMeasure lam₂)
    (hindep : IndepFun τ₂ τ₁ P) (J : ℤ → ℝ) (n : ℤ) :
    ∫ ω, Real.exp (-r * min (τ₂ ω) (τ₁ ω)) * J (if τ₂ ω < τ₁ ω then n + 1 else n - 1) ∂P
      = J (n + 1) * (lam₂ / (r + lam₂ + lam₁))
        + J (n - 1) * (lam₁ / (r + lam₂ + lam₁)) := by sorry

end LNChannels.Exact
Source
Guasoni, Huberman & Shikhelman, Lightning Network Economics: Channels, Management Science (Articles in Advance, Nov. 6, 2023), p. 10 (PDF p. 11), proof of Theorem 1, display "the last term equals" (before (15))
Human review
  • Endorsed by Shuze Chen · Oct 15, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 15, 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