Bounds.limbs_take: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/bounds.bend as Bounds Lines 86-100 of bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/bounds.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/bounds.bend&start_line=86&end_line=100 import Base import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as C import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend as FS import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/limbs.bend as L import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as Lg # the first j limbs of a list whose first n >= j limbs are fine def limbs_take(+one: Nat, n: Nat, j: Nat, +xs: List<&2, Nat>, +hj: {Nat.is_le(j, n) == True{} : Bool}, +h: {FS.limbs16(one, n, L.take(n, xs)) == True{} : Bool}) -> {FS.limbs16(one, j, L.take(j, xs)) == True{} : Bool}: match n j xs: case 0n 0n _: {==} case 0n 1n+i _: Empty.absurd({FS.limbs16(one, 1n+i, L.take(1n+i, xs)) == True{} : Bool}, Lg.false_true(hj)) case 1n+k 0n _: {==} case 1n+k 1n+i Nil{}: Empty.absurd({FS.limbs16(one, 1n+i, L.take(1n+i, [])) == True{} : Bool}, Lg.false_true(h)) case 1n+ +k 1n+ +i +x <> +t: +hx = Lg.and_left(Nat.is_lt(x, C.shift(16n, one)), FS.limbs16(one, k, L.take(k, t)), h) +ht = Lg.and_right(Nat.is_lt(x, C.shift(16n, one)), FS.limbs16(one, k, L.take(k, t)), h) Lg.and_intro(Nat.is_lt(x, C.shift(16n, one)), FS.limbs16(one, i, L.take(i, t)), hx, limbs_take(one, k, i, t, hj, ht)) 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=Empty.absurd https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat 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.is_lt https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend&name=and_intro https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend&name=and_left https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend&name=and_right https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend&name=false_true https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend&name=limbs16 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend&name=shift https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=take