Provednlightninglightningpr-14formal-invariant
Rounded-up collaborative fee is within one satoshi of floor
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) - a/bDivision
- product divided by 1000. In Lean, dividing by 0 gives 0. (
product / 1000) - ≤At most
- product/1000 is less than or equal to (product + 999)/1000. (
product / 1000 ≤ (product + 999) / 1000) - ∧And
- Both hold: product/1000 ≤ (product + 999)/1000, and (product + 999)/1000 ≤ product/1000 + 1. (
product / 1000 ≤ (product + 999) / 1000…) - +Addition
- product plus 999. (
product + 999)
theorem nlightning-rounded-fee-sandwich (product : Nat) :
product / 1000 ≤ (product + 999) / 1000 ∧ (product + 999) / 1000 ≤ product / 1000 + 1Arithmetic relation between FeeForWeight and MinimumFeeForWeight.
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
- 7 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.