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.
I am reading David Corfield's book Modal Homotopy Type Theory. The chapter on Dependent Types is great, helping me wrap my head around intuitive use cases for dependent types in philosophy and programming. In section 2.6, he discusses the question of whether a philosophical type theory should posit a single master type for individuals (e.g., Entity) or rather have several basic types such as (Object, Event, Agent, etc). In the course of this discussion he references the idea of building up sub-types from more basic types. However, I am a bit confused about how the construction of sub-types using dependent types is supposed to work.
I understand how to construct a proposition like "Fluffy is a Cat" from a given element Fluffy of type Animal as a truncated dependent pair type.
||Sigma( Fluffy: Animal, isCat(Fluffy) )||
But this doesn't give me Cat as a Type, nor an element c : Cat. So I am wondering if there is a way using DTT (or perhaps full blown HoTT) to actually construct the sub-type object and it's elements. Maybe another way of asking this question is that I'd like to know what is the type theoretic analogue to the category theory method of using a pullback from the sub-object classifier to define a sub-object.
In the book I've only made it to the start of Chapter 3, so it is possible that the author discusses this at a later point.
It seem to me that "Fluffy is a Cat" is . That's referring to a specific . The truncated type is more like . I know mathematicians often interchange existential propositions and specific constructions, but I think it's arguably bad practice, and might be one of the things the book is trying to address (although I haven't read it).
Also you could perhaps define the type to be , since it is the type of animals together with a proof that they are cats. Without the truncation, you are not removing the distinction between different cats.
This type is a pullback along . The first projection is the monomorphism into .
Or at least, it could be, depending on the details of how everything is arranged.
I asked a similar question on the HoTT Café Mailing list 4 years ago: on the mortality of Socrates. So there may be some good answers to glean from there.
Dan Doel said:
It seem to me that "Fluffy is a Cat" is . That's referring to a specific . The truncated type is more like .
Yes, that's right, my mistake. I guess the element of the (untruncated) sigma type would be an element of "Fluffy as Cat" (sort of like type casting in programming). The truncated sigma type is the existential proposition, "there is a Cat".
Dan Doel said:
Also you could perhaps define the type to be , since it is the type of animals together with a proof that they are cats. Without the truncation, you are not removing the distinction between different cats.
I'm not clear what you mean by forming a sigma type with Animal as the first element of the pair. That would be saying something like, "The abstract category of animals is a Cat" which is plainly false. Animal : Type is not an animal much less a cat. Maybe I'm misunderstanding your suggestion.
Dan Doel said:
This type is a pullback along . The first projection is the monomorphism into .
Right, this is how it would work in Topos theory. What I don't understand is what is the analogue to this in DTT or HoTT.
Henry Story said:
I asked a similar question on the HoTT Café Mailing list 4 years ago: on the mortality of Socrates. So there may be some good answers to glean from there.
Thanks for linking to that discussion. Very interesting although I didn't quite feel it answered the question. I'm left wondering if there is a disconnect between the type systems that make sense for mathematics and those that might make sense for philosophy and common-sense ontologies.
Sorry. By I mean . This is sometimes how it might be written when there is sufficient machinery for to not have to act as a variable binder itself.
Anyhow, what I wrote was all intended to be in type theory, not topos theory.
I don't know exactly how the type theory is structured in the book you're reading, but it would go something like this...
There is a type whose values are propositional types. This allows you to have act in a sort of double way. It's an arrow into the subobject classifier, but it's also a family of types. This happens a lot if you decide to make the type theory have types whose values are other types. is both a map into the subobject classifier and a family of types, while in topos theory there is just a correspondence between these two things.
Since is a family of types indexed by , we can form the sigma type . There are generally multiple ways to think about this. If you think about the family as primary, it's the disjoint union of all the fibers, or the sort of 'total space' of the family. In category theory you usually think of the family as already being the total space with a display map into the indexing type, but type theory prefers to present the family like it's mapping from the indexing type.
But, since the fibers of are propositional, this can also be read like it's a subset of , . The values of the sigma type are animals together with proofs that they are cats, but there is 'at most one' such proof (homotopically if you're doing that) for each animal. So the values of the sigma type are more structured than the elements of a subset are usually thought to be, but the structure is in some sense just acting as a filter.
If you want to get really into the weeds, then there is an alternate way of presenting this. You have a type of propositions, and a family
of truth values. Pullback corresponds to substitution, so if you have
then the substitution
is the family you get by pulling back the truth family along the arrow .
Then you can use Σ to realize the total space of the family as a type in itself, rather than a family of types.
This doesn't blur the lines of what you do in the category theory as much.
Thanks, I think I'm starting to understand better. One question about the sigma type.
Dan Doel said:
The values of the sigma type are animals together with proofs that they are cats...
So when you write, you mean for the a to range over all the terms in Animal. Is that what a sigma type is? I though you needed to give specific term to form a particular dependent pair type. i.e., I that the a:Animal was a concrete term (like Fluffy) rather than a term variable.
Values of are pairs where and .
This is very much like the existential quantifier. ∃ binds a variable in , and the variable ranges over . But to prove an existential statement, you give a particular value of and a proof that holds for that value. But for we want to consider all proofs equivalent, which is what truncation does. If you don't truncate, there are potentially many distinct choices of .
Also, you should be careful about saying the variable ranges over "terms". Those are syntactic expressions that denote something in the semantics. But the semantic values may not be the syntactic expressions.
See e.g. here.
Dan Doel said:
Values of are pairs where and .
Ok, so just to be sure I understand, as a simple example, if I have a type Bool with values true and false. Then the dependent sum type would have two possible values namely the pairs p1 = (true, warrant of B(true)) and p2 = (false, warrant of B(false) ). These would only be values of the sigma type insofar as B(true) and B(false) are true propositions.
Is this correct?
Yes, that's correct.
Ok. So that was the root of my misunderstanding. Now I can see how the sigma type provides a sub-type. Thank you so much for your help. I'll go back through your explanations of the weedy parts to try to really map it out, but I think I get the basics now.
Cool.
I think there is another way where Sigma types act as subtypes. I was looking at these in detail a year ago and wrote it up in a post Modal HoTT on the Web. I tried to illustrate carefully how Sigma Types arise out of an adjunction on slice categories.
So a is the result of mapping the object in the slice category to using the left adjoint of . The is the type of the fiber over , thus a part of . On this view it looks like really selects a subset of (thinking set theoretically), which would in a way be equivalent to a subclass of . It actually partitions the space, where subclasses in OO can be multi-layered. Somehow this does not appear that clearly in the HoTT definition of a sigma time. So I am not quite sure. Sigma Types as Adjunctions, explained in Modal HoTT on the Web blog post
Somehow I also came to the conclusion that a sigma type is a pullback (shown in the illustration above). But I am not sure anymore where I got that from.
Actually, reading @Dan Doel 's example with animals and cats I think I got something wrong in my illustration (it was something that bothered me when I put the post together). I'll draw up an illustration for the Cat example above.
Here is my illustration of the isCat dependent sum as an adjunction on the base change functor for .
Is this correct? I like the way the function is central. But I think the objects in the slice category are called -dependent, yet I thought one says that this type is animal dependent. :thinking:
Looking at the nlab page on dependent sum especially the section "relation to Type Theory" it seems indeed that the dependent sum arising from corresponded to the slice category over A.
(In a way it also corresponds better to the fibered view, where the fibers are over A).
So what I don't quite understand is
Also if I don't slice over but instead did it over as it seems I should according to nlab for @Dan Doel's example, we would have objects in the slice category. But that does not makes a lot less sense: would every such morphism select only one cat and one non-cat?
The point of (sub)object classifiers is that there are correspondences between (certain) and or . The 'in the weeds' presentation I talked about makes the fact that this is a correspondence more explicit, but other times they are presented as just being the same thing.
So, you could hypothesize a family
Meaning essentially that there is a monomorphism , which is also an object of the slice category over . The obvious issue is that I have already invoked a type because I don't know what else to call that part of the subobject.
being a subobject classifier means that there exists , which forms part of a pullback square with . The other parts of the square are and . maps animals to the truth value that corresponds to their cat-hood.
In the more explicit notation I gave, the expectation is something like:
which says that by pulling back 'truth' along , we get a subobject equivalent to , and with the same indexing by . If you want to recover the 'whole space' as a type, rather than an indexed family of types, then you can use the sigma type to get something indexed by instead of . That would be a type equivalent to .
You could also instead hypothesize , which doesn't demand you to also invent directly, and instead allows you to define it. A lot of type theories arguably work this way, where everything is defined in terms of object classifiers (universes) whose values are implicitly usable as their corresponding types.
I guess the point is that you aren't usually considering various families sliced over . You are reindexing from in the slice over along the classifying map .