Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 (i), (2), p. 6 — the minimal cost of a unidirectional channel

Proved
LNChannels.Exact.theorem_1_i_min

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

lightning-networkoptimizationp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1payment-channels

Let B>0B>0B>0, λ2>0\lambda_2>0λ2​>0, r>0r>0r>0 and set k=Blog⁡(1+r/λ2)k=B\log(1+r/\lambda_2)k=Blog(1+r/λ2​). Over real channel sizes m>0m>0m>0, the unidirectional cost m+B(((r+λ2)/λ2)m−1)−1m+B\big(((r+\lambda_2)/\lambda_2)^m-1\big)^{-1}m+B(((r+λ2​)/λ2​)m−1)−1 of (1) has the minimum value

copt(0,λ2)=B2k(−k+k(k+4)+2log⁡(12(k+k(k+4)+2))),c^{opt}(0,\lambda_2)=\frac{B}{2k}\left(-k+\sqrt{k(k+4)}+2\log\Big(\tfrac12\big(k+\sqrt{k(k+4)}+2\big)\Big)\right),copt(0,λ2​)=2kB​(−k+k(k+4)​+2log(21​(k+k(k+4)​+2))),

and the minimum is attained at

l2=Bklog⁡(12(k+k(k+4)+2))>0.l_2=\frac{B}{k}\log\Big(\tfrac12\big(k+\sqrt{k(k+4)}+2\big)\Big)>0.l2​=kB​log(21​(k+k(k+4)​+2))>0.

This gives the optimal size and cost of a unidirectional channel in closed form.

Formalization Note The minimization is over real sizes m>0m>0m>0 (the paper differentiates in l2l_2l2​), with the real power Real.rpow. The paper writes copt(0,λ)c^{opt}(0,\lambda)copt(0,λ) with kkk defined from λ2\lambda_2λ2​; here λ=λ2\lambda=\lambda_2λ=λ2​. B>0B>0B>0 is required: for B=0B=0B=0 the infimum 000 is not attained.

Preamble
import Mathlib
import Definitions.Def_LNChannels_Exact_uniCost

set_option autoImplicit false
Formal statement
namespace LNChannels.Exact

/-- Theorem 1 (i), (2), p. 6: with `k = B log(1 + r/λ₂)`, the minimum over real sizes `m > 0` of
the unidirectional cost (1) is `(B/(2k))(−k + √(k(k+4)) + 2 log(½(k + √(k(k+4)) + 2)))`, attained at
`l₂ = (B/k) log(½(k + √(k(k+4)) + 2))`. -/
theorem theorem_1_i_min (lam₂ r B : ℝ) (hB : 0 < B) (hlam₂ : 0 < lam₂) (hr : 0 < r) :
    let k := B * Real.log (1 + r / lam₂)
    let copt := B / (2 * k) * (-k + Real.sqrt (k * (k + 4))
      + 2 * Real.log ((1 / 2) * (k + Real.sqrt (k * (k + 4)) + 2)))
    let lstar := B / k * Real.log ((1 / 2) * (k + Real.sqrt (k * (k + 4)) + 2))
    IsLeast (uniCost lam₂ r B '' Set.Ioi 0) copt ∧ 0 < lstar ∧
      uniCost lam₂ r B lstar = copt := by sorry

end LNChannels.Exact
Source
Guasoni, Huberman & Shikhelman, Lightning Network Economics: Channels, Management Science (Articles in Advance, Nov. 6, 2023), p. 6 (PDF p. 7), Theorem 1 (i), equation (2); proof §5.2, pp. 10–11
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