5 ms·
I always enjoy a good Julia Evans article, and this one is no different. She has a very approachable, personable way of explaining technical things, which is mi
by yakshaving_jgt 8y ago
I always enjoy a good Julia Evans article, and this one is no different. She has a very approachable, personable way of explaining technical things, which is missing from many monoid (and related) tutorials.
I'm confused by this opening line though:
> Monoidal categories are also called “tensor categories” and I think that term is a little less confusing
Why is that? What is special about the word "monoid" that makes it more or less confusing than "tensor"?
- LudwigNagasena 8y ago>If you have been around functional programming for a bit, you might see the word “monoid” and “categories” and wonder “oh, is julia writing about monads, like in Haskell”? I am not!!
- yakshaving_jgt 8y ago…I don't think that answers the question. Monoids don't come from Haskell. You'll see monoids discussed in Haskell plenty, sure, but the math precedes the programming language by at least a few decades.
- maccam912 8y agoProbably true, but I know some upper level math through programming, and I associate "monoid" with Haskell and an abstract concept, but "tensor" with tensorflow and a more concrete idea.
- fraffo 8y agoBc you obtain them as the result of tensor product between the cathegory algebra and the monoidal algebra, i think
- phlakaton 8y agoTo the contrary, when I think "monoid" I think good old nonnegative integers and addition, or positive integers and multiplication, or any of a half-dozen really easy-to-understand examples. Tensors... what the heck are those? Like matrices, but _more_ complicated, you say? Thanks, but I'll stick with my basic monoids over here. :-) The confusion between monoids and monads is perhaps unfortunate (even if the similarity is quite intentional, because technically monads are a particular kind of monoid), but easily sorted out and not much worse than having to distinguish between the nuts in your pantry and the Nutella.
- throwawaymath 8y ago> Tensors... what the heck are those? Like matrices, but _more_ complicated, you say? Thanks, but I'll stick with my basic monoids over here. :-) A tensor isn't actually a multidimensional array, just as a linear map isn't actually a matrix. Defining tensors as the multidimensional abstraction of scalars, vectors and matrices to n indices is anti-pedagogical, though regrettably common because it's computationally useful. Learning tensors this way is like learning linear algebra primarily by doing matrix multiplication. It hollows out all of what's actually going on by focusing on notation and symbol pushing. What you're comparing here is the heavily symbol-laden, notation-encumbered definition of a tensor with the elegant abstraction of a momoid. If you'd like to compare them on the merits of their abstraction, an alternative definition of "tensor" would be better. The object is not its representation. For example: a tensor is a multilinear map between a product of vector spaces and another vector space. So T: V_{1} x V_{2} x ... x V_{n} --> W is a tensor. Furthermore, every tensor T is itself an element of a tensor product. An example of a tensor product is R^{nk}, which is the nk-dimensional real space you obtain by taking the tensor direct product of the n- and k- dimensional real spaces, R^{n} ⊗ R^{k}. In this way the tensor product is an abstraction of the familiar Cartesian product in which the dimension of two spaces is multiplied instead of the cardinality of two sets. This definition makes it easier to understand why the objects of a monoidal category can be considered tensors. A monoidal category is a category C where the functor ⊗ is defined such that C x C --> C. Note the similarity of this definition with my alternative definition of a tensor - no multidimensional arrays are required! You're just moving up one level of generality from linear maps and Cartesian products. Technically speaking, the monoidal category functor is actually an abstraction the tensor product, the way the tensor product is an abstraction of the Cartesian product. Whereas many monoidal categories admit a Cartesian product, some monoidal categories (like the category of vector spaces) admit a tensor product. Edit - Sorry for the bracket notation used in subscripts and superscripte, I was thinking in LaTeX...
- ginnungagap 8y agoYou can think of a tensor as "an element of a tensor product" (just like a vector is "an element of a vector space") and look at the definition of a tensor product via its universal property, it basically turns bilinear maps into linear maps. This universal property is elegant and immediately gives the Hom-tensor adjunction, but to show that tensor products satisfying it actually exist you'll need an explicit construction, which can be done by quotienting a free module. This explicit construction might look unintuitive at first, but you're really quotienting by the minimal relations required for the "bilinearity" property of tensors to work out
- mbid 8y agoJust to add to the confusion: Monoidal categories are the appropriate notion of "monoid object" in the category of categories; unit and associativity law are replaced by coherent natural isomorphisms (see "categorification"). So that's where the "monoidal" comes from.
- throwawaymath 8y agoI don't actually agree with the author that it's less confusing, but I'll abbreviate my other comment to answer your direct question. A tensor is a multilinear map from a product of n vector spaces to another vector space. Every tensor is an element of a tensor product, which is (loosely speaking) a vector space you obtain by multiplying the dimension of two other vector spaces. So for example, the real space R^nk is the tensor product obtained from combining R^n and R^k. To be more explicit, what you're doing is obtaining a new n by k matrix for every pair of vectors of R^n and R^k. In other words, take the Cartesian product of R^n and R^k. Then take every possible pair of vectors of the Cartesian product and combine them to form an n by k matrix. Now you have a tensor product, and each individual element of your tensor product is a tensor. Going back to the abstract: a monoidal category is a category C of objects equipped with a functor defined ⊗: * C x C -> C*. If you take the category of vector spaces or the category of modules (like vector spaces, but defined over rings instead of fields) and define your monoidal functor to be the tensor product, you turn them into tensor categories. Monoidal categories actually sit at a higher level of abstraction than tensor products, so I don't agree this makes monoidal categories less confusing. In fact it diminishes the abstraction of monoidal categories by forcing you to think of the monoidal operation as the tensor product instead of something which is more general. On the other hand if you're familiar with (and prefer) the computationally-oriented definition of tensors as multidimensional arrays, this framing of monoidal categories might ground them somewhat so they're more accessible.
- dbranes 8y agoIt looks like she wants to talk about symmetric monoidal categories, not just monoidal categories, for that’s where the calculus of string diagrams is actually useful. Tensor categories is another word for symmetric monoidal categories, indeed it’s less of a mouthful, and perhaps more “intuitive” - it’s conventional to write the symmetric monoidal structure as a tensor product.