Provednlightninglightningpr-14deep-formalization
Every BOLT 12 invoice-request range lies in the invoice range
For all :
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
Nat) - ⟹Implies
- If t ≤ 159 ∨ 1000000000 ≤ t ∧ t ≤ 2999999999, then t ≤ 239 ∨ 1000000000 ≤ t ∧ t ≤ 3999999999. (Between types, A → B is the type of functions from A to B.) (
(t ≤ 159 ∨ (1000000000 ≤ t ∧ t ≤ 299999…) - ≤At most
- t is less than or equal to 159. (
t ≤ 159) - ∨Or
- At least one holds: t ≤ 159, or 1000000000 ≤ t ∧ t ≤ 2999999999. (
t ≤ 159 ∨ (1000000000 ≤ t ∧ t ≤ 2999999…) - ∧And
- Both hold: 1000000000 ≤ t, and t ≤ 2999999999. (
1000000000 ≤ t ∧ t ≤ 2999999999)
theorem nlightning-invreq-range-subset-invoice (t : Nat) :
((t ≤ 159 ∨ (1000000000 ≤ t ∧ t ≤ 2999999999)) → (t ≤ 239 ∨ (1000000000 ≤ t ∧ t ≤ 3999999999)))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.