This post is describing a simple construction I worked out while trying to understand the semantics of quantitative type theory. It is a variant of the families fibration, a well known construction in category theory, which is sensitive to the way that sets are made out of elements, and allows fibres to overlap. Hence it is βcursedβ, which is like evil but more.
Letβs begin by recalling how the families fibration works. For any category , we can build a category . The objects of are set-indexed families in : that is, a pair of an index set and a function . A morphism is a pair of a function and an -indexed family of morphisms of .
There is a functor which forgets everything except the index set. This functor turns out to be a fibration. The fibre over a set is exactly , ie. the functor category when is seen as a discrete category.
Now letβs specialise to , so we are considering the fibration . A magical property of the category of sets is that . Letβs go through how this equivalence works. In the forwards direction, we have an -indexed family , which we turn into its disjoint union equipped with the projection onto the index set, . In the backwards direction, we have a function , which we turn into an -indexed family by inverse images: . Both of these turn out to be functorial and define an equivalence of categories.
Doing this on the total category gives us an equivalence of categories , where is the arrow category, whose objects are functions and morphisms are commuting squares. The equivalence looks basically the same: an object of goes to the object of , and the object of goes to the object of .
This extends to an equivalence of fibrations, where the families fibration corresponds to the codomain fibration .
Ok, that concludes our very condensed recap of the families construction. Now letβs make it cursed.
The objects of (fraktur is the appropriate font for a cursed object) are the same as the objects of : a pair of a set and a function . However, we restrict the morphisms (so we get a wide subcategory). A morphism is a pair of a function and an -indexed family functions satsifying an additional property: that if , then , and consequently, both are elements of . (And if this intersection is empty then no morphism of this type can exist.)
This is fundamentally using the fact that is untyped, and we can talk about the intersection of arbitrary sets.
The intuition is that morphisms are not allowed to use their knowledge of the index, unless it can be deduced from the rest of their input. Iβll go through a detailed example of this later.
Just as there is an equivalence of categories , there is a cursed counterpart of that is equivalent to . Iβll call this category$ ^$. An object of is a pair of sets equipped with a binary relation . A morphism from to is a pair of functions and such that if then .
One perspective on is that itβs the category of morphisms in the double category whose proarrows are binary relations.
We can turn an object of into an object of by taking the non-disjoint union together with the relation given by if . Conversely, a binary relation we can do the relational equivalent of inverse images to get the -indexed set .
Both and are fibred over , the latter being by the relational version of codomain, and the equivalence of categories extends to an equivalence of fibrations.
Here is a simple example, which was suggested by Zanzi. Given a set , we have the set of lists, the set of lists of length , and the set of lists of length at most . The sets are non-overlapping for distinct , that is to say, two lists of different lengths cannot be equal. is in natural bijection with the disjoint union (whose elements are pairs of a number and a list of that length), and is equal on the nose to the non-disjoint union .
On the other hand, the sets overlap: iff . The disjoint union consists of pairs of a list and an upper bound on its length. But the non-disjoint union is still equal on the nose to .
Suppose we want to talk about the length function, in considered as a baby model of quantitative type theory. Consider the object , which models an βirrelevant Sigma typeβ where an upper bound on the length is available at the type level but may not be used at the value level.
The set is not a dependent type, so we consider it trivially -indexed, by the object . There is a morphism , given by the unique function together with the -indexed family of functions that ignores and returns the actual length of the list. This satisfies the condition to be a morphism of .
We can say the same thing equivalently in , where the corresponding object is the relation given by if the length of is at most . The object corresponding to is the relation given by for all . The corresponding morphism is given by the unique function and the length function . This satisfies the condition to be a morphism of .
Thatβs all for today, but Iβll leave a puzzle. All of this was very heavily specialised to working concretely with sets. What structure could we put on a category in order that we can talk about βintersections of objectsβ in this way? Bruno suggested that what we need is a Grothendieck (possibly pre-)topology. I find this very plausible: two objects have nonempty overlap if they admit covering families with an object in common. But Iβll definitely leave the details of this for another day.