Definition
A homotopy level (or h-level) is a stratification of types in HoTT based on the complexity of their identity types. The levels are indexed by integers starting at -2.
We define the predicate by Induction on :
- Base case (): is contractible if there is a center of contraction such that for all , .
- Inductive step (): is of level if its path spaces are of level . The first few levels are:
- -2: Contractible type (singleton up to homotopy).
- -1: Proposition (all paths are contractible; proof irrelevant).
- 0: Set (UIP holds; path spaces are propositions).
- 1: Groupoid (path spaces are sets).
- 2: 2-Groupoid.
Properties
Cumulativity
The hierarchy is cumulative. If is of level , it is also of level .
This follows from the fact that a contractible type is a proposition (all paths in a contractible type are contractible).
Closure
-levels are closed under standard type formers.
- -types: If is of level for all , then is of level .
- -types: If is of level and is of level for all , then is of level .
- Path types: If is of level , then is of level .
- Retracts: If is a retract of and is of level , then is of level .
- Equivalence: If and is of level , then is of level .
- Universes: The universe of all -types is itself an -type (univalence implies the universe of propositions is a set, etc.).
Agda
In Cubical Agda, -levels are often indexed by starting at 0 to avoid negative integers, shifting the index by 2.
HLevel : Type
HLevel = ℕ
isOfHLevel : HLevel → Type ℓ → Type ℓ
isOfHLevel 0 A = isContr A
isOfHLevel (suc n) A = (x y : A) → isOfHLevel n (x ≡ y)