It looks like you're new here. If you want to get involved, click one of these buttons!

- All Categories 2.2K
- Programming with Categories Course 26
- Exercises - Programming with Categories Course 16
- Mini-Talks - Programming with Categories Course 3
- Applied Category Theory Course 341
- Applied Category Theory Seminar 4
- Exercises - Applied Category Theory Course 149
- Discussion Groups 50
- How to Use MathJax 15
- Chat 487
- Azimuth Code Project 108
- News and Information 147
- Azimuth Blog 149
- Azimuth Forum 29
- Azimuth Project 189
- - Strategy 108
- - Conventions and Policies 21
- - Questions 43
- Azimuth Wiki 711
- - Latest Changes 701
- - - Action 14
- - - Biodiversity 8
- - - Books 2
- - - Carbon 9
- - - Computational methods 38
- - - Climate 53
- - - Earth science 23
- - - Ecology 43
- - - Energy 29
- - - Experiments 30
- - - Geoengineering 0
- - - Mathematical methods 69
- - - Meta 9
- - - Methodology 16
- - - Natural resources 7
- - - Oceans 4
- - - Organizations 34
- - - People 6
- - - Publishing 4
- - - Reports 3
- - - Software 21
- - - Statistical methods 2
- - - Sustainability 4
- - - Things to do 2
- - - Visualisation 1
- General 42

Options

Last time we talked about string diagrams, which are a great way to draw morphisms in symmetric monoidal categories. But they're the most fun when we have the ability to take a diagram and bend its strings around, converting inputs to outputs or vice versa. And that's what 'compact closed' categories are for!

A **compact closed category** is a symmetric monoidal category \(\mathcal{C}\) where every object \(x\) has a **dual** \(x^\ast\) equipped with two morphisms called the **cap** or **unit**

$$ \cap_x \colon I \to x \otimes x^\ast $$
and the **cup** or **counit**

$$ \cup_x \colon x^\ast \otimes x \to I $$
obeying two equations called the **snake equations**.

You've seen these equations a couple times before! In Lecture 68 I was telling you about feedback in co-design diagrams: caps and cups let you describe feedback. I was secretly telling you that the category of feasibility relations was a compact closed category. In Lecture 71 I came back to this theme at a higher level of generality. Feasibility relations are just \(\mathcal{V}\)-enriched profunctors for \(\mathcal{V} = \mathbf{Bool}\), and in Lecture 71 I was secretly telling you that the category of \(\mathcal{V}\)-profunctors is always a compact closed category! But now I'm finally telling you what a compact closed category is in general.

The snake equations are easiest to remember using string diagrams. In a compact closed category we draw arrows on string in these diagrams as well as labeling them by objects. For any object \(x\) a left-pointing wire labelled \(x\) means the same as a right-pointing wire labelled \(x^\ast\). Thus, we draw the cap as

This picture has no wires coming in at left, which says that the cap is a morphism from \(I\), the unit object of our symmetric monoidal category. It has two wires doing out at right: the top wire with a right-pointing arrow, stands for \(x\), while the bottom wire with a right-pointing arrow stands for \(x^\ast\), and together these tell us that cap is a morphism to \(x \otimes x^\ast\).

Similarly, we draw the cup as

and this diagram, to the trained eye, says that the cup is a morphism from \(x^\ast \otimes x \) to \( I \).

In this language, the snake equations simply say that we can straighten out a 'zig-zag':

or a 'zag-zig':

If we don't use string diagrams, these equation look more complicated. The first says that this composite morphism is the identity:

where the unnamed isomorphisms are the inverse of the left unitor, the associator and the right unitor. The second says that this composite is the identity:

where the unnamed isomorphisms are the inverse of the right unitor, the inverse of the associator, and the left unitor. These are a lot less intuitive, I think! One advantage of string diagrams is that they hide associators and unitors, yet let us recover them if we really need them.

If you've faithfully done all the puzzles so far, you've proved the following grand result, which summarizes a lot of this chapter:

**Theorem.** Suppose \(\mathcal{V}\) is a commutative quantale. Then the category \(\mathbf{Prof}_{\mathcal{V}}\) with

- \(\mathcal{V}\)-enriched categories as objects

and

- \(\mathcal{V}\)-enriched profunctors as morphisms

is compact closed, where tensor product, associator and unitors are defined as in Lecture 70, and the dual, caps and cups are defined as in Lecture 71.

But the most famous example of a compact closed category comes from linear algebra! It's the category \(\mathbf{FinVect}_k\), with

- finite-dimensional vector spaces over the field \(k\) as objects

and

- linear maps as morphisms.

If you don't know about fields, you may still know about real vector spaces: that's the case \(k = \mathbb{R}\). There's a tensor product \(V \otimes W\) of vector spaces \(V\) and \(W\), which has dimension equal to the dimension of \(V\) times the dimension of \(W\). And there's a dual \(V^\ast\) of a vector space \(V\), which is just the space of all linear maps from \(V\) to \(k\).

Tensor products and dual vector spaces are very important in linear algebra. My main point here is that the profunctors work a lot like linear maps: both are morphisms in some compact closed category! Indeed, the introduction of profunctors into category theory was very much like the introduction of linear algebra in ordinary set-based mathematics. I've tried to hint at this several times: the ultimate reason is that composing profunctors is a lot like multiplying matrices! This is easiest to see for \(\mathcal{V}\)-enriched profunctors we've been dealing with. Composing these:

$$ (\Psi\Phi)(x,z) = \bigvee_{y \in \mathrm{Ob}(\mathcal{Y})} \Phi(x,y) \otimes \Psi(y,z)$$ looks just like matrix multiplication, with \(\bigvee\) replacing addition in the field \(k\) and \(\otimes\) replacing multiplication. So it's not surprising that this analogy extends, with the opposite of a \(\mathcal{V}\)-enriched category acting like a dual vector space.

If you're comfortable with tensor products and duals of vector spaces, you may want to solidify your understanding of compact closed categories by doing this puzzle:

**Puzzle 283.** Guess what the cap and cup

$$ \cap_V \colon k \to V \otimes V^\ast, \qquad \cup_V \colon V^\ast \otimes V \to k $$ are for a finite-dimensional vector space \(V\), and check your guess by proving the snake equations.

Here are some good things to know about compact closed categories:

**Puzzle 284.** Using the cap and cup, any morphism \(f \colon x \to y \) in a compact closed category gives rise to a morphism from \(y^\ast\) to \(x^\ast\). This amounts to 'turning \(f\) around' in a certain sense, and we call this morphism \(f^\ast \colon y^\ast \to x^\ast \). Write down a formula for \(f^\ast\) and also draw it as a string diagram.

**Puzzle 285.** Show that \( (fg)^\ast = g^\ast f^\ast \) for any composable morphisms \(f\) and \(g\), and show that \( (1_x)^\ast = 1_x \) for any object \(x\).

**Puzzle 286.** What is a slick way to state the result in Puzzle 285?

**Puzzle 287.** Show that if \(x\) is an object in a compact closed category, \( (x^\ast)^\ast\) is isomorphic to \(x\).

## Comments

So the field k itself is some kind of trivial vector space? I feel like there's a notational pun I'm missing.

`So the field k itself is some kind of trivial vector space? I feel like there's a notational pun I'm missing.`

From my weak understanding of quantum mechanics, I want to think of the cap as the creation of a particle and it's antiparticle, and the cup as the annihilation of a particle and antiparticle. Would the zig-zag and zag-zig equations be analogous to quantum teleportation?

Or maybe a banking analogy where the cap is the creation of a loan, with immediate equal amounts of debits and credits, the cup would then be paying off the loan, and I believe the zig-zag equation becomes something like opening one loan to pay off the current debt of another loan.

`From my weak understanding of quantum mechanics, I want to think of the cap as the creation of a particle and it's antiparticle, and the cup as the annihilation of a particle and antiparticle. Would the zig-zag and zag-zig equations be analogous to quantum teleportation? Or maybe a banking analogy where the cap is the creation of a loan, with immediate equal amounts of debits and credits, the cup would then be paying off the loan, and I believe the zig-zag equation becomes something like opening one loan to pay off the current debt of another loan.`

think there's a typo here:

should read "the dimension of \(\mathcal{V}\)

timesthe dimension of \(\mathcal{W}\)" surely?`think there's a typo here: > There's a [tensor product](https://en.wikipedia.org/wiki/Tensor_product#Tensor_product_of_vector_spaces) \\(V \otimes W\\) of vector spaces \\(V\\) and \\(W\\), which has dimension equal to the dimension of \\(\mathcal{V}\\) and the dimension of \\(\mathcal{W}\\). should read "the dimension of \\(\mathcal{V}\\) **times** the dimension of \\(\mathcal{W}\\)" surely?`

and the same font should be used: "the dimension of \(V\) times the dimension of \(W\)".

`and the same font should be used: "the dimension of \\(V\\) times the dimension of \\(W\\)".`

In the definition of tensor product in Wikipedia it is unclear what do they mean by \(e_i \otimes f_j\), where \(e_i\) and \(f_j\) are basis vectors. They define \(\otimes\) for vector spaces, while not specifying what this means for individual vectors in these spaces.

`In the definition of tensor product in Wikipedia it is unclear what do they mean by \\(e_i \otimes f_j\\), where \\(e_i\\) and \\(f_j\\) are basis vectors. They define \\(\otimes\\) for vector spaces, while not specifying what this means for individual vectors in these spaces.`

@Keith I agree with the banking analogy. My to-go example are the rational numbers under multiplication. This are the snake equations there: \( 3 = 1 * 3 = (3 * 1/3) * 3 = 3 * (1/3 * 3) = 3 * 1 = 3 \)

@All This is a beginner question: I am still confused by how exactly profunctors work. Consider

