jcreed blog > Directed Spaces vs. Categories

Directed Spaces vs. Categories

Categories

I wrote a little before about the well-known fact that the category Cat isn't locally cartesian closed, which means that naively attempting to build a (dependent) type theory where "every type is a category" fails.

We can see this directly in an example of a pushout that is not stable under pullback:

When we take the pushout of two morphisms, $f : A \to B$ and $g : B \to C$, joining them at the middle object $B$, we are asking the question: what is the minimal category that contains the morphism $f$ like so, and contains the morphism $g$ like so? Because being a category requires having composites, the answer to that question is a category with three (nonidentity) morphisms. The third morphism, $gf$, springs magically into existence, once $f$ and $g$ are simultaneously present in a composable configuration.

I want to focus in on why this "magically appearing" morphism is problematic for the purposes of the lccc property, and therefore for supporting dependent types. It's not just that it appears as a consequence of the pushout, but also because of what happens during the pullback.

When we try to restrict attention to that magically-created morphism $gf : A \to C$ --- that is, when we take a pullback along the inclusion of $gf$ --- we get back so little data that it's no longer enough to explain where $gf$ came from. We just get the objects $A$ and $C$ in the northwest and southeast corners of the post-pullback pushout square. The morphisms $f$ and $g$ are absent. In a sense made definite by the result of taking the pullback, we see that the morphisms $f$ and $g$ that cause $gf$ to exist are not the material that constitute the morphism $gf$. They're separate from it.

Directed Spaces

So I want to think about situations where this is not the case: where a composite path is really made up of the parts that compose to form it. I attempt to do this by considering a certain category of sheaves.

Let $\C$ be the category with one object $\U$, which is identified with the open unit interval $(0,1)$. The morphisms will be all strictly monotone continuous maps $(0,1) \to (0,1)$. \[ \C(\U,\U) = \{f : \U \to \U \st \forall x,y \in \U. x < y \imp f(x) < f(y)\}\]

We could then think about the presheaf category $\rset^{\C^\op}$. Let's define a Grothendieck topology $J$ to say which of those presheaves are sheaves: a sieve $S \subseteq \C(\U,\U)$ is considered covering iff the union of all the ranges of morphisms in the sieve in fact cover the unit interval. \[ S \in J \iff \forall y \in \U . \exists f \in S . \exists x \in \U . f(x) = y \] What do sheaves for this site look like?

A presheaf $F : \rset^{\C^\op}$ is some kind of directed space. The set $F(\U)$ is the set of all valid paths through the space. Each one of those paths can be thought of as "a permissible way of mapping the unit interval (0,1) into the space".

The reason why we say $F$ is a directed space is that the monotonicity requirement in the definition of $\C(\U,\U)$ means there's no guarantee that we can reverse paths.

However, we do know that we can at least "zoom in" on any path, or reparameterize it in time, by pulling back along a morphism $\U \to \U$.

In other words: if a path is acceptable, if it goes "with the grain" of the space it traverses, then any subpath of that path is also acceptable.

The sheaf condition provides the converse: if a path is acceptable everywhere locally (i.e. if a path can be cobbled together out of a "covering" collection of acceptable parts) then the path is globally acceptable. A directed space must have a notion of going "with the grain" that is a local condition.

Some Examples of Directed Spaces

Here are some examples of directed spaces.
  1. $U$

    The space $U$ is just the yoneda embedding of the object $\U$ of the presheaf base category. The set $U(\U)$ consists of all strictly monotone continuous functions $(0,1)\to (0,1)$, and the effect of $U$ on morphisms is simply composition.

    There are plenty of morphisms in the presheaf category (i.e. natural transformations) from $U$ to itself, one for each strictly monotone continuous map from $(0,1) \to (0,1)$, which we know to be the case by the Yoneda lemma.

  2. $V$

    The space $V$ is defined by setting $V(\U)$ to be the set of all continuous maps $(0,1) \to [0,1]$ that are strictly monotone "except at the endpoints" in the following sense.

    Say a map $f : (0,1) \to (0,1)$ is "interior strictly monotone" if for all $x,y \in \U$ \[\forall x, y . x \le y \imp f(x) \le f(y) \] \[\forall x, y . f(x) = f(y) \imp (x = y \lor f(x) = 0 \lor f(x) = 1)\] The action of $V$ on morphisms is again simply composition.

  3. $U_0$

    The space $U_0$ is defined by setting $U_0(\U)$ to be the set of all continuous (not necessarily strictly) monotone maps $(0,1) \to (0,1)$. The action of $U_0$ on morphisms is given by composition.

  4. $V_0$

    The space $V_0$ is defined by setting $V_0(\U)$ to be the set of all continuous (not necessarily strictly) monotone maps $(0,1) \to [0,1]$. The action of $V_0$ on morphisms is given by composition.

  5. $C$

    The space $C$ is defined by setting $C(\U)$ to be the closed unit interval $[0,1]$.

    The intuition behind the above drawing of $C(\U)$ is that, unlike the previous directed spaces, which consist of a full continuum-length interval of possible "interior" points, the structure of $C$ consists of merely (a) two endpoints, (depicted as two regions of black ink) together with (b) a single transitional interior point. (depicted as the orange arrowhead).

    Each of the extended regions of black ink is to be understood, thinking in terms of homotopy-equivalence, as indistinguishable from a single point.

    The intended meaning of an element $x \in (0,1) \subseteq [0,1] = C(\U)$ is the time at which a probe path from $(0,1)$ reaches (and necessarily crosses) the single interior transition point. The meaning of the element $0 \in C(\U)$ is a probe path that stays entirely inside the the right endpoint, the endpoint 1 of the space (i.e. the "transition time" was 0, it already had transitioned from endpoint 0 to endpoint 1) and the meaning of the element $1 \in C(\U)$ is a probe path that stays entirely in the endpoint 0.

    The action of $C$ on morphisms can be defined in light of this intended meaning. For a map $f : (0,1) \to (0,1)$, we need to contravariantly give a map $C(\U) \to C(\U)$, i.e. a map $C(f) : [0,1] \to [0,1]$. Let $y \in [0,1]$ be given.

  6. $1$

    The space $1$ is defined by setting $1(\U)$ to be a singleton set. The action of $1$ on morphisms is the identity function.

