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.
The HoTT book (specifically chapter 5) acts like there is a concept of "inductive type", of which the notion of a "W-type" is a special case:
So far, we have been discussing only particular inductive types: 0, 1, 2, N, coproducts, products, Σ-types, W-types, etc.
What would be an example of an inductive type that is not a W-type? I always thought of "W-type" as an already quite general notion of the idea of an "inductive type".
Higher inductive types, maybe?
The natural numbers are one example. A W-type has only one constructor, while Nat has two. There is a W-type that "encodes" Nat (assuming we already have 2, at least), but they are different.
Could someone say a bit more about the distinction, failure and/or encoding?
This is a bit confusing, as the first example on the nLab page says "The most basic W-type is the natural numbers." Presumably this is in reference to the alternative definition there of W-types for Type Theory (we are in the type theory thread after all).
Perhaps Mike's point is that ℕ and W2[0,1] are only equivalent, so at the very intensional level of the syntactic rules of type theory, they literally have different rules. In fact, the equivalence relies on function extensionality, so they aren't equivalent in plain MLTT. Relatedly, not every pair of 0s of W2[0,1] is definitionally equal. The canonical 0 is sup 0 λ()
, but not every f : 0 → U
is definitionally equal to λ()
(i.e, rec₀
).
Yes, this is discussed in section 5.3 and at the beginning of section 5.5 of the HoTT Book.
Spencer Breiner said:
This is a bit confusing, as the first example on the nLab page says "The most basic W-type is the natural numbers."
I think that's a mistake on the nLab, thanks for pointing that out.
Thanks!
Mike Shulman said:
A W-type has only one constructor
I don't understand this, because the branching signature can consist of several labels. I'm confused. :-)
The "tag" of the constructor will always be the same, but of course you can invoke that constructor with several different arguments to _encode_ an inductive with different constructors, which is what @Mike Shulman is suggesting, I think.
Yes, that's the point. It's the difference between two elements of a type , on one hand, and a function , on the other.
I don't get it. What does it mean that the tag of the constructur will always be the same? Also, I don't think there's a difference between two elements of type and a function , since there's a bijection . :P Of course, you know that, but I'm not able to interpret the sentence in any other sensible way.
I suppose the question you're really interested in asking is whether every strictly positive functor on types can be encoded (up to equivalence) as by some choice of and . I believe so, but I haven't really thought it through.
I suppose you could argue that is strictly positive, but let's rule that out for now.
There is a bijection, but they are not definitionally the same set. The distinctions we're talking about here are finer than up-to-isomorphism.
Ah, I see, thanks.
But I don't yet see how this connects to a W-type having only one constructor.
A general inductive type has a finite list of constructors, say where is some functor for . For a W-type we have . We can take for a W-type, but this would be different from an inductive type where and .
Ah, thanks!
BTW, if we have for the unit type and for -types (but no function extensionality), then the natural numbers can be recovered as a W-type, satisfying all the rules, including the judgmental computation rule. This is in Jasper Hugunin's Why not W?.
What's the category-theoretic/semantic analogue of those assumptions?
Ulrik Buchholtz said:
BTW, if we have for the unit type and for -types (but no function extensionality), then the natural numbers can be recovered as a W-type, satisfying all the rules, including the judgmental computation rule. This is in Jasper Hugunin's Why not W?.
This is a nice result, but I don't think it's correct to say that the natural numbers are recoverd as a W-type. Rather, Jasper defines a predicate by recursion on the W-type corresponding to nat, picking out a "subtype" of it that satisfies the judgmental computation rule.
David Michael Roberts said:
What's the category-theoretic/semantic analogue of those assumptions?
It's hard to write down models where for unit and doesn't hold. It basically means that fibrations contain identity maps and are closed under composition.
Mike Shulman said:
This is a nice result, but I don't think it's correct to say that the natural numbers are recoverd as a W-type. Rather, Jasper defines a predicate by recursion on the W-type corresponding to nat, picking out a "subtype" of it that satisfies the judgmental computation rule.
That's a good point: I guess we should say that this result is a reduction of natural numbers to W-types in this setting. It seems like a general technique that might similarly reduce all inductive types to W-types.
Yes, it does.
This discussion has been helpful. I'd like to read about this in more detail. Other than the HoTT book, can you recommend sources for the theory of inductive types?
The approach taken in the HoTT Book is extended and developed further in a series of papers by Awodey, Gambino, and Sojakova: https://arxiv.org/abs/1201.3898, https://arxiv.org/abs/1402.0761, https://arxiv.org/abs/1504.05531.
There are some more references at the nlab pages https://ncatlab.org/nlab/show/W-type and https://ncatlab.org/nlab/show/inductive+type.