type theory (dependent, extensional, intensional type theory)
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.
Let be a type in intensional type theory with dependent sums, dependent products, and identity types. We define a new type as follows:
(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
In other words, any two parallel paths in are equal.
A provably equivalent definition is
This says that a version of Streicher’s “axiom K” holds for h-sets.
One interesting consequence of this definition is the following, first proven by Michael Hedberg (see references).
Suppose that 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
(where is the path type of , ”+” forms the sum type, and on the right we have the -dependent function type into the empty type), has a section.
Then is a set.
Let be the given section. Thus, for any , is either a path from to or a function from to the empty type (implying that is also empty).
It suffices to exhibit an operation connecting any endo-path to the identity path . Given such a path, define . If lies in the second case, then is empty, a contradiction since we know it contains ; hence we may assume as well.
Let be the image of under the section . This is a path in the total space lying over the path in . Equivalently, it is a path in the fiber over from to , where denotes transport in the fibration along the path . However, we have defined , and transport in a path-space is just composition, so may be regarded as a path from to . Canceling , we obtain a path from to .
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