nLab
h-set

h-Sets

Idea

In homotopy type theory, the notion of h-set (or just a set, if no ambiguity will result) is an internalization of the notion of set / 0-truncated object.

hSets can be regarded as a way of embedding extensional type theory into intensional type theory.

Definition

Let A be a type in intensional type theory with dependent sums, dependent products, and identity types. We define a new type isSet(A) as follows:

isSet(A) x:A y:AisProp(x=y)isSet(A) \coloneqq \prod_{x\colon A} \prod_{y\colon A} isProp(x=y)

(using any equivalent definition of the predicate isProp for h-propositions; and where ”” denotes dependent product types and ”=” denotes identity types).

In other words, the only relationship between two elements of an h-set is whether they are equal; there is no room for more than one path between them. By beta-reducing this definition, we can express it as

isSet(A) x,y:A p,q:x=y(p=q)isSet(A) \coloneqq \prod_{x,y\colon A} \prod_{p,q\colon x=y} (p=q)

In other words, any two parallel paths in A are equal.

A provably equivalent definition is

isSet(A) x:A p:x=x(p=id x)isSet(A) \coloneqq \prod_{x\colon A} \prod_{p\colon x=x} (p=id_x)

This says that a version of Streicher’s “axiom K” holds for h-sets.

Examples

  • Most (non-higher) inductive types are h-sets (assuming that all their parameters and indices are so). In particular, the type of natural numbers is an h-set. This can be proven from Theorem 1 below.

Properties

One interesting consequence of this definition is the following, first proven by Michael Hedberg (see references).

Theorem

Suppose that A is a type which has decidable equality in the propositions as types logic (which is not the logic of h-propositions usually used in HoTT). In other words, the projection

Paths A+(0A×A) (Paths AA×A) A×A\array{Paths_A + (0\to A\times A)^{(Paths_A\to A\times A)}\\ \downarrow\\ A\times A}

(where Paths A is the path type of A, ”+” forms the sum type, and on the right we have the A×A-dependent function type into the empty type), has a section.

Then A is a set.

Proof

Let d be the given section. Thus, for any x,y:A, d(x,y) is either a path from x to y or a function from Paths(x,y) to the empty type (implying that Paths(x,y) is also empty).

It suffices to exhibit an operation connecting any endo-path pPaths(x,x) to the identity path 1 x. Given such a path, define q=d(x,x). If d(x,x) lies in the second case, then Paths(x,x) is empty, a contradiction since we know it contains 1 x; hence we may assume qPaths(x,x) as well.

Let r be the image of (1 x,p)Paths A×A((x,x),(x,x) under the section d. This is a path in the total space Paths A lying over the path (1 x,p) in A. Equivalently, it is a path in the fiber over x from (1 x,p) *(d(x,x)) to d(x,x), where (1 x,p) * denotes transport in the fibration Paths AA×A along the path (1 x,p). However, we have defined d(x,x)=q, and transport in a path-space is just composition, so r may be regarded as a path from qp to q. Canceling q, we obtain a path from p to 1 x.

Remarks

  • h-sets are also called h-level 2 types.

References

  • Michael Hedberg, A coherence theorem for Martin-Löf’s type theory, J. Functional Programming, 1998

  • Nicolai Kraus, A direct proof of Hedberg’s theorem, blog post