Documentation

CslibFrontier.Computability.Circuit.Boolean.MassProduction.Basic

Boolean circuit mass production #

Mass complexity is the minimum cost of evaluating a Boolean function on several independent input blocks. Constants are free; NOT, AND and OR each cost one. The circuits and interpretation are CSLib's, and the minimum is the existing weighted source complexity with raw inputs supplied.

The discrete exponential copy budget is 2 ^ (numerator * inputs / denominator), with natural division implementing the floor. The bounding constant is chosen before the input length, function and number of copies. These definitions state the eventual and every-positive-length versions; the exponential-range theorem requires further constructions.

Main definitions #

Main results #

References #

noncomputable def Cslib.Circuits.Boolean.MassProduction.massComplexity {n : ℕ} (f : (Fin n → Bool) → Bool) (k : ℕ) :

Minimum cost of evaluating f on independent blocks, with constants free.

Every finite bound is witnessed by a circuit with that nonconstant-gate budget.

The Boolean basis implements every finite direct product, including at zero inputs.

Some circuit attains the minimum cost. This is an existence theorem, not an efficient algorithm for finding a minimum circuit.

Charging only nonconstant gates costs at most the minimum size, which counts every gate.

@[simp]

Evaluating zero copies of f has mass complexity zero.

theorem Cslib.Circuits.Boolean.MassProduction.massComplexity_mono {n : ℕ} {f : (Fin n → Bool) → Bool} {small large : ℕ} (h : small ≤ large) :

Discarding copies cannot increase minimum cost, including discarding all copies.

Naive independent replication costs at most the number of copies times one-copy cost.

theorem Cslib.Circuits.Boolean.MassProduction.massComplexity_comp_wiring_le {n : ℕ} {f : (Fin n → Bool) → Bool} {p : ℕ} (select : Fin n → Fin p) (k : ℕ) :
massComplexity (fun (x : Fin p → Bool) => f (x ∘ select)) k ≤ massComplexity f k

Rewiring every input block adds no cost.

The copy budget at rational exponent numerator / denominator, rounding down.

theorem Cslib.Circuits.Boolean.MassProduction.rationalCopyBudget_mono_numerator {small large denominator inputs : ℕ} (h : small ≤ large) :
rationalCopyBudget small denominator inputs ≤ rationalCopyBudget large denominator inputs

rationalCopyBudget is monotone in the numerator.

theorem Cslib.Circuits.Boolean.MassProduction.rationalCopyBudget_mono_inputs {numerator denominator small large : ℕ} (h : small ≤ large) :
rationalCopyBudget numerator denominator small ≤ rationalCopyBudget numerator denominator large

rationalCopyBudget is monotone in the input length.

def Cslib.Circuits.Boolean.MassProduction.MassProductionBound (numerator denominator constant inputs : ℕ) :

The uniform bound at one input length, for every function and positive allowed copy count.

theorem Cslib.Circuits.Boolean.MassProduction.MassProductionBound.mono_numerator {small large denominator constant inputs : ℕ} (h : MassProductionBound large denominator constant inputs) (hle : small ≤ large) :
MassProductionBound small denominator constant inputs

Decreasing the allowed numerator preserves a bound at one input length.

Eventual mass production at a fixed rational exponent. The constant and cutoff may depend on the exponent, but are uniform in input length, function and number of copies.

Mass production at every positive input length, with one constant for the fixed exponent.

Every fixed nonnegative rational exponent below one has an all-length bound.

theorem Cslib.Circuits.Boolean.MassProduction.MassProducesAtAllLengths.eventually {numerator denominator : ℕ} (h : MassProducesAtAllLengths numerator denominator) :
MassProducesAt numerator denominator

An all-length bound holds eventually.

theorem Cslib.Circuits.Boolean.MassProduction.MassProducesAt.mono_numerator {small large denominator : ℕ} (h : MassProducesAt large denominator) (hle : small ≤ large) :
MassProducesAt small denominator

Decreasing the allowed numerator preserves eventual mass production.

theorem Cslib.Circuits.Boolean.MassProduction.MassProducesAtAllLengths.mono_numerator {small large denominator : ℕ} (h : MassProducesAtAllLengths large denominator) (hle : small ≤ large) :
MassProducesAtAllLengths small denominator

Decreasing the allowed numerator preserves all-length mass production.