Category Theory
Zulip Server
Archive

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.


Stream: learning: questions

Topic: Imperfect world


view this post on Zulip Soichiro Fujii (Apr 30 2020 at 12:10):

Hi, I just noticed that the following (apparently common) conventions are incompatible with each other, if one works in a sufficiently general setting.

The former convention may be defended on the basis of the (very common) Leibniz convention for composition. The latter can be justified because this lets us view the bicategory Prof\mathscr{P}rof of profunctors as an extension of Cat\mathscr{C}at (as well as of Catcoop\mathscr{C}at^\mathrm{coop}), rather than an extension of Catop\mathscr{C}at^\mathrm{op} or Catco\mathscr{C}at^\mathrm{co}.

However, if one works in the enriched setting where the base monoidal category is not symmetric (or even where the base is a bicategory), then unfortunately the above conventions are incompatible. More precisely, one cannot view the representable presheaf C(,x)\mathcal{C}(-,x) as a profunctor (between C\mathcal{C} and the unit category I\mathcal{I}). (In this general setting, one defines profunctor as a family of objects in the base monoidal category equipped with a suitable two-sided action; see e.g., Section 3 of Enriched categories and cohomology by Street.)

So how do you deal with this difficult situation?

view this post on Zulip sarahzrf (Apr 30 2020 at 14:32):

personally i deal with it poorly

view this post on Zulip sarahzrf (Apr 30 2020 at 14:32):

(sorry)

view this post on Zulip Fabrizio Genovese (Apr 30 2020 at 14:57):

I define the first thing as you do when you say "as opposed to". I never use the \circ to denote composition, but always the ;;. This is because I mainly work with diagrams so writing f;gf;g to stand for XfYgZX \xrightarrow{f} Y \xrightarrow{g} Z is more intuitive for me. :slight_smile:

view this post on Zulip John Baez (Apr 30 2020 at 15:22):

So how do you deal with this difficult situation?

I complain about it, try various conventions, get annoyed, and ultimately shrug my shoulders and decide to wait for civilization to collapse, hoping the next civilization adopts more consistent notation.

The ultimate problem is that we like to write fgf \circ g to mean "do gg first then gg" as if we were reading from right to left, yet we write f ⁣:xyf \colon x \to y, with the arrow going from left to right.

So, one solution is to consistently write from left to right. This means we should use f;gf ; g to mean "do ff first, then gg. This is not too hard for people to accept until we have to apply functions to arguments; then we should say

(x)(f;g)=((x)f)g (x) (f; g) = ((x)f)g

and most people find this upsetting, since they've been trained in the opposite convention (except when using calculators with reverse Polish notation). It's fun to think about how this convention would work:

(x)sin2dxd=(x)sin(x)cos2 \displaystyle{ (x)\sin^2 \frac{d}{xd} = (x)\sin \, (x)\cos 2 }

The other convention is to systematically write from right to left, which also upsets people:

yx:f y \leftarrow x : f

view this post on Zulip Nathaniel Virgo (Apr 30 2020 at 15:45):

John Baez said:

most people find this upsetting, since they've been trained in the opposite convention (except when using calculators with reverse Polish notation).

Or C++:

x.f().g()

I think it'd be quite nice if we wrote xfgx f g for f;gf;g applied to xx, though I don't think I'd use that in a paper.

view this post on Zulip Sam Tenka (Apr 30 2020 at 17:10):

@Fabrizio Genovese

Could f:YXf:Y \leftarrow X be less upsetting than the other possibilities? (My friends have teased me about this notation, so perhaps the answer is no.)

Here's my reasoning. There seem to be 4 possibilities (when writing in plain text on a computer):
(a) f:YXf:Y \leftarrow X
(b) f:XYf:X \to Y
(c) YX:fY \leftarrow X:f
(d) XY:fX \to Y:f,

