Provednlightninglightningpr-14deep-formalization
Commitment-number 24-bit halves recombine exactly
For all , if , then
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
Nat) - <Less than
- obscured is strictly smaller than 2^48. (
obscured < 2^48) - ·Multiplication
- obscured/2^24 times 2^24. (
(obscured / 2^24) * 2^24) - +Addition
- obscured/2^24 · 2^24 plus obscured % 2^24. (
(obscured / 2^24) * 2^24 + obscured % 2…) - =Equality
- obscured/2^24 · 2^24 + obscured % 2^24 and obscured are the same. (
(obscured / 2^24) * 2^24 + obscured % 2…) - a/bDivision
- obscured divided by 2^24. In Lean, dividing by 0 gives 0. (
obscured / 2^24) - aᵇPower
- 2 raised to the power 48. (
2^48) - modRemainder
- The remainder when obscured is divided by 2^24. (
obscured % 2^24)
theorem nlightning-commitment-halves-recombine (obscured : Nat) (bound : obscured < 2^48) :
(obscured / 2^24) * 2^24 + obscured % 2^24 = obscuredRepository-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
- Quot.sound, propext
- Proof
- 6 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.