# nLab h-set

### Context

#### Constructivism, Realizability, Computability

intuitionistic mathematics

# h-Sets

## Idea

In homotopy type theory an h-set is a type $X$ – hence a homotopy type – with the special property that any two of its terms $x,y : X$ are equal (equivalent) in an at most essentially unique way, hence that the identity type $(x = y) : Type$ is an h-proposition.

The notion of h-set is an internalization of the notion of 0-truncated object into homotopy type theory, essentially an internalization of the notion of set (or possibly of preset). See below in Relation to internal sets for more on this.

h-Sets can also 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) \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 “$\prod$” 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) \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) \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. (See also at axiom UIP.)

## 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

### Equivalent characterizations

One interesting consequence of this definition is the following, first proven in (Hedberg)

###### 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

$\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 \times A$-dependent function type into the empty type), has a section.

Then $A$ is a h-set.

###### Proof

Let $d$ be the given section. Thus, for any $x,y\colon 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 $p \in Paths(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 $q\in Paths(x,x)$ as well.

Let $r$ be the image of $(1_x,p) \in Paths_{A\times 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_A \to A\times 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 $q p$ to $q$. Canceling $q$, we obtain a path from $p$ to $1_x$.

Not every h-set has decidable equality (unless the law of excluded middle hold), but there are some other related equivalent characterizations.

• A type $A$ is an h-set if and only if all its identity types $x=_A y$ have split support, i.e. $\prod_{(x,y:A)} \Vert x=y\Vert \to (x=y)$. This is proven in (KECA).

• More generally, $A$ is an h-set if and only if there is some $R:A\to A\to Prop$ which is reflexive (i.e. $\prod_{(x:A)} R(x,x)$) and such that $\prod_{(x,y:A)} R(x,y) \to (x=y)$. This is Theorem 7.2.2 in the HoTT Book.

### Relation to internal sets

When using homotopy type theory as the ambient foundations, h-sets generally play the role of the sets. When homotopy type theory is the internal logic of some (∞,1)-category, then the h-sets are the “internal sets” in this internal logic. (Not to be confused with the other meaning of internal set.)

Note, though, that this notion of “internal set” is of a different sort from the usual notions of internal category or internal groupoid. If an internal set is an h-set, then an “internal groupoid” should mean a 1-truncated type, whereas an internal groupoid usually means some kind of groupoid object in an (∞,1)-category. Conversely, the usual meaning of “internal groupoid” suggests that the meaning of “internal set” should be something more like a setoid, with the h-sets being more like presets. This latter meaning is how “sets” are more often defined by constructive type theorists.

The point is that to be worthy of the name “set”, a notion ought to come with “quotients of equivalence relations”. If we start with a notion which does not have quotients, such as the types in ordinary Martin-Löf dependent type theory, then in order to get a good notion of “set” we need to “freely add quotients”, which semantically means passing to the exact completion whose objects are setoids. But if we start with a notion that does have quotients, then this is unnecessary. In homotopy type theory, h-sets do have quotients, which can be constructed using higher inductive types; thus it makes sense to call them “sets” rather than “presets”.

A good way to reconcile these seemingly clashing terminologies is to talk about exact completions of unary sites or (∞,1)-sites. The presence of a Grothendieck topology allows us to “remember” to what extent our given notion has well-behaved quotients: if we have no quotients, then we use the trivial topology, whereas if we have quotients, we can use the regular topology. And the exact completion builds in quotients “freely” but preserving those which the topology asserts to already exist. In particular, if we start with quotients (an exact category or $(\infty,1)$-category), then the exact completion of the regular topology is idempotent, whereas if we start with a trivial topology, then the exact completion gives a category of setoids. Thus, in general, the good notion of “internal set” in a unary site is “object of the exact completion”.

homotopy leveln-truncationhomotopy theoryhigher category theoryhigher topos theoryhomotopy type theory
h-level 0(-2)-truncatedcontractible space(-2)-groupoidtrue/unit type/contractible type
h-level 1(-1)-truncated(-1)-groupoid/truth value(0,1)-sheafmere proposition, h-proposition
h-level 20-truncatedhomotopy 0-type0-groupoid/setsheafh-set
h-level 31-truncatedhomotopy 1-type1-groupoid/groupoid(2,1)-sheaf/stackh-groupoid
h-level 42-truncatedhomotopy 2-type2-groupoid(3,1)-sheafh-2-groupoid
h-level 53-truncatedhomotopy 3-type3-groupoid(4,1)-sheafh-3-groupoid
h-level $n+2$$n$-truncatedhomotopy n-typen-groupoid(n+1,1)-sheafh-$n$-groupoid
h-level $\infty$untruncatedhomotopy type∞-groupoid(∞,1)-sheaf/∞-stackh-$\infty$-groupoid

## References

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

Formalization of set theory via h-sets in homotopy type theory is discussed in

Revised on February 24, 2016 07:18:49 by Anonymous Coward (138.38.103.61)