def addl_len_le

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/curve25519/poly.bend:168

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/poly.bend as Poly
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/curve25519/field.bend as F
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/logic.bend as L

168def addl_len_le(+n: Nat, +xs: List<&2, U32>, +ys: List<&2, U32>, +ex: {len_le(n, xs) == True{} : Bool}, +ey: {len_le(n, ys) == True{} : Bool}) -> {len_le(n, F.addl(xs, ys)) == True{} : Bool}:
169  match n xs ys:
170    case 0n Nil{} _:
171      ey
172    case 0n Con{x, xt} _:
173      Empty.absurd({len_le(0n, F.addl(Con{x, xt}, ys)) == True{} : Bool}, L.false_true(ex))
174    case 1n+m Nil{} _:
175      ey
176    case 1n+m Con{x, xt} Nil{}:
177      ex
178    case 1n+ +m Con{x, +xt} Con{y, +yt}:
179      addl_len_le(m, xt, yt, ex, ey)

Uses (8)

Used by (1)