7.7 Modalities

Nearly all of the theory of n-types and connectedness can be done in much greater generality. This sectionPlanetmathPlanetmathPlanetmathPlanetmathPlanetmathPlanetmathPlanetmathPlanetmath will not be used in the rest of the book.

Our first thought regarding generalizing the theory of n-types might be to take \autorefthm:trunc-reflective as a definition.

Definition 7.7.1.

A reflective subuniverse is a predicateMathworldPlanetmath P:UProp such that for every A:U we have a type \ocircleA such that P(\ocircleA) and a map ηA:A\ocircleA, with the property that for every B:U with P(B), the following map is an equivalence:


We write :\setofA:𝒰|P(A), so A: means that A:𝒰 and we have P(A). We also write 𝗋𝖾𝖼\ocircle for the quasi-inverse of the above map. The notation \ocircle may seem slightly odd, but it will make more sense soon.

For any reflective subuniverse, we can prove all the familiar facts about reflective subcategories from category theoryMathworldPlanetmathPlanetmathPlanetmathPlanetmath, in the usual way. For instance, we have:

  • A type A lies in if and only if ηA:A\ocircleA is an equivalence.

  • is closed underPlanetmathPlanetmath retracts. In particular, A lies in as soon as ηA admits a retraction.

  • The operation \ocircle is a functorMathworldPlanetmath in a suitable up-to-coherent-homotopy sense, which we can make precise at as high levels as necessary.

  • The types in are closed under all limits such as productsMathworldPlanetmathPlanetmathPlanetmath and pullbacksPlanetmathPlanetmath. In particular, for any A: and x,y:A, the identity type (x=Ay) is also in , since it is a pullback of two functions 𝟏A.

  • ColimitsMathworldPlanetmath in can be constructed by applying \ocircle to ordinary colimits of types.

Importantly, closureMathworldPlanetmath under products extends also to “infinite products”, i.e. dependent function types.

Theorem 7.7.2.

If B:A is any family of types in a reflective subuniverse ¶, then (x:A)B(x) is also in ¶.


For any x:A, consider the function 𝖾𝗏x:((x:A)B(x))B(x) defined by 𝖾𝗏x(f):f(x). Since B(x) lies in P, this extends to a function


Thus we can define h:\ocircle((x:A)B(x))(x:A)B(x) by h(z)(x):𝗋𝖾𝖼\ocircle(𝖾𝗏x)(z). Then h is a retraction of η(x:A)B(x), so that (x:A)B(x) is in . ∎

In particular, if B: and A is any type, then (AB) is in ¶. In categorical languagePlanetmathPlanetmath, this means that any reflective subuniverse is an exponential ideal. This, in turn, implies by a standard argument that the reflector preserves finite products.

Corollary 7.7.3.

For any types A and B and any reflective subuniverse, the induced map \ocircle(A×B)\ocircle(A)×\ocircle(B) is an equivalence.


It suffices to show that \ocircle(A)×\ocircle(B) has the same universal propertyMathworldPlanetmath as \ocircle(A×B). Thus, let C:; we have

(\ocircle(A)×\ocircle(B)C) =(\ocircle(A)(\ocircle(B)C))

using the universal properties of \ocircle(B) and \ocircle(A), along with the fact that BC is in ¶since C is. It is straightforward to verify that this equivalence is given by composing with ηA×ηB, as needed. ∎

It may seem odd that every reflective subcategory of types is automatically an exponential ideal, with a product-preserving reflector. However, this is also the case classically in the categoryMathworldPlanetmath of sets, for the same reasons. It’s just that this fact is not usually remarked on, since the classical category of sets—in contrast to the category of homotopy typesMathworldPlanetmath—does not have many interesting reflective subcategories.

Two basic properties of n-types are not shared by general reflective subuniverses: \autorefthm:ntypes-sigma (closure under Σ-types) and \autorefthm:truncn-ind (truncation inductionMathworldPlanetmath). However, the analogues of these two properties are equivalentMathworldPlanetmathPlanetmathPlanetmathPlanetmath to each other.

Theorem 7.7.4.

For a reflective subuniverse ¶, the following are logically equivalent.

  1. 1.

    If A: and B:A, then (x:A)B(x) is in ¶.

  2. 2.

    for every A:𝒰, type family B:\ocircleA, and map g:(a:A)B(η(a)), there exists f:(z:\ocircleA)B(z) such that f(η(a))=g(a) for all a:A.


Suppose 1. Then in the situation of 2, the type (z:\ocircleA)B(z) lies in , and we have g:A(z:\ocircleA)B(z) defined by g(a):(η(a),g(a)). Thus, we have 𝗋𝖾𝖼\ocircle(g):\ocircleA(z:\ocircleA)B(z) such that 𝗋𝖾𝖼\ocircle(g)(η(a))=(η(a),g(a)).

Now consider the functions 𝗉𝗋2𝗋𝖾𝖼\ocircle(g):\ocircleA\ocircleA and 𝗂𝖽\ocircleA. By assumptionPlanetmathPlanetmath, these become equal when precomposed with η. Thus, by the universal property of \ocircle, they are equal already, i.e. we have pz:𝗉𝗋2(𝗋𝖾𝖼\ocircle(g)(z))=z for all z. Now we can define f(z):pz*(𝗉𝗋2(𝗋𝖾𝖼\ocircle(g)(z))), and the second component of 𝗋𝖾𝖼\ocircle(g)(η(a))=(η(a),g(a)) yields f(η(a))=g(a).

Conversely, suppose 2, and that A: and B:A. Let h be the composite


Then for z:(x:A)B(x) we have

