Documentation

Complexitylib.Algebraic.LowerBound.Cutwidth.MultiOutput.MatMul.Internal.Charge

The three charges bound the crossing signals #

Let the wires out of a program over a finite field carry matMul n, and split the wires into S and its complement, crossed by w signals, and place the terminals matMulTermA, matMulTermB, matMulTermC as in Tripartite (Tripartite.place). Each charge is bounded through the kernels of blocks of one n × n matrix, two blocks per vertex.

At a vertex with a and c placed terminals of its two kinds, a totally regular matrix makes the two kernels miss min (a, n - c) + min (n - a, c) = minority n (a + c) dimensions (prodI_mul_pow_le and its siblings), so each charge is at most w (chargeI_le_of_totallyRegular, ...). For a uniformly random matrix each kernel has average size at most twice the ideal one (sum_card_supportedKernel_mul_pow_le), so by averaging some matrix loses at most 4 n (exists_prodI_mul_pow_le, ...), and each charge is at most w + 4 n over every finite field (chargeI_le_add, ...).

Placing the terminals #

theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.mem_rowSet_placeC {n s : ℕ} (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) {i k : Fin n} :
theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.mem_colSet_placeC {n s : ℕ} (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) {i k : Fin n} :

Arithmetic of the per-vertex bounds #

theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.minority_add_eq {n a c : ℕ} (ha : a ≤ n) (hc : c ≤ n) :
Tripartite.minority n (a + c) = min a (n - c) + min (n - a) c
theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.prod_mul_pow_le {n q : ℕ} (K₁ K₂ p₁ p₂ m₁ m₂ : Fin n → ℕ) (h₁ : ∀ (v : Fin n), K₁ v * q ^ m₁ v ≤ q ^ p₁ v) (h₂ : ∀ (v : Fin n), K₂ v * q ^ m₂ v ≤ q ^ p₂ v) :
(∏ v : Fin n, K₁ v * K₂ v) * q ^ ∑ v : Fin n, (m₁ v + m₂ v) ≤ q ^ ∑ v : Fin n, (p₁ v + p₂ v)

Multiplying the per-vertex bounds.

theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.exists_prod_mul_pow_le {n : ℕ} {X : Type u_1} [Fintype X] [Nonempty X] {q : ℕ} (hq : 1 < q) (K₁ K₂ : Fin n → X → ℕ) (hK₁ : ∀ (v : Fin n) (x : X), 0 < K₁ v x) (hK₂ : ∀ (v : Fin n) (x : X), 0 < K₂ v x) (p₁ p₂ m₁ m₂ : Fin n → ℕ) (hm₁ : ∀ (v : Fin n), m₁ v ≤ p₁ v) (hm₂ : ∀ (v : Fin n), m₂ v ≤ p₂ v) (h₁ : ∀ (v : Fin n), (∑ x : X, K₁ v x) * q ^ m₁ v ≤ 2 * Fintype.card X * q ^ p₁ v) (h₂ : ∀ (v : Fin n), (∑ x : X, K₂ v x) * q ^ m₂ v ≤ 2 * Fintype.card X * q ^ p₂ v) :
∃ (x : X), (∏ v : Fin n, K₁ v x * K₂ v x) * q ^ ∑ v : Fin n, (m₁ v + m₂ v) ≤ q ^ (∑ v : Fin n, (p₁ v + p₂ v) + 4 * n)

Averaging the per-vertex bounds. If the two families of kernels at each vertex average at most twice their ideal sizes, some choice loses at most 4 n in the exponent.

theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.le_add_of_pow_le {q E w R L X : ℕ} (hq : 1 < q) (h₁ : q ^ E ≤ q ^ w * X) (h₂ : X * q ^ R ≤ q ^ (E + L)) :
R ≤ w + L

Comparing exponents. If q ^ E ≤ q ^ w X and X q ^ R ≤ q ^ (E + L), then R ≤ w + L.

Charge identities #

The inputs outside S, counted at the vertices of J.

Kernel products #

