A universal property, in the sense of category theory, generally expresses that a map involving hom-sets, induced by composition with some canonical map(s), is an isomorphism. In type theory we express this using equivalences of hom-types. For instance, the universal property of the sum type says that for any
, the induced map
is an equivalence.
Universal properties are very useful, but since saying that a map between function types is an equivalence requires knowing when two functions are equal, they seem to depend irreducibly on function extensionality (“funext”). Contrary to this impression, in this post I want to talk about a way to define, construct, and use universal properties that does not require function extensionality.
First, however, I should perhaps say a little bit about why one might care. Here are a few reasons:
- Maybe you just like to avoid unnecessary assumptions.
- Maybe you want to define things that compute, rather than getting stuck on the function extensionality axiom.
- Maybe you want to your terms to be free of unnecessary “funext redexes”, making them easier to reason about. Here by a “funext redex” I mean a path obtained by applying funext to a homotopy to get a path between functions, then applying that path at an argument to get a path between function values. (Following the book, by a “homotopy”
I mean an element of
.) Clearly we could just have applied the homotopy in the first place. Once we have a type theory in which paths in function types literally are homotopies, this won’t be a problem, but for now, it makes life easier if we can avoid introducing funext redexes in the first place.
- Finally, this is not a very good reason, but I’ll mention it since it was actually what started me looking into this in the first place: maybe you want to declare a coercion that conforms to Coq’s “uniform inheritance condition”, which means that it can’t depend on an extra hypothesis of funext.
Onwards! To begin with, as you may know, type theory already includes an excellent way to express some universal properties without funext, namely induction principles. The induction principle for sum types makes perfect sense, and importantly is usable, without funext; whereas if we assume funext then the induction principle is equivalent (modulo judgmentality of computation) to the universal property.
So why is this not good enough? Well, to prove the universal property from the induction principle for
, we need to apply that induction principle not only with motive
, but also with motive being a type of homotopies between functions into
. That’s not a problem here, but in some situations, we may want to express a universal property that doesn’t apply to all type families, so that we can’t assert a general induction principle.
A prime example is the notion of reflective subuniverse. As stated in the book, it involves an equivalence of hom-types: there is a reflector and maps
such that for any type
in the subuniverse, the induced map
is an equivalence. Like any universal property, this is unprovable and unusable without funext. However, it’s tricky to state an induction principle for
: if we did the obvious thing and ask it to induct into all families of types in the subuniverse, we would get not a reflective subuniverse but the stronger notion of a modality.
Another, closely related, example is the notion of local type. Given a map , a type
is called
-local if the induced map
is an equivalence. Again, this is unprovable and unusable without funext, but because we’re only talking about a property of a particular type
, we can’t express it as an induction principle.
In considering whether there is any way around this, our first thought might be to take the definition of equivalence, applied to a map such as or
, and replace all the occurrences of paths in function types by homotopies. This certainly gives a notion that is equivalent to the original if we have funext, and which at least doesn’t appear to require funext. However, it seems that in order to actually avoid funext, we have to be quite careful in choosing one out of the many definitions of “equivalence”.
To get an idea of where the problem lies, suppose we assert that is an “equivalence” in the following sense: for every
there is a
, such that
, and for any
we have
(plus, of course, a coherence). Now, one of the things we’d like to know, which certainly ought to follow from
being an “equivalence”, is that if
become the same upon precomposition with
, they should already be the same. We are doing without funext, so “the same” should mean a homotopy, i.e. we would like
to imply
. We naturally want to write
but there is a problem, namely that the “rec” operation need not preserve homotopies. It preserves equalities (paths), of course, since everything does, but without funext, we can’t make a homotopy into an equality.
The same problems arise with most of the other definitions of equivalence, but it turns out that there is one of them that works (after a bit of modification). This definition is not one of the better-known ones (in fact, I don’t think it appears in the book at all): a map is an equivalence if and only if (1)
is split surjective, i.e. there is a
such that
, and (2) for all
, the induced map
is also split surjective. Moreover, this is even a good definition of equivalence, i.e. if we assume funext then it is an hprop. (There is, I believe, no hope of any definition of equivalence being an hprop without funext, since any notion of equivalence will involve functions as part of its data.) Proving this is a nice exercise.
This definition is kind of cute because it is a direct enhancement of the propositions-as-types translation of “ is surjective and injective”. The PAT notion of “surjective” is split surjectivity, while the ordinary PAT notion of “injective” would say that for all
we have
; we simply add the assumption that the latter map is a section of
. (I don’t remember who first pointed this definition out to me.)
Let’s take this definition and funext-reduce it in the case of a precomposition map . Split surjectivity, with paths made into homotopies, says that for any
there is a
, such that
. This is exactly what we had before: maps
extend along
. However, making paths into homotopies in the second clause says that given
and a homotopy
, we have a homotopy
such that
. Thus, it exactly solves the problem we saw before!
We are not quite golden yet, however. What if we want to extend this to higher homotopies? That is, suppose we have two homotopies and a 2-homotopy
; can we conclude that
? This definition seems insufficient to show that without funext. Since we are assuming directly that functions and homotopies extend, maybe we need to assume directly that all higher homotopies extend as well. But is that possible?
Looking back at our chosen definition of equivalence, we are struck by the fact that it treats paths and points in an entirely analogous way. Moreover, clauses (1) and (2) are completely independent; neither depends on the other! Therefore, it admits a very simple recursive extension to all higher paths. We define what it means for a map to be n-path-split by recursion on n as follows:
- Every map is (uniquely) 0-path-split.
is
-path-split if (1) it is split surjective, and (2) for all
, the induced map
is
-path-split.
Thus, our previous notion of equivalence is what we now call “2-path-split”. It’s not hard to show by induction that (assuming funext) “n-path-split” is a good notion of equivalence whenever . Moreover, we can put them all together: say that
is ∞-path-split if it is n-path-split for all n. This is also a good notion of equivalence (since by funext, the dependent product of hprops is an hprop).
The notions of n-path-split as n goes to infinity are closely related to the higher notions of coherent adjoint equivalence. We expect, from homotopy theory, that if instead of cutting off the definition of half-adjoint equivalence after one 2-path coherence, we added also the second 2-coherence and one 3-coherence, or both 2- and 3-coherences and a 4-coherence, etc., we would get good notions of equivalence. At each step we add two new data; if we added only one, we would no longer have a good notion. The tower of path-splitness is entirely analogous, but easier to express and work with internally, because the two new data we add at each step don’t depend on the data added at any previous step; they depend only on the original map .
If we now funext-reduce ∞-path-splitness in the case of a precomposition map, we get a notion of universal property, expressed completely in terms of homotopies, that can deal with all higher homotopies as well. Given , we define what it means for a type family
to be n-extendable along
:
- Every
is (uniquely) 0-extendable along
.
is
-extendable along
if (1) for every
we have a
such that
, and (2) for all
, the family
is
-extendable.
Similarly, we have ∞-extendable families. We can now express an equivalence such as by saying that the constant family
is ∞-extendable along
. Note that we’ve come almost full circle: this is very close to the induction principles we began with, except that we’re only allowing “induction” into families of a very special recursively defined sort.
If we assume funext, then ∞-extendability is equivalent to saying that is ∞-path-split, and hence to saying that it’s an equivalence. However, both directions of the equivalence between ∞-extendability and ∞-path-splitness require funext, and in the absence of funext, ∞-extendability seems to be more useful.
I’ve formalized reflective subuniverses in Coq using this definition of the universal property, and the theory turns out to be entirely free of funext. I don’t have a proof that funext is never needed, but the evidence so far is clear.
To end with, let me say something about localization. Recall from above that given , we define a type
to be
-local if
is an equivalence. Since this is a precomposition map, we can ask instead that it is ∞-extendable, to get a notion of “
-local” that’s usable without funext. Now the localization of an arbitrary type
is supposed to be its reflection into
-local types, i.e. an
-local type
with a map
such that for any
-local
, we have an equivalence
.
We’ve known for a long time that can be constructed as a HIT. Simply take a definition of equivalence, funext reduce it, and make it into constructors of
. The easiest one to do this with is “bi-invertibility” (having both a section and a retraction), since it doesn’t involve higher paths; we get
Inductive : Type :=
| to_local :
| local_e1 :
| local_s1 : , local_e1 g (f s) = g s
| local_e2 :
| local_r2 : , local_e2 (h
f) t = h t.
However, the proof that is
-local and has the right universal property has always required funext. But now, with ∞-extendable maps, we can avoid this: instead of the latter four constructors above, we instead add a constructor asserting that the constant family
is ∞-extendable along
.
This is admittedly a different kind of constructor than we usually see for HITs; it’s parametrized over natural numbers and it has a different “shape” for each natural number. But there seems to be no problem formulating the induction principle and working with it. And semantically, we should be able to replace this constructor by an infinite number of more ordinary ones and then apply the usual methods.
In particular, note that this constructor inserts paths of all dimensions. Have we seen a HIT like that before? I don’t remember for sure, but I can’t think of any right now.
Postscript: Everything in this post has been formalized in the HoTT Coq library. Here is the pull request.
This looks very interesting: I really didn’t think it was possible. But I’m puzzled about a technical step. How can you, in your words, “mak[e] paths into homotopies” without using functional extensionality? What do you replace “ap” with then?
ap
is fine! it’sisequiv_ap
that Mike is avoiding here.Actually, isequiv_ap is also fine; it doesn’t require function extensionality to define ap or to show that ap-ing an equivalence is an equivalence. The technical way to “turn a path into a homotopy”, in the sense of being given a path f = g and getting out a homotopy
(or in the notation of the Coq library, f == g) is what the book calls happly and the Coq library calls ap10 — and that also doesn’t require funext! Funext is only required for the reverse direction, being given
and getting out f = g, which the book calls funext and the library calls path_arrow.
However, none of those is what I meant by “make paths into homotopies”. What I meant is taking a known definition and syntactically replacing paths by homotopies in it to obtain a new definition. That’s not an operation in the theory, it’s a metatheoretic construction. And there, indeed, the central problem is that there is no replacement for ap. If we have a definition involving a path p : f = g which applies it to an argument to obtain happly p x : f x = g x, then under our paths-to-homotopies translation p gets replaced by a homotopy p : forall x, f x = g x , and happly p x is simply replaced by p x. However, if our definition involves ap R p where R is some “functional” defined on the function type, such as rec : (A -> B) -> (O A -> B) (the asserted inverse of precomposition with the unit
), then there is nothing to replace ap R p by if we replace p by a homotopy.
However, this is exactly the problem that the notion of ∞-extendability solves. If a precomposition map
is ∞-extendable, then the
part of that definition says that for any two maps
and homotopy
, there is a homotopy
that yields p when precomposed with
.
I have yet to understand precisely how n-path-splitness specialises to n-extendability.
That being said, are you implying that the n-path-splitness uses equality in an irreductible manner, but that some of its specialisations may refer to homotopies instead. If so, this approach, besides being really nice, happens to lose some modularity with respect to using functional extensionality. Am I correct?
Yes, n-path-splitness, like other definitions of “
is an equivalence”, does refer to equalities in X and Y irreducibly. When we specialize it to “
is an equivalence”, i.e. we take
and
and
, then of course the result refers to equalities in
and
. But in that case, we can replace those equalities by homotopies to obtain a different notion, which I’m calling n-extendability, that is equivalent to n-path-splitness if we have funext, but in the absence of funext is more useful.
I’m not sure what you mean by “modularity”, but maybe this answers your question?
Yes, I believe it does.
It is indeed less modular not to have functional extensionality in that you don’t have a one-size-fits-all definition which you can apply in a generic way: you have to design every instance of a universal property “by hand”, so to speak. On the other hand the derivation is rather systematic, which is interesting, and, of course, makes you wonder if it can be automated.
It is really interesting to be able avoid function extensionality by changing the definition of equivalence, and it is nice that, in particular, if I understand correctly, (0) you don’t need funext to prove that “f is an equivalence” in this sense is a proposition . I presume that, then, (1) to show that this notion of equivalence is equivalent to any of the standard ones you will need funext, and, I ask (2) if one defines univalence using this notion of equivalence you propose, will we still get that UA implies funext?
Oh no, I’m very sorry that I gave that impression. You do definitely need funext to prove that “f is an equivalence” in this sense is a proposition, because this notion of of equivalence (like any notion of equivalence) involves functions as part of its data. I’ll edit the post to make that clear.
As for the other questions, if you’re talking about the notion of equivalence for general maps (not just precomposition maps) which I called “n-path-split for
“, then you don’t need funext to show that it is logically equivalent to any other notion of equivalence. Once you have funext, therefore, it follows that it is actually equivalent, since all of them are hprops. This is the same as the situation for comparing all the other definitions of equivalence. And I think it doesn’t matter much, for purposes of proving funext from univalence, which definition of equivalence you take.
Thanks for the clarification regarding (0), and hence (1), and for editing the post to account for that in the new parenthetical remark.
I am not yet convinced about (2), however (and this is not to be seen as criticism of your very interesting “neutral” notion of equivalence).
To begin with, you can’t run the proof of the book that UA->funext for your version of equivalence (which is really equivalence conditionally to funext), because the fact that your notion of equivalence is an abstract notion of equivalence in the sense of the book depends on funext (which is what we want to prove (from UA)). The point is that if you don’t know that funext holds, you can’t claim that Shulman-equivalence is equivalence (you do know, however, that it is implied by equivalence). Hence if you define Shulman-UA in the obvious way by mimicking the usual definition of UA with usual equivalence replaced by Shulman-equivalence, in MLTT *without* funext, I don’t see how the arguments we know would give that Shulman-UA implies funext. This is not to say that Shulman-UA doesn’t imply funext: it may well be the case that it actually does. But the arguments of the book cannot be directly reused, as they stand, to conclude this.
Actually, the fact that any definition of equivalence is an abstract notion of equivalence in the sense of the book (i.e. it is an hprop that is logically equivalent to qinv) depends on funext. None of the book’s definitions can be shown to be hprops without funext. So the situation with path-split maps is no different from any of them, and the proof that UA implies funext should work just as well.
Is there a reason you don’t want to use the terms I defined like “n-path-split”? Saying “Shulman-equivalence” is, among other things, ambiguous, becuase I mentioned several new-ish notions of equivalence in the post. One family of them, the n-path-split and ∞-path-split ones, have really the same status as all the other notions of equivalence: they are logically equivalent to all the others without funext, and with funext they are hprops and therefore actually equivalent to the others.
The other family, the n-extendable and ∞-extendable pairs, apply only to precomposition maps; they’re not a “notion of equivalence” in the general sense (even with funext) because they just don’t make sense for arbitrary functions. In particular, UA can’t be stated with these notions because UA is about all equivalences, not just precomposition ones. In the special case of precomposition maps where it makes sense, extendability is equivalent with funext to other notions of equivalence, while without funext it is not (as far as I can tell) even logically equivalent to them; in fact, both directions of the implication seem to require funext.
This reply is after a short private interaction with Mike, in which he showed me how to see that qinv(f) iff 2-path-split(f) with a nice short and clever argument for the left-to-right direction, which, crucially, doesn’t use funext (the other is immediate, again without using funext).
What we don’t have, without funext, is that isProp(2-path-split f). But luckily this turns out not to matter for the proof that 2-path-split-UA implies funext.
This is not easily visible from the proof given in the book. But it is immediate from the concise original proof given by Voevodsky in Coq, informally renderered at http://www.pitt.edu/~krk56/UA_implies_FE.pdf
That proof doesn’t depend on the particular notion of equivalence used (although officially it uses the notion given by the contractibility of all fibers). Moreover, crucially, it doesn’t depend on the fact that this notion is hpropositionally-valued.
The only thing it relies on is that, whatever notion “equiv” of equivalence is chosen, it satisfies equiv(f) iff qinv(f). It doesn’t ever use the assumption isProp(equiv f), or the particular nature of “equiv” other than the (incomplete) specification given by equiv(f) iff qinv(f).
So the situation with the notion of equivalence “2-path-split” is very pleasing: Mike can prove what he wants, without using funext, without being able to assert that 2-path-split really amounts to equivalence. But that doesn’t matter: (1) if funext holds, it is indeed equivalent to any of the standard notions, and, moreover, (2) if we use that notion of equivalence to define UA, then UA shows that this notion of equivalence is equivalent to any of the standard ones.
So, perhaps, a better abstract notion of equivalence is this: “e” is a notion of equivalence iff (1) e(f) iff qinv(f), and (2) UA(e) implies isProp(e(f)).
At least this is what is happening for the notion of equivalence e = 2-path-split.
Yes, that’s the same thing that happens with every general notion of equivalence; they’re all logically equivalent to each other without funext, and therefore any of them suffices for UA -> Funext.
I agree that the proof of UA -> Funext in the book is a bit confusing about its assumptions. The reason for that, I would say, is that it doesn’t really fit in the book at all. (-: In general, we made a conscious decision in the book not to spend any effort tracking which theorems require funext and UA; we take the point of view that we are studying only one formal system, and funext and UA are part of that system. Metatheoretic questions about how much we can do without those assumptions are interesting, and important in other contexts, but for purposes of exposition and to avoid confusing the newcomer, we decided not to mess around with sometimes assuming axioms and sometimes not.
Nevertheless, we also decided for some reason to include a proof that UA implies funext. I’m not sure exactly why; maybe just because it’s considered an important result? Unsurprisingly, this makes for a slightly awkward exposition in that section. Maybe we can improve it in the second edition.
Just one quick comment: for the notion of equivalence “equiv” originally considered by Vladimir, we do have, in MLTT without any further assumptions, in particular without funext, that equiv(f) iff qinv(f) and that isProp(equiv(f)). It is the second fact that fails (or rather is undecided) in MLTT for your notion of equivalence “2-path-split”. From what I understand in your blog post, you explicitly wanted to work in MLTT, rather than HoTT, which you successfully accomplished, to prove what you wanted. My comment is just an analysis of what is going on.
If equiv(f) = all fibers of f are contractible, then equiv(f) qinv(f) without funext, but isprop(equiv(f)) again requires funext.
Agreed.
Here’s a thought that occurred to me this morning, along the lines of Arnaud’s suggestion of automation. Consider iterated dependent products of the form
A map from a type of this form to another one
can be induced by a map of contexts
and a map
over
. We should be able to define ∞-extendability for any map of this sort. When
and
this will be ∞-extendability as defined in the post, applicable to precomposition maps
When
and
, it will be a corresponding version for postcomposition maps
And when
, it will be precisely ∞-path-splitness of an ordinary function
. Moreover, it can also be applied to maps such as currying
So this achieves some unification. We can also generalize it to include maps such as
and
by just allowing multiple choices of
for a fixed
. Does that yet include “all” universal properties?