def sub_lt

bend-collections-laws-crypto@1.0.0.0 · proofs/lib/nat.bend:307

import bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend as Nat
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L

307def sub_lt(+a: Nat, +b: Nat, +c: Nat, le: {Nat.is_le(b, a) == True{} : Bool}, lt: {Nat.is_lt(a, Nat.add(b, c)) == True{} : Bool}) -> {Nat.is_lt(Nat.sub(a, b), c) == True{} : Bool}:
308  match a b:
309    case _ 0n:
310      %Equal.sym(Nat, Nat.sub(a, 0n), a, sub_zero(a)) : {Nat.is_lt(_, c) == True{} : Bool}
311      lt
312    case 0n 1n+q:
313      Empty.absurd({Nat.is_lt(Nat.sub(0n, 1n+q), c) == True{} : Bool}, L.false_true(le))
314    case 1n+p 1n+q:
315      sub_lt(p, q, c, le, lt)

Uses (10)

Used by (6)