I know that the label \( \cap_x \otimes 1_x \) is the name of one particular morphism between \( 1 \otimes x \) and \( ( x \otimes x^\ast ) \otimes x \). But how do we actually get from \( 1 \otimes x \) to \( ( x \otimes x^\ast ) \otimes x \) ? Is it by calculating the expression \( ( 1 \otimes x ) \otimes ( \cap_x \otimes 1_x ) \)? (I know that "calculating the expression" is vague. But I don't know what we are doing exactly.)

Edit: I think I get it: So we have a morphism: \[ \cap_x \otimes 1_x \colon ( X \otimes X) \to ( X \otimes X \otimes X) \]

Then we apply it (if we think of the morphism as a function that takes one argument):

\[ \cap_x \otimes 1_x ( ( I \otimes x_1 ) ) = x_1 \otimes x_1^\ast \otimes x_1 \]

Observation: Here the notion of isomorphic vs. equal is important. It is true that \( 1 \otimes x \) is isomorphic to \( 1 \). But they are not equal! If this were a program and \( \cap_x \otimes 1_x \) a function, then that function would not accept \( 1 \) as an argument, but \( 1 \otimes x \). Even though they are isomorphic! For the same reason, \( 1 \otimes x \otimes 1 \) would not be accepted as an argument. We need exactly two objects of \( X \) that are glued together with the tensor operation.

Edit2:

Oh great!My observation cleared up some of my confusion I had about co-design diagrams and feasibility relations! I did not understand: What is the transformation that enables us to switch cables from one side to the other side? These are isomorphisms!`@Keith I agree with the banking analogy. My to-go example are the rational numbers under multiplication. This are the snake equations there: \\( 3 = 1 * 3 = (3 * 1/3) * 3 = 3 * (1/3 * 3) = 3 * 1 = 3 \\) ------ @All This is a beginner question: I am still confused by how exactly profunctors work. Consider ![](http://math.ucr.edu/home/baez/mathematical/7_sketches/snake_1.png) I know that the label \\( \cap_x \otimes 1_x \\) is the name of one particular morphism between \\( 1 \otimes x \\) and \\( ( x \otimes x^\ast ) \otimes x \\). But how do we actually get from \\( 1 \otimes x \\) to \\( ( x \otimes x^\ast ) \otimes x \\) ? Is it by calculating the expression \\( ( 1 \otimes x ) \otimes ( \cap_x \otimes 1_x ) \\)? (I know that "calculating the expression" is vague. But I don't know what we are doing exactly.) ---- Edit: I think I get it: So we have a morphism: \\[ \cap_x \otimes 1_x \colon ( X \otimes X) \to ( X \otimes X \otimes X) \\] Then we apply it (if we think of the morphism as a function that takes one argument): \\[ \cap_x \otimes 1_x ( ( I \otimes x_1 ) ) = x_1 \otimes x_1^\ast \otimes x_1 \\] Observation: Here the notion of isomorphic vs. equal is important. It is true that \\( 1 \otimes x \\) is isomorphic to \\( 1 \\). But they are not equal! If this were a program and \\( \cap_x \otimes 1_x \\) a function, then that function would not accept \\( 1 \\) as an argument, but \\( 1 \otimes x \\). Even though they are isomorphic! For the same reason, \\( 1 \otimes x \otimes 1 \\) would not be accepted as an argument. We need exactly two objects of \\( X \\) that are glued together with the tensor operation. ------ Edit2: **Oh great!** My observation cleared up some of my confusion I had about co-design diagrams and feasibility relations! I did not understand: What is the transformation that enables us to switch cables from one side to the other side? These are isomorphisms!`

Another question I feel a bit ashamed to ask, but better late than never: Is it correct that

could be drawn as

Then we have a \( X \times X^\ast \) -wire leaving from the right and a \( 1 \)-wire coming in from the left. We usually do not draw the \( 1 \)-wire, because (a) when it is the only wire coming in, it is uninteresting and when (b) there are other wires coming in, the resulting product is isomorphic to the product without the wire. (I.e. assume a \( 1 \)-wire, a \( Y \)-wire and a \( Z \)-wire are leading into the box. The resulting product is \( 1 \times Y \times Z \) (in any order). This is isomorphic to \( Y \times Z \)).

`Another question I feel a bit ashamed to ask, but better late than never: Is it correct that <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/cap_lowercase.png"></center> could be drawn as <center> ![Imgur](https://i.imgur.com/ZugI2bol.png)</center> ----- Then we have a \\( X \times X^\ast \\) -wire leaving from the right and a \\( 1 \\)-wire coming in from the left. We usually do not draw the \\( 1 \\)-wire, because (a) when it is the only wire coming in, it is uninteresting and when (b) there are other wires coming in, the resulting product is isomorphic to the product without the wire. (I.e. assume a \\( 1 \\)-wire, a \\( Y \\)-wire and a \\( Z \\)-wire are leading into the box. The resulting product is \\( 1 \times Y \times Z \\) (in any order). This is isomorphic to \\( Y \times Z \\)).`

Yes.

`Yes.`

I feel like the course has just come full-circle, like a good Seinfeld episode.

I was originally interested in this course because I had come to suspect that I needed more insight into tensor products (as they had become 'the thing that kept popping up' for me), and Prof. Baez suggested that symmetric monoidal categories and the like would provide an even more sophisticated way to think about tensor products.

And now we've landed squarely back at vector spaces, but with a vast 'back-story.' I don't know that the course will have much more to say about braided monoidal categories (as the word 'braid' seems to only appear in Spivak's book in the references), but I feel like that's where I should head next, when I'm ready.

`I feel like the course has just come full-circle, like a good Seinfeld episode. I was originally interested in this course because I had come to suspect that I needed more insight into tensor products (as they had become 'the thing that kept popping up' for me), and Prof. Baez suggested that symmetric monoidal categories and the like would provide an even more sophisticated way to think about tensor products. And now we've landed squarely back at vector spaces, but with a vast 'back-story.' I don't know that the course will have much more to say about braided monoidal categories (as the word 'braid' seems to only appear in Spivak's book in the references), but I feel like that's where I should head next, when I'm ready.`

I'm pretty sure this is the first time I've ever tried to answer another person's questions about anything tensor-related, so I apologize if I get something (or everything) totally wrong.

@Igor I imagine the wikipedia article is saying that \(e_i\) and \(f_j\) are basis vectors to two vectors spaces \(E\) and \(F\), which you then want to tensor together to get \(E \otimes F\). It sounds like you're then asking how to find the basis vectors of \(E \otimes F\).

Suppose both \(E\) and \(F\) are two-dimensional; I'll call their basis vectors \(e_1, e_2, f_1, f_2\).

To write down all the \(e_i \otimes f_j\), you just combine every way you can (that fits the pattern):

\(e_1 \otimes f_1\)

\(e_1 \otimes f_2\)

\(e_2 \otimes f_1\)

\(e_2 \otimes f_2\)

Those are your four basis vectors of \(E \otimes F\). (Recall that we expected 4, because the dimension of \(E \otimes F\), which is itself a vector space, is dim(E) * dim(F) = 2*2 = 4.)

`I'm pretty sure this is the first time I've ever tried to answer another person's questions about anything tensor-related, so I apologize if I get something (or everything) totally wrong. @Igor I imagine the wikipedia article is saying that \\(e_i\\) and \\(f_j\\) are basis vectors to two vectors spaces \\(E\\) and \\(F\\), which you then want to tensor together to get \\(E \otimes F\\). It sounds like you're then asking how to find the basis vectors of \\(E \otimes F\\). Suppose both \\(E\\) and \\(F\\) are two-dimensional; I'll call their basis vectors \\(e_1, e_2, f_1, f_2\\). To write down all the \\(e_i \otimes f_j\\), you just combine every way you can (that fits the pattern): \\(e_1 \otimes f_1\\) \\(e_1 \otimes f_2\\) \\(e_2 \otimes f_1\\) \\(e_2 \otimes f_2\\) Those are your four basis vectors of \\(E \otimes F\\). (Recall that we expected 4, because the dimension of \\(E \otimes F\\), which is itself a vector space, is dim(E) * dim(F) = 2*2 = 4.)`

\(\cap_V \colon k \to V \otimes V^\ast \) is the function that takes the inverse of a matrix of a vector space which sends it into its dual space. \(\cup_V \colon V^\ast \otimes V \to k\) is the function that takes the inverse of a dual matrix which sends it back into the vector space.

The snake equations are composing the two inverse functions and therefore, come back full circle back to what you start with.

More precisely, Let \(\mathbf{V}\) be a matrix in a vector space and \(\mathbf{V^\ast}\) be matrix in its dual space. Then: $$\mathbf{V^\ast} \cdot \mathbf{V} = \mathbf{I} = \mathbf{V} \cdot \mathbf{V^\ast}$$ $$\mathbf{V^\ast} = \mathbf{V}^{-1}$$ The snake equations would yield: $$\mathbf{V} = \mathbf{I} \cdot \mathbf{V} = (\mathbf{V}\cdot \mathbf{V^\ast}) \cdot \mathbf{V} = \mathbf{V}\cdot (\mathbf{V^\ast} \cdot \mathbf{V}) = \mathbf{V} \cdot \mathbf{I} = \mathbf{V} $$ $$\mathbf{V^\ast} = \mathbf{V^\ast} \cdot \mathbf{I} = \mathbf{V^\ast}\cdot (\mathbf{V} \cdot \mathbf{V^\ast}) = (\mathbf{V^\ast}\cdot \mathbf{V}) \cdot \mathbf{V^\ast} = \mathbf{I} \cdot \mathbf{V^\ast} = \mathbf{V^\ast} $$ An alternative way to show this is: $$(\mathbf{V}^{-1})^{-1} = \mathbf{V}$$ $$(\mathbf{V^\ast}^{-1})^{-1} = \mathbf{V^\ast}$$

`>**Puzzle 283** >Guess what the cap and cup >$$ \cap_V \colon k \to V \otimes V^\ast, \qquad \cup_V \colon V^\ast \otimes V \to k $$ >are for a finite-dimensional vector space \\(V\\), and check your guess by proving the snake equations. \\(\cap_V \colon k \to V \otimes V^\ast \\) is the function that takes the inverse of a matrix of a vector space which sends it into its dual space. \\(\cup_V \colon V^\ast \otimes V \to k\\) is the function that takes the inverse of a dual matrix which sends it back into the vector space. The snake equations are composing the two inverse functions and therefore, come back full circle back to what you start with. More precisely, Let \\(\mathbf{V}\\) be a matrix in a vector space and \\(\mathbf{V^\ast}\\) be matrix in its dual space. Then: \[\mathbf{V^\ast} \cdot \mathbf{V} = \mathbf{I} = \mathbf{V} \cdot \mathbf{V^\ast}\] \[\mathbf{V^\ast} = \mathbf{V}^{-1}\] The snake equations would yield: \[\mathbf{V} = \mathbf{I} \cdot \mathbf{V} = (\mathbf{V}\cdot \mathbf{V^\ast}) \cdot \mathbf{V} = \mathbf{V}\cdot (\mathbf{V^\ast} \cdot \mathbf{V}) = \mathbf{V} \cdot \mathbf{I} = \mathbf{V} \] \[\mathbf{V^\ast} = \mathbf{V^\ast} \cdot \mathbf{I} = \mathbf{V^\ast}\cdot (\mathbf{V} \cdot \mathbf{V^\ast}) = (\mathbf{V^\ast}\cdot \mathbf{V}) \cdot \mathbf{V^\ast} = \mathbf{I} \cdot \mathbf{V^\ast} = \mathbf{V^\ast} \] An alternative way to show this is: \[(\mathbf{V}^{-1})^{-1} = \mathbf{V}\] \[(\mathbf{V^\ast}^{-1})^{-1} = \mathbf{V^\ast}\]`

Thanks @Steve, but I understand the part about forming all possible combinations of basis vectors. What is \(\otimes\) for example in \(e_1 \otimes f_1\)? If the answer is "tensor product", then all these sounds a bit circular - we define tensor product of vector spaces in terms of tensor products of basis vectors, while never specifying what \(\otimes\) actually does.

Or, if we take for example \(v_1 = a\cdot e_1 + b\cdot e_2 = (a, b)\) and \(v_2 = a'\cdot f_1 + b'\cdot f_2 = (a', b')\), then doing a tensor product we get a new vector \(v_3 = v_1 \otimes v_2 = (a'a, a'b, b'a, b'b)\) in a new 4-dimensional vector space?

There are quite a lot of linear maps, candidates for \(\cup\), which send such a vector \(v_3\) to the underlying field \(k\), for example \(v_4 = (1, 0, 0, 1)^T\) will send the tensor product above to the inner product of \(v_1\) and \(v_2\).

EDITOr, as another example, using \(v_4 = (0, 1, -1, 0)^T\) one may obtain the value of determinant (or, in general, exterior product). This tensor product has the universal property of being the freest bilinear operation, so all other things may be factored through it.`Thanks @Steve, but I understand the part about forming all possible combinations of basis vectors. What is \\(\otimes\\) for example in \\(e_1 \otimes f_1\\)? If the answer is "tensor product", then all these sounds a bit circular - we define tensor product of vector spaces in terms of tensor products of basis vectors, while never specifying what \\(\otimes\\) actually does. Or, if we take for example \\(v_1 = a\cdot e_1 + b\cdot e_2 = (a, b)\\) and \\(v_2 = a'\cdot f_1 + b'\cdot f_2 = (a', b')\\), then doing a tensor product we get a new vector \\(v_3 = v_1 \otimes v_2 = (a'a, a'b, b'a, b'b)\\) in a new 4-dimensional vector space? There are quite a lot of linear maps, candidates for \\(\cup\\), which send such a vector \\(v_3\\) to the underlying field \\(k\\), for example \\(v_4 = (1, 0, 0, 1)^T\\) will send the tensor product above to the inner product of \\(v_1\\) and \\(v_2\\). **EDIT** Or, as another example, using \\(v_4 = (0, 1, -1, 0)^T\\) one may obtain the value of determinant (or, in general, exterior product). This tensor product has the universal property of being the freest bilinear operation, so all other things may be factored through it.`

@Igor It sounds like you probably know at least as much about them as I do; I haven't worked with them directly enough to have any useful insights into how someone more experienced might see them.

I don't know if any of this will be any help, but there are a few impressions about tensors that I've picked up (which are a far cry from the perspective of "tensors are magic, and nearly inexplicable" that I had before then; I attribute much of my change of perspective to Loring Tu's Introduction to Manifolds, where he talked about tensors like they're no big deal):

Tensors seem to be more about bookkeeping than anything else. It's a process that seems to be only one notch more sophisticated than putting numbers into an ordered pair. (On that note, I don't recall the exact relationship between the cartesian product of two vector spaces and the tensor product of those same two vector spaces; was it simply that the cartesian product is isomorphic to a subset of the tensor product, I think?)

But the strength of the tensor notation seems to stem from the fact that we're keeping factors separate. If you can keep pieces of data separate all the way through a problem, then you never have to deal with the ambiguity that's introduced when there are numerous pairs of elements that, if you were to simply multiply them, would have the same result. But let's say my problem uses the tensor \(4 \otimes 5\). If I multiply them, I have to start referring to my quantity as "two factors that multiplied to yield 20," and I may have to rediscover those factors again later. Worse, I may not have a way to distinguish my original tensor from \(5 \otimes 4\), \(10 \otimes 2\) and so on. But in the tensor notation, I never introduce that ambiguity.

About the dimension of the tensor product as a vector space....I'm no longer the kind of person who gives much though to the geometry of things beyond three dimensions. (Projections back into three or fewer dimensions, sure.) To me, that fact that the tensor product of two 3-dimensional vector spaces just means that it takes nine pieces of data to uniquely specify an element of that tensor product. The programmer in me just shrugs and declares nine variables with little regard to their geometry. And once the problem is nearly done, the universal property of tensor products says that there will be a unique way to map each tensor into the codomain of the problem.

btw, I don't have any experience actually doing that last part yet...it's just my understanding of how tensors are 'meant' to work. I hope to get a chance to put them to the test, sooner or later.

`@Igor It sounds like you probably know at least as much about them as I do; I haven't worked with them directly enough to have any useful insights into how someone more experienced might see them. I don't know if any of this will be any help, but there are a few impressions about tensors that I've picked up (which are a far cry from the perspective of "tensors are magic, and nearly inexplicable" that I had before then; I attribute much of my change of perspective to Loring Tu's Introduction to Manifolds, where he talked about tensors like they're no big deal): Tensors seem to be more about bookkeeping than anything else. It's a process that seems to be only one notch more sophisticated than putting numbers into an ordered pair. (On that note, I don't recall the exact relationship between the cartesian product of two vector spaces and the tensor product of those same two vector spaces; was it simply that the cartesian product is isomorphic to a subset of the tensor product, I think?) But the strength of the tensor notation seems to stem from the fact that we're keeping factors separate. If you can keep pieces of data separate all the way through a problem, then you never have to deal with the ambiguity that's introduced when there are numerous pairs of elements that, if you were to simply multiply them, would have the same result. But let's say my problem uses the tensor \\(4 \otimes 5\\). If I multiply them, I have to start referring to my quantity as "two factors that multiplied to yield 20," and I may have to rediscover those factors again later. Worse, I may not have a way to distinguish my original tensor from \\(5 \otimes 4\\), \\(10 \otimes 2\\) and so on. But in the tensor notation, I never introduce that ambiguity. About the dimension of the tensor product as a vector space....I'm no longer the kind of person who gives much though to the geometry of things beyond three dimensions. (Projections back into three or fewer dimensions, sure.) To me, that fact that the tensor product of two 3-dimensional vector spaces just means that it takes nine pieces of data to uniquely specify an element of that tensor product. The programmer in me just shrugs and declares nine variables with little regard to their geometry. And once the problem is nearly done, the universal property of tensor products says that there will be a unique way to map each tensor into the codomain of the problem. btw, I don't have any experience actually doing that last part yet...it's just my understanding of how tensors are 'meant' to work. I hope to get a chance to put them to the test, sooner or later.`

I've never been in a Linear algebra, how does one calculate the dual of a vector space? And what is it used for?

`I've never been in a Linear algebra, how does one calculate the dual of a vector space? And what is it used for?`

The dual of a vector space is space of linear functions from the vector space to the underlying field. For vector spaces of finite dimension they are isomorphic, with the dot product (curried) as the transformation from one to the other.

$$ v \in V \mapsto (_ \cdot v) \in V* $$ I don't remember what happens for infinite dimensional spaces.

`The dual of a vector space is space of linear functions from the vector space to the underlying field. For vector spaces of finite dimension they are isomorphic, with the dot product (curried) as the transformation from one to the other. \[ v \in V \mapsto (\_ \cdot v) \in V* \] I don't remember what happens for infinite dimensional spaces.`

So it's a kind of overcategory of a vector space?

`So it's a kind of overcategory of a vector space?`

@Steve, agree, we don't lose any information while doing tensor product and always can recover the original vector spaces using projections.

If I rewrite the previous example using the dual basis \(e^j\), such that \(e^j(e_i) = e_i(e^j) = 1\ iff\ i = j,\ otherwise\ 0\), I get a tensor product of \(v= a \cdot e_1 + b \cdot e_2\) and \(v^* = a' \cdot e^1 + b' \cdot e^2\) to look as \(v^* \otimes v = aa' \cdot (e^1 \otimes e_1) + a'b \cdot (e^1 \otimes e_2) + ba' \cdot (e^2 \otimes e_1) + b'b \cdot (e^2 \otimes e_2)\).

A cup \(\cup: v^* \otimes v \to k\) then just a dual map to this space.

EDITfollowing John's comment 42, what goes below doesn't make any sense, because we should treat \(e^i \otimes e_j\) as a single abstract symbol.If we assume that it has basis vectors of the form \((e^j \otimes e_i)^* = e_i \otimes e^j\), then, (using interchange law), it seems that \((e^j \otimes e_i) \circ (e_i \otimes e^j) = (e^j \circ e_i) \otimes (e_i \circ e^j) = (e^j(e_i)) \otimes (e_i(e^j))\). For example

\((e^1 \otimes e_1) \circ (e_1 \otimes e^1) = (e^1 \circ e_1) \otimes (e_1 \circ e^1) = 1 \otimes 1 \to 1 \)

\((e^1 \otimes e_2) \circ (e_2 \otimes e^1) = (e^1 \circ e_2) \otimes (e_2 \circ e^1) = 0 \otimes 0 \to 0 \)

using the definition of the dual basis.

`@Steve, agree, we don't lose any information while doing tensor product and always can recover the original vector spaces using projections. If I rewrite the previous example using the dual basis \\(e^j\\), such that \\(e^j(e_i) = e_i(e^j) = 1\ iff\ i = j,\ otherwise\ 0\\), I get a tensor product of \\(v= a \cdot e_1 + b \cdot e_2\\) and \\(v^* = a' \cdot e^1 + b' \cdot e^2\\) to look as \\(v^* \otimes v = aa' \cdot (e^1 \otimes e_1) + a'b \cdot (e^1 \otimes e_2) + ba' \cdot (e^2 \otimes e_1) + b'b \cdot (e^2 \otimes e_2)\\). A cup \\(\cup: v^* \otimes v \to k\\) then just a dual map to this space. **EDIT** following John's [comment 42](https://forum.azimuthproject.org/discussion/comment/20851/#Comment_20851), what goes below doesn't make any sense, because we should treat \\(e^i \otimes e_j\\) as a single abstract symbol. If we assume that it has basis vectors of the form \\((e^j \otimes e_i)^* = e_i \otimes e^j\\), then, (using interchange law), it seems that \\((e^j \otimes e_i) \circ (e_i \otimes e^j) = (e^j \circ e_i) \otimes (e_i \circ e^j) = (e^j(e_i)) \otimes (e_i(e^j))\\). For example \\((e^1 \otimes e_1) \circ (e_1 \otimes e^1) = (e^1 \circ e_1) \otimes (e_1 \circ e^1) = 1 \otimes 1 \to 1 \\) \\((e^1 \otimes e_2) \circ (e_2 \otimes e^1) = (e^1 \circ e_2) \otimes (e_2 \circ e^1) = 0 \otimes 0 \to 0 \\) using the definition of the dual basis.`

Ken wrote:

Yes, every finite-dimensional vector space over a field \(k\) is isomorphic to \(k^n\), the set of \(n\)-tuples of elements of \(k\), with the vector space operations defined as follows:

Addition: \( (x_1, \dots, x_n) + (y_1 , \dots y_n) = (x_1 + y_1 , \dots x_n + y_n) \).

Scalar multiplication: \( a(x_1, \dots, x_n) = (ax_1, \dots, ay_n) \).

When \(n = 1\) we get \(k^1\), which is just \(k\). A 1-tuple of elements of \(k\) is just an element of \(k\).

You may have seen this stuff when \(k = \mathbb{R}\), the field of real numbers. They say the real line is a 1-dimensional real vector space.

(I wouldn't say the case \(n = 1\) is trivial: the

reallytrivial case is \(n = 0\).)`Ken wrote: > So the field k itself is some kind of trivial vector space? I feel like there's a notational pun I'm missing. Yes, every finite-dimensional vector space over a field \\(k\\) is isomorphic to \\(k^n\\), the set of \\(n\\)-tuples of elements of \\(k\\), with the vector space operations defined as follows: * Addition: \\( (x_1, \dots, x_n) + (y_1 , \dots y_n) = (x_1 + y_1 , \dots x_n + y_n) \\). * Scalar multiplication: \\( a(x_1, \dots, x_n) = (ax_1, \dots, ay_n) \\). When \\(n = 1\\) we get \\(k^1\\), which is just \\(k\\). A 1-tuple of elements of \\(k\\) is just an element of \\(k\\). You may have seen this stuff when \\(k = \mathbb{R}\\), the field of real numbers. They say the real line is a 1-dimensional real vector space. (I wouldn't say the case \\(n = 1\\) is trivial: the _really_ trivial case is \\(n = 0\\).)`

I've added some fun puzzles about things you can do in a compact closed category:

Puzzle 284.Using the cap and cup, any morphism \(f \colon x \to y \) in a compact closed category gives rise to a morphism from \(y^\ast\) to \(x^\ast\). This amounts to 'turning \(f\) around' in a certain sense, and we call this morphism \(f^\ast \colon y^\ast \to x^\ast \). Write down a formula for \(f^\ast\) and also draw it as a string diagram.Puzzle 285.Show that \( (fg)^\ast = g^\ast f^\ast \) for any composable morphisms \(f\) and \(g\), and show that \( (1_x)^\ast = 1_x \) for any object \(x\).Puzzle 286.What is a slick way to state the result in Puzzle 285?Puzzle 287.Show that if \(x\) is an object in a compact closed category, \( (x^\ast)^\ast\) is isomorphic to \(x\).`I've added some fun puzzles about things you can do in a compact closed category: **Puzzle 284.** Using the cap and cup, any morphism \\(f \colon x \to y \\) in a compact closed category gives rise to a morphism from \\(y^\ast\\) to \\(x^\ast\\). This amounts to 'turning \\(f\\) around' in a certain sense, and we call this morphism \\(f^\ast \colon y^\ast \to x^\ast \\). Write down a formula for \\(f^\ast\\) and also draw it as a string diagram. **Puzzle 285.** Show that \\( (fg)^\ast = g^\ast f^\ast \\) for any composable morphisms \\(f\\) and \\(g\\), and show that \\( (1_x)^\ast = 1_x \\) for any object \\(x\\). **Puzzle 286.** What is a slick way to state the result in Puzzle 285? **Puzzle 287.** Show that if \\(x\\) is an object in a compact closed category, \\( (x^\ast)^\ast\\) is isomorphic to \\(x\\).`

Daniel wrote:

Yes! Nothing to be ashamed about there; that's a very important point and I was just too lazy to come out and say it. The bottom picture is perfectly correct. The top picture is a kind of abbreviation that turns out to be incredibly useful, for two main reasons:

1) We can omit drawing wires labelled by the unit object \(I\), roughly because \(I \otimes x \cong x \cong x \otimes I\) so putting \(I\) next to another object 'doesn't do anything'. (A more detailed explanation of why we can get away with this would take longer, and invoke Mac Lane's coherence theorem.)

