So far in this series we’ve described the correspondence between type theory and homotopy theory and defined some basic notions of homotopy theory in type theory, including equivalences in several ways. We’ve also mentioned a few axioms that we may want to add to intensional type theory, including “function extensionality”, a subobject classifier, and a truncation π − 1 = τ ≤ − 1 \pi_{-1} = \tau_{\le -1} into (-1)-types.

However, nothing we’ve said so far excludes the possibility that all types are discrete (= 0-types = sets). Intensional type theory plus function extensionality has sound semantics in any locally cartesian closed 1-category; and if the category is regular, then τ ≤ − 1 \tau_{\le -1} exists; while if it is a topos, then of course it has a subobject classifier. But today I’ll introduce Voevodsky’s univalence axiom, which is not valid in any 1-categorical semantics—or, indeed, in n n -categorical semantics for any finite n n ! The univalence axiom is perhaps the easiest and most intuitive way to require that our homotopy type theory is honestly “homotopical”, and it also has other pleasant consquences (including, perhaps surprisingly, function extensionality).

In Voevodsky’s original phrasing, the univalence axiom is an augmentation of universes, which are a type-theoretic notion that I haven’t mentioned yet. (If you don’t like universes, that’s okay; carry on reading.) At an informal level, I think type-theoretic universes are not very different from the universes of the Grothendieck sort that you may be more familiar with, and are even more closely related to their categorial analogues. In terms of categorical semantics, a universe is a type U U , together with a display map E → U E\to U (that is, a type E ( u ) E(u) dependent on u ∈ U u\in U ). We think of the elements of U U as “codes for types”, with u ∈ U u\in U coding for the type E ( u ) E(u) . And we require that the type-theoretic operations, such as dependent sums and products, are represented by operations on U U , so that types of the form E ( u ) E(u) are closed under such operations.

Type-theoretically, we usually identify types E ( u ) E(u) with their codes u ∈ U u\in U , so that the elements (terms) of U U are types. We generally assume every type is contained in some universe, so that we can replace judgments of the form “ A A is a type” with “ A ∈ U A\in U ” for some universe U U . In particular, any universe U = U 0 U=U_0 must be an element of some universe U 1 U_1 , which must be an element of some universe U 2 U_2 , and so on; we often postulate that every type belongs to one of a specific sequence of universes U 0 ∈ U 1 ∈ U 2 ∈ … U_0 \in U_1\in U_2\in\dots . Frequently a universe is written as “ Type Type ” or “ Type n Type_n ”.

Thus a universe is a “type of types.” If we regard types as sets, then this is like a set of sets. But if we are category theorists, we know that it’s unnatural to have a set of sets; really we should have a category, or at least a groupoid, of sets. And we should have a 2-groupoid of groupoids, and an ( n + 1 ) (n+1) -groupoid of n n -groupoids, and so on. But the nice thing about ∞ \infty is that ∞ = ∞ + 1 \infty = \infty+1 , so that we can expect to have an ∞ \infty -groupoid of ∞ \infty -groupoids. Thus, arguably, it’s really in the homotopy context that the notion of universe is “most sensible”.

Now it’s all well and good to say we have an ∞ \infty -groupoid of ∞ \infty -groupoids, but what is that ∞ \infty -groupoid? Its objects are of course ∞ \infty -groupoids, but we also know what its morphisms should be, and its 2-morphisms, and so on: they should be the equivalences, homotopies, and so on between ∞ \infty -groupoids. However, the basic type-theoretic notion of universe doesn’t tell us anything about what the path-types of the universe are like; this is what the univalence axiom fixes. (It’s analogous to how plain intensional type theory doesn’t tell us anything about when two functions should be considered equal; hence we need function extensionality.)

To make things more precise, let A A and B B be types in some universe U U ; we want to specify what Paths U ( A , B ) Paths_U(A,B) should be. And we have a natural candidate, namely the type

Equiv ( A , B ) ≔ ∑ f : A → B IsEquiv ( f ) . Equiv(A,B) \coloneqq \sum_{f\colon A \to B} IsEquiv(f).

of equivalences from A A to B B . (Remember that IsEquiv ( f ) IsEquiv(f) is a proposition, so it makes sense to think of points of Equiv ( A , B ) Equiv(A,B) as functions A → B A\to B with the property of “being an equivalence.”) Moreover, we have a natural map

