def double_le
bendtorch-core@0.1.0.0 · src/tensor/word_conversion.bend:109
import bendtorch-core@0.1.0.0/src/tensor/word_conversion.bend as WordConversion
import Base
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
109def double_le(+left: Nat, +right: Nat, bound: {Nat.is_le(left, right) == True{} : Bool}) ->
110 {Nat.is_le(Nat.double(left), Nat.double(right)) == True{} : Bool}:
111 match left right:
112 case 0n 0n:
113 {==}
114 case 0n 1n+r:
115 {==}
116 case 1n+l 0n:
117 Empty.absurd({Nat.is_le(2n+Nat.double(l), 0n) == True{} : Bool}, Arith.clash(bound))
118 case 1n+l 1n+r:
119 double_le(l, r, bound)