Hardwiring Prefixes of Circuit Inputs #
Fix a prefix of a fan-in-two AND/OR circuit's inputs without changing its gate count. This is the circuit-level operation used to turn length-dependent advice or random seeds into nonuniform constants while leaving the ordinary input live.
The live suffix has positive arity, matching the typed Circuit convention.
Circuit families represent the zero-input member separately with emptyOutput.
Main definitions #
Circuit.castInputArity: transport a circuit across equal input arities.Circuit.restrictPrefix: hardwire the firstkinputs to a fixed bit string.
Main results #
Circuit.restrictPrefix_eval: evaluation agrees with supplyingseed ++ input.Circuit.restrictPrefix_size: hardwiring preserves the exact circuit size.
Transport a circuit across an equality of input arities.
Equations
- Complexity.Circuit.castInputArity h circuit = Eq.ndrec (motive := fun {N' : ℕ} => [inst : NeZero N'] → Complexity.Circuit B N' M G) (fun [NeZero N] => circuit) h
Instances For
Fix the first k inputs of a fan-in-two AND/OR circuit to seed.
The remaining positive number m of inputs retain their order, and the
internal gate count G is unchanged. The zero-length prefix is the identity
after canonical input-arity transport.
Equations
- Complexity.Circuit.restrictPrefix x_3 circuit = Complexity.Circuit.castInputArity ⋯ circuit
- Complexity.Circuit.restrictPrefix seed circuit = Complexity.Circuit.restrictPrefix (Fin.tail seed) (Complexity.restrictCircuit (seed 0) circuit)
Instances For
Prefix hardwiring agrees with evaluating the original circuit on the fixed prefix followed by the live input.
Prefix hardwiring preserves the exact circuit size.