Maps Between Spaces

There are some "obvious" maps $U \to V$ and $U_0 \to V_0$. We are simply including open intervals into closed intervals.

Comparing $U$ to $U_0$ (and $V$ to $V_0$) is more interesting. The directed "texture" of the interior of $U$ is different from that of $U_0$. The space $U_0$ allows for paths into it that slow down to a complete stop, unmoving at some interior point of it, and then maybe resume going forward. The space $U$ does not --- it has a sort of minimum speed limit. To think of it another way: it's as if $U$ is an irreflexive path graph of infinite length, and $U_0$ is a reflexive path graph, with infinitesimal self-edge loops at every interior point.

Because of this, there does exist a sensible inclusion map from $U$ to $U_0$ (and it makes sense that we'd have a graph homomorphism from an irreflexive graph to a reflexive one that is otherwise the same shape) but there is no map $U_0 \to U$.

Likewise, there is a sensible inclusion $V \to V_0$, and only the two trivial maps $V_0 \to V$ that map all of $V_0$ to an endpoint of $V$.

There are endpoint maps $1 \to V$ and $1 \to V_0$. There are no maps $1 \to U$. There are lots of maps $1 \to U_0$ into the interior of $U_0$, as well as corresponding maps $1 \to V_0$ into the interior of $V_0$. The terminal object 1 could be thought of as "sitting still" and so it is acceptable to map it into the interior of objects like $U_0$ and $V_0$, and unacceptable to map it into the interior of objects like $U$ and $V$ that have a "minimum speed limit".

The object $C$, as we suggested above, is structured as two endpoints, plus one "interior point" which imposes a direction, and which requires motion through it to occur only in one direction. We can also think of the endpoints as regions that allow bidirectional motion. So while $V$ is a reflexive directed path graph, $C$ is like an infinite graph that almost everywhere has edges going in both directions, except right in the middle of it, it has a single edge pointing only to the right. This means that it should be easy to find a canonical map $V \to C$, and harder to map $C \to V$.

Indeed, we can construct a map $V \to C$, i.e. a map $\iota : V(\U) \to C(\U)$, exactly by unpacking the intuition defined in the definition of $C$. Given an $f : (0,1) \to [0,1] \in V(\U)$, we ask for which $x$ we find $f(x) = 1/2$. (there can be at most one such $x$) If there is such an $x$, we set $\iota(f) = x$. If the range of $f$ is always below $1/2$, then we set $\iota(f) = 1$, and if the range of $f$ is always greater than $1/2$, we set $\iota(f) = 0$.

Exercise: show every map $C \to V$ factors through $1$.

Why Is This Interesting?

Even though we already know that sheaf categories are toposes, and therefore lccc, we can get a direct feel for why the failure of Cat being lccc doesn't happen here.
The reason is this: if you consider the notion of path that the category is based on, composite paths literally contain the paths that compose them. There's no way of naming the path $gf$ that does not have $f$ and $g$ as its constituents. Therefore the pushout of $f$ and $g$ certainly survives the pullback along the "inclusion of $gf$ in the pushout of $f$ and $g$", because that pullback is trivially along an identity morphism.

What about Categories-as-Types?

This whole business may seem to be solving a problem that nobody wanted solved. We wanted to have types be categories, and instead I'm talking about types that are directed spaces, which maybe have fundamental categories the way that topological spaces have fundamental groupoids, but aren't the same thing as categories.

But I think that it actually is the case that categories include into directed spaces in this sense. The object $C$ described above is the category with two objects and one nontrivial arrow: there is really only one place to transition.

We must be careful that pushouts in the category of directed spaces are not the same thing as pushouts in Cat. If I pushout two copies of $C$ joined at their endpoints, I get something that I might reasonably call $C_2$.

The space $C_2$ has three points (i.e. maps from $1$) and two "directed transitions".

We may notice that even though a $V$-path and a $V$-path into a space can always compose to give another $V$-path, so there is a surjection $V \to C_2$. But it's not the case that the two pushout-provided injections $C\to C_2$ "compose" to produce a surjective map $C \to C_2$. There are in fact only 5 different maps $C \to C_2$, one for every monotone map $\{0,1\} \to \{0,1/2,2\}$ except for the 'spanning' one that sends 0 to 0 and 1 to 1. The domain $C$ doesn't have enough "stretch" to cover two transitional points, and the codomain $C_2$ doesn't have a single-transition "shortcut" from its leftmost endpoint to its rightmost.

Conjecturing a Modality

So this feels very much like the notion of Kan completeness (i.e "being a Segal type") that shows up in Riehl-Shulman. Not every type is a category, but some types are: those in which every time we find a $V$-path we can also find a shortcut $C$-path. I think this is the same thing as saying: a type $T$ is a category if it's fibrant with respect to the inclusion $V \to C$ being a cofibration.
So should I expect there to exist a "fibrant replacement" modality that adds in just enough "shortcut" morphisms to make a type into a category in the most conservative way?