Fwrap.is_high_s: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/fwrap.bend as Fwrap Lines 111-119 of bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/fwrap.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/fwrap.bend&start_line=111&end_line=119 import Base 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/src/crypto/secp256k1/scalar.bend as S 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/crypto/secp256k1/limbs.bend as LV import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/consts.bend as K import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/listops.bend as LO def is_high_s(+one: Nat, +h1: {one == 1n : Nat}, +a: List<&2, Nat>) -> {S.is_high(a) == Nat.is_lt(FS.order(one), Nat.double(FS.value(one, a))) : Bool}: %Equal.sym(Bool, L.ltm(S.cm1(), L.scal(2n, a)), Nat.is_lt(LV.ev(L.scal(2n, a)), 1n+1n+K.np(one)), LO.ltm_vv(one, h1, 1n+K.np(one), S.cm1(), hm_n1(one, h1), L.scal(2n, a))) : {Bool.not(_) == Nat.is_lt(FS.order(one), Nat.double(FS.value(one, a))) : Bool} %Equal.sym(Nat, LV.ev(L.scal(2n, a)), Nat.mul(LV.ev(a), 2n), LV.scal_v(2n, a)) : {Bool.not(Nat.is_lt(_, 1n+1n+K.np(one))) == Nat.is_lt(FS.order(one), Nat.double(FS.value(one, a))) : Bool} %Equal.sym(Nat, FS.value(one, a), LV.ev(a), LV.ev_value(one, h1, a)) : {Bool.not(Nat.is_lt(Nat.mul(LV.ev(a), 2n), 1n+1n+K.np(one))) == Nat.is_lt(FS.order(one), Nat.double(_)) : Bool} %Equal.sym(Bool, Bool.not(Nat.is_lt(Nat.mul(LV.ev(a), 2n), 1n+1n+K.np(one))), Nat.is_lt(1n+K.np(one), Nat.mul(LV.ev(a), 2n)), nlt(Nat.mul(LV.ev(a), 2n), 1n+K.np(one))) : {_ == Nat.is_lt(FS.order(one), Nat.double(LV.ev(a))) : Bool} %Equal.sym(Nat, FS.order(one), 1n+K.np(one), K.order_eq(one, h1)) : {Nat.is_lt(1n+K.np(one), Nat.mul(LV.ev(a), 2n)) == Nat.is_lt(_, Nat.double(LV.ev(a))) : Bool} %Equal.sym(Nat, Nat.double(LV.ev(a)), Nat.mul(2n, LV.ev(a)), NA.double_mul(LV.ev(a))) : {Nat.is_lt(1n+K.np(one), Nat.mul(LV.ev(a), 2n)) == Nat.is_lt(1n+K.np(one), _) : Bool} %Equal.sym(Nat, Nat.mul(2n, LV.ev(a)), Nat.mul(LV.ev(a), 2n), NA.mul_comm(2n, LV.ev(a))) : {Nat.is_lt(1n+K.np(one), Nat.mul(LV.ev(a), 2n)) == Nat.is_lt(1n+K.np(one), _) : Bool} {==} Uses (24): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym 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.double https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/consts.bend&name=np https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/consts.bend&name=order_eq https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/fwrap.bend&name=hm_n1 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/fwrap.bend&name=nlt https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/limbs.bend&name=ev https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/limbs.bend&name=ev_value https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/limbs.bend&name=scal_v https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/listops.bend&name=ltm_vv https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend&name=double_mul https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/proofs/lib/lemmas/proofs/nat_algebra.bend&name=mul_comm https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend&name=order https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend&name=value https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=ltm https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/limbs.bend&name=scal https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/scalar.bend&name=cm1 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/scalar.bend&name=is_high