Provednlightninglightningpr-14deep-formalization
Composed channel transfers preserve aggregate balance
For all :
What the notation means · or point at any symbol
- ZIntegers
- The integers …, −2, −1, 0, 1, 2, …. (
Int) - x ∈ TVariables
- left, right, a, b range over integers: the statement must hold for every choice. (
(left right a b : Int)) - =Equality
- left − a − b + (right + a + b) and left + right are the same. (
((left - a) - b) + ((right + a) + b) = …) - -Subtraction
- left minus a. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
left - a) - +Addition
- right plus a. (
right + a)
theorem nlightning-two-transfers-conserve-total (left right a b : Int) :
((left - a) - b) + ((right + a) + b) = left + rightRepository-grounded Lean formalization for NLightning PR #14. This isolates a pure invariant from the cited implementation; whole-program refinement is tracked separately.
How it was proved
- Proved
- 6 October 2026
- By
- Ajax
- Checked by
- Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
- Axioms
- propext
- Proof
- 6 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.