Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Rigidity

Valiant's rigidity criterion for linear circuits #

Valiant [Val77] showed that a linear map computed by a small, shallow linear circuit is close to a low-rank map: its matrix has low rigidity (Matrix.rigidity). Contrapositively, a highly rigid matrix has no linear circuit of linear size and logarithmic depth. We prove this criterion in the explicit, non-asymptotic form of [Lok09], Theorem 2.1.

The model #

A linear circuit here is a Cslib.Circuits.Circuit over the affine basis Cslib.Circuits.affineSignature K of a field K, interpreted by affineInterpretation K: every gate computes ∑ i, a i * x i + b from its arguments. We require fan-in at most 2 (Circuit.FanInAtMost 2); gates of arity 0 (constants) and 1 (scalings) are allowed, the coefficients may be zero, and the constant terms b are arbitrary. The circuit computes x ↦ A *ᵥ x (Circuit.Computes), with m outputs and n inputs. Size is the number of gates (Circuit.size); depth is the largest number of gates on a path from an input to an output (Circuit.depth).

[Lok09], Definition 2.2, uses a DAG with nonzero edge labels, no constants, fan-in exactly 2 in logarithmic depth, and counts edges for size. Each of its circuits is a circuit of the model above with the same depth, and with at most as many gates as edges. Our model allows more circuits, so the lower bounds below are at least as strong.

Main results #

Proof #

The coefficient of input j at wire w is the trace at Pi.single j 1 minus the trace at 0. The depths of the gates, capped below 2 ^ D, grade the at most 2 * c.size wires read by gates with 2 ^ D levels. By Valiant's depth reduction (Cslib.IsGrading.exists_sdiff, [Lok09], Lemma 2.2, which [Lok09] credits to Erdős, Graham and Szemerédi), removing at most a t / D fraction of these wires leaves wires graded with 2 ^ (D - t) levels. Let T be the set of tails of the removed wires, so |T| ≤ 2 * t * c.size / D. By induction over the program, each output's coefficients, outside at most 2 ^ (2 ^ (D - t)) inputs, are a fixed linear combination of the coefficients at T. This is a matrix of rank at most |T| differing from A in at most m * 2 ^ (2 ^ (D - t)) entries.

Scope #

The quantitative theorem is [Lok09], Theorem 2.1, R_A(s log t / log d) ≤ 2 ^ O(d / t) * n, with explicit constants, under the dictionary t ↦ 2 ^ t, d ↦ 2 ^ D and s ↦ 2 * c.size, so that s log t / log d ↦ 2 * t * c.size / D. Here 2 * c.size is the number of edges when every gate has fan-in 2, and bounds it in general. No explicit matrix is known to satisfy the hypothesis of the asymptotic form for any fixed constants: proving one exists is Valiant's open problem. The criterion is proved for affine circuits over any field. Over an infinite field it extends to circuits with polynomial operations such as +, × (Circuit.Computes.rigidity_le_of_isPolynomial), because linearization keeps size, fan-in and depth (Circuit.Computes.exists_affine). Over finite fields, nonlinear gates are not covered.

References #

theorem Cslib.Circuits.Circuit.Computes.rigidity_le {K : Type u_1} [Field K] {n m : ℕ} {c : Circuit (affineSignature K) n m} {A : Matrix (Fin m) (Fin n) K} (hc : c.Computes (affineInterpretation K) fun (x : Fin n → K) => A.mulVec x) (hfan : c.FanInAtMost 2) {D t : ℕ} (hdepth : c.depth < 2 ^ D) (htD : t ≤ D) :
A.rigidity (2 * t * c.size / D) ≤ m * 2 ^ 2 ^ (D - t)

Valiant's rigidity criterion, quantitative form ([Val77]; [Lok09], Theorem 2.1). Let c be a circuit of affine gates of fan-in at most 2 over a field K computing x ↦ A *ᵥ x, let c.depth < 2 ^ D and let t ≤ D. Then A can be brought to rank at most 2 * t * c.size / D by changing at most m * 2 ^ (2 ^ (D - t)) entries.

The depths of the gates grade the at most 2 * c.size wires read by gates with 2 ^ D levels. Valiant's depth reduction (Cslib.IsGrading.exists_sdiff) removes at most a t / D fraction of these wires so that the rest are graded with 2 ^ (D - t) levels. The gates reading the removed wires are cut: every output is then a linear combination of the removed wires' tails plus a function of at most 2 ^ (2 ^ (D - t)) inputs.

theorem Cslib.Circuits.Circuit.Computes.mul_log_log_lt_size {K : Type u_1} [Field K] {n C k e : ℕ} (hC : 0 < C) (hk : 0 < k) (he : 0 < e) {A : Matrix (Fin n) (Fin n) K} (hn : 2 * k ≤ Nat.log 2 n) (hrig : n * 2 ^ (Nat.log 2 n / k) < A.rigidity (n / e)) {c : Circuit (affineSignature K) n n} (hc : c.Computes (affineInterpretation K) fun (x : Fin n → K) => A.mulVec x) (hfan : c.FanInAtMost 2) (hdepth : c.depth ≤ C * Nat.log 2 n) :
n * (Nat.log 2 (Nat.log 2 n) + 1) < 2 * e * (Nat.log 2 (2 * C * k) + 1) * c.size

Valiant's rigidity criterion, asymptotic form ([Val77]; [Lok09], Theorem 2.1). Let ℓ = Nat.log 2 n and fix constants C, k, e > 0. If changing at most n * 2 ^ (ℓ / k) entries of the n × n matrix A cannot bring its rank down to n / e, then every circuit of affine gates of fan-in at most 2 computing x ↦ A *ᵥ x in depth at most C * ℓ has n * (log₂ ℓ + 1) < 2 * e * (log₂ (2 * C * k) + 1) * c.size: for fixed C, k, e, size Ω(n log log n). The hypothesis 2 * k ≤ ℓ just asks for n ≥ 2 ^ (2 * k).

This is the statement of [Lok09], Theorem 2.1, in explicit form. If A is (εn, n ^ (1 + δ))-rigid, i.e. n ^ (1 + δ) ≤ A.rigidity ⌊ε n⌋, then the hypothesis holds for every e ≥ 1 / ε and every k > 1 / δ once n is large enough: n / e ≤ ⌊ε n⌋, and n * 2 ^ (ℓ / k) ≤ n ^ (1 + 1 / k) < n ^ (1 + δ) for n ≥ 2.

theorem Cslib.Circuits.Circuit.Computes.rigidity_le_of_isPolynomial {K : Type u_1} [Field K] {n m : ℕ} [Infinite K] {σ : Signature} {I : Interpretation σ K} (hI : I.IsPolynomial) {c : Circuit σ n m} {A : Matrix (Fin m) (Fin n) K} (hc : c.Computes I fun (x : Fin n → K) => A.mulVec x) (hfan : c.FanInAtMost 2) {D t : ℕ} (hdepth : c.depth < 2 ^ D) (htD : t ≤ D) :
A.rigidity (2 * t * c.size / D) ≤ m * 2 ^ 2 ^ (D - t)

Valiant's rigidity criterion for polynomial operations over infinite fields. Over an infinite field, a circuit whose operations are polynomials (for example the arithmetic basis +, × and constants) computing x ↦ A *ᵥ x with fan-in at most 2 and c.depth < 2 ^ D obeys the same bound as an affine circuit: linearization (Circuit.Computes.exists_affine) keeps the size, fan-in, and depth.