Executable binary field blocks #
A bounded scan splits an explicitly supplied number of fixed-width blocks. Short inputs produce short or empty final blocks and long suffixes are ignored; the program is total on all inputs. Canonical-width inputs split and flatten exactly. Combined conversion interprets the flat CL vector in the constructed self-dual basis and returns the field arithmetic's canonical Shoup rows.
Equations
- MIPRE.Introspection.BinaryBlock.splitBlocks 0 x✝¹ x✝ = []
- MIPRE.Introspection.BinaryBlock.splitBlocks n.succ x✝¹ x✝ = List.take x✝¹ x✝ :: MIPRE.Introspection.BinaryBlock.splitBlocks n x✝¹ (List.drop x✝¹ x✝)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
MIPRE.Introspection.BinaryBlock.splitStep_apply
(v : Cost.BitStr)
(vs : List Cost.BitStr)
(k : Cost.Unary)
:
theorem
MIPRE.Introspection.BinaryBlock.splitStep_fold
(n : ℕ)
(k : Cost.Unary)
(v : Cost.BitStr)
(vs : List Cost.BitStr)
:
(List.foldl splitStep.step (v, vs) (List.replicate n k)).2 = (splitBlocks n (List.length k) v).reverse ++ vs
Inputs are number of blocks, block width, and flat bits, in that order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
MIPRE.Introspection.BinaryBlock.splitBlocksProg_apply
(n k : Cost.Unary)
(v : Cost.BitStr)
:
Concatenation is an actual ambient program with a polynomial bound.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
MIPRE.Introspection.BinaryBlock.splitBlocks_flatten
(k : ℕ)
(vs : List Cost.BitStr)
(hv : ∀ v ∈ vs, List.length v = k)
:
Read a flat self-dual vector as canonical Shoup field rows.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Write canonical Shoup rows as the flat self-dual CL vector.
Equations
Instances For
theorem
MIPRE.Introspection.BinaryBlock.decodeBlocksProg_apply
(n k : Cost.Unary)
(v : Cost.BitStr)
:
decodeBlocksProg.toFun (n, k, v) = BasisProgram.fromSelfDualRowsProg.toFun (k, splitBlocks (List.length n) (List.length k) v)
theorem
MIPRE.Introspection.BinaryBlock.encodeBlocksProg_apply
(k : Cost.Unary)
(vs : List Cost.BitStr)
:
theorem
MIPRE.Introspection.BinaryBlock.encodeBlocksProg_correct
(k : ℕ)
(hk : 1 ≤ k)
[NeZero k]
(hodd : Odd k)
{n : ℕ}
(u : Fin n → (SAT.shoupBinField k hk).carrier)
:
encodeBlocksProg.toFun (Cost.unary k, (SAT.shoupBinField k hk).vecBits u) = (List.ofFn fun (i : Fin n) =>
LowDegree.BinaryLinear.vectorBits ((SAT.shoupSelfDualNormalBasis k hk hodd).equivFun (u i))).flatten
theorem
MIPRE.Introspection.BinaryBlock.decodeBlocksProg_correct
(k : ℕ)
(hk : 1 ≤ k)
[NeZero k]
(hodd : Odd k)
{n : ℕ}
(u : Fin n → (SAT.shoupBinField k hk).carrier)
:
decodeBlocksProg.toFun
(Cost.unary n, Cost.unary k, (List.ofFn fun (i : Fin n) =>
LowDegree.BinaryLinear.vectorBits ((SAT.shoupSelfDualNormalBasis k hk hodd).equivFun (u i))).flatten) = (SAT.shoupBinField k hk).vecBits u