Universes, or types of types [01ET]

As we have presented it, dependent type theory has two kinds of entity: types and their elements. In many cases, it is useful to have a type whose elements are themselves types!

  1. Even though we have not been shy about writing phrases like “Let A be a type”, we do not currently have the ability to say something like “Let f be a polymorphic function on lists”. If we had a type of types like \mathsf {type}~\mathit {type}, we would give f a precise typing like f:{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(A:\mathsf {type})}}\;\mathsf {List}~A\to \mathsf {List}~A.
  2. If we had a type of types, we would be able to define more examples of dependent types that do something different depending on some value. For example, we would be able to define a type-level if expression without relying on large elimination. In fact, we will see that either large elimination or a universe is required to prove that \mathsf {true} is not equal to \mathsf {false}!

We do need to be careful, for two reasons:

  1. Syntactic objection. A type of types doesn’t make sense, because types are syntactically different kinds of entities from elements. We will solve this by distinguishing between the “code” of a type, which is an element, and the type that it encodes.
  2. Semantic objection. Even if we address the syntactic objection, a type of all types leads to contradiction via the Burali-Forti/Russell “paradox”, because such a type would include itself. Sidenote: the term “paradox” comes from a time when people were far more confused than we are today; we should think of these as no-go theorems instead. We will solve this by considering only types of some types.

Although there are many ways to handle these things in a technical sense, we will adopt a particular approach described by Rijke. The idea is to have a type \mathcal {U}~\mathit {type} together with a family X:\mathcal {U}\vdash \mathcal {T}[X]~\mathit {type}; then an element X:\mathcal {U} is thought of as encoding the type \mathcal {T}[X]~\mathit {type}.

It can be difficult to understand what is going on in the axiom of universes. It is simplest to understand in the case of n=1, so that we are looking at a single family x:A\vdash B[x]~\mathit {type}. In this case, the universe \mathcal {U}_{A,B} contains each type B[u] for u:A; so the role of the family here is to close the universe under all the components of a family at once. Multiple families are allowed for further expressivity; to see why this is needed, consider the following example of a universe hierarchy:

Many presentations of type theory (including those used in Agda, Rocq, and Lean) impose universe hierarchies at the start. We’ll take an agnostic approach, and just assume a universe where it is needed. We won’t assume that this universe necessarily comes from the hierarchy described above.

References

Reference. Introduction to Homotopy Type Theory [https://www.jonmsterling.com/rijke-2025/]

Reference. Théorie des topos et cohomologie étale des schémas (SGA 4) [https://www.jonmsterling.com/sga-4/]

Context

Lecture. Dependent types II [01FF]

Backlinks

Univalent universes [01HR]

Related

Example. A hierarchy of universes [01FA]

The axiom of universes [01F8]

Aside. Dependent types I › The boolean type › Type-level if-expressions [01DB]