2) Drawing the cap and cup the way we do makes the snake equations

seem 'intuitively obvious' and very easy to work with in calculations. This one of those examples of how a good notation does the thinking for you. Remember, the snake equations really say

and

are identity morphisms. But

thatway of writing them makes themnot at allintuitively obvious!`Daniel wrote: > Another question I feel a bit ashamed to ask, but better late than never: Is it correct that > <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/cap_lowercase.png"></center> > could be drawn as > <center> ![Imgur](https://i.imgur.com/ZugI2bol.png)</center> Yes! Nothing to be ashamed about there; that's a very important point and I was just too lazy to come out and say it. The bottom picture is perfectly correct. The top picture is a kind of abbreviation that turns out to be incredibly useful, for two main reasons: 1) We can omit drawing wires labelled by the unit object \\(I\\), roughly because \\(I \otimes x \cong x \cong x \otimes I\\) so putting \\(I\\) next to another object 'doesn't do anything'. (A more detailed explanation of why we can get away with this would take longer, and invoke Mac Lane's coherence theorem.) 2) Drawing the cap and cup the way we do makes the snake equations <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/zigzag_1_lowercase.png"></center> <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/zigzag_2_lowercase.png"></center> seem 'intuitively obvious' and very easy to work with in calculations. This one of those examples of how a good notation does the thinking for you. Remember, the snake equations really say <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/snake_1.png"></center> and <center><img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/snake_2.png"></center> are identity morphisms. But _that_ way of writing them makes them _not at all_ intuitively obvious!`

