Joined: Feb 2023
Online
Okay everyone, I wanted to write up a somewhat comprehensive intro to the h-level hierarchy (also called truncation levels, or n-types) because I feel like this is one of the most beautiful structural ideas in HoTT and it took me an embarrassingly long time to really grok it. This ended up long. Grab your tea or catnip. π΅
Β§1 β The Core Idea
In classical set theory, all collections are essentially sets β elements are equal or they aren't, full stop. But in HoTT, types carry homotopical structure: paths between points, paths between paths, and so on upward. The h-level (or truncation level) of a type measures how much of this higher structure is non-trivial.
The key insight: every type in type theory is naturally an β-groupoid, with the structure of morphisms, 2-morphisms, 3-morphisms, etc., given by the identity type (propositional equality). The truncation level tells you at what dimension this structure collapses to triviality.
Β§2 β The Hierarchy
Here's the full table. Note that Voevodsky originally called these "types of h-level n" starting at 0, but the community now commonly uses the homotopy-theoretic numbering starting at β2:
| Level | HoTT Name | Classical Analogue | Intuition |
|---|---|---|---|
| β2 | Contractible (contr) | Singleton / terminal object | Exactly one element, up to homotopy |
| β1 | hProp / mere proposition | Truth value (Bool, Prop) | At most one element up to equality |
| 0 | hSet / set | Ordinary set (ZFC, ETCS) | Elements with no higher path structure |
| 1 | hGroupoid / groupoid | Category with invertible morphisms | Non-trivial paths, trivial 2-paths |
| 2 | 2-groupoid | Bigroupoid | Non-trivial 2-paths, trivial 3-paths |
| n | n-type | n-groupoid | Trivial above dimension n |
| β | General type (β-groupoid) | Topological space (up to hmtpy) | Possibly non-trivial at all levels |
Β§3 β Propositions: the β1-types (hProps)
A type A is a mere proposition (or hProp, or β1-type) if any two of its elements are propositionally equal. Formally:
isProp (A : Type) : Type := β (x y : A), x = y
This means there is at most one proof of the proposition β all proofs are equal. This is "proof irrelevance." Examples: β€ (trivially), β₯ (vacuously), x = y in an hSet, and any statement about decidable equality in β.
The β1-truncation βAβββ (written β₯Aβ₯) collapses any type into a proposition β it tells you merely whether A is inhabited, erasing the witness. This is also called "squashing" or propositional truncation. It's implemented beautifully as a higher inductive type that forces all elements to be equal.
Β§4 β Sets: the 0-types (hSets)
A type A is an h-set (or 0-type) if all its identity types are propositions. That is:
isSet (A : Type) : Type := β (x y : A), isProp (x = y)
In other words, there is at most one path between any two points β uniqueness of identity proofs (UIP). Examples: β, β€, Bool, finite types, and most "ordinary" mathematical objects you encounter every day. The 0-truncation βAββ gives you the set of connected components of the space A.
Β§5 β Groupoids: the 1-types
A 1-type is like a groupoid: it can have non-trivial paths between points (morphisms), but all 2-paths (paths between paths) are trivial β they are all equal. The universe of sets Set is itself a 1-type! (Because paths between sets are equivalences, and two equivalences are equal iff they agree on all elements β which is a proposition.)
A great motivating example: the circle SΒΉ in HoTT is a 1-type with a non-trivial fundamental group Οβ(SΒΉ) β
β€, while all higher homotopy groups vanish by 1-truncatedness.
Β§6 β The General Pattern
A type A is an n-type iff all of its identity types are (nβ1)-types. This gives us a recursive definition rooted at contractibility (β2-types). Every n-type is also an m-type for all m β₯ n.
A and B are n-truncated, then so are A Γ B and the type of equivalences A β B. Also, subuniverses of n-types are closed under Ξ£-types and Ξ -types (with care). The subuniverse of n-types is denoted π°β€β.
Β§7 β Connection to Classical Topology
The correspondence with classical topology is deep and beautiful. Every topological space X has a fundamental β-groupoid whose k-morphisms are the k-dimensional paths in X. HoTT's type theory natively encodes this: the identity types give you path spaces, and the tower of iterated identity types encodes all higher homotopy groups.
The n-types in HoTT correspond precisely to homotopy n-types in classical topology β spaces whose homotopy groups Οβ vanish for k > n. So an hSet (0-type) is like a space with trivial Οβ, Οβ, ... β just a discrete set of connected components.
Categorically, n-types correspond to n-groupoids. The homotopy hypothesis says this correspondence is essentially an equivalence of theories!
Anyway, hope this helps someone! This took me forever to internalize. Questions/corrections welcome nya~ πΎ