In mathematics, specifically general topology, compactness is a property that seeks to generalize the notion of a closed and bounded subset of Euclidean space. The idea is that every infinite sequence of points has limiting values. For example, the real line is not compact since the sequence of natural numbers has no real limiting value. The open interval (0,1) is not compact because it excludes the limiting values 0 and 1, whereas the closed interval [0,1] is compact. Similarly, the space of rational numbers is not compact, because every irrational number is the limit of the rational numbers that are lower than it. On the other hand, the extended real number line is compact, since it contains both infinities. There are many ways to make this heuristic notion precise. These ways usually agree in a metric space, but may not be equivalent in other topological spaces.
One such generalization is that a topological space is sequentially compact if every infinite sequence of points sampled from the space has an infinite subsequence that converges to some point of the space. The Bolzano–Weierstrass theorem states that a subset of Euclidean space is compact in this sequential sense if and only if it is closed and bounded. Thus, if one chooses an infinite number of points in the closed unit interval [0, 1], some of those points will get arbitrarily close to some real number in that space. For instance, some of the numbers in the sequence 1/2, 4/5, 1/3, 5/6, 1/4, 6/7, ... accumulate to 0 (while others accumulate to 1). Since neither 0 nor 1 are members of the open unit interval (0, 1), those same sets of points would not accumulate to any point of it, so the open unit interval is not compact. Although subsets (subspaces) of Euclidean space can be compact, the entire space itself is not compact, since it is not bounded. For example, considering (the real number line), the sequence of points 0, 1, 2, 3, ... has no subsequence that converges to any real number.