Cyclic circuits and least-fixed-point semantics #
A cyclic circuit reuses native Line and Wire, allowing each equation to refer to any gate.
Unlike a topologically ordered Program, the equations may contain feedback. Designated outputs
can read inputs or gates; zero gates, zero outputs, sharing and unused components are allowed.
Every equation is charged once by its operation weight.
For a monotone interpretation on a complete lattice, Mathlib's OrderHom.lfp gives a canonical
least solution, without a separate construction certificate. This is mathematical semantics,
not an execution algorithm or a finite-iteration bound. In particular, monotonicity alone does
not imply that iteration through the natural numbers reaches or approaches the least solution.
Native acyclic circuits embed with exactly the same gate values, outputs and weighted costs.
Main definitions #
Cslib.Circuits.CyclicCircuit: finite equations with designated output wires.Cslib.Circuits.CyclicCircuit.evalGates,Cslib.Circuits.CyclicCircuit.eval: least-solution gate values and outputs.Cslib.Circuits.CyclicCircuit.ecomplexityFrom: minimum cost from supplied source functions.
Main results #
Cslib.Circuits.Circuit.eval_toCyclic,Cslib.Circuits.Circuit.cost_toCyclic: the native acyclic embedding preserves semantics and costs.Cslib.Circuits.CyclicCircuit.evalGates_le: leastness among pre-fixed states.Cslib.Circuits.CyclicCircuit.ecomplexityFrom_le_acyclic: allowing feedback cannot increase source complexity.
References #
- Adapted from LowerBound/Fusion/Cyclic.lean in S. Schlesinger, Algebraic circuit formalizations in Complexitylib. The least-solution semantics uses Mathlib's Knaster–Tarski fixed-point API.
A finite system of gate equations with designated input or gate outputs.
- size : ℕ
Number of equations; inputs and designated outputs cost nothing.
Every gate may read any input or gate, including itself.
Each output reads an input or a solved gate. Sharing is allowed.
Instances For
Sum all operation weights, including unused and repeated equations.
Instances For
Regard the native acyclic program as a system of simultaneous equations.
Instances For
Update every gate simultaneously using the supplied input and proposed gate values.
Instances For
The least solution of the gate equations in a complete lattice.
Instances For
Read all designated outputs at the least solution.
Instances For
The least solution satisfies every gate equation. This is not a recursive simp rule.
The solution lies below every state whose equation results lie below its gate values.
The unique solution of an acyclic program is its ordinary gate evaluation.
Embedding a native circuit preserves all outputs, including direct inputs and sharing.
Compute the target from exactly the supplied sources using least-fixed-point semantics.
Instances For
Minimum weighted cyclic cost, or infinity if no implementing circuit exists.
Instances For
Every implementing cyclic circuit bounds the minimum cost.
Finite cyclic complexity is equivalent to the existence of an implementation.
A lower bound on cyclic complexity holds exactly when it bounds every implementation.
Allowing feedback cannot increase minimum cost: native circuits embed without any cost.