"bend its strings around, converting inputs to outputs or vice versa"..is there something defined (priority rule perhaps) about short circuit input/ output in this context?

`"bend its strings around, converting inputs to outputs or vice versa"..is there something defined (priority rule perhaps) about short circuit input/ output in this context?`

\(y^\ast \stackrel{\sim}{\to} y^\ast \otimes 1 \stackrel{1_y \otimes \cap_x}{\to} y^\ast \otimes (x \otimes x^\ast) \stackrel{1_y \otimes f \otimes 1_x}{\to} y^\ast \otimes (y \otimes x^\ast) \stackrel{\sim}{\to} (y^\ast \otimes y) \otimes x^\ast \stackrel{\cup_y \otimes 1_x}{\to} 1 \otimes x^\ast \stackrel{\sim}{\to} x^\ast\)

So the composite function would be \( f^\ast = (1_y \otimes \cap_x)(1_y \otimes f \otimes 1_x)(\cup_y \otimes 1_x)\).

Simply put if you pull the strings, the function gets flipped around.

`>**Puzzle 284.** Using the cap and cup, any morphism \\(f \colon x \to y \\) in a compact closed category gives rise to a morphism from \\(y^\ast\\) to \\(x^\ast\\). This amounts to 'turning \\(f\\) around' in a certain sense, and we call this morphism \\(f^\ast \colon y^\ast \to x^\ast \\). Write down a formula for \\(f^\ast\\) and also draw it as a string diagram. \\(y^\ast \stackrel{\sim}{\to} y^\ast \otimes 1 \stackrel{1_y \otimes \cap_x}{\to} y^\ast \otimes (x \otimes x^\ast) \stackrel{1_y \otimes f \otimes 1_x}{\to} y^\ast \otimes (y \otimes x^\ast) \stackrel{\sim}{\to} (y^\ast \otimes y) \otimes x^\ast \stackrel{\cup_y \otimes 1_x}{\to} 1 \otimes x^\ast \stackrel{\sim}{\to} x^\ast\\) So the composite function would be \\( f^\ast = (1_y \otimes \cap_x)(1_y \otimes f \otimes 1_x)(\cup_y \otimes 1_x)\\). ![function_cap_cup](http://aether.co.kr/images/function_cap_cup.svg) Simply put if you pull the strings, the function gets flipped around.`

Is it true that \(\cup^\ast = \cap\)? It looks like it should but the \(k\) in \(\cap_V \colon k \to V \otimes V^\ast\) is throwing me off.

`Is it true that \\(\cup^\ast = \cap\\)? It looks like it should but the \\(k\\) in \\(\cap_V \colon k \to V \otimes V^\ast\\) is throwing me off.`

I don't think it is, I think the dual just fips the direction of arrow going around, not which side has two wires.

`I don't think it is, I think the dual just fips the direction of arrow going around, not which side has two wires.`

I wrote:

I realized that my answer above is incorrect while working out the solutions to the other puzzles. My answer cannot be right since you can't take an inverse of a vector. I was approaching the problem from the wrong direction since we are dealing with vector spaces and not the linear maps.

So I think the answer to this puzzle is :

First we need to define what the dual functor is. The vector space is the basis and lies in the covariant position. The dual space is the linear functions on the basis and therefore lies in the contravariant position. The (-)* functor switches the two positions and for vectors this is just the transpose function.

\(\cup_V \colon V^\ast \otimes V \to k\) is the evaluation map that evaluates the vector multiplication \(w^iv_i = k\) or in 2D components \(w^1v_1 + w^2v_2 = k\).

\(\cap_V \colon k \to V \otimes V^\ast \) is the coevaluation map. This map is kind of like saying there exists some vector and covector \(w^iv_i\) that satisfies the equations (w^iv_i = k\) or every \(k\) can be written as the multiplication of vector and covector.

The snake equations are straight forward but one small detail to be worked out. We need to prove that \(v \stackrel{\sim}{\to} k \otimes v\) and \(v^\mathsf{T} \stackrel{\sim}{\to} v^\mathsf{T} \otimes k\). For this, we have to remember that the objects are vector spaces and one dimensional vectors or scalars serve as identities since a n-dimensional vector space tensored with a 1-dimensional vector space is still a n-dimensional vector space. In other words, it says you can always factor out a scalar from a vector by dividing through like homogenous coordinates.

So if we have scalar \(k\) and vector \(v = \begin{bmatrix} a \ b \end{bmatrix}\), then :

$$\begin{bmatrix} ka \ kb \end{bmatrix} = k \begin{bmatrix} a \ b \end{bmatrix} = \begin{bmatrix} a \ b \end{bmatrix} \begin{bmatrix} a & b \end{bmatrix} \begin{bmatrix} a \ b \end{bmatrix} = \begin{bmatrix} a \ b \end{bmatrix} k = \begin{bmatrix} ak \ bk \end{bmatrix}$$ The other snake equation is similar with tensor order and duals reversed.

... Why isn't the latex working for column vectors?

`>**Puzzle 283** >Guess what the cap and cup >$$ \cap_V \colon k \to V \otimes V^\ast, \qquad \cup_V \colon V^\ast \otimes V \to k $$ >are for a finite-dimensional vector space \\(V\\), and check your guess by proving the snake equations. I wrote: >\\(\cap_V \colon k \to V \otimes V^\ast \\) is the function that takes the inverse of a matrix of a vector space which sends it into its dual space. \\(\cup_V \colon V^\ast \otimes V \to k\\) is the function that takes the inverse of a dual matrix which sends it back into the vector space. I realized that my answer above is incorrect while working out the solutions to the other puzzles. My answer cannot be right since you can't take an inverse of a vector. I was approaching the problem from the wrong direction since we are dealing with vector spaces and not the linear maps. So I think the answer to this puzzle is : First we need to define what the dual functor is. The vector space is the basis and lies in the covariant position. The dual space is the linear functions on the basis and therefore lies in the contravariant position. The (-)* functor switches the two positions and for vectors this is just the transpose function. \\(\cup_V \colon V^\ast \otimes V \to k\\) is the evaluation map that evaluates the vector multiplication \\(w^iv_i = k\\) or in 2D components \\(w^1v_1 + w^2v_2 = k\\). \\(\cap_V \colon k \to V \otimes V^\ast \\) is the coevaluation map. This map is kind of like saying there exists some vector and covector \\(w^iv_i\\) that satisfies the equations (w^iv_i = k\\) or every \\(k\\) can be written as the multiplication of vector and covector. The snake equations are straight forward but one small detail to be worked out. We need to prove that \\(v \stackrel{\sim}{\to} k \otimes v\\) and \\(v^\mathsf{T} \stackrel{\sim}{\to} v^\mathsf{T} \otimes k\\). For this, we have to remember that the objects are vector spaces and one dimensional vectors or scalars serve as identities since a n-dimensional vector space tensored with a 1-dimensional vector space is still a n-dimensional vector space. In other words, it says you can always factor out a scalar from a vector by dividing through like homogenous coordinates. So if we have scalar \\(k\\) and vector \\(v = \begin{bmatrix} a \\ b \end{bmatrix}\\), then : \[\begin{bmatrix} ka \\ kb \end{bmatrix} = k \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} a \\ b \end{bmatrix} \begin{bmatrix} a & b \end{bmatrix} \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} a \\ b \end{bmatrix} k = \begin{bmatrix} ak \\ bk \end{bmatrix}\] The other snake equation is similar with tensor order and duals reversed. ... Why isn't the latex working for column vectors?`

