Documentation

CslibFrontier.Computability.Circuit.Boolean.Zhegalkin.StageStep

Internal stage-step synthesis for {⊕, ∧, 1} circuits #

Internal stage sets (xGroupSet, zhegPairIdx, zhegOddIdx, stageSet) and inductive stage synthesis (synth_stage_step) consumed privately by UpperBound; never re-exported through Zhegalkin.

Main definitions #

Main results #

Nonempty block sums of input wires over width-s blocks.

Section-peer pairs (u, (r₁, r₂)) having at least one paired ZhegCol.

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

Rows r having at least one odd-leftover ZhegCol.

Wires available before synthesizing conjunction-gate stage q₀.

theorem Cslib.Circuits.Boolean.Zhegalkin.synth_stage_step {n M k : ℕ} {f : BooleanFunction n} (d : PaddedDecomp f M k) {s p : ℕ} (hs : 0 < s) (hp : 0 < p) (q₀ : ℕ) :
CostSynthesis interpretation andCost (stageSet d s p q₀) (stageSet d s p (q₀ + 1)) (∑ up ∈ zhegPairIdx d s p with ↑up.row₁ / 2 / s = q₀, ((pairedCols (hasZhegCol d s) p up.sec up.row₁ up.row₂).card - 1) + ∑ r ∈ zhegOddIdx d s p with ↑r / 2 / s = q₀, ((oddCols (hasZhegCol d s) p r).card - 1) + ∑ x : Fin M with ↑x / s = q₀, (2 * (p + s) + 1) + if q₀ < M / s then 2 ^ s - s - 1 else 0) (∑ i : Fin M with ↑i / s = q₀, if ↑i < k then 1 else 0)