Iterating circuits #
A circuit c with as many outputs as inputs computes a map c.eval I on states. Composing t
copies gives c.iterate t, which computes the t-th power of that map
(Circuit.eval_iterate); its arbitrary weighted cost and its size are exactly t times those of
c (Circuit.cost_program_iterate, Circuit.size_iterate). Zero copies are the identity
wiring, with no gates.
When the intermediate states are needed as well, the orbit prefix can be retained within the same
budget: Synthesis.orbit makes every state (c.eval I)^[j] (init x) with j ≤ t available at
cost t * c.size, sharing each state with every later construction (Synthesis.stages,
Synthesis.steps). This uses one copy of c per transition, applied to wires that are already
available.
The signature and the carrier are arbitrary. Sizes bound circuits; they do not certify the running time of any construction of them.
Main definitions #
Cslib.Circuits.Circuit.iterate:tcopies of a circuit composed in sequence.Cslib.Circuits.Synthesis.stages: the values retained through a stage.
Main results #
Cslib.Circuits.Circuit.eval_iterate,Cslib.Circuits.Circuit.cost_program_iterate,Cslib.Circuits.Circuit.size_iterate: exact semantics, weighted cost and size.Cslib.Circuits.Synthesis.steps: a sequence of constructions adds its costs.Cslib.Circuits.Synthesis.orbit: retain an orbit prefix with one circuit per transition.
References #
Circuit.iterateand its semantics and costs follow Algebraic/Iteration.lean in S. Schlesinger, Algebraic circuit formalizations in Complexitylib, with Mathlib'sNat.iteratein place of its own function iteration.- The retained orbits are adapted from lean/Proofs/{Iteration,Synthesis}.lean in S. Schlesinger, Square-root circuit bounds for iterated functions.
A sequence of t constructions of cost C each costs t * C, and retains every stage.
Retained orbit prefixes. If every coordinate of the initial state is available, then all
coordinates of the states (c.eval I)^[j] (init x) for j ≤ t become available with
t * c.size additional gates: one copy of c per transition.