def le_mul_pos

bend-collections-laws-crypto@1.0.0.0 · proofs/math/natural/roots.bend:30

import bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/roots.bend as Roots
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend as N
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend as A

30# x <= x y for y > 0
31def le_mul_pos(+x: Nat, +y: Nat, +hy: {Nat.is_lt(0n, y) == True{} : Bool}) -> {Nat.is_le(x, Nat.mul(x, y)) == True{} : Bool}:
32  match y:
33    case 0n:
34      Empty.absurd({Nat.is_le(x, Nat.mul(x, 0n)) == True{} : Bool}, L.false_true(hy))
35    case 1n+ +yp:
36      %Equal.sym(Nat, Nat.mul(x, 1n+yp), Nat.add(x, Nat.mul(x, yp)), A.mul_succ(x, yp)) : {Nat.is_le(x, _) == True{} : Bool}
37      N.le_add_right(x, Nat.mul(x, yp))

Uses (11)

Used by (3)