You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
Hi everyone. I was wondering whether we can use monad unit natural transformation to form a vector space from a set for example from set of observations to vector of n-tuples , ?
is the set of observations and is the vector space functor.
will this do the trick... first form cartesian product in set i.e . Then use unit monad on the product to embed the product into vector space, forming vector of n-tuples?
For every field , there's an adjunction where
The adjunction leans on the fact that a -linear combination of elements of is really a map of sets . This has the consequence that to give a map is equivalent to give a map , and viceversa (one says the two maps are transposes of each other), so .
Now, every adjunction gives rise to a monad on the 'left' (= the domain of the left adjoint) and a comonad on the 'right' (= the domain of the right adjoint).
To describe them, we need to introduce the unit and counit of an adjunction. The first, , is gotten by choosing to be the transpose of , for each . The second, , is just the dual construction: pick to be the transpose of .
So then the monad and comonad you get are on and on . They satisfy the required laws by virtue of the so-called 'triangle identities', which are identities which characterize the unit and counit of an adjunction.
So to answer your question, yes, we can! The monad (which is what you called ) does exactly that: constructs the set of formal -linear combinations of elements of a set
More down to earth, is the vector space whose preferred basis is , and the unit map maps some element to the vector which, in the preferred basis, is written which picks out just that element
@Matteo Capucci & @Jules Hedges , thank you both for the answer. I am really new to category theory and have no formal higher math education. My background is in biological sciences . I need some time to digest both of your answer.
It's perfectly fine! Feel free to ask questions here, even the dumb-looking ones
will this do the trick... first form cartesian product in set i.e . Then use unit monad on the product to embed the product into vector space, forming vector of n-tuples?
Is this the correct way? or will do just fine...
I don't know what you mean by
I mean cartesian product of the set... because what i understand from my reading so far... unit map will map only single element of the set. For example in the case of powerset monad , the unit will map single element to singleton subset . Thus, I think if we want to map a collection of elements say, to then we have to define the unit map as follows, $$\eta_{x,y,z): x\otimes y\otimes z \to \{x,y,z\}$$
Oh well it depends what you need to. The free vector space monad builds a vector space where is basis, as @Jules Hedges said. Then a vector there would be a combination of elements of , like . This is a way for you to get a 'collection of elements'.
The unit maps pick 'trivial combinations', but that does mean doesn't have more stuff in it
But I'm not sure I'm understanding what exactly bugs you here
I think that what you want is just applying the functor to . I don't think you need monad units to "build a vector space out of a set of examples"
owh... i need clarification that the unit map, will map the whole set X which consist of n elements to the n-tuples vector of vector space of n-dimension... not just pick only one element and form 1 dimensional vector [x].
As Matteo pointed out, the monad unit will just identify some very special elements of given
is a map of sets, so it doesn't form any vector space
is taking any and mapping it to the "base vector" in
I think one source of confusion is this: Monads are endofunctors + some other stuff. Endo- means that they start and end in the same category, in this case .
So the monad, as Matteo said, is formed by considering the functor
This functor takes a set , Generates a vector space using as basis, and then forgets that it is a vector space, and considers it just as a set. This is .
goes from to . It is a function of sets. As I said, it maps any element of to its corresponding "base vector, now considered just as an element of a set", in
Fabrizio Genovese said:
This functor takes a set , Generates a vector space using as basis, and then forgets that it is a vector space, and considers it just as a set. This is .
If i understand you correctly, @Fabrizio Genovese , we can't do anything on UFX that we would like to do in vector space like measure norm, dot product and etc... right?
This is correct, you are in the "wrong category" for that
lives in , so you can just set-like things like counting elements, mapping them to other elements etc.
To consider this kind of stuff, you actually want to operate on , which IS a vector space
Ok. Then what i need is just a Functor .
To be even more precise, you would probably work in , as vector spaces do not have a norm "per se", you have to put it on top of them
There are all sorts of ways to relate to .
Especially if your vector spaces are all finite-dimensional, as I suspect from your use case
In that case you could work in the category , finite dimensional vector spaces, and you will have a canonical way to go from there to , finite dimensional Hilbert spaces
I realize that all this seems pointless if you don't have a formal mathematical training
But the whole point of category theory is that it can make very precise the context in which you are working in. So all this stuff that feels just like a pain in the butt at the moment will pay off big time when the infrastructure you are building gets complicated enough :grinning:
My aim is to formalize a framework where a single construction will capture all necessary pattern. we can then map this pattern to many different context to give meaning of that pattern in that context. I assume this can be achieved using functorial semantic similar to Lawvere. Am i on the right track then?
That's certainly a good approach; I hope you find the formalism you're looking for!
[Mod] Morgan Rogers said:
That's certainly a good approach; I hope you find the formalism you're looking for!
Thank you... i supposed the Lawvere functorial semantic is the way to go right?
Honestly it's a more general principle, but that's a good model!
Come to think of it... I think i ve read somewhere that there is a connection between Lawvere and Monad approach. This is just my hunch... If we can transfer from category of to using the functor then compute the inner product in then what we will get if we use the functor on the resulting inner product? can we somehow capture the inner product pattern from FdHilb back to Set?
What functor are you thinking of? Perhaps you should restrict to finite sets :)
[Mod] Morgan Rogers said:
What functor are you thinking of? Perhaps you should restrict to finite sets :)
I dont have any particular in mind.. perhaps similar functor F as mentioned by @Matteo Capucci ?
For infinite sets, the free vector space construction gives infinite-dimensional vector spaces, and as @Fabrizio Genovese pointed out, there are many (non-equivalent) ways to equip infinite-dimensional vector spaces with norms to produce Hilbert spaces.
(and the result in particular will not be , where "fd" stands for finite dimensional :grinning_face_with_smiling_eyes: )
Yes, in that case you should start from the category of finite sets
I have done some reading on Frobenius monad by Street. Can it somehow capture the inner product pattern of fdHilb?
say, if i start from category of finite set?
I'm not familiar with these myself; do you know of any examples of Frobenius monads on the category of finite sets?
To be honest.. i dont know. Just that, from the definition.. it kinda can somehow capture the inner product.
Start by identifying what exactly it is you want to build into your formalism. What is it that you want to do with the vector spaces? How do you use the norm in the examples you're familiar with? Once you've identified that, you can move into category theory, identifying the categories involved based on the data you're using, and identifying the categorical constructions you'll need based on those which you actually use when reasoning about the cases which are familiar to you.
This will mean that all of the category theory you do will be grounded in things you understand well, but you'll be able to leverage the abstraction whenever it's convenient to you.
The Frobenius monad paper seems too specific to be immediately relevant based on the information you've shared. Start from the bottom and work your way up rather than expecting to find the categorical gadget for you straight away :grinning_face_with_smiling_eyes:
Thank you for your advice... will try to find the answer to your questions first.
Matteo Capucci said:
- is the 'free vector space' functor: it sends a set to the vector space of -linear combinations of elements of .
[...] a -linear combination of elements of is really a map of sets .
By the way, is only the free vector space on when is a finite set. In algebra, "linear combination" means finite linear combination, so only when is finite can we treat every map of sets as a -linear combination of elements of .
In the general case the free vector space on , which I call , can be identified with the vector space of functions that vanish except at finitely many points.
Any function gives a linear map and also a linear map . So we have a covariant and a contravariant way to turn a set into a vector space, but for finite vector spaces these can be identified, so we get covariant and contravariant functors that agree on objects... very handy!
Gosh, you got me there. Classic me: discount the easy bits to go to the real meat, and overlook important details.
I got this correction from someone else, once upon a time, so now I'm passing it on to you. :upside_down: I've been needing these covariant and contravariant functors and their interaction a lot in my work on finite-state Markov chains, so they're always on my mind now.
[Mod] Morgan Rogers said:
Start by identifying what exactly it is you want to build into your formalism. What is it that you want to do with the vector spaces? How do you use the norm in the examples you're familiar with? Once you've identified that, you can move into category theory, identifying the categories involved based on the data you're using, and identifying the categorical constructions you'll need based on those which you actually use when reasoning about the cases which are familiar to you.
I am working with a time series dataset sampled uniformly using multichannel sensors. Let's consider just 1 channel time series and called it , we can embed this 1-d time series to higher dimension using delay embedding (Taken's theorem). Is this operation captured by the unit morphism?
Can the unit map be defined by composition of functions?
John Baez said:
Matteo Capucci said:
- is the 'free vector space' functor: it sends a set to the vector space of -linear combinations of elements of .
[...] a -linear combination of elements of is really a map of sets .
By the way, is only the free vector space on when is a finite set. In algebra, "linear combination" means finite linear combination, so only when is finite can we treat every map of sets as a -linear combination of elements of .
In the general case the free vector space on , which I call , can be identified with the vector space of functions that vanish except at finitely many points.
Any function gives a linear map and also a linear map . So we have a covariant and a contravariant way to turn a set into a vector space, but for finite vector spaces these can be identified, so we get covariant and contravariant functors that agree on objects... very handy!
I am working with time series... so the category of should be appropriate, right?
It depends on whether all the sets you're dealing with are finite or not.
If you're doing stuff with computers maybe all your sets are finite. (Even so, sometimes thinking about this stuff mathematically brings in infinite sets.)
Hakimi Rashid said:
I am working with a time series dataset sampled uniformly using multichannel sensors. Let's consider just 1 channel time series and called it , we can embed this 1-d time series to higher dimension using delay embedding (Taken's theorem). Is this operation captured by the unit morphism?
Succinctly, no. Specifying the data as you have is equivalent to giving a function , where is the forgetful functor as above. The fact that this functor is the right adjoint in an adjunction means that this function must factor through the unit map along (the underlying function of) a linear map ; specifically, this is the function which sends to that same sum viewed as an element of . This is purely linear algebra; all of the functions involved completely ignore the dynamic structure of the time series .
Takens' theorem uses ideas from Whitney's embedding theorem for embedding finite-dimensional real manifolds into higher dimensional Euclidean space. This result lies in differential geometry, and the linear structure of is not really relevant here.
Can the unit map be defined by composition of functions?
I'm not really sure what you're asking here; the unit is intrinsic data of the adjunction. For example, if we take the one-element set , the unit map at is the function (the latter being the vector space of expressions of the form with ) sending to ; I don't see how this could be decomposed in any meaningful way.
It's plausible that there is another adjunction out there that could be helpful to you. Has anyone tried to make the Whitney embedding theorem functorial?
Functorial wrt what maps? A cheap way to get an embedding of a compact manifold in a Euclidean space is to take a partition of unity subordinate to a good (say) open cover by charts. A good open cover by charts is more-or-less equivalent to a groupoid internal to the coproduct completion of the category Cart of cartesian spaces. The category of manifolds is some kind of colimit completion of this (eg inside the category of diffeological spaces = concrete sheaves on Cart). Alternatively, one can think of maps between manifolds as being certain anafunctors between these groupoids. It's presumably possible to think of some way of getting data including partitions of unity into this picture. Then the embedding of the manifold represented by one of these groupoids with a partition of unity could be constructed directly from the groupoid. The naive thing, assuming the partitions of unity are respected on the nose by anafunctors presumably loses too much. But I can imagine having some modulating data that allows for more flexibility.
Just some random thoughts.
That might be a bit of a deep dive terminology-wise for @Hakimi Rashid :sweat_smile:
I was wondering if we could restrict Whitney embedding in order to make it functorial with respect to smooth maps of manifolds. If so, perhaps that functor would have an adjoint, and the resulting adjunction might be closer to what Hakimi was looking for. I'm not super optimistic that such a functor or adjunction exists, given that the embedding as you (@David Michael Roberts) describe it involves a partition of unity (and selecting one of those involves a non-trivial choice!) but I hope this is at least an indication of how to make these ideas might be made categorical.
[Mod] Morgan Rogers said:
Hakimi Rashid said:
I am working with a time series dataset sampled uniformly using multichannel sensors. Let's consider just 1 channel time series and called it , we can embed this 1-d time series to higher dimension using delay embedding (Taken's theorem). Is this operation captured by the unit morphism?
Succinctly, no. Specifying the data as you have is equivalent to giving a function , where is the forgetful functor as above. The fact that this functor is the right adjoint in an adjunction means that this function must factor through the unit map along (the underlying function of) a linear map ; specifically, this is the function which sends to that same sum viewed as an element of . This is purely linear algebra; all of the functions involved completely ignore the dynamic structure of the time series .
Takens' theorem uses ideas from Whitney's embedding theorem for embedding finite-dimensional real manifolds into higher dimensional Euclidean space. This result lies in differential geometry, and the linear structure of is not really relevant here.
If i understand it correctly, the unit map will only embed n-element set into same n-dimension vector , and not any other arbitrary lower or higher dimension...?
[Mod] Morgan Rogers said:
That might be a bit of a deep dive terminology-wise for Hakimi Rashid :sweat_smile:
Unfortunately yes. I am still learning... quite a steep curve for me.
No worries. It's nice that you're making the effort to look for the connections! I wish you the best of luck :cartwheel:
I think I get some of it. If I want to know what is possible or not with the unit map, i have to know what is actually happening under the hood i.e, i have to decompose monad to adjunction between 2 categories, right?
so, for example, if we start from the category of , apply functor , we get vectors of which our elements are the bases. In , we can do dot product between 2 vectors, we get . finally, we apply functor on the result to get back to our starting category.
So, in essence, what we have done cannot be captured by unit map alone. maybe unit composed with something, right?
It is only occurring me now that while we can look at the restriction of the free vector space functor to the category of finite sets, we can't restrict the monad: assuming that we're working over an infinite field (), there is no forgetful functor , since the underlying sets of the vector spaces are infinite...
But in any case, what's missing from your description is not that (we can still use the usual forgetful functor here), but rather a way to get from to inside ; the obvious diagonal map is not linear!
[Mod] Morgan Rogers said:
It is only occurring me now that while we can look at the restriction of the free vector space functor to the category of finite sets, we can't restrict the monad: assuming that we're working over an infinite field (), there is no forgetful functor , since the underlying sets of the vector spaces are infinite...
I dont understand... I thought the underlying set is finite since we apply the free functor to finite set forming finite dimensional vector space? The field only serve as scalar coefficient right? am i missing something?
But in any case, what's missing from your description is not that (we can still use the usual forgetful functor here), but rather a way to get from to inside ; the obvious diagonal map is not linear
Why do we need diagonal map? Why not linear?
The underlying set of the vector space is the set of elements of that space. So the underlying set of is... , without the additive and scalar multiplicative structure.
You're trying to describe the norm, or the square of the norm, on a space in terms of its inner product, right? If you want to describe the norm of an element using an inner product , you need a way to map that to the element in . But the diagonal mapping is not linear, so you can't perform this duplication operation in .
So, we need more constructions than what could provide to describe operation that we can do in vector space? Based on what you said about diagonal map... then, perhaps bialgebras?
That could work! :innocent:
Picking a basis on a finite-dimensional vector space makes it into a commutative Frobenius algebra, where the comultiplication has
and the multiplication has
if
if
i have read about frobenius algebra... frobenius object by definition have diagonals, and also comes with bilinear form. But how can we use in monad?
This theme was explored further here
However, they may go straight to describing orthonormal bases in finite-dimensional Hilbert spaces. There should be a similar (but different) story for bases in finite-dimensional vector spaces.
I don't know what "how can we use in monad?" means.
owh.. i typed before i saw your answer...
I have read paper by Street on Frobenius monad... could that capture the same thing but in monadic way? http://web.science.mq.edu.au/~street/Frob.pdf
A Frobenius monad in Vect is called a Frobenius algebra; these were invented much earlier, and if you just want to talk about duplication of basis elements in a vector space (the map described above, which sends to ) you don't need fancy modern stuff about Frobenius monads.
Street's paper is great but I don't see how it would help you. On the other hand, I don't really understand what you're trying to do.
My aim is to describe and formalize the analysis methods i used in the language of category theory. Maybe then, hopefully it can be turn into framework somehow and generalize to many context. I dont know if this possible...
Based on what ive read so far... there are 2 ways to do this... either using monad or using functorial semantic aka Lawvere theory, right? so, thats why i wanted to know more about monad and whether it can help to achieved that goal. Also, which way is better and simpler?
It sounds like you've read about 2 of the many ways of reaching generalizations through category theory. If the situation you're working with doesn't naturally involve a monad (which it doesn't appear to), it doesn't make sense to try to force one upon it. Monads (and other category-theoretic gadgets) can pop up in unexpected places, so you might encounter a relevant one later on, but the work of expressing all of the ingredients of your situation categorically has to come first. Once you know what ingredients are involved, it should become clearer what context you should be working in, and I'm sure there will be someone with relevant expertise here to help you.
[Mod] Morgan Rogers said:
It sounds like you've read about 2 of the many ways of reaching generalizations through category theory. If the situation you're working with doesn't naturally involve a monad (which it doesn't appear to), it doesn't make sense to try to force one upon it.[...]
What are other ways of reaching the goal? If you can list them, that would be really helpful. Maybe i can explore more options if things dont work out...
Step 1: Find the right categorical setting.
Step 2: Express the process categorically.
Step 3: Identify the key ingredients and distil them.
Step 4: Find the relevant literature.
There are steps beyond Step 4, regarding what you can do once you have a categorified version of your argument or construction in hand, but there's no point getting too far ahead. To give you fair warning: it's entirely possible that you could do the work of Steps 1 to 3 and find at Step 4 that from a categorical perspective, what's happening is a common phenomenon. This might seem disappointing at first, but:
Thanks a lot for the guidance and tips @[Mod] Morgan Rogers. I really appreciate it. Looks like there's gonna be lot of works and obstacles ahead... But I'm up for it. Thanks again.
Yes, this sort of process often takes time. It's fun to recall examples:
When @Brendan Fong and I came up with a category-theoretic description of electrical circuits, I thought it would be easy since circuit diagrams look like string diagrams, a well-known tool in category theory. I worked out the basic idea in May 2010 here. But there were some "details" that seemed hard to check, so I gave this as a thesis project to Brendan. He developed a new technique, the theory of decorated cospans and decorated corelations, to fill in these "details". By February 2015 he finished a paper on decorated cospans and by April 2015 we came out with a paper solving the problem: A compositional framework for passive linear networks.
However, Brendan later realized that more use of decorated corelations would help explain some mysterious ad hoc steps in our construction. Our paper took a long time to referee, and when we finally got the referee's report, which demanded extensive changes, we rewrote the paper to include a lot more material on decorated corelations. The result was a much deeper paper, which we finished in November 2018. Also in 2018 Brendan came out with a a paper on decorated corelations.
It later turned out that there were some problems with the decorated cospan framework, which can be fixed in a number of ways. My favorite way is the theory of structured cospans, which @Kenny Courser did his thesis on. He finished his thesis in August 2020, and we wrote a paper on structured cospans based on this material, which is close to being published - we finished the first version in November 2019 but we're almost done dealing with the referee's corrections now, and with luck the editor will accept this new version!
This seems like a lot of work to figure out what's going on with electrical circuits - over a decade! Was it really worthwhile? I think so. Electrical circuits are interesting and it's good to understand them clearly. Further, the ideas apply to many other subjects: Brendan, @Blake Pollard and I wrote a paper applying them to Markov processes, Blake and I wrote a paper applying them to chemical reaction networks, @Jade Master and I wrote a paper applying them to Petri nets, and there are many more applications waiting to be developed.
I really like @[Mod] Morgan Rogers' description of the process. I have never attempted to explain how to do applied category theory! I think one crucial prerequisite is to learn a lot of category theory and a lot about the subject you're trying to apply it to - and especially the mathematics of the subject you're trying to apply it to.
For example: someone might be very familiar with electrical circuits, but if they don't know some graph theory - especially the many different definitions of graph - it would be hard to get anywhere trying to apply category theory to electrical circuits.
Feel free to quote me on it if you think it's a useful description! It's a process that can be boiled down to a couple of sentences, but that hides the sheer amount of work and refinement that's involved. The beauty is that the hard work is also hidden in the finished product: once you have the right setting, everything starts to flow smoothly.