Bits.le_step: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/proofs/math/natural/bits.bend as Bits Lines 89-95 of bend-collections-laws-math@1.0.0.0/proofs/math/natural/bits.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/natural/bits.bend&start_line=89&end_line=95 import Base import bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend as N import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as SC # the lower bound, as 2^L <= max(1, 2 n) def le_step(+np: Nat, +h: Nat, +x: Nat, +e: {1n+np == Nat.add(Nat.double(h), Nat.mod(1n+np, 2n)) : Nat}, +ih: {Nat.is_le(SC.pow2(x), Nat.max(1n, Nat.double(h))) == True{} : Bool}) -> {Nat.is_le(SC.pow2(x), 1n+np) == True{} : Bool}: match h: case 0n: N.le_trans(SC.pow2(x), 1n, 1n+np, ih, N.lt_succ_le_succ(0n, 1n+np, {==})) case 1n+ +hp: N.le_trans(SC.pow2(x), Nat.double(1n+hp), 1n+np, ih, N.le_trans(Nat.double(1n+hp), Nat.add(Nat.double(1n+hp), Nat.mod(1n+np, 2n)), 1n+np, N.le_add_right(Nat.double(1n+hp), Nat.mod(1n+np, 2n)), N.eq_le(Nat.add(Nat.double(1n+hp), Nat.mod(1n+np, 2n)), 1n+np, Equal.sym(Nat, 1n+np, Nat.add(Nat.double(1n+hp), Nat.mod(1n+np, 2n)), e)))) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.double https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.max https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend&name=eq_le https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend&name=le_add_right https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend&name=le_trans https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend&name=lt_succ_le_succ https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/lib/common.bend&name=pow2