Iterating for a number of steps given as input #
A circuit with n + m inputs reads a state from its first n inputs and a number of steps from
its last m inputs, in binary with the least significant bit first, and returns that iterate of
f (inputTimeIterate). Binary powering builds it from fixed powers: stage j applies a circuit
for f^[2 ^ j] to the current state, and bit j of the time selects its result or the current
state, at four gates per state bit (synthesis_binary_powering). With the fixed-power circuits
of size 40000 * powerBudget n s (2 ^ n) L, an m-bit time costs at most
m * (40000 * powerBudget n s (2 ^ n) L + 4 * n) (variable_time), and
m * (120000 * optimizedBudget n s (2 ^ n) + 4 * n) with the balanced parameter
(variable_time_optimized). The cost is linear in m; a bound additive in m, which first
reduces the time modulo the cycle length, is variable_time_additive in Iteration.LongTime.
The shared rule synthesis_batched_binary_powering processes r states with independent
m-bit times using one batched power circuit of size at most C per stage, for a total of
m * (C + 4 * (r * n)) gates. Scalar binary powering is its singleton specialization;
Circuit.replicate 1 supplies the batched power circuits without increasing their size.
The circuits are native De Morgan circuits: every NOT, AND and OR gate and every constant is
charged, while wiring and fanout are free. They exist for each m, because the fixed-power
circuits do; nothing here bounds the time to construct them.
Main definitions #
Cslib.Circuits.Boolean.Iteration.inputTimeIterate: the iterate whose number of steps is part of the input.
Main results #
Cslib.Circuits.Boolean.Iteration.synthesis_batched_binary_powering: binary powering with shared circuits for batched powers and a separate time for each member.Cslib.Circuits.Boolean.Iteration.synthesis_binary_powering: binary powering from circuits for the powersf^[2 ^ j].Cslib.Circuits.Boolean.Iteration.binary_powering: its circuit form.Cslib.Circuits.Boolean.Iteration.variable_time,Cslib.Circuits.Boolean.Iteration.variable_time_optimized: input times through fixed powers.
References #
- Adapted from lean/Proofs/{VariableTime,BinaryNumbers}.lean in S. Schlesinger, Square-root circuit bounds for iterated functions.
Batched binary powering. If every batched power f^[2 ^ j] with j < m has a circuit of
size at most C, then r available states, each with its own time given by m available bits,
cost at most m * (C + 4 * r * n) gates.
Binary powering. If every power f^[2 ^ j] with j < m has a circuit of size at most
C, then T steps of f from an available state, with T given by m available bits, cost at
most m * (C + 4 * n) gates: one power circuit and one multiplexer per bit.
Input times. For every 0 < L ≤ 2 ^ n, some circuit of size at most
m * (40000 * powerBudget n c.size (2 ^ n) L + 4 * n) iterates c for a number of steps given
by m input bits.
Square-root input times.