Documentation

Complexitylib.Algebraic.LowerBound.Cutwidth.MultiOutput.FieldMul.Internal

Proofs for multiplication in coordinates #

Write X(u) = ∑ j, u j • b j for the element with coordinates u, and split the 2 n inputs into the coordinates x of the first factor (xCoords) and y of the second (yCoords).

The two factors #

The inputs holding the coordinates of the first factor.

Equations
Instances For

    The inputs holding the coordinates of the second factor.

    Equations
    Instances For

      The first-factor inputs placed in S, as coordinates of all inputs.

      Fixing one factor #

      theorem Algebraic.Cutwidth.MultiOutput.Internal.fieldMul_eq {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (z : Fin (n + n) → F) :
      fieldMul b z = b.equivFun ((b.equivFun.symm fun (j : Fin n) => z (Fin.castAdd n j)) * b.equivFun.symm fun (j : Fin n) => z (Fin.natAdd n j))
      theorem Algebraic.Cutwidth.MultiOutput.Internal.fieldMul_append {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (x y : Fin n → F) :
      theorem Algebraic.Cutwidth.MultiOutput.Internal.fieldMul_append_equivFun {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (u v : K) :
      fieldMul b (Fin.append (b.equivFun u) (b.equivFun v)) = b.equivFun (u * v)

      Multiplication in coordinates multiplies.

      noncomputable def Algebraic.Cutwidth.MultiOutput.Internal.shiftLeft {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (y₀ : Fin n → F) (d : Fin (n + n) → F) :
      Fin n → F

      The change of the product when the input changes by d and the second factor has the coordinates y₀.

      Equations
      Instances For
        noncomputable def Algebraic.Cutwidth.MultiOutput.Internal.shiftRight {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (x₀ : Fin n → F) (d : Fin (n + n) → F) :
        Fin n → F

        The change of the product when the input changes by d and the first factor has the coordinates x₀.

        Equations
        Instances For
          theorem Algebraic.Cutwidth.MultiOutput.Internal.fieldMul_sub_left {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (y₀ : Fin n → F) (z z' : Fin (n + n) → F) (hz : ∀ k ∉ xCoords n, z k = Fin.append 0 y₀ k) (hz' : ∀ k ∉ xCoords n, z' k = Fin.append 0 y₀ k) :
          fieldMul b z' - fieldMul b z = shiftLeft b y₀ (z' - z)

          With the second factor fixed, the product changes by shiftLeft.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.fieldMul_sub_right {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (x₀ : Fin n → F) (z z' : Fin (n + n) → F) (hz : ∀ k ∉ yCoords n, z k = Fin.append x₀ 0 k) (hz' : ∀ k ∉ yCoords n, z' k = Fin.append x₀ 0 k) :
          fieldMul b z' - fieldMul b z = shiftRight b x₀ (z' - z)

          With the first factor fixed, the product changes by shiftRight.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.equivFun_symm_single {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (j : Fin n) :
          b.equivFun.symm (Pi.single j 1) = b j
          theorem Algebraic.Cutwidth.MultiOutput.Internal.shiftLeft_single {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (y₀ : Fin n → F) (j : Fin n) :
          shiftLeft b y₀ (Pi.single (Fin.castAdd n j) 1) = b.equivFun (b j * b.equivFun.symm y₀)

          A unit vector on a first-factor input shifts the product by b j times the second factor.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.shiftRight_single {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (x₀ : Fin n → F) (j : Fin n) :
          shiftRight b x₀ (Pi.single (Fin.natAdd n j) 1) = b.equivFun (b.equivFun.symm x₀ * b j)

          A unit vector on a second-factor input shifts the product by the first factor times b j.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.shiftLeft_single_apply {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (j i : Fin n) :
          shiftLeft b (b.equivFun ((b j)⁻¹ * b i)) (Pi.single (Fin.castAdd n j) 1) i = 1

          Every block entry can be made nonzero: with the second factor (b j)⁻¹ * b i, the unit vector on the first-factor input j shifts output i by one.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.shiftRight_single_apply {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (j i : Fin n) :
          shiftRight b (b.equivFun (b i * (b j)⁻¹)) (Pi.single (Fin.natAdd n j) 1) i = 1

          With the first factor b i * (b j)⁻¹, the unit vector on the second-factor input j shifts output i by one.

          Averaging the fixed factor #

          theorem Algebraic.Cutwidth.MultiOutput.Internal.card_filter_forall_eq_zero {n : ℕ} {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] (Q : Finset (Fin n)) :
          {u : Fin n → F | ∀ i ∈ Q, u i = 0}.card = Fintype.card F ^ Qᶜ.card

          The vectors vanishing on Q number |F| ^ |Qᶜ|.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.card_filter_shiftLeft_eq {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) {d : Fin (n + n) → F} (hd : (b.equivFun.symm fun (j : Fin n) => d (Fin.castAdd n j)) ≠ 0) (Q : Finset (Fin n)) :
          {y₀ : Fin n → F | ∀ i ∈ Q, shiftLeft b y₀ d i = 0}.card = Fintype.card F ^ Qᶜ.card

          For a vector d whose first-factor part is a nonzero element, exactly |F| ^ |Qᶜ| second factors put it in the kernel on the rows Q.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.sum_card_supportedKernel_le {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (P : Finset (Fin (n + n))) (hP : P ⊆ xCoords n) (Q : Finset (Fin n)) :
          ∑ y₀ : Fin n → F, (supportedKernel (shiftLeft b y₀) P Q).card ≤ Fintype.card F ^ n + Fintype.card F ^ P.card * Fintype.card F ^ Qᶜ.card

          Averaging over the fixed factor. For P within the first factor, the kernels on P and Q number at most |F| ^ n + |F| ^ |P| · |F| ^ |Qᶜ| in total over all second factors.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.sum_card_supportedKernel_le_two_mul {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (P : Finset (Fin (n + n))) (hP : P ⊆ xCoords n) (Q : Finset (Fin n)) (hPQ : P.card ≤ Q.card) :
          ∑ y₀ : Fin n → F, (supportedKernel (shiftLeft b y₀) P Q).card ≤ 2 * Fintype.card F ^ n

          When |P| ≤ |Q|, the kernels number at most 2 |F| ^ n in total.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.exists_card_add_card_le_four {n : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (P₁ P₂ : Finset (Fin (n + n))) (hP₁ : P₁ ⊆ xCoords n) (hP₂ : P₂ ⊆ xCoords n) (Q₁ Q₂ : Finset (Fin n)) (h₁ : P₁.card ≤ Q₁.card) (h₂ : P₂.card ≤ Q₂.card) :
          ∃ (y₀ : Fin n → F), (supportedKernel (shiftLeft b y₀) P₁ Q₁).card + (supportedKernel (shiftLeft b y₀) P₂ Q₂).card ≤ 4

          Some fixed factor makes two kernels small. If |P₁| ≤ |Q₁| and |P₂| ≤ |Q₂|, some second factor makes the two kernels number at most 4 together.

          The cut bound #

          theorem Algebraic.Cutwidth.MultiOutput.Internal.le_add_two_of_trace {σ : Signature} {n s : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (p : Program σ (n + n) s) (I : Interpretation σ F) (out : Fin n → Wire (n + n) s) (hf : ∀ (z : Fin (n + n) → F) (i : Fin n), p.trace I z (out i) = fieldMul b z i) (S : Finset (Wire (n + n) s)) (hS : {j : Fin n | Wire.input (Fin.castAdd n j) ∈ S}.card + (outputsIn out S).card = n) :

          The cut bound for multiplication. If the wires out of a program carry fieldMul b, every split holding a inputs of the first factor and n - a outputs is crossed by at least n - 2 signals.

          One component and distinct terminals #

          theorem Algebraic.Cutwidth.MultiOutput.Internal.mem_component_of_trace {σ : Signature} {n s : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (hn : 0 < n) (p : Program σ (n + n) s) (I : Interpretation σ F) (out : Fin n → Wire (n + n) s) (hf : ∀ (z : Fin (n + n) → F) (i : Fin n), p.trace I z (out i) = fieldMul b z i) :
          (∀ (k : Fin (n + n)), Wire.input k ∈ component p (out ⟨0, hn⟩)) ∧ ∀ (i : Fin n), out i ∈ component p (out ⟨0, hn⟩)

          All inputs and outputs lie in one component. If the wires out of a program carry fieldMul b and n ≥ 1, the component of the first output contains every input and every output.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.out_injective {σ : Signature} {n s : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (p : Program σ (n + n) s) (I : Interpretation σ F) (out : Fin n → Wire (n + n) s) (hf : ∀ (z : Fin (n + n) → F) (i : Fin n), p.trace I z (out i) = fieldMul b z i) :

          A program carrying fieldMul b carries distinct outputs on distinct wires: with the second factor 1, the outputs are the coordinates of the first factor.

          theorem Algebraic.Cutwidth.MultiOutput.Internal.out_ne_input {σ : Signature} {n s : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (p : Program σ (n + n) s) (I : Interpretation σ F) (out : Fin n → Wire (n + n) s) (hf : ∀ (z : Fin (n + n) → F) (i : Fin n), p.trace I z (out i) = fieldMul b z i) (i j : Fin n) :

          No output of a program carrying fieldMul b is an input of the first factor: with the second factor 0, every output is zero.

          def Algebraic.Cutwidth.MultiOutput.Internal.terminal {n s : ℕ} (out : Fin n → Wire (n + n) s) :
          Fin n ⊕ Fin n → Wire (n + n) s

          The terminals: the inputs of the first factor, then the outputs.

          Equations
          Instances For
            theorem Algebraic.Cutwidth.MultiOutput.Internal.terminal_injective {σ : Signature} {n s : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) (p : Program σ (n + n) s) (I : Interpretation σ F) (out : Fin n → Wire (n + n) s) (hf : ∀ (z : Fin (n + n) → F) (i : Fin n), p.trace I z (out i) = fieldMul b z i) :

            Distinct terminals lie on distinct wires.

            theorem Algebraic.Cutwidth.MultiOutput.Internal.card_filter_terminal {n s : ℕ} (out : Fin n → Wire (n + n) s) (q : Wire (n + n) s → Prop) [DecidablePred q] :
            {a : Fin n ⊕ Fin n | q (terminal out a)}.card = {j : Fin n | q (Wire.input (Fin.castAdd n j))}.card + {i : Fin n | q (out i)}.card

            Counting terminals splits into first-factor inputs and outputs.

            The finite bound #

            theorem Algebraic.Cutwidth.MultiOutput.Internal.card_terminal_prefixBelow_succ_le {n s : ℕ} (rank : Wire (n + n) s → ℕ) (hrank : Function.Injective rank) (out : Fin n → Wire (n + n) s) (hterm : Function.Injective (terminal out)) (t : ℕ) :
            {a : Fin n ⊕ Fin n | rank (terminal out a) < t + 1}.card ≤ {a : Fin n ⊕ Fin n | rank (terminal out a) < t}.card + 1
            theorem Algebraic.Cutwidth.MultiOutput.Internal.sub_two_le_of_trace {σ : Signature} {n s : ℕ} {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Algebra F K] (b : Module.Basis (Fin n) F K) {A η C : ℝ} (hAη : 0 ≤ A + η) (order : Multigraph.OrderingBound A η C) (p : Program σ (n + n) s) (hp : p.FanInAtMost 2) (I : Interpretation σ F) (out : Fin n → Wire (n + n) s) (hf : ∀ (z : Fin (n + n) → F) (i : Fin n), p.trace I z (out i) = fieldMul b z i) :
            ↑n - 2 ≤ (A + η) * max (↑s - 2 * ↑n) 0 + 3 * Real.logb 2 (2 * ↑n + 3 * ↑s) + C

            The finite bound for multiplication. A fan-in-two program over any signature whose wires out carry fieldMul b has n - 2 ≤ (A + η) (s - 2 n)⁺ + 3 log₂ (2 n + 3 s) + C.

            Asymptotics #

            theorem Algebraic.Cutwidth.MultiOutput.Internal.eventually_lt_size_of_orderingBound_fieldMul {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] (K : Type w) [inst_2 : Field K] [inst_3 : Algebra F K] (b : Module.Basis (Fin n) F K) (σ : Signature) (I : Interpretation σ F) (c : Circuit σ (n + n) n), c.FanInAtMost 2 → c.Computes I (fieldMul b) → (2 + 1 / A - ε) * ↑n < ↑c.size

            The asymptotic bound for multiplication with a general ordering coefficient.