Certified circuit reductions #
A reduction packages a semantics-preserving circuit transformation under an input substitution together with a certified cost saving. The construction of the residual circuit is deliberately basis-specific; consumers need only this common certificate.
A circuit has minimum weighted cost among all circuits computing a target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A circuit is lexicographically minimal by weighted cost and then by internal gate count. The tie-break excludes gratuitous zero-cost internal structure.
- cost : CostMinimal operationCost circuit interpretation target
No implementation has lower weighted cost.
- gateCount (competitor : Circuit σ n m) : competitor.ComputesWith interpretation target → competitor.cost operationCost = circuit.cost operationCost → circuit.size ≤ competitor.size
Among equal-cost implementations, none has fewer internal gates.
Instances For
A minimum-cost implementation of a target, including its proof.
- circuit : Circuit σ n m
Chosen implementation.
- computes : self.circuit.ComputesWith interpretation target
The implementation computes the requested target.
- minimal : CostSizeMinimal operationCost self.circuit interpretation target
The implementation is cost-minimal with a gate-count tie-break.
Instances For
Number of internal gates in the chosen implementation.
Instances For
Choose a minimum-cost implementation of a target from any supplied implementation. This uses only well-ordering of natural-valued costs; the collection of circuits need not be finite. The chosen implementation is a classical proof witness, not an executable circuit optimizer.
Equations
- Cslib.Circuits.Circuit.minimum operationCost circuit interpretation target computes = { circuit := Classical.choose ⋯, computes := ⋯, minimal := ⋯ }
Instances For
A circuit reduction under an input substitution with certified cost saving.
- result : Circuit σ k m
The residual circuit on the new inputs.
- eval_eq (input : Fin k → U) : self.result.eval interpretation input = source.eval interpretation (substitution.apply input)
The residual circuit agrees with the source under the substitution.
- saving : ℕ
Certified amount by which the chosen cost decreases.
The residual cost plus the saving is bounded by the source cost.
Instances For
Number of internal gates in the residual circuit.
Instances For
The identity circuit reduction.
Equations
- Cslib.Circuits.Circuit.Reduction.refl operationCost circuit interpretation = { result := circuit, eval_eq := ⋯, saving := 0, saving_le := ⋯ }
Instances For
Rebase a reduction from a cheaper implementation of the same target onto the original source circuit. This is the bridge from optimal-circuit elimination arguments to lower bounds for arbitrary circuits.
Equations
Instances For
Compose certified circuit reductions.
Equations
Instances For
A reduction of a computing circuit computes the restricted target.