Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Theorem 1, p. 10 — E[e−rτ]E[e^{-r\tau}]E[e−rτ] and the expected opportunity cost until the next payment

Proved
LNChannels.Exact.first_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 on a probability space, and let τ=τλ2∧τλ1\tau=\tau^{\lambda_2}\wedge\tau^{\lambda_1}τ=τλ2​∧τλ1​ be the time until the next payment. Let r>0r>0r>0 and let l1,l2l_1,l_2l1​,l2​ be natural numbers. Then

E[e−rτ]=λ2+λ1λ2+λ1+rE\big[e^{-r\tau}\big]=\frac{\lambda_2+\lambda_1}{\lambda_2+\lambda_1+r}E[e−rτ]=λ2​+λ1​+rλ2​+λ1​​

and the expected discounted opportunity cost of the locked capital until the next payment is

E[∫0τe−rs r(l1+l2) ds]=(l1+l2)rr+λ2+λ1.E\Big[\int_0^\tau e^{-rs}\,r(l_1+l_2)\,ds\Big]=(l_1+l_2)\frac{r}{r+\lambda_2+\lambda_1}.E[∫0τ​e−rsr(l1​+l2​)ds]=(l1​+l2​)r+λ2​+λ1​r​.

This is the first coefficient of the first-step equation (15) for the cost of a bidirectional channel.

Formalization Note The exponential laws are Mathlib's expMeasure, imposed through the push-forward measures of measurable random variables, and independence is IndepFun. Expectations are Bochner integrals; the integrability needed for them is part of what is to be proved, not a hypothesis (the stated values are nonzero, so Lean's value 000 for a non-integrable function cannot make the statement hold).

Preamble
import Mathlib

set_option autoImplicit false

open MeasureTheory ProbabilityTheory
Formal statement
namespace LNChannels.Exact

/-- Proof of Theorem 1, p. 10, "the first term equals": for independent exponential clocks
`τ^{λ₂}`, `τ^{λ₁}` with rates `λ₂`, `λ₁` and `τ = τ^{λ₂} ∧ τ^{λ₁}`,
`E[e^{−rτ}] = (λ₂ + λ₁)/(λ₂ + λ₁ + r)` and
`E[∫₀^τ e^{−rs} r(l₁ + l₂) ds] = (l₁ + l₂) r/(r + λ₂ + λ₁)`. -/
theorem first_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) (l₁ l₂ : ℕ) :
    ∫ ω, Real.exp (-r * min (τ₂ ω) (τ₁ ω)) ∂P = (lam₂ + lam₁) / (lam₂ + lam₁ + r) ∧
    ∫ ω, (∫ s in (0 : ℝ)..(min (τ₂ ω) (τ₁ ω)), Real.exp (-r * s) * r * ((l₁ : ℝ) + l₂)) ∂P
      = ((l₁ : ℝ) + l₂) * (r / (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 first 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