I often use (a). The styles (a) and (c) have the advantage that they align with conventions for function composition, matrix multiplication, and so on. The styles (a) and (b) have the advantage that they align with conventions for judgements in type theory. The styles (a) and (d) have the advantage that the target is written more closely to f. This is nice because f's type is more like the type of its target than of its source. More precisely, only one of the two hom functors is covariant! This corresponds to a common goal-oriented approach to interactive proving and to vanilla functional programming. So, for all three matchings on the tetrahedral graph, (a)'s pair wins!

view this post on Zulip Fabrizio Genovese (Apr 30 2020 at 22:28):

B is the only viable one for me.All the others have the great disadvantage to be read right to left, that in a left-to-right language is very confusing imho

view this post on Zulip Fabrizio Genovese (Apr 30 2020 at 22:29):

In any case, as long as one chooses two symbols for composition (e.g. f;gf;g and fgf \circ g or even better fgfg) I don't see too much ambiguity in using both

view this post on Zulip Fabrizio Genovese (Apr 30 2020 at 22:30):

"Let's consider the composition f;g:XZf;g: X \to Z. Then on an element xXx \in X we compute gf(x)gf(x) ..." Makes perfect sense to me

view this post on Zulip Fabrizio Genovese (Apr 30 2020 at 22:30):

So I don't really get what this fuss is about. You don't have to pick one convention and stick to it, it's not a religion. You can just be very opportunistic and use whatever you see fit whenever you see fit.

view this post on Zulip Fabrizio Genovese (Apr 30 2020 at 22:32):

And, as usual, the point is: Notation should help you writing mathematics, not the other way around. So as long as something works for you (e.g. it helps you reasoning) then go for it :slight_smile:

view this post on Zulip John Baez (Apr 30 2020 at 22:37):

((x)f)g makes a lot of sense: you start with x, you apply f to it, then you apply g. But we've all been trained to write g(f(x)) so it looks very unsettling to see ((x)f)g.

view this post on Zulip Sam Tenka (Apr 30 2020 at 23:03):

Fabrizio Genovese said:
B is the only viable one for me.All the others have the great disadvantage to be read right to left, that in a left-to-right language is very confusing imho
I think I see what you're saying.

For me, I read all of them from left to right, just the same way that I read the membership "fYXf \in Y^X" or the conditional probability "Prob(coin Y | bias X)" from left to right. For example, I read (A) as:

That way, halfway through reading, what's in my brain is:

This preference is very personal though!

view this post on Zulip Nathanael Arkor (Apr 30 2020 at 23:08):

John Baez said:

((x)f)g makes a lot of sense: you start with x, you apply f to it, then you apply g. But we've all been trained to write g(f(x)) so it looks very unsettling to see ((x)f)g.

No time to start a culture shift like the present.

view this post on Zulip Reid Barton (Apr 30 2020 at 23:09):

You can find some old papers by Barr, I believe, if you want to see how good or bad an idea this might be.

view this post on Zulip John Baez (May 01 2020 at 00:34):

I have no desire to spend any time trying to reform the world in this way.... well, except to raise the idea that there are other ways we could write.

view this post on Zulip Soichiro Fujii (May 01 2020 at 01:17):

Thanks for the comments. Yes, the diagrammatic order convention f;gf;g makes a lot of sense, so it is unfortunate that the other convention has become so common.

But the convention to define a profunctor H ⁣:ABH\colon \mathcal{A}\longrightarrow \mathcal{B} as a functor H ⁣:Bop×ASetH\colon \mathcal{B}^\mathrm{op}\times\mathcal{A}\longrightarrow \mathbf{Set} also involves some “reversal”, so I am not sure if the diagrammatic order convention alone solves the problem completely...

