Previously: Fibrations and Cofibrations. In topology, we say that two shapes are the same if there is a homeomorphism– an invertible continuous map– between them. Continuity means that nothing is broken and nothing is glued together. This is how we can turn a coffe cup into a torus. A homeomorphism, however, won’t let us shrink a torus to a circle. So if we are only interested in how many holes the shapes have, we have to relax our notion of equivalence. Let’s go back to the definition of homeomorphism. It is defined as a pair of continuous functions between two topological spaces, and , such that their compositions are identity maps, and , respectively. If we want to allow for extreme shrinkage, as with a torus shrinking down to a circle, we have to relax the identity conditions. A homotopy equivalence is a pair of continuous functions, but their compositions don’t have to be equal to identities. It’s enough that they are homotopic to identities. In other words, it’s possible to create an animation that transforms one to another. Take the example of a line and a point. The point is a trivial topological space where only the whole space (here, the singleton ) and the empty set are open. and are obviously not homeomorphic, but they don’t have any holes, so they should be homotopy equivalent. Indeed, let’s construct the equivalence as a pair of constant functions: and (the origin of ). Both are continuous: The pre-image is the whole real line, which is open. The pre-image of any open set in is , which is also open. The composition is equal to the identity on , so it’s automatically homotopic to it. The interesting part is the composition , which is emphatically not equal to identity on . We can however construct a homotpy between the identity and it. It’s a function that interpolates between them: ( is the unit interval .) Such a function exists: When a space is homotopy equivalent to a point, we say that it’s contractible. Thus is contractible. Similarly, n-dimensional spaces, , as well as n-dimensional balls are all contractible. A circle, however, is not contractible, because it has a hole. Another way of looking for holes in spaces is by trying to shrink loops. If there is a hole inside a loop, it cannot be continuously shrunk to a point. Imagine a loop going around a circle. There is no way you can “unwind” it without breaking something. In fact, you can have loops that wind n times around a circle. They can’t be homotopied into each other if their winding numbers are different. In general, paths in a topological space , i.e. continuous mappings , naturally split into equivalence classes with respect to homotopy. Two paths, and , sharing the same endpoints are in the same class if there is a homotopy between them: Moreover, two paths can be composed, as long as the endpoint of one coincides with the start point of the other (after performing appropriate reparametrizations). There is a unit of such composition, a constant path; and every path has its inverse, a path that traces the original but goes in the opposite direction. It’s easy to see that path composition induces a groupoid structure on the set of equivalence classes of paths. A groupoid is a category in which every morphism (here, path) is invertible. This particular groupoid is called the fundamental groupoid of the topological space . If we pick a base point in , the paths that start and end at this point form closed loops. These loops then form a fundamental group . Notice that, as long as there is a path from to , the fundamental groups at both points are isomorphic. This is because every loop at induces a loop at given by the concatenation . So there is essentially a single fundamental group for the whole space, as long as is path-connected, i.e., it doesn’t split into multiple disconnected chunks. Going back to our example of a circle, its fundamental group is the group of integers with addition. All loops that wind n-times around the circle in one direction correspond to the integer n. Negative integers correspond to loops winding in the opposite direction. If you follow an n-loop with an m-loop, you get an (m+n)-loop. Zero corresponds to loops that can be shrunk to a point. To tie these two notions of hole-counting together, it can be shown that two spaces that are homotopy equivalent also have the same fundamental groups. This makes sense, since equivalent spaces have the same holes. Not only that, they also have the same higher homotopy groups (as long as both are path-connected). We define the n-th homotopy group by replacing simple loops (which are homotopic to a circle, or a 1-dimensional sphere) with n-dimensional spheres. Attempts at shrinking those may detect higher-dimensional holes. For instance, imagine an Earth-like ball with it’s inner core scooped out. Any 1-loop inside its bulk can be shrunk to a point (it will glide off the core). But a 2-sphere that envelops the core cannot be shrunk. In fact such a 2-sphere can be wrapped around the core an arbitrary number of times. In math notation, we say: Corresponding to these higher homotopy groups there is also a higher homotopy groupoid, in which there are invertible paths, surfaces between paths, volumes between surfaces, etc. Taken together, these form an infinity groupoid. It is exactly the inspiration behind the infinity groupoid in homotopy type theory, HoTT. Spaces that are homotopy equivalent have the same homotopy groups, but the converse is not true. There are spaces that are not homotopy equivalent even though they have the same homotopy groups. This is why a weaker version of equivalence was introduced. A map between topological spaces is called a weak homotopy equivalence if it induces isomorphisms between all homotopy groups. There is a subtle difference between strong and weak equivalences. Strong equivalence can be broken by a local anomaly, like in the following example: Take , the set of natural numbers in which every number is considered an open set. Take with the topology inherited from the real line. The singleton set in is the obstacle to constructing a homeomorphism or a homotopy equivalence between and . That’s because it is not open (there is no open set in that contains it and nothing else). However, it’s impossible to have a non-trivial loop that would contain it, so and are weakly equivalent. Grothendieck conjectured that the infinity groupoid captures all information about a topological space up to weak homotopy equivalence. Weak equivalences, together with fibrations and cofibrations, form the foundation of weak factorization systems and Quillen model categories.