def sub_le0

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/f64divv.bend:57

import bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64divv.bend as F64divv
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend as N

57def sub_le0(+a: Nat, +b: Nat) -> {Nat.is_le(Nat.sub(a, b), a) == True{} : Bool}:
58  match a b:
59    case 0n 0n:
60      {==}
61    case 0n 1n+ +bp:
62      {==}
63    case 1n+ +ap 0n:
64      N.le_refl(1n+ap)
65    case 1n+ +ap 1n+ +bp:
66      N.le_trans(Nat.sub(ap, bp), ap, 1n+ap, sub_le0(ap, bp), N.le_succ(ap))

Uses (7)

Used by (2)