For example, even using the diagrammatic order convention throughout (but using the above convention for profunctors), the composition of the profunctors H ⁣:ABH\colon\mathcal{A}\longrightarrow\mathcal{B} and K ⁣:BCK\colon\mathcal{B}\longrightarrow \mathcal{C} is given by (H;K)(c,a)=bBK(c,b)×H(b,a)(H;K)(c,a)=\int^{b\in\mathcal{B}}K(c,b)\times H(b,a), which might lead to some notational inconsistency sometime later.

view this post on Zulip Matteo Capucci (he/him) (May 02 2020 at 13:50):

I try to never write down a composition explictly exactly for this reason. The convention is cursed and alternative notation is not widespread.
My go-to alternatives are:

Of course I'm not always able to do it, but I strive.

view this post on Zulip Jules Hedges (May 02 2020 at 13:59):

I'm going to stand up for just not caring. I write fgfg in notes for myself and gfg \circ f in papers, I think life's far too short to worry about something so tedious

view this post on Zulip John Baez (May 02 2020 at 14:02):

I write things both ways; this is not something I actually lose sleep over. Nonetheless it's interesting to me how our conventions have become locked into this problem, so I enjoy talking about it once or twice a year.

view this post on Zulip Jules Hedges (May 02 2020 at 14:03):

Matrix multiplication is backwards too, but somehow nobody cares about that

view this post on Zulip Henry Story (May 02 2020 at 14:04):

Nathaniel Virgo said:

Or C++: x.f().g()

It's fun to think that OO notation had it right all along.

"Hello World!".length

:smiling_devil:

view this post on Zulip Jules Hedges (May 02 2020 at 14:04):

If you start with a vector vv and then you apply a linear map MM and then apply a linear map NN, the resulting vector is NMvNMv

view this post on Zulip Jules Hedges (May 02 2020 at 14:05):

So if you write your categorical composition as ;; then you have to be careful that the matrix representing the linear map M;NM;N is NMNM

view this post on Zulip Reid Barton (May 02 2020 at 14:06):

I think "nobody cares about that" because it's consistent with the other conventions that everyone uses. (NM)v=N(Mv)(NM)v = N(Mv).

view this post on Zulip Reid Barton (May 02 2020 at 14:07):

It would be very bad to write it the other way!

view this post on Zulip Jules Hedges (May 02 2020 at 14:07):

It's not consistent with the way you write diagrams in the category of vector spaces V1MV2NV3V_1 \overset{M}\longrightarrow V_2 \overset{N}\longrightarrow V_3

view this post on Zulip John Baez (May 02 2020 at 14:08):

Lots of people get upset about this, but it's just a special case of how function composition is backward; there's nothing special about matrix multiplication here.

view this post on Zulip Reid Barton (May 02 2020 at 14:08):

Of course it is, because gfgf is how you write the composition of functions.

view this post on Zulip John Baez (May 02 2020 at 14:09):

Jules seems to be pointing out that doing M first and then N is written MN when you do matrix multiplication, but I'm saying this annoying fact is just a fact about how we write the composition of anything.

view this post on Zulip John Baez (May 02 2020 at 14:10):

In the the theory of Markov processes they multiply vectors by matrices on the right so in Jules' example they'd write vMNvMN for a vector v in V1V_1.

view this post on Zulip John Baez (May 02 2020 at 14:11):

They want to do it this way because they think about the relation between matrix multiplication and composing paths, and most people write γ1γ2\gamma_1 \gamma_2 for moving first along a path γ1\gamma_1 and then along a path γ2\gamma_2.

view this post on Zulip Jules Hedges (May 02 2020 at 14:11):

That issue should come up in representation theory of quivers too, I guess?

view this post on Zulip John Baez (May 02 2020 at 14:12):

It should, yes. Right now I forget what people usually do.

view this post on Zulip John Baez (May 02 2020 at 14:13):

Anyway, I sometimes tell people if they can't deal with a problem like this they're not cut out for math.

view this post on Zulip Jules Hedges (May 02 2020 at 14:13):

If you think the order of composition is annoying, wait till you find out how many pointless meetings you have to do as an academic...

