def sub_u32

bendtorch-core@0.1.0.0 · src/storage/arith.bend:482

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

482def sub_u32(+i: U32, +c: U32, h: {Nat.is_le(U32.to_nat(c), U32.to_nat(i)) == True{} : Bool}) ->
483  {U32.to_nat(i) == Nat.add(U32.to_nat(c), U32.to_nat(U32.sub(i, c))) : Nat}:
484  match i c:
485    case U32{x} U32{y}:
486      Equal.sym(Nat, Nat.add(Word.to_nat(32n, y), Word.to_nat(32n, Word.adc(32n, x, y, True{}, True{}))), Word.to_nat(32n, x),
487        sub_word(32n, x, y, True{}, h))

Uses (11)

Used by (2)