extern U , A , B : Paths U ( A , B ) → Equiv ( A , B ) extern_{U,A,B} \colon Paths_U(A,B) \to Equiv(A,B)

and the univalence axiom for U U simply states that this map is an equivalence for any A A and B B , i.e.

UnivalenceAxiom ( U ) ≔ ∏ A , B ∈ U IsEquiv ( extern U , A , B ) . UnivalenceAxiom(U) \coloneqq \prod_{A,B\in U} IsEquiv(extern_{U,A,B}).

How do we define extern U , A , B extern_{U,A,B} ? Remember from the first post that the “elimination rule” for path-types says:

Given a type C ( x , y , p ) C(x,y,p) which may depend on two points x , y ∈ X x,y\in X and a path p ∈ Paths X ( x , y ) p\in Paths_X(x,y) between them, if we have a way to produce an element of C ( x , x , r x ) C(x,x,r_x) for any x ∈ X x\in X , then we can “transport” it along any path p ∈ Path X ( x , y ) p\in Path_X(x,y) to produce a canonical element of C ( x , y , p ) C(x,y,p) (and in such a way that if we transport it along r x r_x then it doesn’t change).

We’re going to apply this rule with X = U X=U , x = A x=A , and y = B y=B . We’ll take the type C ( A , B , p ) C(A,B,p) to be Equiv ( A , B ) Equiv(A,B) , which depends on A A and B B and (vacuously) a path between them. Now we do have a way to produce an element of C ( A , A , r A ) = Equiv ( A , A ) C(A,A,r_A) = Equiv(A,A) , namely the identity function 1 A : A → A 1_A\colon A\to A (which is an equivalence; I’ll leave proving that as an exercise). Therefore, we can transport the identity 1 A 1_A along any path p ∈ Paths U ( A , B ) p\in Paths_U(A,B) to produce a canonical element of Equiv ( A , B ) Equiv(A,B) corresponding to p p . This defines the map extern U , A , B extern_{U,A,B} .

Let’s think first about the semantics of univalence. First of all, in the form I stated it above, it is an axiom about a particular universe U U . A universe satisfying the univalence axiom is called a univalent universe. We generally assume that all of the specified universes U 0 ∈ U 1 ∈ U 2 ∈ … U_0 \in U_1\in U_2\in\dots are univalent.

In the “standard” model in ∞ \infty -groupoids, we obtain a univalent universe from “the ∞ \infty -groupoid of all ∞ \infty -groupoids bounded in size by some inaccessible cardinal κ \kappa ”. Thus, if there are arbitrarily large inaccessibles, every type will belong to some univalent universe. (I’m not sure whether inaccessibles are necessary here or whether some weaker assumption would suffice.) I believe this is the only model with enough univalent universes that has been constructed in set theory with anything approaching rigor (by Voevodsky).

However, I think most people expect that in more general ( ∞ , 1 ) (\infty,1) -categorical semantics, we ought to obtain a univalent universe from any object classifier with strong enough closure properties. In particular, in any (Grothendieck) ( ∞ , 1 ) (\infty,1) -topos, there ought to be a univalent universe of all “ κ \kappa -compact” types, for any inaccessible κ \kappa .

Moreover, any “full subuniverse” of a univalent universe will again be a univalent universe, as long as it is closed under the type-theoretic operations. In particular, if U U is any univalent universe, then its full subuniverse of n n -types is again univalent for any n n , and that subuniverse will itself be an ( n + 1 ) (n+1) -type. Thus a univalent universe need not itself be of infinite h-level: we can have a univalent groupoid (1-type) of small sets (0-types), a univalent 2-groupoid (2-type) of small groupoids, and so on. At the bottom, we can have a univalent set (0-type) of small truth values ((-1)-types).

In particular, a subobject classifier, if one exists, is also a univalent universe; so to get ourselves out of the world of sets we need at least two univalent universes. Similarly, we can have a sequence of univalent universes U 0 ∈ U 1 ∈ U 2 ∈ … U_0 \in U_1\in U_2\in\dots in which U 0 U_0 contains only (-1)-types and is itself a 0-type, U 1 U_1 contains only 0-types and is itself a 1-type, and so on. Such a stratification of universes by “categorical dimension” as well as by size does seem to match much of mathematical practice—but only outside of homotopy theory. For homotopy theory, we do really want to have ∞ \infty -types that aren’t n n -types for any finite n n (such as, for instance, the 2-sphere S 2 S^2 ), and an infinite sequence of univalent universes doesn’t seem to be enough to guarantee this. I’ll come back to this later.

