Documentation

CslibFrontier.Computability.Circuit.Boolean.ThresholdNC1

Threshold and majority circuits in NC¹ #

Combining the logarithmic-depth carry-save Hamming weight circuit (weightCircuit) with the comparator (leCircuit) yields a fan-in-two De Morgan circuit thresholdDeMorganCircuit k j computing the k-bit threshold function threshold k j in size O(k log k) and depth O(log k) (computes_thresholdDeMorganCircuit, size_thresholdDeMorganCircuit_le, depth_thresholdDeMorganCircuit_le) Chandra et al., Vollmer, Chapter 4. Specializing to cutoff ⌈k / 2⌉ gives a De Morgan circuit majorityDeMorganCircuit k for majority k.

Consequently, any threshold slice family fun n => threshold n (t n) lies in NC¹ (threshold_mem_NC_one), and in particular MAJ ∈ NC¹ (majority_mem_NC_one) and strictMajority ∈ NC¹ (strictMajority_mem_NC_one). Replacing each gate of a fan-in-bounded threshold or majority circuit by thresholdDeMorganCircuit simulates depth d and fan-in F in De Morgan depth O(d log F) and size O(s F log F) (Threshold.exists_deMorgan_simulation_of_fanInAtMost, Unbounded.exists_deMorgan_simulation_majority_of_fanInAtMost).

Main definitions #

Main results #

References #

Threshold and majority circuits in NC¹ #

Logarithmic-depth threshold circuit: computes threshold k j over the De Morgan basis of fan-in two by computing the ⌈log₂ (k + 1)⌉-bit binary numeral of the input's Hamming weight (weightCircuit k) and comparing it against j (leCircuit). When k < j, the threshold cannot be met and a single false gate is used.

@[simp]

Evaluating thresholdDeMorganCircuit k j on x yields single (threshold k j) x.

thresholdDeMorganCircuit k j uses O(k log k) gates.

thresholdDeMorganCircuit k j has depth at most 2 + 23 ⌈log₂ (k + 1)⌉.

Logarithmic-depth majority circuit: computes majority k over the De Morgan basis of fan-in two in size O(k log k) and depth O(log k).

majorityDeMorganCircuit k uses O(k log k) gates.

majorityDeMorganCircuit k has depth at most 2 + 23 ⌈log₂ (k + 1)⌉.

Every family of threshold functions fun n => threshold n (t n) belongs to NC¹.

Simulating fan-in-bounded threshold and majority circuits #

A De Morgan circuit of fan-in two for each operation of the threshold basis: one negation gate for .not, and thresholdDeMorganCircuit m j for .threshold m j.

The De Morgan circuit of a threshold operation computes it.

The De Morgan circuit of a threshold operation of arity k uses O(k log k) gates.

The De Morgan circuit of a threshold operation of arity k has depth at most 2 + 23 ⌈log₂ (k + 1)⌉.

De Morgan circuits simulate fan-in-bounded threshold circuits: a circuit over the threshold basis of n inputs, s gates, depth d, and fan-in at most F has an equivalent De Morgan circuit of fan-in two with at most s (4 + F + 40 F ⌈log₂ (F + 1)⌉ + ⌈log₂ (F + 1)⌉ (20 ⌈log₂ (F + 1)⌉ + 6)) gates and depth at most (2 + 23 ⌈log₂ (F + 1)⌉) d.

A De Morgan circuit of fan-in two for each operation of the TC basis: balanced trees for the unbounded fan-in operations, and majorityDeMorganCircuit m for .gate m.

The De Morgan circuit of a TC operation of arity k uses O(k log k) gates.

The De Morgan circuit of a TC operation of arity k has depth at most 2 + 23 ⌈log₂ (k + 1)⌉.

De Morgan circuits simulate fan-in-bounded majority circuits: a circuit over the TC basis (unbounded AND, OR, NOT, and MAJ gates) of n inputs, s gates, depth d, and fan-in at most F has an equivalent De Morgan circuit of fan-in two of size O(s F log F) and depth O(d log F).

theorem Cslib.Circuits.Boolean.mem_NC_succ_of_threshold_fanInAtMost {L : Language Bool} {i c : ℕ} {s F : ℕ → ℕ} (hs : PolynomiallyBounded s) (hF : PolynomiallyBounded F) (hC : ∀ (n : ℕ), ∃ (C : Circuit Threshold.signature n 1), C.Computes Threshold.interpretation (single (L.slice n)) ∧ C.depth ≤ c * (Nat.log 2 n + 1) ^ i ∧ C.size ≤ s n ∧ C.FanInAtMost (F n)) :
L ∈ NC (i + 1)

Any language decided by polynomial-size, polynomially fan-in-bounded threshold circuits of depth O((log n) ^ i) belongs to NCⁱ⁺¹ Vollmer, Theorem 4.22.

Any language decided by polynomial-size, polynomially fan-in-bounded TC circuits of depth O((log n) ^ i) belongs to NCⁱ⁺¹ Vollmer, Theorem 4.22.