Christopher

I am not sure if my answer above is correct but if cup and cap are evaluation and coevaluation maps, they should be duals. Also since \(k\) is a scalar, \(k^\ast\) should be the transpose of a scalar which is just a scalar again so the (-)* functor actually works on the cap and cup.

`Christopher I am not sure if my answer above is correct but if cup and cap are evaluation and coevaluation maps, they should be duals. Also since \\(k\\) is a scalar, \\(k^\ast\\) should be the transpose of a scalar which is just a scalar again so the (-)* functor actually works on the cap and cup.`

Just to elaborate and add a bit of beginner's background to Michael's answer to Puzzle 283, from someone who didn't know what dual spaces were and had to look them up:

The dual space has as elements "linear functionals", or equivalently covectors, \(\phi \colon V \rightarrow \mathcal{k}\). These can be thought of as morphisms that apply a row vector to a column vector to yield a real number value. In other words, it takes a vector representing the values of a linear polynomial and applies coefficients to get a real number. So the tensored category \(V \otimes V^\ast\) contains tuples \(\langle v, \phi \rangle\) of vectors and linear functionals. \(\cap_V\) is a profunctor between \(k\) and \(V \otimes V^\ast\). That's like asking about the feasibility of a real number being equal to the value of a vector applied to a linear functional. Namely, a real number \(n\) is related to a tuple \(\langle v, \phi \rangle\) iff \(\phi(v) = n\).

