Documentation

CslibFrontier.Foundations.Data.BitString.Parity.SubsetSum

Additive bits of subset sums #

An additive map φ : M →+ Bool (into the Boolean ring, where addition is exclusive or) sends the sum ∑ t, if x t then v t else 0 of the vectors v t selected by a bit string x to the parity of x on the fixed set of indices t with φ (v t) = true (Cslib.BitString.map_sum_ite_eq_parityOn). For example, a coordinate of an element of a vector space over 𝔽₂, read as a bit, is additive. So that coordinate of a sum selected by x is a parity of x over a set that does not depend on x. This is how a field element computed linearly from the bits of x becomes a row of parity gates.

Main results #

theorem Cslib.BitString.map_sum_ite_eq_parityOn {ι : Type u_1} {M : Type u_2} [Fintype ι] [AddCommMonoid M] (φ : M →+ Bool) (v : ι → M) (x : ι → Bool) :
φ (∑ t : ι, if x t = true then v t else 0) = parityOn {t : ι | φ (v t) = true} x

An additive bit of a subset sum is a parity. For an additive map φ : M →+ Bool, the bit φ (∑ t, if x t then v t else 0) of the sum of the vectors v t selected by x is the parity of x on the indices t with φ (v t) = true.