def sub_le

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/f64addg.bend:81

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

81def sub_le(+a: Nat, +b: Nat) -> {Nat.is_le(Nat.sub(a, b), a) == True{} : Bool}:
82  match a b:
83    case 0n 0n:
84      {==}
85    case 0n 1n+ +bp:
86      {==}
87    case 1n+ +ap 0n:
88      N.le_refl(1n+ap)
89    case 1n+ +ap 1n+ +bp:
90      N.le_trans(Nat.sub(ap, bp), ap, 1n+ap, sub_le(ap, bp), N.le_succ(ap))

Uses (7)

Used by (1)