In the mathematical field of topology, a homeomorphism or topological isomorphism (from the Greek words ὅμοιος (homoios) = similar and μορφή (morphē) = shape = form (Latin deformation of morphe)) is a bicontinuous function between two topological spaces. Homeomorphisms are the isomorphisms in the category of topological spaces — that is, they are the mappings which preserve all the topological properties of a given space. Two spaces with a homeomorphism between them are called homeomorphic, and from a topological viewpoint they are the same.
Roughly speaking, a topological space is a geometric object, and the homeomorphism is a continuous stretching and bending of the object into a new shape. Thus, a square and a circle are homeomorphic to each other, but a sphere and a donut are not. An often-repeated joke is that topologists can't tell the coffee cup from which they are drinking from the donut they are eating, since a sufficiently pliable donut could be reshaped to the form of a coffee cup by creating a dimple and progressively enlarging it, while shrinking the hole into a handle.
Intuitively, a homeomorphism maps points in the first object that are "close together" to points in the second object that are close together, and points in the first object that are not close together to points in the second object that are not close together. Topology is the study of those properties of objects that do not change when homeomorphisms are applied.
A function with these three properties is sometimes called bicontinuous. If such a function exists, we say X and Y are homeomorphic. A self-homeomorphism is a homeomorphism of a topological space and itself. The homeomorphisms form an equivalence relation on the class of all topological spaces. The resulting equivalence classes are called homeomorphism classes.
Homeomorphisms are the isomorphisms in the category of topological spaces. As such, the composition of two homeomorphisms is again a homeomorphism, and the set of all self-homeomorphisms X → X forms a group, called the homeomorphism group of X, often denoted Homeo(X).
This characterization of a homeomorphism often leads to confusion with the concept of homotopy, which is actually defined as a continuous deformation, but from one function to another, rather than one space to another. In the case of a homeomorphism, envisioning a continuous deformation is a mental tool for keeping track of which points on space X correspond to which points on Y — one just follows them as X deforms. In the case of homotopy, the continuous deformation from one map to the other is of the essence, and it is also less restrictive, since none of the maps involved need to be one-to-one or onto. Homotopy does lead to a relation on spaces: homotopy equivalence.
There is a name for the kind of deformation involved in visualizing a homeomorphism. It is (except when cutting and regluing are required) an isotopy between the identity map on X and the homeomorphism from X to Y.