Documentation

Complexitylib.Algebraic.LowerBound.Cutwidth.MultiOutput.Quadratic.Internal

Proofs for quadratic forms #

Linear algebra #

theorem Algebraic.Cutwidth.MultiOutput.Internal.rank_add_rank_le_rank_mul_add_card {F : Type u_1} [Field F] {ι : Type u_2} {κ : Type u_3} {μ : Type u_4} [Fintype κ] [Fintype μ] (B : Matrix ι κ F) (V : Matrix κ μ F) :
B.rank + V.rank ≤ (B * V).rank + Fintype.card κ

Sylvester's rank inequality. For a matrix B with columns indexed by κ and a matrix V with rows indexed by κ, rank B + rank V ≤ rank (B V) + |κ|.

The kernel of a matrix has dimension width - rank.

theorem Algebraic.Cutwidth.MultiOutput.Internal.card_filter_mem_submodule {F : Type u_1} [Field F] [Fintype F] {V : Type u_2} [AddCommGroup V] [Module F V] [Fintype V] (P : Submodule F V) [DecidablePred fun (x : V) => x ∈ P] :
{x : V | x ∈ P}.card = Fintype.card F ^ Module.finrank F ↥P

A submodule of a finite space over a finite field has |F| ^ finrank elements.

theorem Algebraic.Cutwidth.MultiOutput.Internal.card_mul_card_le_of_dotProduct_mulVec_eq_zero {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (B : Matrix ι κ F) (L : Finset (ι → F)) (R : Finset (κ → F)) (h : ∀ l ∈ L, ∀ l' ∈ L, ∀ r ∈ R, ∀ r' ∈ R, (l - l') ⬝ᵥ B.mulVec (r - r') = 0) :

The product-class bound. If (l - l') ⬝ B (r - r') = 0 for all l, l' ∈ L and r, r' ∈ R, then |L| |R| ≤ |F| ^ (|ι| + |κ| - rank B).

The mixed second difference #

theorem Algebraic.Cutwidth.MultiOutput.Internal.trace_add_trace_eq_trace_mix_add_trace_mix {σ : Signature} {n s : ℕ} {U : Type u_1} [AddCommMonoid U] (p : Program σ n s) (I : Interpretation σ U) {S : Finset (Wire n s)} {x x' : Fin n → U} (h : SingleCut.boundaryKey p I S x = SingleCut.boundaryKey p I S x') (w : Wire n s) :
p.trace I x w + p.trace I x' w = p.trace I (SingleCut.mix S x x') w + p.trace I (SingleCut.mix S x' x) w

Values on a class are additive under mixing. If two inputs have the same boundary key, the values of any wire at the two inputs sum to its values at the two mixed inputs: the mixed second difference vanishes.

theorem Algebraic.Cutwidth.MultiOutput.Internal.sum_inputsIn_eq {n s : ℕ} {F : Type u_1} [CommRing F] (S : Finset (Wire n s)) (g : Fin n → F) :
∑ i : ↥(SingleCut.inputsIn S), g ↑i = ∑ i : Fin n, if Wire.input i ∈ S then g i else 0

A sum over the inputs placed in S is a full sum with the other terms zeroed.

theorem Algebraic.Cutwidth.MultiOutput.Internal.sum_inputsIn_compl_eq {n s : ℕ} {F : Type u_1} [CommRing F] (S : Finset (Wire n s)) (g : Fin n → F) :
∑ j : ↥(SingleCut.inputsIn S)ᶜ, g ↑j = ∑ j : Fin n, if Wire.input j ∈ S then 0 else g j

A sum over the inputs placed outside S is a full sum with the other terms zeroed.

theorem Algebraic.Cutwidth.MultiOutput.Internal.quadForm_add_quadForm_eq {n s : ℕ} {F : Type u_1} [CommRing F] (M : Matrix (Fin n) (Fin n) F) (S : Finset (Wire n s)) (x x' : Fin n → F) :

The mixed second difference of a quadratic form is the bilinear cross term (x_S - x'_S)ᵀ (M + Mᵀ)[X_S, X_T] (x_T - x'_T).

The rank-cut bound for quadratic forms #

theorem Algebraic.Cutwidth.MultiOutput.Internal.dotProduct_mulVec_eq_zero_of_mix {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (p : Program σ n s) (I : Interpretation σ F) (M : Matrix (Fin n) (Fin n) F) (S : Finset (Wire n s)) (hmix : ∀ (x x' : Fin n → F), SingleCut.boundaryKey p I S x = SingleCut.boundaryKey p I S x' → quadForm M x + quadForm M x' = quadForm M (SingleCut.mix S x x') + quadForm M (SingleCut.mix S x' x)) {κ : (↥(SingleCut.forward p S) → F) × (↥(SingleCut.backward p S) → F)} {l l' : ↥(SingleCut.inputsIn S) → F} (hl : l ∈ SingleCut.leftParts p I S Finset.univ κ) (hl' : l' ∈ SingleCut.leftParts p I S Finset.univ κ) {r r' : ↥(SingleCut.inputsIn S)ᶜ → F} (hr : r ∈ SingleCut.rightParts p I S Finset.univ κ) (hr' : r' ∈ SingleCut.rightParts p I S Finset.univ κ) :
(l - l') ⬝ᵥ ((M + M.transpose).submatrix (fun (i : ↥(SingleCut.inputsIn S)) => ↑i) fun (j : ↥(SingleCut.inputsIn S)ᶜ) => ↑j).mulVec (r - r') = 0

Classes are isotropic. If the quadratic form of M is additive under mixing inputs with equal boundary keys, then on the inputs with a given key any two left parts and any two right parts satisfy (l - l')ᵀ (M + Mᵀ)[X_S, X_T] (r - r') = 0.

theorem Algebraic.Cutwidth.MultiOutput.Internal.dotProduct_mulVec_eq_zero_of_mem_parts {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (p : Program σ n s) (I : Interpretation σ F) (out : Wire n s) (M : Matrix (Fin n) (Fin n) F) (hf : ∀ (x : Fin n → F), p.trace I x out = quadForm M x) (S : Finset (Wire n s)) {κ : (↥(SingleCut.forward p S) → F) × (↥(SingleCut.backward p S) → F)} {l l' : ↥(SingleCut.inputsIn S) → F} (hl : l ∈ SingleCut.leftParts p I S Finset.univ κ) (hl' : l' ∈ SingleCut.leftParts p I S Finset.univ κ) {r r' : ↥(SingleCut.inputsIn S)ᶜ → F} (hr : r ∈ SingleCut.rightParts p I S Finset.univ κ) (hr' : r' ∈ SingleCut.rightParts p I S Finset.univ κ) :
(l - l') ⬝ᵥ ((M + M.transpose).submatrix (fun (i : ↥(SingleCut.inputsIn S)) => ↑i) fun (j : ↥(SingleCut.inputsIn S)ᶜ) => ↑j).mulVec (r - r') = 0

Classes are isotropic. On the inputs with a given boundary key, any two left parts and any two right parts satisfy (l - l')ᵀ (M + Mᵀ)[X_S, X_T] (r - r') = 0, when a wire carries the quadratic form of M.

The rank-cut bound for quadratic forms additive under mixing. If the quadratic form of M is additive under mixing inputs with equal boundary keys for the split S, then rank (M + Mᵀ)[X_S, X_T] ≤ |A| + |B|.

theorem Algebraic.Cutwidth.MultiOutput.Internal.blockRank_add_transpose_le {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (p : Program σ n s) (I : Interpretation σ F) (out : Wire n s) (M : Matrix (Fin n) (Fin n) F) (hf : ∀ (x : Fin n → F), p.trace I x out = quadForm M x) (S : Finset (Wire n s)) :

The rank-cut bound for quadratic forms. If the wire out of a program over a finite field carries the quadratic form of M, then every split S has rank (M + Mᵀ)[X_S, X_T] ≤ |A| + |B|.

theorem Algebraic.Cutwidth.MultiOutput.Internal.blockRank_add_transpose_le_of_sum {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : ℕ} (p : Program σ n s) (I : Interpretation σ F) (out : Fin m → Wire n s) (coeff : Fin m → F) (M : Matrix (Fin n) (Fin n) F) (hf : ∀ (x : Fin n → F), ∑ o : Fin m, coeff o * p.trace I x (out o) = quadForm M x) (S : Finset (Wire n s)) :

The rank-cut bound for a combination of outputs. If the combination ∑ o, coeff o · out o of output wires of a program over a finite field is the quadratic form of M, then every split S has rank (M + Mᵀ)[X_S, X_T] ≤ |A| + |B|: the mixed second difference vanishes on every class for each output wire, hence for the combination.

Symmetric totally regular matrices #

theorem Algebraic.Cutwidth.MultiOutput.Internal.totallyRegular_add_transpose {F : Type u_1} [Field F] {N : ℕ} {M : Matrix (Fin N) (Fin N) F} (hM : TotallyRegular M) (hsymm : M.transpose = M) (h2 : 2 ≠ 0) :

If M is symmetric and totally regular and 2 ≠ 0, then M + Mᵀ = 2 M is totally regular.

theorem Algebraic.Cutwidth.MultiOutput.Internal.hankelCauchyZMod_eq_cauchy (q N : ℕ) [Fact (Nat.Prime q)] :
hankelCauchyZMod q N = cauchy (fun (i : Fin N) => ↑↑i + 1) fun (j : Fin N) => -(↑↑j + 1)

The Hankel Cauchy matrix is the Cauchy matrix with nodes x i = i + 1 and y j = -(j + 1).

The Hankel Cauchy matrix is totally regular over ZMod q for a prime q > 2 N.

The symmetrized Hankel Cauchy matrix is totally regular over ZMod q for a prime q > 2 N: it is twice a symmetric totally regular matrix, and 2 ≠ 0 as q is odd.

The finite bound #

All inputs lie in one component. If M + Mᵀ is totally regular and every split of a program obeys the rank-cut bound for M + Mᵀ, the component of an input wire contains every input: it is closed, hence crossed by no signal, so its inputs form a block of rank zero.

theorem Algebraic.Cutwidth.MultiOutput.Internal.half_le_of_quadForm_rank_cuts {σ : Signature} {F : Type u_1} [Field F] {A η C : ℝ} (hAη : 0 ≤ A + η) (order : Multigraph.OrderingBound A η C) {N s : ℕ} (p : Program σ N s) (hp : p.FanInAtMost 2) {M : Matrix (Fin N) (Fin N) F} (hM : TotallyRegular (M + M.transpose)) (hcut : ∀ (S : Finset (Wire N s)), blockRank (M + M.transpose) (SingleCut.inputsIn S) (SingleCut.inputsIn S)ᶜ ≤ (SingleCut.forward p S).card + (SingleCut.backward p S).card) :
↑(N / 2) ≤ (A + η) * max (↑s - ↑N) 0 + 3 * Real.logb 2 (↑N + 3 * ↑s) + C

The finite bound from rank cuts. A fan-in-two program over any signature and any field whose splits all obey the rank-cut bound for M + Mᵀ, with M + Mᵀ totally regular, has ⌊N/2⌋ ≤ (A + η) (s - N)⁺ + 3 log₂ (N + 3 s) + C.

theorem Algebraic.Cutwidth.MultiOutput.Internal.input_mem_component_of_quadForm {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (p : Program σ n s) (I : Interpretation σ F) (out : Wire n s) {M : Matrix (Fin n) (Fin n) F} (hM : TotallyRegular (M + M.transpose)) (hf : ∀ (x : Fin n → F), p.trace I x out = quadForm M x) (j j' : Fin n) :

All inputs lie in one component. If M + Mᵀ is totally regular, the component of an input wire contains every input: it is closed, hence crossed by no signal, so by the rank-cut bound its inputs form a block of rank zero.

theorem Algebraic.Cutwidth.MultiOutput.Internal.half_le_of_quadForm {σ : Signature} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {A η C : ℝ} (hAη : 0 ≤ A + η) (order : Multigraph.OrderingBound A η C) {N s : ℕ} (p : Program σ N s) (hp : p.FanInAtMost 2) (I : Interpretation σ F) (out : Wire N s) {M : Matrix (Fin N) (Fin N) F} (hM : TotallyRegular (M + M.transpose)) (hf : ∀ (x : Fin N → F), p.trace I x out = quadForm M x) :
↑(N / 2) ≤ (A + η) * max (↑s - ↑N) 0 + 3 * Real.logb 2 (↑N + 3 * ↑s) + C

The finite bound for quadratic forms. A fan-in-two program over any signature whose wire out carries the quadratic form of M, with M + Mᵀ totally regular, has ⌊N/2⌋ ≤ (A + η) (s - N)⁺ + 3 log₂ (N + 3 s) + C.

Asymptotics #

theorem Algebraic.Cutwidth.MultiOutput.Internal.eventually_lt_size_of_quadForm_rank_cuts {A : ℝ} (hA : 0 < A) (order : ∀ (η : ℝ), 0 < η → ∃ (C : ℝ), Multigraph.OrderingBound A η C) {ε : ℝ} (hε : 0 < ε) :
∀ᶠ (N : ℕ) in Filter.atTop, ∀ (F : Type u) [inst : Field F] (M : Matrix (Fin N) (Fin N) F), TotallyRegular (M + M.transpose) → ∀ (σ : Signature) (c : Circuit σ N 1), c.FanInAtMost 2 → (∀ (S : Finset (Wire N c.size)), blockRank (M + M.transpose) (SingleCut.inputsIn S) (SingleCut.inputsIn S)ᶜ ≤ (SingleCut.forward c.program S).card + (SingleCut.backward c.program S).card) → (1 + 1 / (2 * A) - ε) * ↑N < ↑c.size

The asymptotic bound from rank cuts. If the graph-ordering hypothesis holds with coefficient A > 0 for every positive slack, then for every ε > 0 and all large N, every fan-in-two single-output circuit over any field whose splits obey the rank-cut bound for a totally regular M + Mᵀ has more than (1 + 1/(2A) - ε) N gates.

theorem Algebraic.Cutwidth.MultiOutput.Internal.eventually_lt_size_of_quadForm_of_orderingBound {A : ℝ} (hA : 0 < A) (order : ∀ (η : ℝ), 0 < η → ∃ (C : ℝ), Multigraph.OrderingBound A η C) {ε : ℝ} (hε : 0 < ε) :
∀ᶠ (N : ℕ) in Filter.atTop, ∀ (F : Type u) [inst : Field F] [Fintype F] [DecidableEq F] (M : Matrix (Fin N) (Fin N) F), TotallyRegular (M + M.transpose) → ∀ (σ : Signature) (I : Interpretation σ F) (c : Circuit σ N 1), c.FanInAtMost 2 → (c.Computes I fun (x : Fin N → F) (x_1 : Fin 1) => quadForm M x) → (1 + 1 / (2 * A) - ε) * ↑N < ↑c.size

The asymptotic bound for quadratic forms with a general ordering coefficient.