Factorial-improved Shannon counting #
After semantic normalization, all internal gate functions are distinct. Each
computed function can therefore be encoded under all g! gate relabelings,
and those encodings are distinct. This removes the artificial topological
ordering from the leading Shannon count.
Loose presentations and relabeling #
A circuit presentation whose internal gates need not be topologically ordered.
One defining line for every labeled internal gate.
One designated wire for every output.
Instances For
Equations
- Algebraic.instFintypeLooseCircuit = Fintype.ofEquiv ((Fin g → Cslib.Circuits.Line σ n g) × (Fin m → Cslib.Circuits.Wire n g)) (Algebraic.looseCircuitEquiv σ n g m).symm
Exact count of loose labeled circuit presentations.
A loose circuit valuation solves all of its internal gate equations.
Equations
Instances For
Read designated output wires under a chosen internal-gate valuation.
Equations
- circuit.evalOutputs _interpretation input values output = Cslib.Circuits.Wire.elim input values (circuit.outputs output)
Instances For
Rename gate wires along a bijection of gate labels, fixing every input.
Equations
- Cslib.Circuits.Wire.Renaming.ofEquiv labels = { gates := fun (gate : Fin g) => Cslib.Circuits.Wire.gate (labels gate) }
Instances For
Forget topological order, then rename every internal gate along a bijection
onto the labels Fin g.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Acyclicity and unique valuations #
Inputs are always available; a gate wire is below a numeric rank bound.
Equations
- Cslib.Circuits.Wire.Below rank bound wire = Cslib.Circuits.Wire.elim (fun (x : Fin n) => True) (fun (gate : Fin g) => rank gate < bound) wire
Instances For
A rank strictly decreases along every internal gate dependency.
Equations
- circuit.AcyclicUnder rank = ∀ (gate : Fin g) (argument : Fin (σ.Arity (circuit.internal gate).op)), Cslib.Circuits.Wire.Below rank (rank gate) ((circuit.internal gate).wires argument)
Instances For
An acyclic loose presentation has at most one solution to its gate equations.
The factorial encoding #
A target together with evidence that an irredundant g-gate circuit
computes it.
Equations
- Cslib.Circuits.Circuit.IrredundantTarget interpretation n g m = ↥(Cslib.Circuits.Circuit.irredundantFunctions interpretation n g m)
Instances For
Choose one irredundant representative circuit for a target.
Equations
- Cslib.Circuits.Circuit.irredundantRepresentative interpretation target = Classical.choose ⋯
Instances For
Gate labels of the chosen representative, renamed by a permutation of
Fin g.
Equations
- Cslib.Circuits.Circuit.representativeLabels interpretation target permutation = (finCongr ⋯).trans permutation
Instances For
Encode one chosen irredundant circuit for a function under a gate renaming.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The target fixes the unique acyclic valuation of an encoded presentation; irredundancy then makes its gate permutation recoverable.
Counting consequences #
Sharp fixed-size Shannon count, including the full g! relabeling gain.
Sharp Shannon budget for all circuits with at most G internal gates.
Equations
- σ.sharpBudget n m G = ∑ g ∈ Finset.range (G + 1), σ.sharpCount n g m
Instances For
A family larger than the sharp budget contains a size-hard function.
Full-universe sharp Shannon lower bound.
Under functional completeness, a target outside the sharp budget is both
hard below G and computable at some finite size.
Boolean specialization of the sharp Shannon theorem.