def mul_le_mono

bendtorch-core@0.1.0.0 · src/autograd/reduce_fiber_proof.bend:137

import bendtorch-core@0.1.0.0/src/autograd/reduce_fiber_proof.bend as ReduceFiberProof
import Base
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

137def mul_le_mono(+a: Nat, +q: Nat, +size: Nat, h: {Nat.is_le(a, q) == True{} : Bool}) ->
138  {Nat.is_le(Nat.mul(a, size), Nat.mul(q, size)) == True{} : Bool}:
139  match a q:
140    case 0n q:
141      Arith.le_zero(Nat.mul(q, size))
142    case 1n+p 0n:
143      Empty.absurd({Nat.is_le(Nat.mul(1n+p, size), 0n) == True{} : Bool}, Arith.clash(h))
144    case 1n+p 1n+r:
145      le_add_cong(size, Nat.mul(p, size), Nat.mul(r, size), mul_le_mono(p, r, size, h))

Uses (8)

Used by (2)