noncomputable def Algebraic.Cutwidth.MultiOutput.MatMul.Internal.prodI {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (B₀ : Matrix (Fin n) (Fin n) F) (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) :

The kernels of the rows of δA ↦ δA B₀ at the split S.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    noncomputable def Algebraic.Cutwidth.MultiOutput.MatMul.Internal.prodK {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (A₀ : Matrix (Fin n) (Fin n) F) (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) :

    The kernels of the columns of δB ↦ A₀ δB at the split S.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def Algebraic.Cutwidth.MultiOutput.MatMul.Internal.prodJ {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (Λ : Matrix (Fin n) (Fin n) F) (S : Finset (Wire (n * n + n * n) s)) :

      The kernels of the blocks of the Hessian of ∑ Λ i k C i k at the split S.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.card_supportedKernel_shiftLeft_le {n : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (B₀ : Matrix (Fin n) (Fin n) F) (P : Finset (Fin (n * n + n * n))) (hP : P ⊆ leftCoords n) (Q : Finset (Fin (n * n))) :
        (supportedKernel (shiftLeft B₀) P Q).card ≤ ∏ i : Fin n, (supportedKernel (fun (u : Fin n → F) => Matrix.vecMul u B₀) {j : Fin n | matMulLeft n i j ∈ P} {k : Fin n | matMulOutput n i k ∈ Q}).card

        Row decomposition of the kernels with B fixed.

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.card_supportedKernel_shiftRight_le {n : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (A₀ : Matrix (Fin n) (Fin n) F) (P : Finset (Fin (n * n + n * n))) (hP : P ⊆ rightCoords n) (Q : Finset (Fin (n * n))) :
        (supportedKernel (shiftRight A₀) P Q).card ≤ ∏ k : Fin n, (supportedKernel (fun (u : Fin n → F) => A₀.mulVec u) {j : Fin n | matMulRight n j k ∈ P} {i : Fin n | matMulOutput n i k ∈ Q}).card

        Column decomposition of the kernels with A fixed.

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.pow_le_mul_prodI {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {p : Program σ (n * n + n * n) s} {I : Interpretation σ F} {out : Fin (n * n) → Wire (n * n + n * n) s} (hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o) (S : Finset (Wire (n * n + n * n) s)) (B₀ : Matrix (Fin n) (Fin n) F) :

        The bound behind R_I. Fixing the second factor to B₀, |F| ^ (n²) ≤ |F| ^ w · prodI B₀ S.

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.pow_le_mul_prodK {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {p : Program σ (n * n + n * n) s} {I : Interpretation σ F} {out : Fin (n * n) → Wire (n * n + n * n) s} (hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o) (S : Finset (Wire (n * n + n * n) s)) (A₀ : Matrix (Fin n) (Fin n) F) :

        The bound behind R_K. Fixing the first factor to A₀, |F| ^ (n²) ≤ |F| ^ w · prodK A₀ S.

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.card_ker_le_prodJ {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (Λ : Matrix (Fin n) (Fin n) F) (S : Finset (Wire (n * n + n * n) s)) :
        {v : ↥(SingleCut.inputsIn S)ᶜ → F | v ∈ ((bilinForm Λ + (bilinForm Λ).transpose).submatrix (fun (x : ↥(SingleCut.inputsIn S)) => ↑x) fun (y : ↥(SingleCut.inputsIn S)ᶜ) => ↑y).mulVecLin.ker}.card ≤ prodJ Λ S

        Kernels of the Hessian block. The kernel of the cross block of H = M + Mᵀ between the inputs in S and outside S embeds in the product of the kernels at the vertices j.

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.pow_le_mul_prodJ {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {p : Program σ (n * n + n * n) s} {I : Interpretation σ F} {out : Fin (n * n) → Wire (n * n + n * n) s} (hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o) (S : Finset (Wire (n * n + n * n) s)) (Λ : Matrix (Fin n) (Fin n) F) :

        The bound behind R_J. For every Λ, with X_T the inputs outside S, |F| ^ |X_T| ≤ |F| ^ w · prodJ Λ S.

        The charges #

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.prodI_mul_pow_le {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {M : Matrix (Fin n) (Fin n) F} (hM : TotallyRegular M) (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) :

        Totally regular rows. If M is totally regular, prodI M S · |F| ^ R_I ≤ |F| ^ (n²).

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.prodK_mul_pow_le {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {M : Matrix (Fin n) (Fin n) F} (hM : TotallyRegular M) (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) :

        Totally regular columns. If M is totally regular, prodK M S · |F| ^ R_K ≤ |F| ^ (n²).

        A totally regular Hessian. If Λ is totally regular, prodJ Λ S · |F| ^ R_J ≤ |F| ^ |X_T|.

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.exists_prodI_mul_pow_le {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) :
        ∃ (B₀ : Matrix (Fin n) (Fin n) F), prodI B₀ S out * Fintype.card F ^ Tripartite.chargeI (Tripartite.place (matMulTermA n s) S) (Tripartite.place (matMulTermC out) S) ≤ Fintype.card F ^ (n * n + 4 * n)

        Uniform rows. Some B₀ has prodI B₀ S · |F| ^ R_I ≤ |F| ^ (n² + 4 n).

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.exists_prodK_mul_pow_le {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (S : Finset (Wire (n * n + n * n) s)) (out : Fin (n * n) → Wire (n * n + n * n) s) :
        ∃ (A₀ : Matrix (Fin n) (Fin n) F), prodK A₀ S out * Fintype.card F ^ Tripartite.chargeK (Tripartite.place (matMulTermB n s) S) (Tripartite.place (matMulTermC out) S) ≤ Fintype.card F ^ (n * n + 4 * n)

        Uniform columns. Some A₀ has prodK A₀ S · |F| ^ R_K ≤ |F| ^ (n² + 4 n).

        A uniform Hessian. Some Λ has prodJ Λ S · |F| ^ R_J ≤ |F| ^ (|X_T| + 4 n).

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.charges_le_of_totallyRegular {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {p : Program σ (n * n + n * n) s} {I : Interpretation σ F} {out : Fin (n * n) → Wire (n * n + n * n) s} (hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o) {M : Matrix (Fin n) (Fin n) F} (hM : TotallyRegular M) (S : Finset (Wire (n * n + n * n) s)) :

        The three charges, with a totally regular matrix. If F has a totally regular n × n matrix, each charge of every split is at most the number of crossing signals.

        theorem Algebraic.Cutwidth.MultiOutput.MatMul.Internal.charges_le_add {σ : Signature} {n s : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {p : Program σ (n * n + n * n) s} {I : Interpretation σ F} {out : Fin (n * n) → Wire (n * n + n * n) s} (hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o) (S : Finset (Wire (n * n + n * n) s)) :

        The three charges over every finite field. Each charge of every split is at most the number of crossing signals plus 4 n.