Programs with shared gates over the full binary basis #
A SharedProgram over Binary.Formula on n inputs with k shared gates consists of k
intermediate formulas over the full binary basis together with one output formula, where each
formula may read the primary inputs and all previously computed shared values.
Fixing the coordinates outside a block Y ⊆ Fin n turns each of the k + 1 formulas into a
subfunction of the coordinates in Y together with the active shared variables:
- If a shared formula
Ghas no leaves in the current block (G.leavesIn Y = 0), then byFormula.eval_eq_of_leavesIn_eq_zeroits value is constant once the outside coordinates are fixed, so its output wire is placed outside the block (castBlock Y) and contributes0to both the shared-gate count and the shared-leaf count onY. - If
G.leavesIn Y ≠ 0, its output wire is included in the active block (snocBlock Y), contributing1active shared gate andP.occ Nactive shared-variable leaves.
Applying Nechiporuk's counting lemma (Nechiporuk.card_subfunctions_le) to the active formulas
yields
|(subfunctions P.eval Y)| ≤ 2 ^ (P.activeShared Y + 1) · 16 ^ (P.inputLeavesIn Y + P.activeSharedLeaves Y) (SharedProgram.card_subfunctions_le_activeSharedLeaves), which in turn
implies the global bound
|(subfunctions P.eval Y)| ≤ 2 ^ (k + 1) · 16 ^ (P.inputLeavesIn Y + P.sharedLeaves n)
(SharedProgram.card_subfunctions_le_inputLeavesIn).
Every single-output circuit c over Binary.signature decomposes from its last gate down into a
SharedProgram with k ≤ KW.sharedGateCount c shared gates, at most c.size binary gates, at
most sharedFanOut c total shared-variable leaves, and on every block Y ⊆ Fin n, at most
activeSharedGateCount c Y active shared gates and activeSharedFanOut c Y active shared-variable
leaves (exists_sharedProgram_of_circuit). Summed over a family of blocks, the active shared
fan-out weights each shared gate by the number of blocks its syntactic input cone meets
(sum_activeSharedFanOut, sum_activeSharedFanOut_le_of_gateBlockSpan_le,
sum_activeSharedFanOut_le_add_highSpanSharedFanOut). Moreover, wireActive and gateActive
coincide with having syntactic input support (Program.wireSupport) meeting Y
(wireActive_eq_true_iff, gateActive_eq_true_iff), so over pairwise disjoint blocks a gate's
block-span never exceeds the cardinality of its input support (gateBlockSpan_le_card_wireSupport),
and in any single-output binary circuit sharedFanOut c ≤ 2 * c.size + 1
(sharedFanOut_le_two_mul_size_add_one).
The definitions live in Complexitylib.Algebraic.LowerBound.Nechiporuk.Sharing.Defs and the proof
internals in Complexitylib.Algebraic.LowerBound.Nechiporuk.Sharing.Internal.
Shared fan-out and translation from binary circuits to SharedProgram #
Over pairwise disjoint blocks Y, the number of blocks on which gate g is active is at most
the cardinality of its syntactic input support.