h(η(z)) =η-1(\ocircle(𝗉𝗋1)(η(z)))

Denote this path by pz. Now if we define C:\ocircle((x:A)B(x))𝒰 by C(w):B(h(w)), we have


Thus, the assumption yields f:(w:\ocircle((x:A)B(x)))C(w) such that f(η(z))=g(z). Together, h and f give a function k:\ocircle((x:A)B(x))(x:A)B(x) defined by k(w):(h(w),f(w)), while pz and the equality f(η(z))=g(z) show that k is a retraction of η(x:A)B(x). Therefore, (x:A)B(x) is in ¶. ∎

Note the similarity to the discussion in \autorefsec:htpy-inductive. The universal property of the reflector of a reflective subuniverse is like a recursion principle with its uniqueness property, while \autorefthm:modal-char2 is like the corresponding induction principle. Unlike in \autorefsec:htpy-inductive, the two are not equivalent here, because of the restrictionPlanetmathPlanetmathPlanetmath that we can only eliminate into types that lie in . Condition 1 of \autorefthm:modal-char is what fixes the disconnect.

Unsurprisingly, of course, if we have the induction principle, then we can derive the recursion principle. We can also derive its uniqueness property, as long as we allow ourselves to eliminate into path types. This suggests the following definition. Note that any reflective subuniverse can be characterized by the operation \ocircle:𝒰𝒰 and the functions ηA:A\ocircleA, since we have P(A)=𝗂𝗌𝖾𝗊𝗎𝗂𝗏(ηA).

Definition 7.7.5.

A modality is an operation \ocircle:UU for which there are

  1. 1.

    functions ηA\ocircle:A\ocircle(A) for every type A.

  2. 2.

    for every A:𝒰 and every type family B:\ocircle(A)𝒰, a function

  3. 3.

    A path 𝗂𝗇𝖽\ocircle(f)(ηA\ocircle(a))=f(a) for each f:(a:A)\ocircle(B(ηA\ocircle(a))).

  4. 4.

    For any z,z:\ocircle(A), the function ηz=z\ocircle:(z=z)\ocircle(z=z) is an equivalence.

We say that A is modal for \ocircle if ηA\ocircle:A\ocircle(A) is an equivalence, and we write

𝒰\ocircle:\setofX:𝒰|X is \ocircle-modal (7.7.5)

for the type of modal types.

Conditions 2 and 3 are very similar to \autorefthm:modal-char2, but phrased using \ocircleB(z) rather than assuming B to be valued in . This allows us to state the condition purely in terms of the operation \ocircle, rather than requiring the predicate P:𝒰𝖯𝗋𝗈𝗉 to be given in advance. (It is not entirely satisfactory, since we still have to refer to P not-so-subtly in clause 4. We do not know whether 4 follows from 13.) However, the stronger-looking property of \autorefthm:modal-char2 follows from \autorefdefn:modality2 and 3, since for any C:\ocircleA𝒰\ocircle we have C(z)\ocircleC(z), and we can pass back across this equivalence.

As with other induction principles, this implies a universal property.

Theorem 7.7.7.

Let A be a type and let B:\ocircle(A)U\ocircle. Then the function


is an equivalence.


By definition, the operation 𝗂𝗇𝖽\ocircle is a right inverseMathworldPlanetmath to (ηA\ocircle). Thus, we only need to find a homotopyMathworldPlanetmathPlanetmath


for each s:(z:\ocircle(A))B(z), exhibiting it as a left inverse as well. By assumption, each B(z) is modal, and hence each type s(z)=RX\ocircle(sηA\ocircle)(z) is also modal. Thus, it suffices to find a function of type


which follows from \autorefdefn:modality3. ∎

In particular, for every type A and every modal type B, we have an equivalence (\ocircleAB)(AB).

Corollary 7.7.8.

For any modality \ocircle, the \ocircle-modal types form a reflective subuniverse satisfying the equivalent conditions of \autorefthm:modal-char.

Thus, modalities can be identified with reflective subuniverses closed under Σ-types. The name modality comes, of course, from modal logic, which studies logic where we can form statements such as “possibly A” (usually written A) or “necessarily A” (usually written A). The symbol \ocircle is somewhat common for an arbitrary modal operator. Under the propositions-as-types principle, a modality in the sense of modal logic corresponds to an operation on types, and \autorefdefn:modality seems a reasonable candidate for how such an operation should be defined. (More precisely, we should perhaps call these idempotentMathworldPlanetmathPlanetmath, monadic modalities; see the Notes.) As mentioned in \autorefsubsec:when-trunc, we may in general use adverbs to speak informally about such modalities, such as “merely” for the propositional truncation and “purely” for the identityPlanetmathPlanetmathPlanetmath modality (i.e. the one defined by \ocircleA:A).

For any modality \ocircle, we define a map f:AB to be \ocircle-connected if \ocircle(𝖿𝗂𝖻f(b)) is contractibleMathworldPlanetmath for all b:B, and to be \ocircle-truncated if 𝖿𝗂𝖻f(b) is modal for all b:B. All of the theory of \autorefsec:connectivity,\autorefsec:image-factorization which doesn’t involve relating n-types for different values of n applies verbatim in this generality. In particular, we have an orthogonal factorization system.

An important class of modalities which does not include the n-truncations is the left exact modalities: those for which the functor \ocircle preserves pullbacks as well as finite products. These are a categorification of “Lawvere-Tierney topologies” in elementary topos theory, and correspond in higher-categorical semantics to sub-(,1)-toposes. However, this is beyond the scope of this book.

Some particular examples of modalities other than n-truncation can be found in the exercises.

Title 7.7 Modalities