Provednlightninglightningpr-14deep-formalization
Adjacent gossip block ranges partition their combined window
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) - x ∈ TVariables
- first, left, right, height range over natural numbers: the statement must hold for every choice. (
(first left right height : Nat)) - ≤At most
- first is less than or equal to height. (
first ≤ height) - ∧And
- Both hold: first ≤ height, and height < first + (left + right). (
first ≤ height ∧ height < first + (left…) - ∨Or
- At least one holds: first ≤ height ∧ height < first + left, or first + left ≤ height ∧ height < first + left + right. (
(first ≤ height ∧ height < first + left…) - <Less than
- height is strictly smaller than first + (left + right). (
height < first + (left + right)) - +Addition
- left plus right. (
left + right)
theorem nlightning-adjacent-block-ranges-partition (first left right height : Nat) (inside : first ≤ height ∧ height < first + (left + right)) :
(first ≤ height ∧ height < first + left) ∨ (first + left ≤ height ∧ height < first + left + right)Repository-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
- Classical.choice, Quot.sound, propext
- Proof
- 6 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.