Finite tensors, restrictions and rank #
A tensor of order three over a commutative semiring R with finite index types X, Y, Z is
given by its structure constants T : X → Y → Z → R (Cslib.Tensor). It is the bilinear map
Tensor.bil T A B = fun z => ∑ x, ∑ y, T x y z * A x * B y, with A and B the coefficient lists
of the two inputs. This is the model of bilinear computation of
Bürgisser, Clausen and Shokrollahi, Chapter 14, and the
selected products of Pass, Definition 2.1, in which the monomials of a shape are
replaced by their index sets.
A restriction of S by the matrices α, β, γ (Tensor.restrict) computes T from S
by linear encoding of the two inputs and linear decoding of the output
(Tensor.bil_restrict): T.bil A B = γ *ᵥ S.bil (α *ᵥ A) (β *ᵥ B). This is a polynomial
packing of one target by one source in the sense of Pass, Definition 2.2. The
rank of T is at most r (Tensor.Rank) when T is a restriction of the unit tensor
unit r, the r independent scalar multiplications: a bilinear algorithm with r
multiplications.
Restrictions compose (Tensor.restrict_restrict), and they are compatible with the tensor
product Tensor.tprod and its finite form Tensor.tprodPi, with the direct sum Tensor.dsum and
the shared-left sum Tensor.slSum, with the three leg exchanges Tensor.swap12,
Tensor.swap23, Tensor.swap13, and with reindexing by equivalences Tensor.reindex. These are
the elementary operations on packings of Pass, Observation 2.5 and Lemmas 2.7–2.10,
in which renaming the variables of a shape is reindexing.
Matrix multiplication of p × q by q × r matrices is the tensor Tensor.mm p q r.
Main definitions #
Cslib.Tensor,Cslib.Tensor.bil: tensors and their bilinear maps.Cslib.Tensor.restrict,Cslib.Tensor.IsRestriction: restriction by three matrices.Cslib.Tensor.unit,Cslib.Tensor.Rank: the unit tensor and rank bounds.Cslib.Tensor.mm: the matrix multiplication tensor.Cslib.Tensor.tprod,Cslib.Tensor.tprodPi,Cslib.Tensor.tpow: tensor products.Cslib.Tensor.dsum,Cslib.Tensor.slSum: direct sums and shared-left sums of a family.Cslib.Tensor.swap12,Cslib.Tensor.swap23,Cslib.Tensor.swap13,Cslib.Tensor.reindex.
Main results #
Cslib.Tensor.bil_restrict: a restriction computes its target by encoding and decoding.Cslib.Tensor.restrict_restrict,Cslib.Tensor.IsRestriction.trans: composition.Cslib.Tensor.IsRestriction.tprod,Cslib.Tensor.IsRestriction.tprodPi,Cslib.Tensor.IsRestriction.dsum,Cslib.Tensor.IsRestriction.swap12,Cslib.Tensor.IsRestriction.swap23,Cslib.Tensor.IsRestriction.swap13,Cslib.Tensor.isRestriction_reindex: closure of restriction.Cslib.Tensor.isRestriction_dsum_comp,Cslib.Tensor.isRestriction_slSum_comp,Cslib.Tensor.isRestriction_dsum_const_of_card_le: deleting, reordering and adding summands.Cslib.Tensor.tprod_comm,Cslib.Tensor.tprod_assoc,Cslib.Tensor.tprod_dsum,Cslib.Tensor.dsum_dsum,Cslib.Tensor.swap12_dsum,Cslib.Tensor.tprod_tprod_tprod_comm: rearrangements, as equalities up to reindexing (Pass, Lemma 2.10).Cslib.Tensor.swap12_mm,Cslib.Tensor.swap13_mm,Cslib.Tensor.tprod_mm_mm,Cslib.Tensor.isRestriction_mm_tprod_swaps,Cslib.Tensor.isRestriction_mm_of_le,Cslib.Tensor.isRestriction_mm_pow_tpow: role exchanges, products, padding and powers of matrix multiplication.Cslib.Tensor.Rank.tprod,Cslib.Tensor.Rank.dsum,Cslib.Tensor.rank_mm: rank bounds.
References #
Structural operations #
The shared-left sum of a family of tensors with a common left leg: block diagonal on the right input and output legs, the same left input for every summand.
Exchanging the right input and output legs of a shared-left sum exchanges them in every summand.
Bilinear maps and restrictions #
The bilinear map of a tensor on coefficient lists.
Restriction of S along the encoders α, β and the decoder γ:
T x y z = ∑ α x' x * β y' y * γ z z' * S x' y' z'.
T is a restriction of S: a bilinear algorithm computes T from one evaluation of S.
The inclusion matrix of a map f : X → X': the column x is the unit vector at f x.
The inclusion of the identity is the identity matrix.
Restriction computes the bilinear map of T from the bilinear map of S: encode the inputs
by α and β, evaluate S, decode by γ.
Restriction is linear in the source tensor.
Restriction is linear in the source tensor.
Restriction by identity matrices is the identity.
Composition of restrictions: the matrices multiply.
A tensor is a restriction of itself.
Restrictions compose.
Leg exchanges and reindexing of restrictions #
Exchanging the inputs of a restriction exchanges the encoders.
Exchanging the right input and the output of a restriction transposes the right encoder and the decoder and exchanges them (the transposition principle).
Exchanging the left input and the output of a restriction transposes the left encoder and the decoder and exchanges them.
Restriction along inclusion matrices is precomposition with the maps.
A reindexed tensor is a restriction of the original, by permutation matrices.
A tensor is a restriction of its reindexing.
Restriction transfers along reindexings of the source.
Reindexing a restriction reindexes the target-side indices of its matrices.
Restriction transfers along reindexings of the target.
Tensor products of restrictions #
Restriction is compatible with tensor products: the matrices multiply as Kronecker products.
The Kronecker product of a family of matrices, on function index types.
Restriction is compatible with finite tensor products.
The tensor product of two finite tensor products is a finite tensor product over the sum of the index types.
A finite tensor product reindexed along a bijection of the index set.
Direct sums and shared-left sums of restrictions #
The block diagonal matrix of a family of matrices.
Restriction is compatible with direct sums, by block diagonal matrices.
Restriction is compatible with shared-left sums: the left encoder is common, the right encoders and decoders are block diagonal.
Deleting and reordering summands of a direct sum is a restriction, along an injection of the index sets.
Deleting and reordering summands of a shared-left sum is a restriction with the identity on the left leg.
The tensor product of two shared-left sums is a shared-left sum over pairs of summands.
A tensor power of a shared-left sum is the shared-left sum, over words, of the finite tensor products of the summands along the word.
Rearranging tensor products and direct sums #
The isomorphisms of Pass, Lemma 2.10, as equalities up to reindexing.
The tensor product is associative up to reindexing.
Reindexing the second factor of a tensor product.
Regrouping three tensor products of pairs into a tensor product of two triples.
The leg exchanges distribute over direct sums.
The tensor product of two direct sums is a direct sum over pairs of summands.
A tensor product with a direct sum on the left is a direct sum of tensor products.
A direct sum of direct sums is a direct sum over pairs.
A summand of a direct sum of copies of T is a restriction of the sum.
Fewer copies of T are a restriction of more copies.
Rank #
The tensor product of two unit tensors is a unit tensor.
Matrix multiplication #
The trivial algorithm: p q r scalar multiplications.
Matrix multiplication tensors multiply as block matrix multiplication.
Exchanging the inputs of matrix multiplication exchanges the outer dimensions (Pass, §2.1, role exchanges).
Exchanging the left input and the output of matrix multiplication exchanges the inner dimension with the right one.
Matrix multiplication tensors with equal dimensions restrict to each other.
Zero padding of matrices: mm n n n is a restriction of mm n' n' n' for n ≤ n'.
Tensor powers of matrix multiplication are matrix multiplication of the power.
The shared-left sum of n copies of T is T tensored with mm 1 1 n.