In mathematics, a path in a topological spaceX is a continuous functionf from the unit interval I = to X The initial point of the path is f and the terminal point is f. One often speaks of a "path from x to y" where x and y are the initial and terminal points of the path. Note that a path is not just a subset of X which "looks like" a curve, it also includes a parameterization. For example, the maps f = x and g = x2 represent two different paths from 0 to 1 on the real line. A loop in a spaceX based at x ∈ X is a path from x to x. A loop may be equally well regarded as a map f : I → X with f = f or as a continuous map from the unit circleS1 to X This is because S1 may be regarded as a quotient of I under the identification 0 ∼ 1. The set of all loops in X forms a space called the loop space of X. A topological space for which there exists a path connecting any two points is said to be path-connected. Any space may be broken up into path-connected components. The set of path-connected components of a space X is often denoted π0;. One can also define paths and loops in pointed spaces, which are important in homotopy theory. If X is a topological space with basepoint x0, then a path in X is one whose initial point is x0. Likewise, a loop in X is one that is based at x0.
Paths and loops are central subjects of study in the branch of algebraic topology called homotopy theory. A homotopy of paths makes precise the notion of continuously deforming a path while keeping its endpoints fixed. Specifically, a homotopy of paths, or path-homotopy, in X is a family of paths ft : I → X indexed by I such that
ft = x0 and ft = x1 are fixed.
the map F : I × I → X given by F = ft is continuous.
The paths f0 and f1 connected by a homotopy are said to be homotopic. One can likewise define a homotopy of loops keeping the base point fixed. The relation of being homotopic is an equivalence relation on paths in a topological space. The equivalence class of a path f under this relation is called the homotopy class of f, often denoted .
One can compose paths in a topological space in an obvious manner. Suppose f is a path from x to y and g is a path from y to z. The path fg is defined as the path obtained by first traversing f and then traversing g: Clearly path composition is only defined when the terminal point of f coincides with the initial point of g. If one considers all loops based at a point x0, then path composition is a binary operation. Path composition, whenever defined, is not associative due to the difference in parametrization. However it is associative up to path-homotopy. That is, = . Path composition defines a group structure on the set of homotopy classes of loops based at a point x0 in X. The resultant group is called the fundamental group of X based at x0, usually denoted π1. In situations calling for associativity of path composition "on the nose," a path in X may instead be defined as a continuous map from an interval to X for any real a ≥ 0. A path f of this kind has a length |f| defined as a. Path composition is then defined as before with the following modification: Whereas with the previous definition, f, g, and fg all have length 1, this definition makes |fg| = |f| + |g|. What made associativity fail for the previous definition is that although h and f have the same length, namely 1, the midpoint of h occurred between g and h, whereas the midpoint of f occurred between f and g. With this modified definition h and f have the same length, namely |f|+|g|+|h|, and the same midpoint, found at /2 in both h and f; more generally they have the same parametrization throughout.
There is a categoricalpicture of paths which is sometimes useful. Any topological space X gives rise to a category where the objects are the points of X and the morphisms are the homotopy classes of paths. Since any morphism in this category is an isomorphism this category is a groupoid, called the fundamental groupoid of X. Loops in this category are the endomorphisms. The automorphism group of a point x0 in X is just the fundamental group based at x0. More generally, one can define the fundamental groupoid on any subset A of X, using homotopy classes of paths joining points of A. This is convenient for the Van Kampen's Theorem.