Nearly all of the theory of -types and connectedness can be done in much greater generality. This section will not be used in the rest of the book.
Our first thought regarding generalizing the theory of -types might be to take \autorefthm:trunc-reflective as a definition.
We write , so means that and we have . We also write for the quasi-inverse of the above map. The notation may seem slightly odd, but it will make more sense soon.
A type lies in if and only if is an equivalence.
Colimits in can be constructed by applying to ordinary colimits of types.
Importantly, closure under products extends also to “infinite products”, i.e. dependent function types.
If is any family of types in a reflective subuniverse ¶, then is also in ¶.
For any , consider the function defined by . Since lies in , this extends to a function
Thus we can define by . Then is a retraction of , so that is in . ∎
In particular, if and is any type, then is in ¶. In categorical language, this means that any reflective subuniverse is an exponential ideal. This, in turn, implies by a standard argument that the reflector preserves finite products.
For any types and and any reflective subuniverse, the induced map is an equivalence.
It suffices to show that has the same universal property as . Thus, let ; we have
using the universal properties of and , along with the fact that is in ¶since is. It is straightforward to verify that this equivalence is given by composing with , 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 category 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 types—does not have many interesting reflective subcategories.
Two basic properties of -types are not shared by general reflective subuniverses: \autorefthm:ntypes-sigma (closure under -types) and \autorefthm:truncn-ind (truncation induction). However, the analogues of these two properties are equivalent to each other.
For a reflective subuniverse ¶, the following are logically equivalent.
If and , then is in ¶.
for every , type family , and map , there exists such that for all .
Now consider the functions and . By assumption, these become equal when precomposed with . Thus, by the universal property of , they are equal already, i.e. we have for all . Now we can define and the second component of yields .
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 restriction 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 and the functions , since we have .
A modality is an operation for which there are
functions for every type .
for every and every type family , a function
A path for each .
For any , the function is an equivalence.
We say that is modal for if is an equivalence, and we write
for the type of modal types.
Conditions 2 and 3 are very similar to \autorefthm:modal-char2, but phrased using rather than assuming to be valued in . This allows us to state the condition purely in terms of the operation , rather than requiring the predicate to be given in advance. (It is not entirely satisfactory, since we still have to refer to not-so-subtly in clause 4. We do not know whether 4 follows from 1–3.) However, the stronger-looking property of \autorefthm:modal-char2 follows from \autorefdefn:modality2 and 3, since for any we have , and we can pass back across this equivalence.
As with other induction principles, this implies a universal property.
Let be a type and let . Then the function
is an equivalence.
In particular, for every type and every modal type , we have an equivalence .
For any modality , the -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 ” (usually written ) or “necessarily ” (usually written ). The symbol 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 idempotent, 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 identity modality (i.e. the one defined by ).
For any modality , we define a map to be -connected if is contractible for all , and to be -truncated if is modal for all . All of the theory of \autorefsec:connectivity,\autorefsec:image-factorization which doesn’t involve relating -types for different values of applies verbatim in this generality. In particular, we have an orthogonal factorization system.
An important class of modalities which does not include the -truncations is the left exact modalities: those for which the functor 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--toposes. However, this is beyond the scope of this book.
Some particular examples of modalities other than -truncation can be found in the exercises.