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.
So, I wanted to understand categorial models of dependent types, and I went like [[categorical semantics of dependent type theory]] → [[bundle]] → [[codomain fibration]] → [[Grothendieck fibration]], at which point I found hardship going forward.
I think I understand the concrete example where we have the functors and . It seems to say that the category of arrows and equations (commuting squares) of is a fiber bundle of slice categories over the base category . For every object we can take the pullback of the functor along the fibration to get the category .
I technically understand the definition of [[Grothendieck fibration]]#definition but I do not understand why it is needed.
I cannot understand the definition of the functor described at [[Grothendieck+fibration]]#fibrations_versus_pseudofunctors. They say:
To obtain the action on morphisms, given an in and an object , we choose a cartesian arrow over and call its source .
This does not makes sense. What is a Cartesian arrow over ? The definition of a Cartesian arrow requires two premises: an object in the total category and an arrow in the base category . They only name an arrow — this is not enough to apply the definition of a Cartesian arrow. I tried to guess what they want me to do but nothing works.
They later go on to say that is indeed a fibration and its Cartesian arrows are pullbacks, but by then I am so lost this statement, that must have been easy and illuminating, goes altogether over my head. What makes pullbacks Cartesian arrows?
I would like to learn some of these things as well! I wonder if chapter 1 of "Categorical Logic and Type Theory" by Jacobs might be a helpful reference for clarifying what the nLab is saying. For example, it introduces and discusses Cartesian morphisms.
The first chapter of Jacobs starts out like this:
start of Jacobs chapter 1
And regarding the name "Cartesian arrow", there is some discussion here you might find helpful.
Regarding a connection between pullbacks and Cartesian arrows, this at least seems closely related (following Jacobs page 25):
(I don't know if you'll find any of this useful. But I'll post it just in case!)
In the category of sets, a pullback is a morphism in the arrow category :
pullback
This pullback square describes a morphism from to .
We can then ask, given another object and a morphism from it to as follows
other morphism
where is such so that , can we "complete" the square on the left uniquely with some to obtain a unique morphism from to , so that we get the morphism by composition of after ? This is related to starting with the 2/3 of a triangle (a "horn"?) defined by and , and if we can complete it to a commutative triangle with some , then we want to know if we can uniquely "lift" that whole resulting commutative triangle up to the commutative triangle . That starts to sound reminiscent of the definition of a Cartesian arrow, I think.
In this case, we can find such a unique , I think using the fact that the square on the right is a pullback square.
The usual definition of fibration is technical and scary, so I think it's important to start by learning a bunch of examples of fibrations that let you see what this concept is good for. The examples that work for you will depend on who you are.
For example, I find it easy to visualize graphs (in the category theorist's sense, also called [[quivers]] and the forgetful functor from graphs to sets, which forgets the edges and remembers only the set of vertices. This is both a fibration and an opfibration.
Because this functor is a fibration, we get this:
Suppose I have a function between sets and a way to make into the vertices of a graph: .
Then there's a god-given best way to make into the vertices of a graph!
You can guess what this best way is. Then you can think about why it's "best", while staring at the definition of Grothendick fibration... and you'll see that the definition captures how this way is the "best".
This is how I managed to first understand the definition of Grothendieck fibration. Then I learned about other examples from logic, and topology, and algebra, and they reinforced my understanding.
For me, it was hopeless to understand fibrations by only thinking about the definition without the help of any examples.
Nice example! It's closely related to the example that helped me understand (a little bit about) fibrations: the fibration that defines an equipment. In the case of the equipment of spans, there is a forgetful functor that sends a span to its pair of feet. (Here is the copresheaf category on the walking span , not some higher-dimensional structure.)
This functor is a fibration. It generalizes the example of graphs if we think that a graph is an "endospan".
So yeah, the basic moral here is: you get a fibration when you have a functor that "forgets extra structure", turning objects of into their underlying -objects, and - here's the key point - a god-given best way to pull back tha extra structure, so if you have extra structure on and a morphism , you can get extra structure on .
(And although I said "structure" above, it's actually typical in examples for to be forgetting extra stuff, in the technical sense of "stuff". That is, is often not faithful. It's not in the two examples we've just looked at. The edges of a graph are extra stuff, when we use the category theorists' definition of "graph". In other words, what a graph morphism does to the vertices does not determine what it does to the edges.)
Conceptually, from the point of view of type theory, I think it can be helpful to understand a grothendieck fibration as a dependent type where your types are synthetic categories (ie. directed 1-types). Now, in the case that the fibers are small enough, the grothendieck construction tells you exactly that dependent types correspond exactly to pseudofunctors , the latter being the universe of suitably small categories. Now, the dependent directed 1-types can be seen as an apparatus where types over the base have some directed transport structure, ie. an arrow in the base category lets you transport things in the fibers over the arrow.
in that sense it looks a lot like a fibration, in that fibrations can be seen as "dependent types with extra operations on it from the base". However the definition as-is doesn't really correspond to a right class of a WFS on , but you could argue that this is because this is a 2-category of things with a quite complex structure, and that one should instead investigate a 1-categorical presentation of it... I'm no specialist of those questions though, so I'd appreciate input from people who may have thought about that last part more
to expand a bit on the above, I can give you some type-theoretic-flavored examples: the type is the codomain opfibration that was mentioned above, which can be made into a fibration if the category has all pullbacks (ie. to get the contravariant -action). The fibration , the "directed identity type with a fixed endpoint", is actually , which under the grothendieck construction corresponds to the presheaf .
note though that if you're familiar with HoTT, being a Grothendieck fibration is actually the propositional truncation of the structure of cleavage, a cleavage being a choice of cartesian lifts!
This type-theoretic explanation of Grothendieck fibrations is helpful for people who feel comfortable with "dependent types". I was giving an explanation aimed at being helpful to people who feel comfortable with graphs and how a graph can seen as a set of vertices together with extra stuff. There would be another explanation helpful for people who feel comfortable with rings and their modules - this is close to Grothendieck's original application of fibrations. And also other explanations, I'm sure. So the people who asked the original question should tell us which explanation they want to dive into!
Since OP wanted to know about categorical models of dependent types, I thought this would be an approach they could be familiar with, but there are definitely a lot of ways of looking at grothendieck fibrations (and fibrations in general!)
(although I would argue that the dependent types one is the "right" as in most general view, but now that's just my personal opinion :p)
Thank you @David Egolf @John Baez @Evan Patterson @Josselin Poiret for your fantastic suggestions! This is enough homework to keep me busy for a while!
John Baez said:
Suppose I have a function between sets and a way to make into the vertices of a graph: .
Then there's a god-given best way to make into the vertices of a graph!
Let be the "best" graph that has as its vertices. It has vertices, and so it remains to figure out what its edges should be.
I don't know if this is the "best" way, but this is what comes to mind. If there is an edge in , then for each in so that and , add in an edge in from to .
I'm not sure how this relates to more general ideas just yet, though.
I'm thinking about how we can induce edges in from edges in . Let denote the graph with vertices and with an edge from to . Then, a graph homorphism from to specifies an edge of . So, given a morphism , we would like to find a morphism , using the fact that we have a morphism where .
One way to induce such a morphism would be by composition. If we could find some morphism from to compatible in an appropriate way with , then we could try setting . However, we don't have such a morphism, and the morphism we do have runs in the opposite direction.
We might want a different way to induce a morphism from a morphism , then. Imagine that we have some way of "lifting" our function to a graph homomorphism , so that . We can ask about which morphisms make the resulting diagram with and commute, so . Asking this diagram to commute involves requiring to pick out an edge in that is in the preimage of in under the mapping . So, for each edge in , we induce up to several "analogous" edges in .
There can indeed be multiple of these edges so that . This can happen because may map multiple elements of to the same element of . There is a second analogous diagram in the category of sets relating to this: we have a function and a function . A function so that corresponds to a choice of an ordered pair of vertices in so that the chosen pair lands on the ordered pair of vertices in corresponding to the edge . Again, there can be multiple such functions , with each choice for specifying a single pair of vertices in .
Once we pick a specific ordered pair of vertices in that map onto the edge , then we hope that this will induce a unique edge in . That is, once we pick a so that , we hope there is a unique so that . This edge connects the ordered pair of vertices selected by , I think.
We can then repeat this process of choosing and choosing to get all the edges of , I think.
I tried to imitate above the definition of a Cartesian arrow. If is a Cartesian arrow with , then I think we are ensured that the process described above does indeed induce a unique from each choice for and . And if is a fibration, then I think we are ensured that there is indeed a Cartesian so that .
So, how can we determine ? I think each allowed choice - so the appropriate diagram commutes, as discussed above - of gives us an edge of . (Without checking carefully, I suspect this results in the approach I described in my first post above.) And this really induces a unique edge of the graph compatible with because there exists a Cartesian with . Presumably we then take to be the graph with all the edges that can be induced in this way.
Although, I suppose this only describes a unique graph for a given choice of . I don't know if there can be multiple such .
David Egolf said:
John Baez said:
Suppose I have a function between sets and a way to make into the vertices of a graph: .
Then there's a god-given best way to make into the vertices of a graph!
Let be the "best" graph that has as its vertices. It has vertices, and so it remains to figure out what its edges should be.
I don't know if this is the "best" way, but this is what comes to mind. If there is an edge in , then for each in so that and , add in an edge in from to .
Yes, that's the best way.
I didn't follow all your further comments, but to make precise one sense in which it's the "best" way, you can show that this method exhibits the forgetful functor as a fibration.
What you're doing is taking a morphism and a graph with , and finding a graph, say , with .
But you're doing more, because this graph comes with a map of graphs, say which "lifts" the morphism . That's jargon for
And it's not just any old lift: it's a cartesian lift! That is, it has a universal property which is described here: [[cartesian morphism]].
The fact that every morphism in has a cartesian lift is what makes a Grothendieck fibration.
I'm too lazy to work through the definition of "cartesian morphism" in this example and check that is a cartesian morphism, mainly because it's tiring to draw diagrams here on Zulip. But this is a good thing to do. (Maybe you've already done it.)
That's making sense, and it's sounding familiar after I typed out the stuff above!
(If there are any comments I made above you would like me to clarify, I'd be happy to do so. Basically, I was trying to use the existence of a Cartesian arrow to figure out the edges in .)
I did not show that some particular is a Cartesian morphism, though.
I was wondering if there could be more than one Cartesian lift of in the case of this example - probably not? Anyways, I feel like I've learned a lot about this stuff, and I'm happy with that for now!
As usual with things defined by universal properties, there will be multiple Cartesian lifts, but they will all be isomorphic. You defined the set of edges in your graph in a reasonable way, but I could have chosen an isomorphic set of edges and used that!
I'd like to add some remarks in the spirit of the good example above of graphs as a fibration.
1) Perhaps the simplest example of non-trivial (and non-discrete) fibration is the subset fibration :
the objects of are pairs , where is a set and is a subset of ,
while its arrows are mappings such that implies ,
and the functor is the obvious one.
Of course this is a both a fibration and an op-fibration via the inverse and direct image of a subset.
From the indexed category point of view, it is simply the subset functor given by
and it is one of the main instances of Lawvere's hyperdoctrine in his 1969-70 papers.
2) By restricting (i.e. pulling back) along the product functor
one gets the fibration of binary relations, and by restricting further along the diagonal
one gets the fibration of endorelations.
3) may be seen as a restriction (in another sense) of the codomain fibration ,
by taking only injective mapping as objects (and quotienting out by the usual equivalence relation).
4) If we start from the codomain fibration itself and restrict it as in 2) we get respectively the fibrations of spans and of graphs
mentioned by Evan and John.
5) Of course all the above can be generalized replacing with a category with suitable properties.
6) Another source of fibrations are 2-categories : fixing an object we get the "representable" indexed category
and the accompanying fibration (over the underlying category of )
whose objects are arrows , while its arrows from to over are 2-cells .
7) As an instance of 6), consider the 2-category of posets, and take , the usual 2-element poset.
We so get the fibration of posets with an order ideal ;
by restricting to discrete posets, we get again the example in 1).
8) As another instance of 6) consider the 2-category of categories and any category;
restricting along the discrete inclusion we get the usual family fibration of .
9) Yet another instance of 6) with and , is the indexed category of presheaves ,
also a main instance of Lawvere's hyperdoctrine.
10) The example in 9) above can be also obtained as a restriction of the codomain fibration by taking, as objects,
just those functors which are discrete fibrations (a sort of generalization of the relation between 1) and 3)).
Thus we have the "discrete fibration" fibration :
the objects of are pairs , where is a category and is a discrete fibration over
while its arrows are functors and such that ,
and the functor is the obvious one.
For instance, the fiber in over the category with two parallel arrows is of course essentially the category of graphs,
but a morphism in over the endofunctor of which exchanges those arrows
is an contravariant morphism of graphs .
11) The fact that is in fact a bifibration (that is, it is also an op-fibration) subsumes in a sense the Yoneda lemma.
Indeed, let a discrete fibration (that is, an object of over ),
and let be the terminal object, which is the identity discrete fibration over the terminal category .
Then it is clear that "points" in , over a point/object in
correspond to the objects of over (that is to elements of , if we see as a presheaf).
But since is an opfibration, these correspond also to vertical arrows (natural transformation of presheaves)
from the image/sum/existential quantification of along .
That is, the presheaf on represented by the object is the existential quantification of the terminal object of along the morphism in the base category .
(Of course, quantifications in this context are usually known as Kan extension...)