Independent copies of a circuit #
Inputs and outputs are arranged in consecutive blocks. A family of circuits runs its members on disjoint blocks and adds their gate counts and arbitrary weighted costs exactly. Replication is the constant family: it preserves sharing between the outputs of each copy, and multiplies both gate count and arbitrary weighted cost exactly. Keeping a positive initial batch requires only input and output wiring. The resulting minimum cost is monotone even at zero copies, where a separate empty circuit suffices.
Main definitions #
Cslib.Circuits.directProduct: independent copies of a scalar function.Cslib.Circuits.Circuit.parallelFamily: different circuits on consecutive disjoint blocks.Cslib.Circuits.Circuit.replicate: independent copies of a multi-output circuit, the constant family.Cslib.Circuits.Circuit.replicateScalar: the single-output specialization.Cslib.Circuits.Circuit.takeDirectProductPrefix: retain a positive initial batch.
Main results #
Cslib.Circuits.Circuit.eval_parallelFamily_apply,Cslib.Circuits.Circuit.cost_program_parallelFamily: blockwise semantics and additive cost.Cslib.Circuits.Circuit.eval_replicate,Cslib.Circuits.Circuit.cost_program_replicate: exact replication semantics and cost.Cslib.Circuits.ecomplexityFrom_directProduct_le: the naive replication upper bound.Cslib.Circuits.ecomplexityFrom_directProduct_mono,Cslib.Circuits.complexity_directProduct_mono: monotonicity in the number of copies.Cslib.Circuits.ecomplexityFrom_directProduct_comp_wiring_le: blockwise input rewiring.
References #
- Adapted from MassProduction/DirectProduct.lean and MassProduction/InputSplit.lean in S. Schlesinger, Boolean circuit mass production formalization.
A scalar computation gives a concrete circuit for every finite direct product.
Retain a positive initial batch by rewiring inputs and selecting outputs, without adding or removing gates. Discarded input blocks read the first retained block.
Instances For
Retaining an initial batch preserves direct-product semantics.
Zero copies have zero weighted complexity, even for a function with no circuit.
Independently replicating a scalar implementation gives the naive weighted upper bound. The statement includes zero copies and functions of infinite complexity.
Minimum weighted direct-product complexity is monotone in the number of copies.
Applying the same input wiring independently in every block adds no weighted cost.
Minimum direct-product size is monotone in the number of copies, including zero copies.
One copy costs no more than a single-output implementation.