7.7 Modalities
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.
Definition 7.7.1.
A reflective subuniverse is a predicate such that for every we have a type such that and a map , with the property that for every with , the following map is an equivalence:
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.
For any reflective subuniverse, we can prove all the familiar facts about reflective subcategories from category theory, in the usual way. For instance, we have:
-
•
A type lies in if and only if is an equivalence.
-
•
is closed under retracts. In particular, lies in as soon as admits a retraction.
- •
- •
-
•
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.
Theorem 7.7.2.
If is any family of types in a reflective subuniverse ¶, then is also in ¶.
Proof.
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.
Corollary 7.7.3.
For any types and and any reflective subuniverse, the induced map is an equivalence.
Proof.
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.
Theorem 7.7.4.
For a reflective subuniverse ¶, the following are logically equivalent.
-
1.
If and , then is in ¶.
-
2.
for every , type family , and map , there exists such that for all .
Proof.
Suppose 1. Then in the situation of 2, the type lies in , and we have defined by . Thus, we have such that .
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 .
Conversely, suppose 2, and that and . Let be the composite
Then for we have
Denote this path by . Now if we define by , we have
Thus, the assumption yields such that . Together, and give a function defined by , while and the equality show that is a retraction of . Therefore, 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 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 .
Definition 7.7.5.
A modality is an operation for which there are
-
1.
functions for every type .
-
2.
for every and every type family , a function
-
3.
A path for each .
-
4.
For any , the function is an equivalence.
We say that is modal for if is an equivalence, and we write
(7.7.5) |
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.
Theorem 7.7.7.
Let be a type and let . Then the function
is an equivalence.
Proof.
By definition, the operation is a right inverse to . Thus, we only need to find a homotopy
for each , exhibiting it as a left inverse as well. By assumption, each is modal, and hence each type is also modal. Thus, it suffices to find a function of type
which follows from \autorefdefn:modality3. ∎
In particular, for every type and every modal type , we have an equivalence .
Corollary 7.7.8.
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.
Title | 7.7 Modalities |
---|---|
\metatable |