Provednlightninglightningpr-14formal-invariant
Not trimmed is equivalent to meeting the dust-plus-fee threshold
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) - x ∈ TVariables
- amount, dust, fee range over natural numbers: the statement must hold for every choice. (
(amount dust fee : Nat)) - ⟺If and only if
- ¬(amount/1000 < dust + fee) holds exactly when dust + fee ≤ amount/1000 holds. (
(¬ amount / 1000 < dust + fee) ↔ dust +…) - ¬Not
- It is not the case that amount/1000 < dust + fee. (
¬ amount / 1000 < dust + fee) - a/bDivision
- amount divided by 1000. In Lean, dividing by 0 gives 0. (
amount / 1000) - <Less than
- amount/1000 is strictly smaller than dust + fee. (
amount / 1000 < dust + fee) - +Addition
- dust plus fee. (
dust + fee) - ≤At most
- dust + fee is less than or equal to amount/1000. (
dust + fee ≤ amount / 1000)
theorem nlightning-htlc-trim-threshold-complement (amount dust fee : Nat) :
(¬ amount / 1000 < dust + fee) ↔ dust + fee ≤ amount / 1000Linear-order complement of the exact HTLC trimming predicate.
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.