Ineq.digit_lt: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend as Ineq Lines 66-71 of bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend&start_line=66&end_line=71 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/proofs/lib/nat.bend as N import bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend as NA import bend-collections-laws-crypto@1.0.0.0/proofs/math/typed/width.bend as WW # a < 2^k and e < P: a + 2^k e < 2^k P (2^k written C.shift(k, one)) def digit_lt(+k: Nat, +one: Nat, +h1: {one == 1n : Nat}, +a: Nat, +e: Nat, +pp: Nat, +ha: {Nat.is_lt(a, C.shift(k, one)) == True{} : Bool}, +he: {Nat.is_lt(e, pp) == True{} : Bool}) -> {Nat.is_lt(Nat.add(a, C.shift(k, e)), C.shift(k, pp)) == True{} : Bool}: +s1 = lt_le_add(a, C.shift(k, e), C.shift(k, one), C.shift(k, e), ha, N.le_refl(C.shift(k, e))) +e1 = Equal.trans(Nat, Nat.add(C.shift(k, one), C.shift(k, e)), C.shift(k, Nat.add(one, e)), C.shift(k, Nat.add(e, 1n)), Equal.sym(Nat, C.shift(k, Nat.add(one, e)), Nat.add(C.shift(k, one), C.shift(k, e)), WW.shift_add(k, one, e)), Equal.cong(Nat, Nat, z => C.shift(k, z), Nat.add(one, e), Nat.add(e, 1n), Equal.trans(Nat, Nat.add(one, e), Nat.add(e, one), Nat.add(e, 1n), NA.add_comm(one, e), Equal.cong(Nat, Nat, z => Nat.add(e, z), one, 1n, h1)))) N.lt_le_trans(Nat.add(a, C.shift(k, e)), C.shift(k, Nat.add(e, 1n)), C.shift(k, pp), lt_subst_r(Nat.add(a, C.shift(k, e)), Nat.add(C.shift(k, one), C.shift(k, e)), C.shift(k, Nat.add(e, 1n)), e1, s1), shift_le(k, Nat.add(e, 1n), pp, lt_succ_le(e, pp, he))) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans 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.is_lt https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend&name=lt_le_add https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend&name=lt_subst_r https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend&name=lt_succ_le https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/ineq.bend&name=shift_le https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend&name=add_comm https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend&name=le_refl https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend&name=lt_le_trans https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/math/typed/width.bend&name=shift_add https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend&name=shift