Inner gates and multiary gates #
A gate of arity zero is a constant: like an input, it is a leaf of the circuit. The inner gates of a program are its gates of positive arity, and the inner size of a circuit counts them. A lower bound that holds over every basis can only count inner gates, since every value of the alphabet may be a constant gate of the basis.
Over a finite alphabet U, gates of arity one can also be made free without changing the basis:
every wire of arity at most one computes either a constant in U or a unary function U → U of
an input or a gate of arity at least two. The multiary gates of a program are its gates of arity
at least two, and the multiary size of a circuit counts them (Circuit.multiarySize). By
deduplicating gates of arity at most one that compute the same constant or the same unary function
of the same input or multiary gate (Circuit.exists_eval_eq_multiarySize_size_le), every circuit
over any signature σ and interpretation on U is equivalent to one over σ with at most
c.multiarySize multiary gates and total gate count O_{|U|}(c.multiarySize + n).
Main definitions #
Cslib.Circuits.Program.innerGates: the gates of positive arity.Cslib.Circuits.Circuit.innerSize: the number of gates of positive arity.Cslib.Circuits.Program.multiaryGates: the gates of arity at least two.Cslib.Circuits.Circuit.multiarySize: the number of gates of arity at least two.
Main results #
Cslib.Circuits.Circuit.innerSize_le_size: constant gates are free.Cslib.Circuits.Circuit.multiarySize_le_innerSize: unary gates are free inmultiarySize.Cslib.Circuits.Circuit.innerSize_eq_size_of_forall_arity_ne_zero: without constant symbols, the inner size equals the size.Cslib.Circuits.Circuit.multiarySize_eq_innerSize_of_forall_arity_ne_one: without unary symbols, the multiary size equals the inner size.Cslib.Circuits.Program.fanInAtMost_of_forall_arity_le,Cslib.Circuits.Circuit.fanInAtMost_of_forall_arity_le,Cslib.Circuits.Circuit.fanInAtMost_fullSignature: fan-in bounds from signature arities.Cslib.Circuits.Circuit.innerSize_eq_zero_of_fanInAtMost_zero: without arguments every gate is a constant.Cslib.Circuits.Circuit.multiarySize_eq_zero_of_fanInAtMost_one: with fan-in at most one, no gate is multiary.Cslib.Circuits.Circuit.exists_eval_eq_multiarySize_size_le: over a finite alphabetU, deduplicating constant and unary gates bounds total circuit size linearly inc.multiarySize + nover the same signatureσ.
A gate k belongs to p.innerGates if and only if its operation has nonzero arity.
Without arguments every gate is a constant, so a circuit of fan-in zero has inner size zero.
If every operation symbol has arity at most r, every program over the signature has fan-in at
most r.
If every operation symbol has arity at most r, every circuit over the signature has fan-in at
most r.
Every circuit over the full basis of arity r has fan-in at most r.
Multiary gates and finite-alphabet unary deduplication #
A gate k belongs to p.multiaryGates if and only if its operation has arity at least two.
Multiary gates are inner gates, so multiarySize ≤ innerSize.
With fan-in at most one every gate is nullary or unary, so the multiary size is zero.
A pure input-wiring circuit has 0 multiary gates.
Deduplicating unary and constant gates over a finite alphabet. Over a finite alphabet U,
every circuit c over any signature σ can be replaced by a circuit c' over the same
signature σ that computes the same function under I, preserves every fan-in bound of c,
uses at most c.multiarySize multiary gates, and has total gate count at most
c.multiarySize + |U| + (c.multiarySize + n) * |U| ^ |U|.