Monotone circuit complexity of cyclic shift and permutation operators #
Following Sergeev [Ser20], an (n q + m, n q)-input operator on n Boolean
vectors X = (x_0, …, x_{n-1}) of length q (packed via finProdFinEquiv : Fin n × Fin q ≃ Fin (n * q)) and an m-bit control vector Y : Fin m → Bool (appended via Fin.append X Y)
implements:
- the monotone cyclic shift operator
S_{q, A}(ComputesMonotoneShift c α) when for everyXandk : Fin n, evaluatingcat(X, α k)yields the right cyclic shiftcyclicShiftVec X kplacing input blockx_iat output block(i + k) mod n; - the monotone permutation operator
P_{q, Π}(ComputesMonotonePerm c β) when for everyXandπ : Equiv.Perm (Fin n), evaluatingcat(X, β π)yieldspermuteVec X π, whose output blockjisx_{π(j)}.
Whenever 0 < q, monotonicity of Monotone.interpretation forces any code α (or β) computed
by a monotone circuit to have pairwise incomparable codewords (ComputesMonotoneShift.not_le,
ComputesMonotonePerm.not_le), hence an injective indexing of an antichain in Fin m → Bool
(ComputesMonotoneShift.injective_and_isAntichain,
ComputesMonotonePerm.injective_and_isAntichain).
On the upper-bound side (Theorem 1, [Ser20], pp. 3–4), from any monotone
circuit cA computing the antichain monomials fun Y r => decide (α r ≤ Y) (which evaluate at
α k to the one-hot indicator decide (r = k)), monotoneShiftCircuit q cA ORs the indicator
wires into 2 ⌈log₂ n⌉ bit-value tests and feeds an explicit ⌈log₂ n⌉-stage monotone barrel
shifter built from 3-gate monotone multiplexers (y₁ ∧ a) ∨ (y₀ ∧ b), achieving
binaryCost ≤ cA.program.cost binaryCost + 4 * q * n * Nat.clog 2 n. On the weight-1 one-hot
antichain oneHotShiftAntichain (L(A₁) = 0), oneHotShiftCircuit uses at most
4 * q * n * Nat.clog 2 n gates; on the dual-rail binary code dualRailShiftCode n b (b ≥ Nat.clog 2 n, covering both minimal width dualRailShiftAntichain n and Sergeev's
b = Nat.log 2 n + 1), dualRailShiftCircuit reads the bit rails directly with zero indicator
gates and exact cost 3 * q * n * Nat.clog 2 n. Sergeev's Theorem 2 (sorting-network upper
bounds for P_{q, Π} via AKS) is not included in this module.
On the lower-bound side (Theorem 3 and Corollary, [Ser20], pp. 4–6,
adapting Chashkin [Cha06] and Lamagna–Savage [LS74]), monotone projection
isolation (eq_proj_or_eq_proj_of_or, eq_proj_or_eq_proj_of_and) traces for each shift k and
input coordinate (i, b) a chain of {∧, ∨} gates computing X(i, b) from (i, b) to output
((i + k) mod n, b). For fixed k these gate sets are pairwise disjoint across all n q
coordinates, while for fixed output (j, b) at most 2^d inputs reach the output wire within d
gates, forcing the path lengths to sum to at least ∑_{t=1}^n ⌈log₂ t⌉ ≥ n ⌊log₂ n⌋ - n. Thus
every monotone circuit computing S_{q, α} — and, by restriction along cyclicShiftPerm, every
monotone circuit computing P_{q, β} — has binaryCost at least
q * ∑_{t=1}^n Nat.clog 2 t ≥ q * n * Nat.log 2 n - q * n, independently of the choice of
antichain α or β and control width m.
Main definitions #
Cslib.Circuits.Monotone.permuteVec,Cslib.Circuits.Monotone.cyclicShiftPerm,Cslib.Circuits.Monotone.cyclicShiftVec: block permutation and right cyclic shift onnvectors of widthq.Cslib.Circuits.Monotone.ComputesMonotoneShift,Cslib.Circuits.Monotone.ComputesMonotonePerm: monotone circuit computation ofS_{q, A}andP_{q, Π}.Cslib.Circuits.Monotone.oneHotShiftAntichain,Cslib.Circuits.Monotone.dualRailShiftCode,Cslib.Circuits.Monotone.dualRailShiftAntichain: the weight-1(A₁) and dual-rail binary (A₀) shift antichains.Cslib.Circuits.Monotone.monotoneShiftCircuit,Cslib.Circuits.Monotone.oneHotShiftCircuit,Cslib.Circuits.Monotone.dualRailShiftCircuit: explicit monotone barrel-shifter circuits for general antichains,A₁, andA₀.
Main results #
Cslib.Circuits.Monotone.ComputesMonotoneShift.injective_and_isAntichain,Cslib.Circuits.Monotone.ComputesMonotonePerm.injective_and_isAntichain: when0 < q, any monotone-computable shift or permutation code injectively indexes an antichain.Cslib.Circuits.Monotone.computesMonotoneShift_monotoneShiftCircuit,Cslib.Circuits.Monotone.cost_monotoneShiftCircuit_le: Theorem 1 (L(S_{q, A}) ≤ L(A) + 4 q n ⌈log₂ n⌉).Cslib.Circuits.Monotone.computesMonotoneShift_oneHotShiftCircuit,Cslib.Circuits.Monotone.cost_oneHotShiftCircuit_le,Cslib.Circuits.Monotone.computesMonotoneShift_dualRailShiftCircuit,Cslib.Circuits.Monotone.cost_dualRailShiftCircuit:O(q n log n)instantiations onA₁andA₀.Cslib.Circuits.Monotone.eq_proj_or_eq_proj_of_or,Cslib.Circuits.Monotone.eq_proj_or_eq_proj_of_and: monotone projection isolation at OR and AND gates.Cslib.Circuits.Monotone.mul_sum_clog_le_cost_of_computesMonotoneShift,Cslib.Circuits.Monotone.mul_log_sub_le_cost_of_computesMonotoneShift: Theorem 3 (L(S_{q, A}) ≥ q ∑_{t=1}^n ⌈log₂ t⌉ ≥ q n ⌊log₂ n⌋ - q nfor every antichainA).Cslib.Circuits.Monotone.mul_sum_clog_le_cost_of_computesMonotonePerm,Cslib.Circuits.Monotone.mul_log_sub_le_cost_of_computesMonotonePerm: Corollary (L(P_{q, Π}) ≥ q ∑_{t=1}^n ⌈log₂ t⌉ ≥ q n ⌊log₂ n⌋ - q nfor every permutation antichainΠ).
References #
Block permutations, cyclic shifts, and monotone operator specifications #
At coordinate (j, b), permuteVec X π reads coordinate (π j, b) of X.
The permutation of Fin n corresponding to a cyclic right shift by k positions: output
position j reads input position (j - k) mod n, while input position i moves to output
position (i + k) mod n.
Output block (i + k) mod n of cyclicShiftVec X k carries input block i.
Distinct shift amounts k₁ ≠ k₂ induce distinct permutations of Fin n.
A monotone circuit c computes the monotone cyclic shift operator S_{q, A} for control
code α : Fin n → Fin m → Bool when c evaluates (X, α k) to cyclicShiftVec X k for all
data vectors X and shift indices k ([Ser20], p. 2).
A monotone circuit c computes the monotone permutation operator P_{q, Π} for control code
β : Equiv.Perm (Fin n) → Fin m → Bool when c evaluates (X, β π) to permuteVec X π for all
data vectors X and permutations π ([Ser20], p. 3).
Restricting a monotone permutation circuit along cyclicShiftPerm yields a monotone cyclic
shift circuit for fun k => β (cyclicShiftPerm k) ([Ser20], p. 3).
Monotonicity of circuit evaluation and antichain necessity #
When 0 < q, any monotone circuit computing P_{q, Π} forces distinct permutations to have
incomparable control codewords (¬ β π₁ ≤ β π₂).
When 0 < q, any code β computed by a monotone permutation circuit is injective and its
range is an antichain under the pointwise order on Fin m → Bool.
When 0 < q, any monotone circuit computing S_{q, α} forces distinct shift amounts to have
incomparable control codewords (¬ α k₁ ≤ α k₂).
When 0 < q, any shift code α computed by a monotone shift circuit is injective and its
range is an antichain under the pointwise order on Fin m → Bool.
Standard shift antichains: one-hot (A₁) and dual-rail binary (A₀) #
oneHotShiftAntichain n is injective.
The range of oneHotShiftAntichain n is an antichain in Fin n → Bool.
Minimal-width (2 * Nat.clog 2 n) dual-rail binary shift antichain; Sergeev's p. 2 width
2 * (⌊log₂ n⌋ + 1) is dualRailShiftCode n (Nat.log 2 n + 1).
Whenever n ≤ 2 ^ b (in particular for b = Nat.clog 2 n and b = Nat.log 2 n + 1),
dualRailShiftCode n b is injective.
Whenever n ≤ 2 ^ b, the range of dualRailShiftCode n b is an antichain in
Fin (2 * b) → Bool.
Theorem 1: Monotone barrel-shifter upper bounds #
Theorem 1 circuit construction ([Ser20], pp. 3–4): from any monotone
circuit cA : Circuit signature m n computing the one-hot/monomial indicators of an n-element
shift antichain, build a monotone circuit for S_{q, A} by ORing the indicators into 2 ⌈log₂ n⌉
rail bits and applying the ⌈log₂ n⌉-stage monotone barrel shifter (and pure zero-output wiring
when q = 0).
Theorem 1 (correctness) ([Ser20], pp. 3–4): if α injectively indexes
an antichain in Fin m → Bool and cA computes the antichain monomials
fun Y r => decide (α r ≤ Y) (Y^{α_r} = ⋀_{α_{r,t} = 1} Y_t), then monotoneShiftCircuit q cA
computes the monotone cyclic shift operator S_{q, α}.
Theorem 1 (cost bound) ([Ser20], pp. 3–4): monotoneShiftCircuit q cA
has binary monotone gate cost at most cA.program.cost binaryCost + 4 * q * n * Nat.clog 2 n
(L(S_{q, A}) ≤ L(A) + O(q n log n)).
oneHotShiftCircuit n q computes S_{q, A₁} on oneHotShiftAntichain n.
oneHotShiftCircuit n q uses at most 4 * q * n * Nat.clog 2 n binary monotone gates
([Ser20], p. 3).
Explicit monotone shift circuit for dualRailShiftCode n b whenever Nat.clog 2 n ≤ b
([Ser20], pp. 2–4), wiring the first Nat.clog 2 n positive and negated shift
bits directly into the barrel shifter with zero indicator gates.
dualRailShiftCircuit n q b hb computes S_{q, A₀} on dualRailShiftCode n b.
dualRailShiftCircuit n q b hb uses exact binary monotone gate cost
3 * q * n * Nat.clog 2 n.
Theorem 3 and Permutation Corollary: Antichain-independent lower bounds #
Monotone projection isolation at an OR gate ([Ser20], proof of
Theorem 3, Step (a), p. 5): if f, g : (Fin N → Bool) → Bool are monotone and (f x || g x) = x i for all x, then either f or g equals the coordinate projection fun x => x i.
Monotone projection isolation at an AND gate ([Ser20], proof of
Theorem 3, Step (a), p. 5): if f, g : (Fin N → Bool) → Bool are monotone and (f x && g x) = x i for all x, then either f or g equals the coordinate projection fun x => x i.
Theorem 3 (exact finite sum form) ([Ser20], pp. 4–6; after
[Cha06] and [LS74]): for every control code α : Fin n → Fin m → Bool and
every monotone circuit c computing S_{q, α},
q * (∑ t ∈ Icc 1 n, Nat.clog 2 t) ≤ c.program.cost binaryCost.
Theorem 3 (q n log₂ n - O(q n) form) ([Ser20], p. 4): for every
control code α : Fin n → Fin m → Bool and every monotone circuit c computing S_{q, α},
q * n * Nat.log 2 n - q * n ≤ c.program.cost binaryCost.
Permutation Corollary (exact finite sum form) ([Ser20], p. 6): for
every permutation code β : Equiv.Perm (Fin n) → Fin m → Bool and every monotone circuit c
computing P_{q, Π}, q * (∑ t ∈ Icc 1 n, Nat.clog 2 t) ≤ c.program.cost binaryCost.
Permutation Corollary (q n log₂ n - O(q n) form) ([Ser20], p. 6): for
every permutation code β : Equiv.Perm (Fin n) → Fin m → Bool and every monotone circuit c
computing P_{q, Π}, q * n * Nat.log 2 n - q * n ≤ c.program.cost binaryCost.