Internal full-block column encoding and block group-sum synthesis #
Internal block-sum combinators (all_group_subSums) and compressed full-block column helpers
(fullBlockEmb, fullRowPattern, FullCol, hasFullCol, fullColVal, matrixTailSet,
sum_fullCol_lt_eq, sum_row_eq_fullCol_add_tail) shared by AdditiveBound, StageParts,
StageStep, and UpperBound; never re-exported through Zhegalkin.
Main definitions #
Cslib.Circuits.Additive.fullBlockEmb,fullRowPattern,FullCol,hasFullCol,fullColVal,matrixTailSet: compressed width-sblock columns and trailing columns.
Main results #
Cslib.Circuits.all_group_subSums: width-sblock subset-sum synthesis bound.Cslib.Circuits.Additive.sum_fullCol_lt_eq,Cslib.Circuits.Additive.sum_row_eq_fullCol_add_tail: prefix full-block and full-row sum identities.
theorem Cslib.Circuits.all_group_subSums {σ : Signature} {n : ℕ} {G : Type u} [AddCommMonoid G] {I : Interpretation σ G} {w : σ.Op → ℕ} {addOp : σ.Op} {k width : ℕ} (hw : 0 < width) (hArity : σ.Arity addOp = 2) (hEval : ∀ (args : Fin (σ.Arity addOp) → G), I addOp args = args ⟨0, ⋯⟩ + args ⟨1, ⋯⟩) (hZeroW : w addOp = 0) {s : Set ((Fin n → G) → G)} (v : Fin k → (Fin n → G) → G) (hv : ∀ (j : Fin k), v j ∈ s) :
All nonempty subset sums within each width-width block of v : Fin k → (Fin n → G) → G
cost at most (k * 2 ^ width) / width binary addition gates.
@[reducible, inline]
Columns of the compressed full-block matrix: pairs (q, T) with q < n / s and T a nonempty
subset of Fin s.
def Cslib.Circuits.Additive.fullColVal {G : Type u_1} [AddCommMonoid G] {n s : ℕ} (c : FullCol n s) (x : Fin n → G) :
G
Sum of inputs selected by the full-block column c under valuation x.
theorem Cslib.Circuits.Additive.sum_row_eq_fullCol_add_tail {G : Type u_1} [AddCommMonoid G] {m n : ℕ} (A : Matrix (Fin m) (Fin n) Bool) {s : ℕ} (hs : 0 < s) (r : Fin m) (x : Fin n → G) :
(∑ j : Fin n, if A r j = true then x j else 0) = ∑ c : FullCol n s with hasFullCol A s r c = true, fullColVal c x + ∑ j ∈ matrixTailSet A s r, x j