def cb_okb
bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/curve25519/mulw.bend:47
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/mulw.bend as Mulw
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/num.bend as M
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/limbs.bend as LM
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/poly.bend as PL
47def cb_okb(+n: Nat, +xs: List<&2, U32>, +b: Nat, +k: Nat, +e: {LM.okb(n, xs, b) == True{} : Bool}) -> {PL.cb(xs, k) == PL.cbn(n, k) : Nat}:
48 match n xs:
49 case 0n Nil{}:
50 {==}
51 case 0n Con{y, yt}:
52 Empty.absurd({PL.cb(Con{y, yt}, k) == 0n : Nat}, L.false_true(e))
53 case 1n+m Nil{}:
54 Empty.absurd({0n == PL.cbn(1n+m, k) : Nat}, L.false_true(e))
55 case 1n+ +m Con{+y, +yt}:
56 M.cong_r(k, PL.cb(yt, k), PL.cbn(m, k), cb_okb(m, yt, b, k, LM.okb_tail(m, y, yt, b, e)))