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).
Main definitions #
Cslib.Circuits.Boolean.substitute,Cslib.Circuits.Boolean.appendInputs,Cslib.Circuits.Boolean.prependInputs.Cslib.Circuits.Boolean.substituteCircuit: executable substitution with two shared constants.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.exists_complexity_le_of_agree_prefix: fixing ignored inputs.
Substitutions do not make functions harder. Feeding the inputs of f from variables and
constants costs at most two more gates than f.
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.
Instances For
Restricting is substituting constants for the fixed bits.