(As an aside, it seems arbitrary that we use \(=\) here instead of \(\leq\). We could move from enriching our relations with \((\mathcal{R}, =, 1, *)\) to enriching them in \((\mathcal{R}, \leq, 1, *)\), so that we're asking about the feasibility of a real number being less than or equal to \(\phi(v)\). Not sure if that makes sense though.)

So to translate this into the snake equation, we:

take any vector \(v\) and factor out some \(k\) - because we're allowed to do that with scalars and vectors. now we have a tuple \(\langle k, 1/k * v \rangle\).

transform (or coevaluate) the \(k\) into \(\langle v_k, \phi_k \rangle\) via the \(\cap_V\) - since it's "feasible" to do. notice that in parallel we're also taking \(1/k * v\) to itself.

do the associator magic which takes every \(\langle\langle v_k, \phi_k \rangle, 1/k * v \rangle \) to \(\langle v_k, \langle \phi_j, 1/k * v \rangle\rangle\).

transform (or evaluate) \(\langle \phi_j, 1/k * v \rangle\) to some new real number \(j\), and in parallel take \(v_k\) to \(v_k\).

multiply \(v_k\) by \(j\) to get your original vector \(v\).

In addition, we need to show that for any input \(v\) we can choose some \(k, v_k, \phi_k, \phi_j, j\) that will make this work. Well, just let \(k\) and \(j\) be reciprocals, and let \(\phi_j(1/k * v) = j = 1/k\). Notice that the associator doesn't restrict us to using the same linear functional - we can pick whatever we want to make this equation work so long as it's 1:1.

`Just to elaborate and add a bit of beginner's background to Michael's answer to Puzzle 283, from someone who didn't know what dual spaces were and had to look them up: The dual space has as elements "linear functionals", or equivalently covectors, \\(\phi \colon V \rightarrow \mathcal{k}\\). These can be thought of as morphisms that apply a row vector to a column vector to yield a real number value. In other words, it takes a vector representing the values of a linear polynomial and applies coefficients to get a real number. So the tensored category \\(V \otimes V^\ast\\) contains tuples \\(\langle v, \phi \rangle\\) of vectors and linear functionals. \\(\cap_V\\) is a profunctor between \\(k\\) and \\(V \otimes V^\ast\\). That's like asking about the feasibility of a real number being equal to the value of a vector applied to a linear functional. Namely, a real number \\(n\\) is related to a tuple \\(\langle v, \phi \rangle\\) iff \\(\phi(v) = n\\). (As an aside, it seems arbitrary that we use \\(=\\) here instead of \\(\leq\\). We could move from enriching our relations with \\((\mathcal{R}, =, 1, *\)\\) to enriching them in \\((\mathcal{R}, \leq, 1, *)\\), so that we're asking about the feasibility of a real number being less than or equal to \\(\phi(v)\\). Not sure if that makes sense though.) So to translate this into the snake equation, we: 1. take any vector \\(v\\) and factor out some \\(k\\) - because we're allowed to do that with scalars and vectors. now we have a tuple \\(\langle k, 1/k * v \rangle\\). 2. transform (or coevaluate) the \\(k\\) into \\(\langle v_k, \phi_k \rangle\\) via the \\(\cap_V\\) - since it's "feasible" to do. notice that in parallel we're also taking \\(1/k * v\\) to itself. 3. do the associator magic which takes every \\(\langle\langle v_k, \phi_k \rangle, 1/k * v \rangle \\) to \\(\langle v_k, \langle \phi_j, 1/k * v \rangle\rangle\\). 4. transform (or evaluate) \\(\langle \phi_j, 1/k * v \rangle\\) to some new real number \\(j\\), and in parallel take \\(v_k\\) to \\(v_k\\). 5. multiply \\(v_k\\) by \\(j\\) to get your original vector \\(v\\). In addition, we need to show that for any input \\(v\\) we can choose some \\(k, v_k, \phi_k, \phi_j, j\\) that will make this work. Well, just let \\(k\\) and \\(j\\) be reciprocals, and let \\(\phi_j(1/k * v) = j = 1/k\\). Notice that the associator doesn't restrict us to using the same linear functional - we can pick whatever we want to make this equation work so long as it's 1:1.`

So after working that out, I think the inverse functor is just the dual functor for a linear map.

If we have two different vector spaces \(x \text{ and } y \text{ where } Ax =y\) Since A is invertible, \(A^{-1}A = I\).

Then $$x^\ast x = x^\ast I x = x^\ast (A^{-1}A) x = (x^\ast A^{-1})(Ax) = (Ax)^\ast(Ax) =y^\ast y$$ In terms of string diagrams maybe something like this?

Seems like something is missing though...

Edit: I have labeled the top circle \(A^{-1}\) but keeping with notation I should have labeled it just \(A\) .

`So after working that out, I think the inverse functor is just the dual functor for a linear map. If we have two different vector spaces \\(x \text{ and } y \text{ where } Ax =y\\) Since A is invertible, \\(A^{-1}A = I\\). Then \[x^\ast x = x^\ast I x = x^\ast (A^{-1}A) x = (x^\ast A^{-1})(Ax) = (Ax)^\ast(Ax) =y^\ast y\] In terms of string diagrams maybe something like this? ![Inverse](http://aether.co.kr/images/inverse_string_diagram.svg) Seems like something is missing though... Edit: I have labeled the top circle \\(A^{-1}\\) but keeping with notation I should have labeled it just \\(A\\) .`

Complete speculation here but nonetheless very interesting.

The cup and cap can be seen as lollipopped unital laws as shown below:

Once you lollipop the unital law you can add in two identity morphisms that are dual of each other and the tensor product of the two is the identity matrix. This is interesting because this complex was an identity morphism to start off with!

We can add a real morphism A into the picture as below:

You can add the morphism on either side and you will have the same result, an morphism going from \(y^\ast \rightarrow x^\ast\). But we can once again introduce the inverse of A to make the whole complex become a identity morphism and we get \(A^{-1}A = I = AA^{-1}\)!

Maybe someone with more experience can verify if this checks out and/or explain the details further? I was trying to figure out where \(A^{-1}A = I = AA^{-1}\) and \(x^\ast I x = x^\ast (A^{-1}A) x\) in comment 28 above was coming from and entered this hall of mirrors LOL. Would be great if someone can take us down the rabbit hole a little deeper.

`Complete speculation here but nonetheless very interesting. The cup and cap can be seen as lollipopped unital laws as shown below: ![lollipop identity](http://aether.co.kr/images/finvect_lollipop_2.svg) Once you lollipop the unital law you can add in two identity morphisms that are dual of each other and the tensor product of the two is the identity matrix. This is interesting because this complex was an identity morphism to start off with! We can add a real morphism A into the picture as below: ![lollipop inverse](http://aether.co.kr/images/finvect_lollipop_1.svg) You can add the morphism on either side and you will have the same result, an morphism going from \\(y^\ast \rightarrow x^\ast\\). But we can once again introduce the inverse of A to make the whole complex become a identity morphism and we get \\(A^{-1}A = I = AA^{-1}\\)! Maybe someone with more experience can verify if this checks out and/or explain the details further? I was trying to figure out where \\(A^{-1}A = I = AA^{-1}\\) and \\(x^\ast I x = x^\ast (A^{-1}A) x\\) in comment 28 above was coming from and entered this hall of mirrors LOL. Would be great if someone can take us down the rabbit hole a little deeper.`

From comment #28:

Since we are working with finite dimensional vector spaces, we can assume they have bases. I will assume \(x\) is an element of an \(N-\)dimensional vector space \(V\), and \(y\) is an element of an \(M-\)dimensional vector space \(W\). Let \(x=\sum_{n=1}^Na^ne_n\) and \(y=\sum_{m=1}^M b^m\tilde e_m\), where \(\{e_n\}_{n=1}^N\) is a basis for \(V\) and \(\{\tilde e_m\}_{m=1}^M\) is a basis for \(W\).

Then \(A:V\to W\) can be written as \[\sum_{n=1}^N\sum_{m=1}^M A^{nm}e^* _n\otimes\tilde e_m\], where \(A^{nm}\) is the number in the nth row and mth column of the matrix that represents \(A\) in the chosen bases, and \(e^* _n\) is the transpose of \(e_n\).

Since linear transformations can be expressed as linear combinations of tensor products, it is not consistent to choose the dual independently for vectors and linear transformations (in particular, inverse for linear transformations does not act in a way consistent with transpose on vectors).

`From comment [#28](https://forum.azimuthproject.org/discussion/comment/20832/#Comment_20832): >So after working that out, I think the inverse functor is just the dual functor for a linear map. >If we have two different vector spaces \\(x \text{ and } y \text{ where } Ax =y\\) Since A is invertible, \\(A^{-1}A = I\\). Since we are working with finite dimensional vector spaces, we can assume they have bases. I will assume \\(x\\) is an element of an \\(N-\\)dimensional vector space \\(V\\), and \\(y\\) is an element of an \\(M-\\)dimensional vector space \\(W\\). Let \\(x=\sum\_{n=1}^Na^ne_n\\) and \\(y=\sum\_{m=1}^M b^m\tilde e_m\\), where \\(\\{e\_n\\}\_{n=1}^N\\) is a basis for \\(V\\) and \\(\\{\tilde e\_m\\}\_{m=1}^M\\) is a basis for \\(W\\). Then \\(A:V\to W\\) can be written as \\[\sum\_{n=1}^N\sum\_{m=1}^M A^{nm}e^* \_n\otimes\tilde e\_m\\], where \\(A^{nm}\\) is the number in the nth row and mth column of the matrix that represents \\(A\\) in the chosen bases, and \\(e^* \_n\\) is the transpose of \\(e\_n\\). Since linear transformations can be expressed as linear combinations of tensor products, it is not consistent to choose the dual independently for vectors and linear transformations (in particular, inverse for linear transformations does not act in a way consistent with transpose on vectors).`

David

I thought i was just working out a special case but forgot that we are talking about finite vector spaces and linear transformations and it can't even be a special case... So the dual is just the transpose of a matrix. The inverse seems like a much more complex concept.

`David I thought i was just working out a special case but forgot that we are talking about finite vector spaces and linear transformations and it can't even be a special case... So the dual is just the transpose of a matrix. The inverse seems like a much more complex concept.`

Using Michael Hong's reasoning in 22, I think that,

\[ g^\ast f^\ast = \\ (\cap_x \otimes \cap_y \otimes 1_{z^\ast}); \\ (1_{x^\ast} \otimes f \otimes 1_{y^\ast} \otimes g \otimes 1_{y^\ast}); \\ (1_{x^\ast} \otimes \cup_y \otimes \cup_z ). \]

However, proving that,

\[ (fg)^\ast = \\ (\cap_x \otimes 1_{z^\ast}); \\ (1_{x^\ast} \otimes (g \circ f) \otimes 1_{z^\ast});\\ (1_{x^\ast} \otimes \cup_z ) \\ \] \[ =\\ \] \[ (\cap_x \otimes \cap_y \otimes 1_{z^\ast});\\ (1_{x^\ast} \otimes f \otimes 1_{y^\ast} \otimes g \otimes 1_{y^\ast});\\ (1_{x^\ast} \otimes \cup_y \otimes \cup_z ) \\ = g^* f^* \]

Is a bit harder.

`Using Michael Hong's reasoning in 22, I think that, \\[ g^\ast f^\ast = \\\\ (\cap\_x \otimes \cap\_y \otimes 1\_{z^\ast}); \\\\ (1\_{x^\ast} \otimes f \otimes 1\_{y^\ast} \otimes g \otimes 1\_{y^\ast}); \\\\ (1\_{x^\ast} \otimes \cup\_y \otimes \cup\_z ). \\] However, proving that, \\[ (fg)^\ast = \\\\ (\cap\_x \otimes 1\_{z^\ast}); \\\\ (1\_{x^\ast} \otimes (g \circ f) \otimes 1\_{z^\ast});\\\\ (1\_{x^\ast} \otimes \cup\_z ) \\\\ \\] \\[ =\\\\ \\] \\[ (\cap\_x \otimes \cap\_y \otimes 1\_{z^\ast});\\\\ (1\_{x^\ast} \otimes f \otimes 1\_{y^\ast} \otimes g \otimes 1\_{y^\ast});\\\\ (1\_{x^\ast} \otimes \cup\_y \otimes \cup\_z ) \\\\ = g^* f^* \\] Is a bit harder.`

Keith

The one on the left is when you compose it. I think the one in the center is the diagram you drew. Both of these are equal to the right one since all we are doing is extending identities. If you draw it like the diagram on the right, you will be able to separate out the y components and factor out a snake.

There is sliding rule needed to be made rigorous here where you can slide morphisms and stretch the diagrams without changing it but I haven't been able to quite get it.

`Keith ![dual composition](http://aether.co.kr/images/dual_functor_composition.svg) The one on the left is when you compose it. I think the one in the center is the diagram you drew. Both of these are equal to the right one since all we are doing is extending identities. If you draw it like the diagram on the right, you will be able to separate out the y components and factor out a snake. There is sliding rule needed to be made rigorous here where you can slide morphisms and stretch the diagrams without changing it but I haven't been able to quite get it.`

The sliding rule seems to be: you can compose tensors with different dimensions by sticking together terms with same components which is essentially following morphisms down the line. The cups, caps and morphisms can be composed on either one of its ends. Identity morphisms can always disappear and reappear around same subscripts.

Using your equations for \(g^\ast f^\ast\), if we collect terms we get:

$$ \cap_x\ \cdot 1_x \cdot 1_x \otimes g \cdot (\cap_y \cdot 1_y \cdot \cup_y) \cdot f \otimes 1_z \cdot 1_z \cdot \cup_z$$ $$ \cap_x\ \cdot 1_x \cdot 1_x \otimes g \cdot (1_y \cdot \cap_y) \cdot (\cup_y \cdot 1_y) \cdot f \otimes 1_z \cdot 1_z \cdot \cup_z$$ $$ \cap_x\ \cdot 1_x \cdot 1_x \otimes g \cdot f \otimes 1_z \cdot 1_z \cdot \cup_z$$

`The sliding rule seems to be: you can compose tensors with different dimensions by sticking together terms with same components which is essentially following morphisms down the line. The cups, caps and morphisms can be composed on either one of its ends. Identity morphisms can always disappear and reappear around same subscripts. Using your equations for \\(g^\ast f^\ast\\), if we collect terms we get: \[ \cap_x\ \cdot 1_x \cdot 1_x \otimes g \cdot (\cap_y \cdot 1_y \cdot \cup_y) \cdot f \otimes 1_z \cdot 1_z \cdot \cup_z\] \[ \cap_x\ \cdot 1_x \cdot 1_x \otimes g \cdot (1_y \cdot \cap_y) \cdot (\cup_y \cdot 1_y) \cdot f \otimes 1_z \cdot 1_z \cdot \cup_z\] \[ \cap_x\ \cdot 1_x \cdot 1_x \otimes g \cdot f \otimes 1_z \cdot 1_z \cdot \cup_z\]`

Okay I think I kind of get it now. So a square matrix is an identity morphism in \(\mathbf{FinVect}\). \(AA^\mathsf{T}\) is always a square matrix so will always be equal to an identity morphism. I kept thinking a identity matrix was the identity morphism but in this category, the collection of square matrices is the identity morphisms which threw me off.

`![transpose identity](http://aether.co.kr/images/transpose_identity.svg) Okay I think I kind of get it now. So a square matrix is an identity morphism in \\(\mathbf{FinVect}\\). \\(AA^\mathsf{T}\\) is always a square matrix so will always be equal to an identity morphism. I kept thinking a identity matrix was the identity morphism but in this category, the collection of square matrices is the identity morphisms which threw me off.`

Concerning

To show isomorphism we need a bijection between these 2 objects. Since \(x^\ast\) are just objects in the same closed compact category, they also have cap and cup (natural) isomorphisms: \(\cap: I \to x^\ast \otimes (x^\ast)^\ast\) and \(\cup: (x^\ast)^\ast \otimes x^\ast \to I\). Also we have symmetry \(\sigma: x \otimes y \to y \otimes x\). Let's try to construct a bijection between \(x\) and \((x^\ast)^\ast\):

\(x \to x\otimes I \to x \otimes (x^\ast \otimes (x^\ast)^\ast) \to (x \otimes x^\ast) \otimes (x^\ast)^\ast \to (x^\ast \otimes x) \otimes (x^\ast)^\ast \to I \otimes (x^\ast)^\ast \to (x^\ast)^\ast\)

All arrows here are natural isomorphisms: right unitor, cap, associator, symmetry, cup, left unitor. Bijection between \((x^\ast)^\ast\) and \(x\) might be constructed in a similar way.

Here comes a question: if a category isn't symmetric, \((x^\ast)^\ast\) is not isomorphic to \(x\) in general?

`Concerning >**Puzzle 287.** Show that if \\(x\\) is an object in a compact closed category, \\((x^\ast)^\ast\\) is isomorphic to \\(x\\). To show isomorphism we need a bijection between these 2 objects. Since \\(x^\ast\\) are just objects in the same closed compact category, they also have cap and cup (natural) isomorphisms: \\(\cap: I \to x^\ast \otimes (x^\ast)^\ast\\) and \\(\cup: (x^\ast)^\ast \otimes x^\ast \to I\\). Also we have symmetry \\(\sigma: x \otimes y \to y \otimes x\\). Let's try to construct a bijection between \\(x\\) and \\((x^\ast)^\ast\\): \\(x \to x\otimes I \to x \otimes (x^\ast \otimes (x^\ast)^\ast) \to (x \otimes x^\ast) \otimes (x^\ast)^\ast \to (x^\ast \otimes x) \otimes (x^\ast)^\ast \to I \otimes (x^\ast)^\ast \to (x^\ast)^\ast\\) All arrows here are natural isomorphisms: right unitor, cap, associator, symmetry, cup, left unitor. Bijection between \\((x^\ast)^\ast\\) and \\(x\\) might be constructed in a similar way. Here comes a question: if a category isn't symmetric, \\((x^\ast)^\ast\\) is not isomorphic to \\(x\\) in general?`

Michael wrote in comment #22:

This looks great! We take

$$ f \colon x \to y ,$$ use a cup to bend its output wire so that the output \(y\) becomes the input \(y^\ast\), use a cap to bend its input wire so that the input \(x\) becomes the output \(x^\ast\), and get a morphism we define to be

$$ f^\ast \colon y^\ast \to x^\ast .$$

You mean "composite morphism"...

This simplified formula is only correct if you're in a

strictmonoidal category. In your detailed formula\(y^\ast \stackrel{\sim}{\to} y^\ast \otimes I \stackrel{1_y \otimes \cap_x}{\to} y^\ast \otimes (x \otimes x^\ast) \stackrel{1_y \otimes (f \otimes 1_x)}{\to} y^\ast \otimes (y \otimes x^\ast) \stackrel{\sim}{\to} (y^\ast \otimes y) \otimes x^\ast \stackrel{\cup_y \otimes 1_x}{\to} I \otimes x^\ast \stackrel{\sim}{\to} x^\ast\)

you've got some isomorphisms! First you've got the inverse of the right unitor:

$$ \rho_{y^\ast} \colon y^\ast \stackrel{\sim}{\to} y^\ast \otimes I $$ then the inverse of the associator:

$$ \alpha_{y^\ast, y, x^\ast} \colon y^\ast \otimes (y \otimes x^\ast) \stackrel{\sim}{\to} (y^\ast \otimes y) $$ and then the left unitor:

$$ \lambda_{x^\ast} \colon I \otimes x^\ast \stackrel{\sim}{\to} x^\ast $$ In a

strictmonoidal category these are all identity morphisms. Also, in a strict monoidal category we can write \(1_y \otimes (f \otimes 1_x)\) as \(1_y \otimes f \otimes 1_x \) since the tensor product is associative. So, if our compact closed category is strict monoidal we can write:$$ f^\ast = (1_y \otimes \cap_x)(1_y \otimes f \otimes 1_x)(\cup_y \otimes 1_x) .$$ In general, the formula is more complicated. This is one reason string diagrams are convenient: they allow us to hide the associators and unitors. Of course, it takes work to justify the use of string diagrams! I'm not going to prove any theorems about that.... they are in here:

`Michael wrote in [comment #22](https://forum.azimuthproject.org/discussion/comment/20826/#Comment_20826): > >**Puzzle 284.** Using the cap and cup, any morphism \\(f \colon x \to y \\) in a compact closed category gives rise to a morphism from \\(y^\ast\\) to \\(x^\ast\\). This amounts to 'turning \\(f\\) around' in a certain sense, and we call this morphism \\(f^\ast \colon y^\ast \to x^\ast \\). Write down a formula for \\(f^\ast\\) and also draw it as a string diagram. > \\(y^\ast \stackrel{\sim}{\to} y^\ast \otimes I \stackrel{1_y \otimes \cap_x}{\to} y^\ast \otimes (x \otimes x^\ast) \stackrel{1_y \otimes (f \otimes 1_x)}{\to} y^\ast \otimes (y \otimes x^\ast) \stackrel{\sim}{\to} (y^\ast \otimes y) \otimes x^\ast \stackrel{\cup_y \otimes 1_x}{\to} I \otimes x^\ast \stackrel{\sim}{\to} x^\ast\\) > ![function_cap_cup](http://aether.co.kr/images/function_cap_cup.svg) This looks great! We take \[ f \colon x \to y ,\] use a cup to bend its output wire so that the output \\(y\\) becomes the input \\(y^\ast\\), use a cap to bend its input wire so that the input \\(x\\) becomes the output \\(x^\ast\\), and get a morphism we define to be \[ f^\ast \colon y^\ast \to x^\ast .\] > So the composite function... You mean "composite morphism"... > ...would be \\( f^\ast = (1_y \otimes \cap_x)(1_y \otimes f \otimes 1_x)(\cup_y \otimes 1_x)\\). This simplified formula is only correct if you're in a _strict_ monoidal category. In your detailed formula \\(y^\ast \stackrel{\sim}{\to} y^\ast \otimes I \stackrel{1_y \otimes \cap_x}{\to} y^\ast \otimes (x \otimes x^\ast) \stackrel{1_y \otimes (f \otimes 1_x)}{\to} y^\ast \otimes (y \otimes x^\ast) \stackrel{\sim}{\to} (y^\ast \otimes y) \otimes x^\ast \stackrel{\cup_y \otimes 1_x}{\to} I \otimes x^\ast \stackrel{\sim}{\to} x^\ast\\) you've got some isomorphisms! First you've got the inverse of the right unitor: \[ \rho_{y^\ast} \colon y^\ast \stackrel{\sim}{\to} y^\ast \otimes I \] then the inverse of the associator: \[ \alpha_{y^\ast, y, x^\ast} \colon y^\ast \otimes (y \otimes x^\ast) \stackrel{\sim}{\to} (y^\ast \otimes y) \] and then the left unitor: \[ \lambda_{x^\ast} \colon I \otimes x^\ast \stackrel{\sim}{\to} x^\ast \] In a _strict_ monoidal category these are all identity morphisms. Also, in a strict monoidal category we can write \\(1_y \otimes (f \otimes 1_x)\\) as \\(1_y \otimes f \otimes 1_x \\) since the tensor product is associative. So, if our compact closed category is strict monoidal we can write: \[ f^\ast = (1_y \otimes \cap_x)(1_y \otimes f \otimes 1_x)(\cup_y \otimes 1_x) .\] In general, the formula is more complicated. This is one reason string diagrams are convenient: they allow us to hide the associators and unitors. Of course, it takes work to justify the use of string diagrams! I'm not going to prove any theorems about that.... they are in here: * André Joyal and Ross Street, [The geometry of tensor calculus I](https://www.sciencedirect.com/science/article/pii/000187089190003P).`

Michael wrote in comment #23:

That's a nice question! The short answer is: "Literally speaking, no. But morally speaking, yes".

It's easier to think about this in general, not in the special case of finite-dimensional vector spaces.

You've shown how to 'turn around' any morphism \(f \colon x \to y\) using caps and cups to get a morphism \(f^\ast \colon y^\ast \to x^\ast \). What if we do this to the cup itself? We start with

$$ \cup_x \colon x^\ast \otimes x \to I $$ and we get some morphism

$$ \cup_x^\ast \colon I^\ast \to (x^\ast \otimes x)^\ast .$$ It's too much to expect this is

equalto the cap$$ \cap_x \colon I \to x \otimes x^\ast $$ because these two morphisms will, in general, have a different source:

$$ I^\ast \ne I $$ and a different target:

$$ (x^\ast \otimes x)^\ast \ne x \otimes x^\ast.$$ However, their sources are

canonically isomorphic:that is, you can define an 'obvious best' isomorphism$$ A \colon I^\ast \stackrel{\sim}{\longrightarrow} I $$ and an 'obvious best' isomorphism

$$ B \colon (x^\ast \otimes x)^\ast \stackrel{\sim}{\longrightarrow} x \otimes x^\ast.$$ If you use these, you can show that

$$ \cap_x = B \circ \cup_x^\ast \circ A^{-1} .$$ So, while \(\cap_x\) and \(\cup_x^\ast \) aren't equal, they come as close as you could hope.

To find \(A\) and \(B\), and to prove

$$ \cap_x = B \circ \cup_x^\ast \circ A^{-1} ,$$ is yet another fun puzzle. There's a lot of stuff to do in this subject! I used to spend hours scribbling string diagrams and equations, working out all these things.

`Michael wrote in [comment #23](https://forum.azimuthproject.org/discussion/comment/20827/#Comment_20827): > Is it true that \\(\cup^\ast = \cap\\)? That's a nice question! The short answer is: "Literally speaking, no. But morally speaking, yes". > It looks like it should but the \\(k\\) in \\(\cap_V \colon k \to V \otimes V^\ast\\) is throwing me off. It's easier to think about this in general, not in the special case of finite-dimensional vector spaces. You've shown how to 'turn around' any morphism \\(f \colon x \to y\\) using caps and cups to get a morphism \\(f^\ast \colon y^\ast \to x^\ast \\). What if we do this to the cup itself? We start with \[ \cup_x \colon x^\ast \otimes x \to I \] and we get some morphism \[ \cup_x^\ast \colon I^\ast \to (x^\ast \otimes x)^\ast .\] It's too much to expect this is _equal_ to the cap \[ \cap_x \colon I \to x \otimes x^\ast \] because these two morphisms will, in general, have a different source: \[ I^\ast \ne I \] and a different target: \[ (x^\ast \otimes x)^\ast \ne x \otimes x^\ast.\] However, their sources are _canonically isomorphic:_ that is, you can define an 'obvious best' isomorphism \[ A \colon I^\ast \stackrel{\sim}{\longrightarrow} I \] and an 'obvious best' isomorphism \[ B \colon (x^\ast \otimes x)^\ast \stackrel{\sim}{\longrightarrow} x \otimes x^\ast.\] If you use these, you can show that \[ \cap_x = B \circ \cup_x^\ast \circ A^{-1} .\] So, while \\(\cap_x\\) and \\(\cup_x^\ast \\) aren't equal, they come as close as you could hope. To find \\(A\\) and \\(B\\), and to prove \[ \cap_x = B \circ \cup_x^\ast \circ A^{-1} ,\] is yet another fun puzzle. There's a lot of stuff to do in this subject! I used to spend hours scribbling string diagrams and equations, working out all these things.`

Anindya and Valter - thanks for your typo corrections in comments #3 and #4. I've fixed these mistakes.

`Anindya and Valter - thanks for your typo corrections in [comments #3 and #4](https://forum.azimuthproject.org/discussion/comment/20803/#Comment_20803). I've fixed these mistakes.`

Michael wrote in comment #11:

I don't know what a "matrix in a vector space" is, or what "matrix in its dual space" is, but I don't like this answer to Puzzle 283 - it makes my hair stand on end. I'm hoping someone corrected you and people eventually figured out some better answer! I have a lot of catching up to do here.

`Michael wrote in comment #11: > More precisely, let \\(\mathbf{V}\\) be a matrix in a vector space and \\(\mathbf{V^\ast}\\) be matrix in its dual space. Then: > \[\mathbf{V^\ast} \cdot \mathbf{V} = \mathbf{I} = \mathbf{V} \cdot \mathbf{V^\ast}\] > \[\mathbf{V^\ast} = \mathbf{V}^{-1}\] I don't know what a "matrix in a vector space" is, or what "matrix in its dual space" is, but I don't like this answer to Puzzle 283 - it makes my hair stand on end. I'm hoping someone corrected you and people eventually figured out some better answer! I have a lot of catching up to do here.`

Here come a few general questions about

Puzzle 283, I'm trying to see how the abstract concepts and their concrete realizations are linked. They may be highly imprecise though.FinVect?`Here come a few general questions about **Puzzle 283**, I'm trying to see how the abstract concepts and their concrete realizations are linked. They may be highly imprecise though. 1. For vector spaces we have also what is known as [direct sum](https://en.wikipedia.org/wiki/Direct_sum) or direct product, or \\(\oplus\\). Basically it is a Cartesian product of two vector spaces \\(A\\) and \\(B\\), and consists of ordered pairs \\((a, b)\\). Intuitively, it looks like a limit, or at least has its flavor - there are projections from \\(A\times B\\) to spaces \\(A\\) and \\(B\\). Is there something to it, why are we not using it as "tensoring"? 2. It seems that in the case of \\(\oplus\\), \\(I\\) is a 0-dimensional vector space, is this the case? 3. Also we have tensor product \\(\otimes\\) over vector spaces. Speaking abstractly/intuitively about "tensoring", it looks like a colimit, or at least has its flavor - we include or embed two objects into one, or glue them together. Translating this to vector spaces, we see that we indeed don't lose any information, but the resulting space is somewhat "mangled" in the sense that we need to multiply coordinates of the source vector spaces. And to reconstruct the original spaces, we need to solve some equations. What is the motivation of defining "tensoring" as tensor product for **FinVect**?`

Igor wrote in comment #5:

They actually do explain this in the section tensor product of vector spaces: they say that if you choose a basis \(e_i\) of the vector space \(V\) and a basis \(f_j\) of the vector space \(W\), the vector space \(V \otimes W\) has a basis consisting of meaningless formal symbols \(e_i \otimes f_j\).

They don't actually say "meaningless formal symbols", but they say something that means the same if you're a mathematician: they say "each basis element is denoted \(e_i \otimes f_j\)". The word "denoted" here means "don't ask what it means: it's just a meaningless formal symbol".

There are dozens of ways to describe tensor products of vector spaces, and Wikipedia describes a few, but this is the quickest. Not the best, but the quickest.

`Igor wrote in [comment #5](https://forum.azimuthproject.org/discussion/comment/20805/#Comment_20805): > In the definition of tensor product in Wikipedia it is unclear what do they mean by \\(e_i \otimes f_j\\), where \\(e_i\\) and \\(f_j\\) are basis vectors. They define \\(\otimes\\) for vector spaces, while not specifying what this means for individual vectors in these spaces. They actually do explain this in the section [tensor product of vector spaces](https://en.wikipedia.org/wiki/Tensor_product#Tensor_product_of_vector_spaces): they say that if you choose a basis \\(e_i\\) of the vector space \\(V\\) and a basis \\(f_j\\) of the vector space \\(W\\), the vector space \\(V \otimes W\\) has a basis consisting of meaningless formal symbols \\(e_i \otimes f_j\\). They don't actually say "meaningless formal symbols", but they say something that means the same if you're a mathematician: they say "each basis element is denoted \\(e_i \otimes f_j\\)". The word "denoted" here means "don't ask what it means: it's just a meaningless formal symbol". There are dozens of ways to describe tensor products of vector spaces, and Wikipedia describes a few, but this is the quickest. Not the best, but the quickest.`

John wrote

Thank you very much, this is the best explanation possible! Indeed I didn't pay attention to this subtlety - I suspected something like that, but wasn't sure that I'm interpreting it in the right way :)

`John wrote >They don't actually say "meaningless formal symbols", but they say something that means the same if you're a mathematician: they say "each basis element is denoted \\(e_i \otimes f_j\\)". The word "denoted" here means "don't ask what it means: it's just a meaningless formal symbol" Thank you very much, this is the best explanation possible! Indeed I didn't pay attention to this subtlety - I suspected something like that, but wasn't sure that I'm interpreting it in the right way :)`

John wrote:

Thanks for reminding me. Breaking old habits always time... My habit is always trying to simplify things mainly because of my poor memory and I can't keep up with too many players. This usually leads to clumping similar groups together and I think thats what we do when we use the equal sign. Category theory seems to be clumping things together but doing so while respecting the integrity of each individual and ... we end up getting the best of both worlds?

BTW This completely clarified my confusions with the words 'obvious best'!

This is kind of like asking "What two rules do we need to add to make our two diagrams commute (one for each direction) ie make the two compositions equal for each direction?" The rules come in the form of natural isomorphisms, A and B.

\(A \colon I^\ast \stackrel{\sim}{\longrightarrow} I\) says the identity object and its identity is conserved when using \((-)^\ast\) which may or may not be true but in the case of \(\mathbf{FinVect}\) where the field is the real numbers, it is since the transpose of a scalar is still a scalar and left and right multiplication doesn't matter.

\(B \colon (x^\ast \otimes x)^\ast \stackrel{\sim}{\longrightarrow} x \otimes x^\ast\) is saying \((-)^\ast\) will work on the tensor by components.

Now that we have our rules we just need to prove \(\cap_x = B \circ \cup_x^\ast \circ A^{-1}\) which is the same as showing the first diagram commutes :

This amounts showing that the next two diagrams commutes which it does and we have shown a way to get from one from the other in both directions.

`John wrote: >because these two morphisms will, in general, have a different source: >\[ I^\ast \ne I \] >and a different target: >\[ (x^\ast \otimes x)^\ast \ne x \otimes x^\ast.\] >However, their sources are _canonically isomorphic:_ that is, you can define an 'obvious best' isomorphism >\[ A \colon I^\ast \stackrel{\sim}{\longrightarrow} I \] >and an 'obvious best' isomorphism >\[ B \colon (x^\ast \otimes x)^\ast \stackrel{\sim}{\longrightarrow} x \otimes x^\ast.\] >If you use these, you can show that >\[ \cap_x = B \circ \cup_x^\ast \circ A^{-1} .\] >So, while \\(\cap_x\\) and \\(\cup_x^\ast \\) aren't equal, they come as close as you could hope. Thanks for reminding me. Breaking old habits always time... My habit is always trying to simplify things mainly because of my poor memory and I can't keep up with too many players. This usually leads to clumping similar groups together and I think thats what we do when we use the equal sign. Category theory seems to be clumping things together but doing so while respecting the integrity of each individual and ... we end up getting the best of both worlds? BTW This completely clarified my confusions with the words 'obvious best'! >To find \\(A\\) and \\(B\\), and to prove >\[ \cap_x = B \circ \cup_x^\ast \circ A^{-1} ,\] >is yet another fun puzzle. This is kind of like asking "What two rules do we need to add to make our two diagrams commute (one for each direction) ie make the two compositions equal for each direction?" The rules come in the form of natural isomorphisms, A and B. \\(A \colon I^\ast \stackrel{\sim}{\longrightarrow} I\\) says the identity object and its identity is conserved when using \\((-)^\ast\\) which may or may not be true but in the case of \\(\mathbf{FinVect}\\) where the field is the real numbers, it is since the transpose of a scalar is still a scalar and left and right multiplication doesn't matter. \\(B \colon (x^\ast \otimes x)^\ast \stackrel{\sim}{\longrightarrow} x \otimes x^\ast\\) is saying \\((-)^\ast\\) will work on the tensor by components. Now that we have our rules we just need to prove \\(\cap_x = B \circ \cup_x^\ast \circ A^{-1}\\) which is the same as showing the first diagram commutes : ![cup cap dual](http://aether.co.kr/images/cap_cup_dual.svg) This amounts showing that the next two diagrams commutes which it does and we have shown a way to get from one from the other in both directions.`

While working the puzzle above I ran into two questions:

When you connect the commuting diagrams between \(\cup \leftrightarrow \cap^\ast \text{ and } \cap \leftrightarrow \cup^\ast\) using the \((-)^\ast\) functor, the diagram kind of makes it looks like \((-)^\ast\) is a self adjoint. Does such a thing exist?

In order to show that the diagram commutes, we had to prove two composite morphisms are equal. So for fun I tried expanding this out into a square as below:

Is the identity morphism an isomorphism? Can it have a dual that is not isomorphic to itself?

`While working the puzzle above I ran into two questions: 1. When you connect the commuting diagrams between \\(\cup \leftrightarrow \cap^\ast \text{ and } \cap \leftrightarrow \cup^\ast\\) using the \\((-)^\ast\\) functor, the diagram kind of makes it looks like \\((-)^\ast\\) is a self adjoint. Does such a thing exist? 2. In order to show that the diagram commutes, we had to prove two composite morphisms are equal. So for fun I tried expanding this out into a square as below: ![identity dual](http://aether.co.kr/images/identity_dual.svg) Is the identity morphism an isomorphism? Can it have a dual that is not isomorphic to itself?`

Michael wrote:

Yes. Let's see why! An

isomorphismis a morphism \(f \colon x \to y\) that has a morphism \(g \colon y \to x\) for which$$ gf = 1_x \textrm{ and } fg = 1_y .$$ We call \(g\) an

inverseof \(f\).Is an identity morphism \(1_x \colon x \to x \) an isomorphism? Yes: it has itself as its own inverse! In this example \(y = x\), \(f = 1_x\), \(g = 1_x\), and

$$ 1_x 1_x = 1_x \textrm{ and } 1_x 1_x = 1_x .$$ So the inverse of an identity morphism is itself.

The same argument shows that an identity natural transformation is a natural isomorphism.

`Michael wrote: > Is the identity morphism an isomorphism? Yes. Let's see why! An **isomorphism** is a morphism \\(f \colon x \to y\\) that has a morphism \\(g \colon y \to x\\) for which \[ gf = 1_x \textrm{ and } fg = 1_y .\] We call \\(g\\) an **inverse** of \\(f\\). Is an identity morphism \\(1_x \colon x \to x \\) an isomorphism? Yes: it has itself as its own inverse! In this example \\(y = x\\), \\(f = 1_x\\), \\(g = 1_x\\), and \[ 1_x 1_x = 1_x \textrm{ and } 1_x 1_x = 1_x .\] So the inverse of an identity morphism is itself. The same argument shows that an identity natural transformation is a natural isomorphism.`

Keith wrote:

Let me take the second question first. In a basic math class you'd call

$$ f(x) = a x + b $$ a linear function, but in advanced math we call this

affine, and say a typical linear function of one variable is like$$ f(x) = a x .$$ Linear functions are the simplest functions except for constant functions.

For any vector spaces \(V\) and \(W\) over a field \(k\) we say a map \(f \colon V \to W \) is

lineariff \(f((cv+dw) = c f(v) + d f(w) \) for all \(c,d \in k\) and \(v,w \in V\). We call the set of linear maps \(f \colon V \to k) thedualof \(V\) and it turns out to be a vector space in its own right, which we call \(V^\ast\). It's the starting point for all studies of functions on \(V\). For example, polynomial function \(f \colon V \to k\) are linear combinations of products of linear functions.Here's a nice fact about the dual: the set of all linear maps from a vector space \(V\) to a vector space \(W\) is itself a vector space, and this vector space is isomorphic to \(W \otimes V^\ast\).

`Keith wrote: > I've never been in a Linear algebra, how does one calculate the dual of a vector space? And what is it used for? Let me take the second question first. In a basic math class you'd call \[ f(x) = a x + b \] a linear function, but in advanced math we call this **affine**, and say a typical linear function of one variable is like \[ f(x) = a x .\] Linear functions are the simplest functions except for constant functions. For any vector spaces \\(V\\) and \\(W\\) over a field \\(k\\) we say a map \\(f \colon V \to W \\) is **linear** iff \\(f((cv+dw) = c f(v) + d f(w) \\) for all \\(c,d \in k\\) and \\(v,w \in V\\). We call the set of linear maps \\(f \colon V \to k\) the **dual** of \\(V\\) and it turns out to be a vector space in its own right, which we call \\(V^\ast\\). It's the starting point for all studies of functions on \\(V\\). For example, polynomial function \\(f \colon V \to k\\) are linear combinations of products of linear functions. Here's a nice fact about the dual: the set of all linear maps from a vector space \\(V\\) to a vector space \\(W\\) is itself a vector space, and this vector space is isomorphic to \\(W \otimes V^\ast\\).`

Once you've chosen a basis, the dual of a vector is its transpose \(v^T\). This is because \(f(x)=v^T x\) is a linear functional on a the vector space.

While I am a little fuzzy on what the tensor product means for vectors spaces and what cap and cup should be here.

My intuition is that cap sends elements of \(k\) to a diagonal matrix (which is an element of \(V \otimes V^\ast\)).

$$ \cap_V : a \mapsto a I \quad a \in k \quad I : V \to V$$ While cup is something like the trace, sending linear maps in \(V^\ast \otimes V\) to an element of \(k\).

$$\cup_V : A \mapsto \mathrm{tr}(A) \quad A : V^\ast \to V^\ast $$ If you compose them directly, you get a linear map \(k \to k\) (which is a field homomorphism I believe).

Is that right?

`> I've never been in a Linear algebra, how does one calculate the dual of a vector space? And what is it used for? Once you've chosen a basis, the dual of a vector is its transpose \\(v^T\\). This is because \\(f(x)=v^T x\\) is a linear functional on a the vector space. > Here's a nice fact about the dual: the set of all linear maps from a vector space \\(V\\) to a vector space \\(W\\) is itself a vector space, and this vector space is isomorphic to \\(W \otimes V^\ast\\). While I am a little fuzzy on what the tensor product means for vectors spaces and what cap and cup should be here. My intuition is that cap sends elements of \\(k\\) to a diagonal matrix (which is an element of \\(V \otimes V^\ast\\)). \[ \cap_V : a \mapsto a I \quad a \in k \quad I : V \to V\] While cup is something like the trace, sending linear maps in \\(V^\ast \otimes V\\) to an element of \\(k\\). \[\cup_V : A \mapsto \mathrm{tr}(A) \quad A : V^\ast \to V^\ast \] If you compose them directly, you get a linear map \\(k \to k\\) (which is a field homomorphism I believe). Is that right?`

Puzzle 286: The dual is a contravariant endofunctor.`**Puzzle 286**: The dual is a contravariant endofunctor.`

Right!

`Right!`