Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

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

Proved
LNChannels.Exact.theorem_1_i_cost

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

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

Let only node 2 pay, at rate λ2>0\lambda_2>0λ2​>0, let r>0r>0r>0, B∈RB\in\mathbb RB∈R, and let l2≥1l_2\ge1l2​≥1 be the natural size of the unidirectional channel. The unidirectional cost system (J(n)=l2rr+λ2+J(n+1)λ2r+λ2J(n)=l_2\frac{r}{r+\lambda_2}+J(n+1)\frac{\lambda_2}{r+\lambda_2}J(n)=l2​r+λ2​r​+J(n+1)r+λ2​λ2​​ for 0≤n<l20\le n<l_20≤n<l2​, with J(l2)=J(0)+BJ(l_2)=J(0)+BJ(l2​)=J(0)+B) has a solution, and every solution has

c0,l2(0,λ2)=J(0)=l2+B((r+λ2λ2)l2−1)−1.c^{0,l_2}(0,\lambda_2)=J(0)=l_2+B\left(\left(\frac{r+\lambda_2}{\lambda_2}\right)^{l_2}-1\right)^{-1}.c0,l2​(0,λ2​)=J(0)=l2​+B((λ2​r+λ2​​)l2​−1)−1.

This is the cost of settling a one-directional stream through a channel, the benchmark against which both on-chain settlement and bidirectional channels are compared.

Formalization Note The cost is defined by its equations (IsUniCostFn), not by (1). The size is a natural number and the power is a natural power.

Preamble
import Mathlib
import Definitions.Def_LNChannels_Exact_IsUniCostFn

set_option autoImplicit false
Formal statement
namespace LNChannels.Exact

/-- Theorem 1 (i), (1), p. 6 (proof in §5.2, pp. 10–11): the cost `c^{0,l₂}(0, λ₂) = J(0)` of a
unidirectional channel of size `l₂`. The cost system of §5.2 has a solution, and every solution
has `J(0) = l₂ + B(((r + λ₂)/λ₂)^{l₂} − 1)⁻¹`. -/
theorem theorem_1_i_cost (lam₂ r B : ℝ) (l₂ : ℕ)
    (hlam₂ : 0 < lam₂) (hr : 0 < r) (hl₂ : 1 ≤ l₂) :
    (∃ J : ℤ → ℝ, IsUniCostFn lam₂ r B l₂ J) ∧
    ∀ J : ℤ → ℝ, IsUniCostFn lam₂ r B l₂ J →
      J 0 = (l₂ : ℝ) + B * (((r + lam₂) / lam₂) ^ l₂ - 1)⁻¹ := 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 (1); proof in §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