Substituting variables and constants for inputs #
A substitution ρ : Fin N → Fin n ⊕ Bool feeds every input of a Boolean function of N
variables from one of n new variables or from a constant; several inputs may receive the same
variable, so this is a projection in Valiant's sense rather than a restriction, which would leave
the remaining inputs free. A substitution does not make a function harder to compute: a circuit for
f with its inputs rewired, and two gates for the constants, computes f ∘ ρ.
The substitution appendInputs r fixes the last p inputs of a function of n + p variables to
the bits r: substituting it computes x ↦ f (Fin.append x r); prependInputs r fixes the first
p inputs instead. A restriction (partial
assignment) is the substitution that replaces each bit by itself or by a constant
(BitString.PartialAssignment.substitute_toSubstitution).
Fixing inputs that a target function ignores keeps the agreement on average: if g agrees with a
function of its first n inputs on a δ fraction of all inputs, then for some fixing of the other
inputs the resulting function, two gates larger, agrees with it on a δ fraction of the inputs
(Cslib.Circuits.Boolean.exists_complexity_le_of_agree_prefix).
Fixing a prefix u of the input of a language L, and reading only the first P of Q new
inputs, gives a function r ↦ [u ++ (first P bits of r) ∈ L] at most two gates larger than the
slice of L at length |u| + P (Cslib.Circuits.Boolean.complexity_le_of_append_take). This is
the circuit of a verifier with its instance hardwired, used in derandomization. When the slices of
L have circuits of size C (N + 1) ^ d and the prefix is polynomially long, so do the hardwired
slices (Cslib.Circuits.Boolean.complexity_slice_le_of_prefix_of_le).
The substitution padInputs m n feeds the first m of n inputs from m variables and the
others with false; it shows that extending a function by ignored inputs does not make it easier
(Cslib.Circuits.Boolean.complexity_le_extend).
Main definitions #
Cslib.Circuits.Boolean.substitute,Cslib.Circuits.Boolean.appendInputs,Cslib.Circuits.Boolean.prependInputs,Cslib.Circuits.Boolean.padInputs.Cslib.Circuits.Boolean.projectionCircuit: executable substitution from a bank of two constant outputs, over any basis, with its evaluation, cost, size and depth.Cslib.Circuits.Boolean.substituteCircuit: executable substitution with two shared constants, the projection circuit of the De Morgan constant gates.Cslib.BitString.PartialAssignment.toSubstitution: a partial assignment as a substitution.
Main results #
Cslib.Circuits.Boolean.complexity_substitute_le: a substitution costs at most two gates.Cslib.Circuits.Boolean.complexity_le_extend: ignored inputs do not make a function easier.Cslib.Circuits.Boolean.exists_complexity_le_of_agree_prefix: fixing ignored inputs.Cslib.Circuits.Boolean.complexity_le_of_append_take: hardwiring a prefix of a language's input.Cslib.Circuits.Boolean.complexity_slice_le_of_prefix_of_le: hardwiring a polynomially long prefix into polynomial-size circuits.
The output of a two-output constant circuit that carries the constant b: false is output
0 and true is output 1.
A projection from a bank of two constants. Over any basis, K is a circuit whose outputs
0 and 1 are the constants false and true; the projection circuit appends the outputs of
K to the live inputs and wires output j from input i when ρ j = .inl i, and from the
output of K carrying b when ρ j = .inr b. Gates exist only in K: it costs exactly what K
costs, and adds no depth beyond that of K.
If K carries the constants, the projection circuit evaluates substitute ρ.
Substitutions do not make functions harder. Feeding the inputs of f from variables and
constants costs at most two more gates than f.
Substituting appendInputs r on x appends r after x.
Substituting prependInputs r on x prepends r before x.
Hardwiring a prefix. Let f on Q inputs test whether u followed by the first P ≤ Q
bits of its input lies in L. Then f costs at most two gates more than the slice of L at
length u.length + P.
Hardwiring a polynomially long prefix. If x ∈ L exactly when pre ++ x ∈ M for the
words of length n, the slices of M have circuits of size C (N + 1) ^ d, and
|pre| + n + 1 ≤ a (n + 1) ^ K, then the slice of L at length n has circuits of size
(C a ^ d + 2) (n + 1) ^ (K d).
Ignored inputs do not make a function easier. A function f of n ≤ N variables costs at
most two gates more than its extension to N inputs that reads the first n.
Fixing ignored inputs. If g on N inputs agrees with a function E of its first n
inputs on more than δ * 2 ^ N inputs, then fixing the other N - n inputs suitably
(appendInputs) gives a function on n inputs, of complexity at most two more, that agrees with
E on more than δ * 2 ^ n inputs: some fixing does at least as well as the average.
The substitution replacing each fixed bit by its value and each free bit by itself.
Restricting is substituting constants for the fixed bits.