One of the major innovations of Homotopy Type Theory is the alternative interpretation of types and tokens it provides using ideas from homotopy theory. Homotopies can be thought of as continuous distortions between functions, or between the images of functions. Facts about homotopy theory are therefore only given ‘up to continuous distortions’, and only facts that are preserved by all such distortions are well-defined. Homotopy is usually presented by starting with topological spaces. Given two such spaces X and Y , we say that continuous maps f, g : X → Y are homotopic, written ‘f ∼ g’, just if there is a continuous map h : [0, 1] × X → Y with h(0, x) = f(x) and h(1, x) = g(x) ∀ x ∈ X. Such a map is a homotopy between f and g. For example, any two curves between the same pair of points in the Euclidean plane are homotopic to one another, because they can be continuously deformed into one another. However, in a space with a hole in it (such as an annulus) there can be paths between two points that are not homotopic, since a path going one way around the hole cannot be continuously deformed into a path going the other way around the hole.
Two spaces X and Y are homotopy equivalent if there are maps f : X → Y and f′ : Y → X such that f′◦ f ∼ idX and f ◦ f′ ∼ idY. This is an equivalence relation between topological spaces, so we can define the equivalence class [X] of all topological spaces homotopy equivalent to X, called the homotopy type of X. Homotopy theory does not distinguish between spaces that are homotopy equivalent, and thus homotopy types, rather than the topological spaces themselves, are the basic objects of study in homotopy theory.
In the homotopy interpretation of the basic language of HoTT we interpret types as homotopy types or ‘spaces’. It is then natural to interpret tokens of a type as ‘points’ in a space. The points of topological space have what we might call absolute identity, being elements of the underlying set. But a homotopy equivalence will in general map a given point x ∈ X to some other x′ ∈ X, and so when we work with homotopy types the absolute identity of the points is lost. Rather, we must say that a token belonging to a type is interpreted as a function from a one-point space into the space.
Given two points a and b in a space X, a path between them is a function γ : [0, 1] → X with γ(0) = a and γ(1) = b. However, given any such path, X can be smoothly distorted by retracting the path along its length toward a. Thus a space containing two distinct points and a path between them is homotopic to a space in which both points coincide (and the path is just a constant path at this point). We may therefore interpret a path between points as an identification of those points. Thus the identity type IdX(a,b) corresponds to the path space of paths from a to b. This also gives a straightforward justification for the principle of path induction: since any path is homotopic to a constant path (which corresponds to a trivial self-identification), any property (that respects homotopy) that holds of all trivial self-identifications must hold of all identifications.