I believe
is the main idea. (row/down vector) contracts many values down to one while (column/up vector) expands one value back up to many, linearly.
Yeah, bra/ket but not quite. I was trying to match your notation where is the expander and is the contractor. I think I mixed up the bracket directions, and it makes more sense as
that way we can think of it as one big contraction
or expansion
I believe bra/ket is for row and column vectors. I don't think it applies here, because in the general case (semiadditive categories), you have arbitrary linear maps as the entries. And in the case, they're reals, not row or column vectors.
It is true that you can decompose as either or . To be clear I'm using and [] from category theory product/coproduct notation, it's not meant to match linear algebra or bra/ket notation.
Why are linear functions between finite-dimensional vector spaces representable by matrices? And why does matrix multiplication compose the corresponding linear maps? There's geometric intuition for this, e.g. presented by 3Blue1Brown. I will alternatively present a category-theoretic analysis. The short version is that, in the category of vector spaces and linear maps, products are also coproducts (hence biproducts); and in categories with biproducts, maps between biproducts decompose as (generalized) matrices. These generalized matrices align with traditional numeric matrices and matrix multiplication in the category of vector spaces. The category-theoretic lens reveals matrices as an elegant abstraction, contra The New Yorker.
I'll use a standard notion of a vector space over the field . A vector space has addition, zero, and scalar multiplication defined, which have the standard commutativity/associativity/distributivity properties. The category has as objects vector spaces (over the field ), and as morphisms linear maps. A linear map between vector spaces U, V satisfies and . (Advanced readers may see nlab on Vect.)
Clearly, is a vector space, as is 0 (the vector space with only one element, which is zero). 0 is both an initial and a terminal object. Any linear map from 0 must always return the zero vector; and so must any linear map into 0. Therefore, by definition 0 is a category-theoretic zero object.
If U and V are vector spaces, then the direct sum , which has as elements pairs (u, v) with , and for which addition and scalar multiplication are element-wise, is also a vector space. The direct sum is both a product and a coproduct.
To show that the direct sum is a product, let U and V be vector spaces, and let and be the projections of the direct sum onto its elements. Let us suppose a third vector space T and linear maps and . Let be defined as . Now uniquely commutes:
To show that the direct sum is a coproduct, let U and V be vector spaces, and let be defined as , and similarly let be defined as . Let us suppose a third vector space W and linear maps and . Let be defined as . Now uniquely commutes:
The upshot is that the direct sum is both a product and a coproduct; hence, by definition it is a biproduct. We can now abstract from the category to semiadditive categories, which are by definition categories with a zero object and all pairwise biproducts. Let C stand for any semiadditive category, with biproduct .
Biproducts enable powerful decomposition of morphisms (such as linear maps). Given (in C), we may uniquely decompose it as for some and , specifically . And similarly, we may uniquely decompose as for some and , specifically .
Biproducts generalize from binary to n-ary. Suppose n is natural and is an object for natural . Now the n-ary biproduct is . We take the empty biproduct to be 0. We can also generalize the projections , the injections , the "row-wise" combination , and the "column-wise" combination , from binary to n-ary.
This generalization to n-ary biproducts enables conceiving of matrices categorically. Let m, n be natural, and let and be objects in C, for natural and . Suppose . We first decompose h "row-wise", as where . Then we decompose each row "column-wise", as where . We can now write h in matrix style, as ; the notation can be visualized as vertical matrix concatenation, and can be visualized as horizontal matrix concatenation.
This is the core abstract idea, but how to apply it more concretely? Back in , we can form the Euclidean space . Now a map decomposes as a matrix of linear maps . This is not quite a traditional matrix, but note that linear maps of type are always multiplication by a constant real slope. Representing each by its slope yields a more traditional numeric matrix.
We can generalize matrix representation of linear maps to finite-dimensional vector spaces (which by definition have finite bases), by noting that each of these is isomorphic to for some natural n. Specifically, if a space U has a basis , then the linear map defined as is an isomorphism. Hence, matrix representation extends to maps between finite-dimensional vector spaces.
So far, we have a treatment of matrix-vector multiplication, but not matrix-matrix multiplication. We would like to show that composition of linear maps leads to the matrix representations multiplying in the expected way. Let be natural, and let be objects in C (for naturals ). Suppose we have maps and . We can write f in matrix form (), and similarly g ().
Now we wish to find the matrix form of the composition . We fix i, k and consider the entry . Now note and . Therefore
This expression is a row-column matrix multiplication, similar to a vector dot product. In the case of , we can more explicitly write:
Since in , the set of linear maps from U to V, naturally forms a vector space, can also be written:
In the case where each is , this aligns with traditional matrix multiplication; composing linear maps of type multiplies their slopes.
There is a way to generalize the row-column matrix multiplication to semiadditive categories in general; for details, see Wikipedia on additive categories.
To summarize general lessons about semiadditive categories:
And in the case of , these imply the standard results:
This is a nice way of showing the standard results, and the abstract results generalize to other semiadditive categories, such as the category of Abelian groups. For more detailed category-theoretic study of linear algebra, see Filip Bár's thesis, "On the Foundations of Geometric Algebra". For an even more abstract treatment, see "Graphical Linear Algebra".