Following up on the deep learning and toposes-post, I was planning to do something on the logic of neural networks.
Prepping for this I saw David Spivak’s paper Learner’s Languages doing exactly that, but in the more general setting of ‘learners’ (see also the deep learning post).
And then … I fell under the spell of PolyPoly.
Spivak is a story-telling talent. A long time ago I copied his short story (actually his abstract for a talk) “Presheaf, the cobbler” in the Children have always loved colimits-post.
Last week, he did post Poly makes me happy and smart on the blog of the Topos Institute, which is another great read.
If this is way too ‘fluffy’ for you, perhaps you should watch his talk Poly: a category of remarkable abundance.
If you like (applied) category theory and have some days to waste, you can binge-watch all 15 episodes of the Poly-course Polynomial Functors: A General Theory of Interaction.
If you are more the reading-type, the 273 pages of the Poly-book will also kill a good number of your living hours.
Personally, I have no great appetite for category theory, I prefer to digest it in homeopathic doses. And, I’m allergic to co-terminology.
So then, how to define PolyPoly for the likes of me?
PolyPoly, you might have surmised, is a category. So, we need ‘objects’ and ‘morphisms’ between them.
Any set AA has a corresponding ‘representable functor’ sending a given set SS to the set of all maps from AA to SS
yA : Sets→SetsS↦SA=Maps(A,S)yA : Sets→SetsS↦SA=Maps(A,S)
This looks like a monomial in a variable yy (yy for Yoneda, of course), but does it work?
What is y1y1, where 11 stands for the one-element set {∗}{∗}? Maps(1,S)=SMaps(1,S)=S, so y1y1 is the identity functor sending SS to SS.
What is y0y0, where 00 is the empty set ∅∅? Well, for any set SS there is just one map ∅→S∅→S, so y0y0 is the constant functor sending any set SS to 11. That is, y0=1y0=1.
Going from monomials to polynomials we need an addition. We add such representable functors by taking disjoint unions (finite or infinite), that is
∑i∈IyAi : Sets→SetsS↦⨆i∈IMaps(Ai,S)∑i∈IyAi : Sets→SetsS↦⨆i∈IMaps(Ai,S)
If all AiAi are equal (meaning, they have the same cardinality) we use the shorthand IyAIyA for this sum.
The objects in PolyPoly are exactly these ‘polynomial functors’
p=∑i∈Iyp[i]p=∑i∈Iyp[i]
with all p[i]∈Setsp[i]∈Sets. Remark that p(1)=Ip(1)=I as for any set A there is just one map to 1, that is yA(1)=Maps(A,1)=1, and we can write
p=∑i∈p(1)yp[i]
An object p∈Poly is thus described by the couple (p(1),p[−]) with p(1) a set, and a functor p[−]:p(1)→Sets where p(1) is now a category with objects the elements of p(1) and no morphisms apart from the identities.
We can depict p by a trimmed down forest, Spivak calls it the corolla of p, where the tree roots are the elements of p(1) and the tree with root i∈p(1) has one branch from the root for any element in p[i]. The corolla of p=y2+2y+1 looks like

If M is an m-dimensional manifold, then you might view its tangent bundle TM set-theoretically as the ‘corolla’ of the polynomial functor MyRm, the tree-roots corresponding to the points of the manifold, and the branches to the different tangent vectors in these points.
Morphisms in Poly are a bit strange. For two polynomial functors p=(p(1),p[−]) and q=(q(1),q[−]) a map p→q in Poly consists of
- a map ϕ1:p(1)→q(1) on the tree-roots in the right direction, and
- for any i∈p(1) a map q[ϕ1(i)]→p[i] on the branches in the opposite direction
In our manifold/tangentbundle example, a morphism MyRm→y1 sends every point p∈M to the unique root of y1 and the unique branch in y1 picks out a unique tangent-vector for every point of M. That is, vectorfields on M are very special (smooth) morphisms MuRm→y1 in Poly.
A smooth map between manifolds M→N, does not determine a morphism MyRm→NyRn in Poly because tangent vectors are pushed forward, not pulled back.
If instead we view the cotangent bundle T∗M as the corolla of the polynomial functor MyRm, then everything works well.
But then, I promised not to use co-terminology…
Another time I hope to tell you how Poly helps us to understand the logic of learners.
Comments