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.
It's known that a dependent function type can be modeled as a morphism in the slice from the identity map. That is, the set of dependent functions in is isomorphic to the set of morphisms , (where is the projection). This allows us to move away from and state this in an arbitrary category .
It's also known that a dependent pair type is modeled simply as an object in the slice category. That is, , together with the above projection, is simply an object of .
But how do I state the following set --- a combination of these --- in an arbitrary category?
I imagine this should be a morphism in the slice over , but I'm getting confused since at the end I'm producing something over . But it also can't be a map in slice over since that would imply we're universally quantifying over .
Your description of - and -types is a bit confused, which I think is what's producing your confusion about combining them. E.g. while "the set of morphisms from the identity in a slice category" can be stated in any category, it itself is only ever a set, whereas a -type in a category should also be a thing in .
A better way to think about it is that and are, respectively, left and right adjoints to pullback from to the slice . Or, more generally, from one slice to another , where is given as an object of (and type-theoretically we would tend to write something like instead of , to indicate that it's a "context extension").
The reason "is" an object of a slice category is that the left adjoint just forgets the map to , remembering only its domain.
So if and are both objects of (i.e. neither depends on the other), then would denote an object of the double slice , and would mean to first apply the left adjoint on , that is forgetting the map to , or equivalently composing the map with the projection , and then apply the right adjoint .
I think the 'proper' way to think about this is using contexts. That is, where a type corresponds with an object of the slice category .
The sigma and pi type formers then correspond to functors between the slice categories: if corresponds with an object then the sigma-type corresponds with the object defined by .
Similarly, if is locally cartesian closed then you get a functor .
So for the expression you've written you start with something which is interpreted as an object of , then is an object of and is an object of .
(Mikes message came in just as I finished typing this, but I'll send it anyway, in case it helps to have the same thing written two ways)
Also, you can see where the expression you have (for the set of dependent functions) comes from, using the adjunction between and the pullback functor . (I'm writing to mean the terminal map ).
means that , and , so points of are equivalently elements of .
Thanks for the answers. Let me check if I understand what you mean.
It sounds like you're suggesting I should make a distinction between
You seem to be suggesting that I should call only the latter a sigma type (is that what you're suggesting?).
Now, I understand the idea of interpreting the latter as a term in a trivial context where the original is now existentially quantified. But I'm confused by the fact that: a) now this term is not 'over' anything. The whole thing about categorical semantics of dependent types is that we think of things being over one another, no?, and b) in the former, also appears existentially quantified (in ). If this is not to be thought of as a sigma type, then what is this?
Bruno Gavranović said:
The whole thing about categorical semantics of dependent types is that we think of things being over one another, no?
Yes, but the thing that we think of types being over is contexts. is a type defined over and that's reflected in the way it's interpreted as an object of the fibre over . The sigma type moves this 'overness' into the object, so that we can talk about closed types which are still dependent. It would be a bit weird if we couldn't give semantics to an arbitrary type without first looking inside to decide which category it belongs in.
It's a similar situation to the use of exponentials in the semantics of simple type theory. You could say the whole thing about categorical semantics of simple types is that we can think of types as morphisms with a domain and codomain, but we still interpret function types as an object of a CCC rather than a morphism, because without that we can't talk about higher order functions. You run into the same thing with the semantics of dependent types because you can't talk about "higher order" dependent types without internalising some of information about the dependence into the object.
Bruno Gavranović said:
in the former, $(a:A)$ also appears existentially quantified (in $(\Sigma (a : A) . A'(A), \pi)$). If this is not to be thought of as a sigma type, then what is this?
In the first bullet point you're using the sigma to describe an object of whereas in the second you're using the sigma to describe a type in the type theory so these are different situations. But all the same, even in writing that, you have run into a reason why sigma-types should be interpreted in that way, maybe without realising it.
To describe an object of you must give an object of and a morphism . You did this by giving an object , but if sigma-types were to be interpreted as an object of then this wouldn't type-check, because you gave an object of the wrong category!
In case saying the same thing in different words helps:
Bruno Gavranović said:
You seem to be suggesting that I should call only the latter a sigma type (is that what you're suggesting?).
Yes.
Now, I understand the idea of interpreting the latter as a term in a trivial context where the original is now existentially quantified. But I'm confused by the fact that: a) now this term is not 'over' anything.
What it's "over" syntactically is the empty context, which category-theoretically corresponds to the terminal object. It just so happens that the slice category over the terminal object is equivalent to the category itself, .
b) in the former, also appears existentially quantified (in ). If this is not to be thought of as a sigma type, then what is this?
The Sigma-type is the object (or, more precisely, that object paired with its unique map to the terminal object). The pair is not a Sigma-type. It "contains within it" the data of the Sigma-type, but the operation of "taking the Sigma-type" is the operation of forgetting the morphism (or, more precisely, composing it with the unique morphism ).
You might also find it helpful to read about some [[categorical models of dependent types]], which distinguish more carefully between "types in a context" and "objects of a slice category". Many category-theorists find it more intuitive to blur that line, but it sounds like maybe this blurring is part of what's causing your confusion and looking at a more precise treatment would help.
Second that motion. I found it all much too floppy to understand till I read about categories with families, which actually distinguish between contexts, types and terms in the semantics.