Documentation

CslibFrontier.Computability.Circuit.Boolean.Zhegalkin.StageParts

Internal staged column-pairing partition for {⊕, ∧, 1} synthesis #

Internal combined X ⊕ G column definitions and row-sum partition lemmas (ZhegCol, mul_sum_hasZhegCol_le, zhegRowParts, card_zhegRowParts_le, sum_zhegRowParts_eq) consumed by StageStep and UpperBound; never re-exported through Zhegalkin.

Main definitions #

Main results #

@[reducible, inline]

Combined column index across original X blocks and prior G gate blocks.

theorem Cslib.Circuits.Boolean.Zhegalkin.card_zhegCol_le (n M s : ℕ) (hs : 0 < s) :
Fintype.card (ZhegCol n M s) ≤ 2 ^ s * ((n + M) ⌈/⌉ s)

Boolean function associated with column c : ZhegCol n M s.

def Cslib.Circuits.Boolean.Zhegalkin.hasZhegCol {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) (s : ℕ) (r : Fin (2 * M)) :
ZhegCol n M s → Bool

Whether conjunction input row r uses non-intra column c : ZhegCol n M s.

theorem Cslib.Circuits.Boolean.Zhegalkin.mul_sum_hasZhegCol_le {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) (s : ℕ) :
s * ∑ r : Fin (2 * M), {c : ZhegCol n M s | hasZhegCol d s r c = true}.card ≤ M * (M + 2 * n)
def Cslib.Circuits.Boolean.Zhegalkin.zhegPairVal {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) (s p : ℕ) (up : SectionPeer (2 * M)) (x : Fin n → Bool) :

Shared sum of columns paired between two rows in horizontal section up.sec.

def Cslib.Circuits.Boolean.Zhegalkin.zhegOddVal {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) (s p : ℕ) (r : Fin (2 * M)) (x : Fin n → Bool) :

Sum of unpaired odd-leftover columns for row r.

def Cslib.Circuits.Boolean.Zhegalkin.intraGSet {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) (s : ℕ) (r : Fin (2 * M)) :

Intra-stage conjunction indices ℓ < r / 2 active in row r.

Linear input form hFn d r fed into conjunction gate r / 2.

Index tags partitioning a conjunction input row r across stages.

Embedding of section peers into ZhegPartIdx M.

Embedding of intra-stage gates into ZhegPartIdx M.

def Cslib.Circuits.Boolean.Zhegalkin.zhegRowParts {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) (s p : ℕ) (r : Fin (2 * M)) :

Finset of non-empty partition pieces making up hFn d r.

Boolean function for each tag in zhegRowParts d s p r.

theorem Cslib.Circuits.Boolean.Zhegalkin.card_zhegRowParts_le {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) {s p : ℕ} (hs : 0 < s) (hp : 0 < p) (r : Fin (2 * M)) :
(zhegRowParts d s p r).card ≤ p + s + 1
theorem Cslib.Circuits.Boolean.Zhegalkin.sum_zhegRowParts_eq {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) {s : ℕ} (hs : 0 < s) (p : ℕ) (r : Fin (2 * M)) (x : Fin n → Bool) :
∑ idx ∈ zhegRowParts d s p r, zhegPartVal d s p r idx x = hFn d r x