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: Intuition for cospans


view this post on Zulip Eric Forgy (Jan 21 2021 at 19:07):

Hello,

Over the past several weeks, I've developed some rudimentary intuition for spans. I think of them as generalizations of functions (i.e. multi-valued partial functions). An endomorphism in Span(Set)\mathbf{Span(Set)} is a directed graph.

Now, I am hoping to develop a similar intuition for cospans. I can see that it is related to inputs and outputs, but my intuition kind of stops there at the moment. How should we think about cospans in terms of familiar things? "Familiar" being vaguely what someone with a degree in physics/engineering, but little to no exposure to CT, might know.

view this post on Zulip David Egolf (Jan 21 2021 at 19:17):

Can't you make a cospan into a span by working in an opposite category? Then maybe your intuition would apply already to that?

view this post on Zulip Eric Forgy (Jan 21 2021 at 19:23):

To some extent :blush:

For example,
{}
Span(Set)Cospan(Setop),\mathbf{Span(Set)} \cong \mathbf{Cospan(Set^{op})},
{}
but how about Cospan(Set)\mathbf{Cospan(Set)}?

Maybe that helps more than I original thought if I try to think about Span(Setop),\mathbf{Span(Set}^\mathsf{op}), but my intuition is not so great with op{}^\mathsf{op} either :sweat_smile:

However, I supect their should be some ways to develop intuition directly with cospans and that is what I'm after :blush:

view this post on Zulip Jules Hedges (Jan 21 2021 at 19:29):

If you think of spans as "proof-relevant relations", then you can think of a cospan as a "proof-relevant corelation". (Like a relation is a subset of a cartesian product, a corelation is a quotient of a disjoint union. If you didn't meet them before, they're super intuitive once you've drawn a bunch of dots with some circles around them)

view this post on Zulip Eric Forgy (Jan 21 2021 at 19:38):

This has a nice intro :+1:

but the example with directed graphs seems special since a directed graph is already a span, so the example is a cospan of spans. Still helpful :+1:

This also has a nice discussion:

view this post on Zulip John Baez (Jan 21 2021 at 21:11):

Eric Forgy said:

To some extent :blush:

For example,
{}
Span(Set)Cospan(Setop),\mathbf{Span}(\mathsf{Set}) \cong \mathbf{Cospan}(\mathrm{Set}^{\rm op}),
{}
but how about Cospan(Set)\mathbf{Cospan(Set)}?

Well,

Cospan(Set)Span(Setop).\mathbf{Cospan(\mathsf{Set})} \cong \mathbf{Span(\mathsf{Set}^{\rm op})}.

When developing the theory of span or cospan (bi)categories, it's good to know that

Span(C)Cospan(Cop)\mathbf{Span}(\mathsf{C}) \cong \mathbf{Cospan}(\mathsf{C}^{\rm op})

so any theorem about span categories is also a theorem about cospan categories, and vice versa!

However, spans in Set\mathsf{Set} are very different than cospans in Set\mathsf{Set}, so it's good to know a battery of theorems about each one.

view this post on Zulip Jade Master (Jan 22 2021 at 02:12):

Spans and cospans between two fixed sets X and Y are related as well. Given a cospan XAY X \to A \leftarrow Y you can get a span XBY X \leftarrow B \to Y where B contains an element (x,y) mapping to x and y whenever x and y map to the same element in the cospan. This is a 0-dimensional version of the comma category construction. Dually given a span XBYX \leftarrow B \to Y , you can get a cospan by taking preimages...i .e. a cospan mapping x and y to e whenever there is an element in your span mapping to x and y. This is the 0-dimensional cocomma construction.

view this post on Zulip Jade Master (Jan 22 2021 at 02:17):

iirc. These two constructions form an idempotent adjunction and factor through Bool-profunctors between X and Y.

view this post on Zulip Jade Master (Jan 22 2021 at 02:18):

Check out the end of this article for more info: https://ncatlab.org/nlab/show/profunctor

view this post on Zulip Cole Comfort (Jan 22 2021 at 02:33):

Jade Master said:

Spans and cospans between two fixed sets X and Y are related as well. Given a cospan XAY X \to A \leftarrow Y you can get a span XBY X \leftarrow B \to Y where B contains an element (x,y) mapping to x and y whenever x and y map to the same element in the cospan. This is a 0-dimensional version of the comma category construction. Dually given a span XBYX \leftarrow B \to Y , you can get a cospan by taking preimages...i .e. a cospan mapping x and y to e whenever there is an element in your span mapping to x and y. This is the 0-dimensional cocomma construction.

Is this not just the pullback and pushout?

view this post on Zulip Jade Master (Jan 22 2021 at 02:44):

That might be a simpler way to think about it...

view this post on Zulip Jade Master (Jan 22 2021 at 02:47):

Yeah I'm pretty sure that's right because comma and cocomma categories are lax pullbacks and pushouts.

view this post on Zulip John Baez (Jan 22 2021 at 05:17):

Jade Master said:

Spans and cospans between two fixed sets X and Y are related as well. Given a cospan XAY X \to A \leftarrow Y you can get a span XBY X \leftarrow B \to Y where B contains an element (x,y) mapping to x and y whenever x and y map to the same element in the cospan.

If I understand you correctly, this is called "taking the pullback".

A cospan XAYX \to A \leftarrow Y is precisely the sort of diagram you can take the pullback of, getting the span

XX×AYY X \leftarrow X \times_A Y \to Y

As you said, X×AYX \times_A Y contains an element (x,y)(x,y) mapping to xx and yy whenever xx and yy map to the same element in AA.

view this post on Zulip John Baez (Jan 22 2021 at 05:18):

Okay, so Cole already said this! I often respond to a post and then scroll down and see people already said the same thing. But I hope it's not too unpleasant to hear different people say the same thing in different ways.

view this post on Zulip Eric Forgy (Jan 22 2021 at 06:26):

:+1:

If a category CC has pullbacks, there is a bicategory Span(C)\mathbf{Span}(C) whose

{}
If (C,×)(C,\times) is furthermore a cartesian monoidal category with pullbacks (hence finitely complete), then
{}
Span(C,×)Bim(Cop,×)\mathbf{Span}(C,\times)\cong \mathbf{Bim}(C^\mathsf{op},\times)
{}
which relates spans to bimodules. This was a fun journey spelled out in another stream here.

Similarly, if a category CC has pushouts, you can form the obvious bicategory
{}
Cospan(C)\mathbf{Cospan}(C)
{}
with composition of cospans given by the pushout of the span connecting adjacent cospans.

If (C,+)(C,+) is cocartesian monoidal with pushouts, then
{}
Cospan(C,+)Bim(C,+).\mathbf{Cospan}(C,+)\cong\mathbf{Bim}(C,+).
{}
I find all this super fascinating which is why I'm trying to gain better intuition for cospans :blush:

view this post on Zulip Cole Comfort (Jan 22 2021 at 13:25):

Jade Master said:

That might be a simpler way to think about it...

I think it funny when I am studying something from a really abstract perspective without realizing that I already know it much better in more concrete terms.