view this post on Zulip Henry Story (May 02 2020 at 14:15):

That's without counting people who write string diagrams starting from the bottom scanning left to right, and others who do it scanning right to left :-)
https://twitter.com/bblfish/status/1221425869899599873

@BartoszMilewski Best to read the article "Category Theory Using String Diagrams" last after going through Bartosz course and reading the bicategories of relations. Also annotate the diagrams in the article carefully, for it to make sense, and try writing a few equations like this https://twitter.com/bblfish/status/1221425869899599873/photo/1

- The 🐟‍‍ BabelFish (@bblfish)

view this post on Zulip John Baez (May 02 2020 at 14:15):

Right, and I'm left-handed, and people force me to write dragging my hand over the stuff I've just written.

view this post on Zulip John Baez (May 02 2020 at 14:15):

Life is cruel.

view this post on Zulip Jules Hedges (May 02 2020 at 14:16):

String diagrams are different, people who write string diagrams bottom-to-top are Objectively Wrong and possibly heretical

view this post on Zulip John Baez (May 02 2020 at 14:16):

I agree with that of course. When I become king they'll be punished.

view this post on Zulip John Baez (May 02 2020 at 14:17):

But physicists starting with Feynman always write Feynman diagram bottom-to-top since t increases up the page in (x,t)(x,t) coordinates.

view this post on Zulip John Baez (May 02 2020 at 14:18):

My advisor complained that physicists should use (t,x)(t,x) because tt is the independent variable.

view this post on Zulip Fabrizio Genovese (May 02 2020 at 14:19):

Jules Hedges said:

String diagrams are different, people who write string diagrams bottom-to-top are Objectively Wrong and possibly heretical

Well, considering that this is the CQM convention and CQM is what made string diagrams popular in the first place, I'd say everyone else is wrong. In any case the right standard is clearly writing left-to-right, wrt clarity and space taken in papers.

view this post on Zulip John Baez (May 02 2020 at 14:20):

James Dolan tries to do everything logically: he writes left-to-right and then top-to-bottom. So when he graphs things the first variable goes across the page and the second one goes down... I think.

view this post on Zulip Oscar Cunningham (May 02 2020 at 14:20):

Does writing string diagrams left-to-right mean that \circ is left-to-right or \otimes?

view this post on Zulip John Baez (May 02 2020 at 14:20):

The title of this thread, "Imperfect world", is exactly right. We live in an imperfect world.

view this post on Zulip Fabrizio Genovese (May 02 2020 at 14:22):

Oscar Cunningham said:

Does writing string diagrams left-to-right mean that \circ is left-to-right or \otimes?

\circ is left to right, \otimes is top to bottom. The point is that in this way "the flow" of the diagram is left-to-right

view this post on Zulip Fabrizio Genovese (May 02 2020 at 14:23):

(modulo snake equations etc, obviously)

view this post on Zulip Oscar Cunningham (May 02 2020 at 14:24):

That does seem like the nicest convention.

view this post on Zulip John Baez (May 05 2020 at 05:32):

Okay, I'll get a job in Ulan Bator and learn Mongolian.

view this post on Zulip Daniel Geisler (May 05 2020 at 06:42):

First lesson in Mongolian.

view this post on Zulip Fabrizio Genovese (May 05 2020 at 10:00):

I always found mongolian script one of the most beautiful around. Unfortunately I don't think I'll ever find the time to learn mongolian, too many languages to tackle already T_T

view this post on Zulip John Baez (May 05 2020 at 14:17):

Rongmin Lu said:

Oops... turns out Mongolian is written left-to-right, sorry! :sweat_smile:

Now I have to cancel my plane ticket!

view this post on Zulip James Wood (May 06 2020 at 18:33):

Jules Hedges said:

Matrix multiplication is backwards too, but somehow nobody cares about that

My solution to this, which I use with good reason in my recent paper, is to primarily work with row vectors.