Vladimir explained the origin of the word “univalent” as follows:

a universal fibration is one of which every other fibration is a pullback in a unique way (up to homotopy).

a versal fibration is one of which every other fibration is a pullback in some way, not necessarily unique.

a univalent fibration is one of which every other fibration is a pullback in at most one way (up to homotopy).

Thus the univalence axiom asserts that the structural fibration of the universe is univalent.

Now, the principal way we use the univalence axiom is as follows: given an equivalence f : A → B f\colon A \to B , we apply the inverse of extern U , A , B extern_{U,A,B} to get a path f ^ ∈ Paths U ( A , B ) \hat{f}\in Paths_U(A,B) , then apply the above-mentioned “elimination rule” for elements of path-types. Putting this together, we get the following consequence of univalence, apparently first formulated by Peter Lumsdaine and Andrej Bauer.

Given a type C ( A , B , f ) C(A,B,f) which may depend on two types A , B A,B and an equivalence f : A → B f\colon A\to B between them, if we have a way to produce an element of C ( A , A , 1 x ) C(A,A,1_x) for any type A A , then we can “transport” it along any equivalence f : A → B f\colon A\to B to produce a canonical element of C ( A , B , f ) C(A,B,f) (and in such a way that if we transport it along 1 A 1_A then it doesn’t change).

The elimination rule for paths is sometimes called path induction, since it is an instance of the general induction principle for inductively defined types. By analogy, we refer to the above consequence of univalence as equivalence induction. Informally, it means that

Given an equivalence f : A → B f\colon A\to B , we can “identify” B B with A A along f f . Specifically, in any construction we can perform, or theorem we can prove, starting only from a type A A , we can obtain another valid construction or theorem by replacing some copies of A A with B B and any necessary occurrences of 1 A 1_A by f f . Behind the scenes, this replacement uses f f and its inverse to silently transfer data back and forth between A A and B B as necessary.

Such “identification” of course a very common thing to do in mathematics, often without even remarking on it! But usually, if it is justified at all, it is “by abuse of notation” or by trusting the reader to do the translation. The univalence axiom formalizes it, makes it happen “automatically” in the background, and makes it “natural/continuous.”

Moreover, equivalence induction actually implies the full univalence axiom. For if we apply equivalence induction to the type C ( A , B , f ) ≔ Paths U ( A , B ) C(A,B,f) \coloneqq Paths_U(A,B) and the identity path r A ∈ Paths U ( A , A ) r_A\in Paths_U(A,A) , we obtain a way to make any equivalence f : A → B f\colon A\to B into a path f ^ ∈ Paths U ( A , B ) \hat{f}\in Paths_U(A,B) . The final condition that transporting along the identity equivalence leaves something unchanged (together with the same property for the identity path) then makes this construction into an inverse of extern U , A , B extern_{U,A,B} . I’ve checked this in Coq. But it’s not really surprising, because equivalence induction gives the type Equiv ( A , B ) Equiv(A,B) the “same inductive/universal property” as Paths U ( A , B ) Paths_U(A,B) . (But I don’t know how to state equivalence induction in a way that is evidently a proposition.)

Note that equivalence induction makes no reference to a particular universe containing A A and B B , except that the type C ( A , B , f ) C(A,B,f) is required to be defined “parametrically” for all A , B A,B in the universe. In particular, this implies that if U 1 U_1 is a univalent universe and U 2 U_2 is a “larger” universe, in the sense that every type in U 1 U_1 also belongs to U 2 U_2 , then extern U 2 , A , B extern_{U_2,A,B} is also an equivalence for any A , B ∈ U 1 A,B\in U_1 , whether or not U 2 U_2 itself is univalent. (It can apparently still be the case that a “smaller” non-univalent universe is contained in a “larger” univalent one, however.) So univalence is almost a property of types (or pairs of types) rather than a property of universes. Furthermore, we can make sense of equivalence induction even if there are no universes, if instead we have some sort of “polymorphism” allowing us to make sense of “defining a type parametrically over other types”. (Thanks to Peter Lumsdaine for correcting some errors in the original version of this paragraph; see his comment and ensuing discussion below.)

Univalence also implies other useful things, like function extensionality and (maybe, with some help) quotients, but let’s save those for another day.