Documentation

CslibFrontier.Foundations.LinearAlgebra.Tensor.Polynomial

The polynomial multiplication tensors #

Tensor.full a b is the tensor of multiplying a polynomial of length a (degree below a) by one of length b, returning all a + b - 1 coefficients of the product: the full product Full_{a,b} of Pass, §2.1. All three legs are indexed by Fin (a + b - 1): the input legs are padded by zero rows, so that every polynomial tensor of the same output length has the same index types and the leg exchanges act on one type. The middle product Tensor.mid a b = swap23 (full a b) is the dual Mid_{a,b} = Full_{a,b}^{23} of Pass, equation (2): from A of length a and the coefficients of a product A Q, recover b coefficients of Q.

Exchanging the two inputs exchanges the lengths (Tensor.swap12_full, Pass, equation (9)), and full 1 1 is the unit tensor.

Rank (Pass, Lemma 2.3, for the full product): full a b has rank at most a + b - 1 over a field of characteristic zero, by evaluation at a + b - 1 integer points and Lagrange interpolation (Tensor.rank_full). The bound transfers to mid a b and to the other leg exchanges, since rank is invariant under them.

Main definitions #

Main results #

References #

def Cslib.Tensor.full {K : Type u_1} [Zero K] [One K] (a b : ℕ) :
Tensor K (Fin (a + b - 1)) (Fin (a + b - 1)) (Fin (a + b - 1))

The full polynomial product Full_{a,b}: the coefficient k of the product of a polynomial with coefficients i < a and one with coefficients j < b, with all legs padded to Fin (a + b - 1).

def Cslib.Tensor.mid {K : Type u_1} [Zero K] [One K] (a b : ℕ) :
Tensor K (Fin (a + b - 1)) (Fin (a + b - 1)) (Fin (a + b - 1))

The middle product Mid_{a,b}, the dual of the full product: exchange the right input and the output legs.

@[simp]
theorem Cslib.Tensor.full_apply {K : Type u_1} [Zero K] [One K] (a b : ℕ) (i j k : Fin (a + b - 1)) :
full a b i j k = if ↑i < a ∧ ↑j < b ∧ ↑i + ↑j = ↑k then 1 else 0
@[simp]
theorem Cslib.Tensor.mid_apply {K : Type u_1} [Zero K] [One K] (a b : ℕ) (i k j : Fin (a + b - 1)) :
mid a b i k j = if ↑i < a ∧ ↑j < b ∧ ↑i + ↑j = ↑k then 1 else 0
noncomputable def Cslib.Tensor.toPoly {K : Type u_1} [Semiring K] {s : ℕ} (a : ℕ) (A : Fin s → K) :

The polynomial with the coefficient list A, truncated to the coefficients below a.

theorem Cslib.Tensor.bil_full {K : Type u_1} [CommSemiring K] (a b : ℕ) (A B : Fin (a + b - 1) → K) (k : Fin (a + b - 1)) :
(full a b).bil A B k = (toPoly a A * toPoly b B).coeff ↑k

The bilinear map of full a b is the coefficient list of the product of the two input polynomials.

theorem Cslib.Tensor.swap12_full {K : Type u_1} [Zero K] [One K] (a b : ℕ) :
(full a b).swap12 = reindex (finCongr ⋯) (finCongr ⋯) (finCongr ⋯) (full b a)

Exchanging the two inputs of Full_{a,b} gives Full_{b,a} (Pass, eq. (9)).

theorem Cslib.Tensor.full_one_one {K : Type u_1} [Zero K] [One K] :
full 1 1 = unit 1

Full_{1,1} is the unit tensor.

theorem Cslib.Tensor.rank_full {K : Type u_1} [Field K] [CharZero K] (a b : ℕ) :
Rank (a + b - 1) (full a b)

Interpolation bound (Pass, Lemma 2.3): Full_{a,b} has rank at most a + b - 1 over a field of characteristic zero. Evaluate both inputs at the integer points 0, …, a + b - 2, multiply the values, and recover the coefficients of the product by Lagrange interpolation.

theorem Cslib.Tensor.rank_mid {K : Type u_1} [Field K] [CharZero K] (a b : ℕ) :
Rank (a + b - 1) (mid a b)