Fixing the random seed of a circuit with several outputs #
A randomized circuit reads an input x of n bits followed by a seed r of p bits, and its
outputs should satisfy a specification Correct x that may allow several answers, as for an
approximate count. If, at every input, fewer than a 2 ^ (-n) fraction of the seeds make it fail,
then by the union bound over the 2 ^ n inputs some seed makes it correct at every input at once
(Circuit.exists_seed_forall). Hardwiring that seed costs two gates for the constants and one
level of depth (Boolean.exists_circuit_of_card_bad_lt). This is the nonuniform derandomization
of Adleman's theorem without amplification Arora and Barak, Theorem 7.14,
[Adl78], for circuits with any number of outputs.
Main results #
Cslib.Circuits.Circuit.exists_seed_forall: a seed that is good for every input, over any basis.Cslib.Circuits.Boolean.exists_circuit_of_card_bad_lt: a deterministic De Morgan circuit with the seed hardwired.Cslib.Circuits.Boolean.exists_computes_of_card_bad_lt: the same when the specification is a function.
This recovers the earlier Complexitylib Classes/Randomized/CircuitHardwiring formalization
by Samuel Schlesinger, using the current shared-constant substitution circuit.
References #
A seed good for every input. If, at every input x of n bits, fewer than a 2 ^ (-n)
fraction of the seeds r make the outputs on x ++ r violate Correct x, then one seed makes
them satisfy it at every input.
Fixing the seed of a De Morgan circuit. If, at every input x of n bits, fewer than a
2 ^ (-n) fraction of the seeds r make the outputs on x ++ r violate Correct x, then a
deterministic circuit with at most two more gates, and at most one more level, satisfies Correct x
at every input.
Fixing the seed of a De Morgan circuit computing a function. If, at every input x of n
bits, the outputs on x ++ r differ from f x for fewer than a 2 ^ (-n) fraction of the seeds
r, then a deterministic circuit with at most two more gates, and at most one more level, computes
f.