jcreed blog > Spans as Colored Spaces

Spans as Colored Spaces

The other day I noticed a really simple and appealing interpretation of spans in HoTT. It relates to my earlier post about Sealevel Logic, and I think it makes for an even simpler encoding of braid groups in HoTT than what I was trying to do with parametricity here and here Consider a span $ A \leftarrow R \to B$. Because we're in HoTT, all of $A, R, B$ might have nontrivial homotopy structure. Think of $A$ as being "colored red" and $B$ as being "colored blue", and think of $R$ and the functions of the span as instructions for "how to glue the red and blue parts together". It shouldn't be surprising that this sounds like a pushout; a span is exactly the data we take a pushout of. But I'm taking the span seriously as a first-class thing. By not actually taking the pushout yet, I'm "remembering which parts were red and blue".

So let's look at some examples. If the span is trivial except for one side, it's just a one-colored space:

I'm writing $S^1$ for the 1-dimensional sphere, i.e. the circle, and $S^1 \lor S^1$ as the wedge sum of circles. If we simply glue two points together, I can draw it like this:
And if we glue two points together two different ways, we get a circle that's colored red on one side and blue on the other:
Notice that for all of these diagrams, if I actually take the pushout of the span, I get the type that results from erasing all the color distinctions in the picture. The pushout of $1 \leftarrow 1 \to 1$ is simply 1, and the "left red, right blue" disk becomes simply a disk. The pushout of $1 \leftarrow 2 \to 1$ is the circle, and the "left red, right blue" circle becomes simply a circle.

We can do long zigzag relations of red and blue elements:

and we can construct shapes that are blue blobs sitting inside a red ambient space:
Notice that again the pushouts of these last two spans are boring — they're contractible, even! — but the spans themselves are kind of interesting. More complicated gluings are possible, e.g.
and this isn't even touching on diagrams that are harder to draw in two dimensions, like those involving $S^2$ or higher types still.

Functions between Colored Spaces

Here's where the Sealevel logic thinking comes back into play. I'd like a notion of function between colored spaces that both "feels appropriately homotopical" but which also "allows me to rewrite red into blue".

In particular, we should have examples of maps between colored spaces that are red-blue zigzags arising from ordered maps between finite linearly ordered sets. For example, this should depict the map from $\{0,1,2,3,4,5\}$ to $\{0,1,2,3,4,5,6\}$ which takes $0,1,2$ to $0$, $3$ to $2$, and $4,5$ to $5$.

As a first step we define a bordism between from a span $A_1 \leftarrow R_1 \to B_1$ to a span $A_2 \leftarrow R_2 \to B_2$ to be a span $A_* \leftarrow R_* \to B_*$ making the following diagram commute: \[ \begin{CD} A_1 @<<< R_1 @>>> B_1 \\ @VVV @VVV @VVV \\ A_* @<<< R_* @>>> B_* \\ @AAA @AAA @AAA \\ A_2 @<<< R_2 @>>> B_2 \end{CD} \] In other words, it is just a cospan of spans. We can say a bordism is functional if the two indicated morphisms are iso and the two indicated squares are pushouts: \[\begin{CD} A_1 @<<< R_1 @>>> B_1 \\ @| @VVV @V{\raisebox{-1.3em}{$\ulcorner\kern0.4em$}}VV \\ A_* @<<< R_* @>>> B_* \\ @AA{\raisebox{0.9em}{$\kern0.4em\lrcorner$}}A @AAA @| \\ A_2 @<<< R_2 @>>> B_2 \end{CD}\] I think this is really lovely and symmetric. The blue material, the "positive space", behaves like a function top to bottom, and symmetrically, the red material, the "empty space", behaves like a function bottom to top.

Here's how the example above plays out:

Why do I think this is the right definition? The top left isomorphism says that the all empty (i.e. red) spaces in the overall function diagram must "flow up" and match up with empty spaces in the domain; the bottom left isomorphism says that all filled (i.e. blue) spaces in the overall function diagram must "flow down" and match up with filled spaces in the codomain.
The top-right pushout is saying that the boundary between the red and the blue regions in the interior of the diagram together with the filled spaces in the domain, if you glue them together, is exactly the same information as the filled (blue) spaces in the overall diagram. (see the yellow region in the above suggestive picture on the left) Likewise, the bottom-left pushout is saying that the boundary between the red and the blue regions in the interior of the diagram together with the empty spaces in the codomain, form a homotopically equivalent description of the empty (red) spaces in the overall diagram (see the yellow region in the above suggestive picture on the right)

Consequently, I'm inclined to make the following conjecture. Let $\mathsf{line}(n)$ be the zigzag span $n+1 \leftarrow n+2 \to n$ that represents $n$ blue blobs surrounded by $n+1$ red blobs. Let $\textcolor{red}2$ be the span $2 \leftarrow 0 \to 0$. There is an evident map $\textcolor{red}2 \to \mathsf{line}(n)$ that takes the two points to the leftmost and rightmost red point of $\mathsf{line}(n)$.

Conjecture: The functional bordisms $f$ that make \[\begin{array}{c} \mathsf{line}(m) \xrightarrow{\quad f \quad} \mathsf{line}(n) \\ \nwarrow \quad \nearrow \\ \textcolor{red}{2} \end{array}\] commute are in bijective correspondence with ordered maps from an $m$-element set to an $n$-element set.