# Compactly generated space

In topology, a topological space $X$ is called a compactly generated space or k-space if its topology is determined by compact spaces in a manner made precise below. There is in fact no commonly agreed upon definition for such spaces, as different authors use variations of the definition that are not exactly equivalent to each other. Also some authors include some separation axiom (like Hausdorff space or weak Hausdorff space) in the definition of one or both terms, and others don't.
In the simplest definition, a compactly generated space is a space that is coherent with the family of its compact subspaces, meaning that for every set $A\subseteq X,$ $A$ is open in $X$ if and only if $A\cap K$ is open in $K$ for every compact subspace $K\subseteq X.$ Other definitions use a family of continuous maps from compact spaces to $X$ and declare $X$ to be compactly generated if its topology coincides with the final topology with respect to this family of maps. And other variations of the definition replace compact spaces with compact Hausdorff spaces.
Compactly generated spaces were developed to remedy some of the shortcomings of the category of topological spaces. In particular, under some of the definitions, they form a cartesian closed category while still containing the typical spaces of interest, which makes them convenient for use in algebraic topology.

## Definitions
### General framework for the definitions

Let $(X,T)$ be a topological space, where $T$ is the topology, that is, the collection of all open sets in $X.$
There are multiple (non-equivalent) definitions of compactly generated space or k-space in the literature. These definitions share a common structure, starting with a suitably specified family ${\mathcal {F}}$ of continuous maps from some compact spaces to $X.$ The various definitions differ in their choice of the family ${\mathcal {F}},$ as detailed below.
The final topology $T_{\mathcal {F}}$ on $X$ with respect to the family ${\mathcal {F}}$ is called the k-ification of $T.$ Since all the functions in ${\mathcal {F}}$ were continuous into $(X,T),$ the k-ification of $T$ is finer than (or equal to) the original topology $T$. The open sets in the k-ification are called the k-open sets in $X;$ they are the sets $U\subseteq X$ such that $f^{-1}(U)$ is open in $K$ for every $f:K\to X$ in ${\mathcal {F}}.$ Similarly, the k-closed sets in $X$ are the closed sets in its k-ification, with a corresponding characterization. In the space $X,$ every open set is k-open and every closed set is k-closed. The space $X$ together with the new topology $T_{\mathcal {F}}$ is usually denoted $kX.$
The space $X$ is called compactly generated or a k-space (with respect to the family ${\mathcal {F}}$) if its topology is determined by all maps in ${\mathcal {F}}$, in the sense that the topology on $X$ is equal to its k-ification; equivalently, if every k-open set is open in $X,$ or if every k-closed set is closed in $X;$ or in short, if $kX=X.$
As for the different choices for the family ${\mathcal {F}}$, one can take all the inclusions maps from certain subspaces of $X,$ for example all compact subspaces, or all compact Hausdorff subspaces. This corresponds to choosing a set ${\mathcal {C}}$ of subspaces of $X.$ The space $X$ is then compactly generated exactly when its topology is coherent with that family of subspaces; namely, a set $A\subseteq X$ is open (resp. closed) in $X$ exactly when the intersection $A\cap K$ is open (resp. closed) in $K$ for every $K\in {\mathcal {C}}.$ Another choice is to take the family of all continuous maps from arbitrary spaces of a certain type into $X,$ for example all such maps from arbitrary compact spaces, or from arbitrary compact Hausdorff spaces.
These different choices for the family of continuous maps into $X$ lead to different definitions of compactly generated space. Additionally, some authors require $X$ to satisfy a separation axiom (like Hausdorff or weak Hausdorff) as part of the definition, while others don't. The definitions in this article will not comprise any such separation axiom.
As an additional general note, a sufficient condition that can be useful to show that a space $X$ is compactly generated (with respect to ${\mathcal {F}}$) is to find a subfamily ${\mathcal {G}}\subseteq {\mathcal {F}}$ such that $X$ is compactly generated with respect to ${\mathcal {G}}.$ For coherent spaces, that corresponds to showing that the space is coherent with a subfamily of the family of subspaces. For example, this provides one way to show that locally compact spaces are compactly generated.
Below are some of the more commonly used definitions in more detail, in increasing order of specificity.
For Hausdorff spaces, all three definitions are equivalent. So the terminology compactly generated Hausdorff space is unambiguous and refers to a compactly generated space (in any of the definitions) that is also Hausdorff.

### Definition 1

Informally, a space whose topology is determined by its compact subspaces, or equivalently in this case, by all continuous maps from arbitrary compact spaces.
A topological space $X$ is called compactly-generated or a k-space if it satisfies any of the following equivalent conditions:
    (1) The topology on $X$ is coherent with the family of its compact subspaces; namely, it satisfies the property:
       a set $A\subseteq X$ is open (resp. closed) in $X$ exactly when the intersection $A\cap K$ is open (resp. closed) in $K$ for every compact subspace $K\subseteq X.$
    (2) The topology on $X$ coincides with the final topology with respect to the family of all continuous maps $f:K\to X$ from all compact spaces $K.$
    (3) $X$ is a quotient space of a topological sum of compact spaces.
    (4) $X$ is a quotient space of a weakly locally compact space.
As explained in the final topology article, condition (2) is well-defined, even though the family of continuous maps from arbitrary compact spaces is not a set but a proper class.
The equivalence between conditions (1) and (2) follows from the fact that every inclusion from a subspace is a continuous map; and on the other hand, every continuous map $f:K\to X$ from a compact space $K$ has a compact image $f(K)$ and thus factors through the inclusion of the compact subspace $f(K)$ into $X.$

### Definition 2

Informally, a space whose topology is determined by all continuous maps from arbitrary compact Hausdorff spaces.
A topological space $X$ is called compactly-generated or a k-space if it satisfies any of the following equivalent conditions:
    (1) The topology on $X$ coincides with the final topology with respect to the family of all continuous maps $f:K\to X$ from all compact Hausdorff spaces $K.$ In other words, it satisfies the condition:
       a set $A\subseteq X$ is open (resp. closed) in $X$ exactly when $f^{-1}(A)$ is open (resp. closed) in $K$ for every compact Hausdorff space $K$ and every continuous map $f:K\to X.$
    (2) $X$ is a quotient space of a topological sum of compact Hausdorff spaces.
    (3) $X$ is a quotient space of a locally compact Hausdorff space.
As explained in the final topology article, condition (1) is well-defined, even though the family of continuous maps from arbitrary compact Hausdorff spaces is not a set but a proper class.
Every space satisfying Definition 2 also satisfies Definition 1. The converse is not true. For example, the one-point compactification of the Arens-Fort space is compact and hence satisfies Definition 1, but it does not satisfies Definition 2.
Definition 2 is the one more commonly used in algebraic topology. This definition is often paired with the weak Hausdorff property to form the category CGWH of compactly generated weak Hausdorff spaces.

### Definition 3

Informally, a space whose topology is determined by its compact Hausdorff subspaces.
A topological space $X$ is called compactly-generated or a k-space if its topology is coherent with the family of its compact Hausdorff subspaces; namely, it satisfies the property:
    a set $A\subseteq X$ is open (resp. closed) in $X$ exactly when the intersection $A\cap K$ is open (resp. closed) in $K$ for every compact Hausdorff subspace $K\subseteq X.$
Every space satisfying Definition 3 also satisfies Definition 2. The converse is not true. For example, the Sierpiński space $X=\{0,1\}$ with topology $\{\emptyset ,\{1\},X\}$ does not satisfy Definition 3, because its compact Hausdorff subspaces are the singletons $\{0\}$ and $\{1\}$, and the coherent topology they induce would be the discrete topology instead. On the other hand, it satisfies Definition 2 because it is homeomorphic to the quotient space of the compact interval $[0,1]$ obtained by identifying all the points in $(0,1].$
By itself, Definition 3 is not quite as useful as the other two definitions as it lacks some of the properties implied by the others. For example, every quotient space of a space satisfying Definition 1 or Definition 2 is a space of the same kind. But that does not hold for Definition 3.
However, for weak Hausdorff spaces Definitions 2 and 3 are equivalent. Thus the category CGWH can also be defined by pairing the weak Hausdorff property with Definition 3, which may be easier to state and work with than Definition 2.

## Motivation

Compactly generated spaces were originally called k-spaces, after the German word kompakt. They were studied by Hurewicz, and can be found in General Topology by Kelley, Topology by Dugundji, Rational Homotopy Theory by Félix, Halperin, and Thomas.
The motivation for their deeper study came in the 1960s from well known deficiencies of the usual category of topological spaces. This fails to be a cartesian closed category, the usual cartesian product of identification maps is not always an identification map, and the usual product of CW-complexes need not be a CW-complex. By contrast, the category of simplicial sets had many convenient properties, including being cartesian closed. The history of the study of repairing this situation is given in the article on the nLab on convenient categories of spaces.
The first suggestion (1962) to remedy this situation was to restrict oneself to the full subcategory of compactly generated Hausdorff spaces, which is in fact cartesian closed. These ideas extend on the de Vries duality theorem. A definition of the exponential object is given below. Another suggestion (1964) was to consider the usual Hausdorff spaces but use functions continuous on compact subsets.
These ideas generalize to the non-Hausdorff case; i.e. with a different definition of compactly generated spaces. This is useful since identification spaces of Hausdorff spaces need not be Hausdorff.
In modern-day algebraic topology, this property is most commonly coupled with the weak Hausdorff property, so that one works in the category CGWH of compactly generated weak Hausdorff spaces.

## Examples

As explained in the Definitions section, there is no universally accepted definition in the literature for compactly generated spaces; but Definitions 1, 2, 3 from that section are some of the more commonly used. In order to express results in a more concise way, this section will make use of the abbreviations CG-1, CG-2, CG-3 to denote each of the three definitions unambiguously. This is summarized in the table below (see the Definitions section for other equivalent conditions for each).
| Abbreviation | Meaning summary |
| CG-1 | Topology coherent with family of its compact subspaces |
| CG-2 | Topology same as final topology with respect to continuous maps from arbitrary compact Hausdorff spaces |
| CG-3 | Topology coherent with family of its compact Hausdorff subspaces |
For Hausdorff spaces the properties CG-1, CG-2, CG-3 are equivalent. Such spaces can be called compactly generated Hausdorff without ambiguity.
Every CG-3 space is CG-2 and every CG-2 space is CG-1. The converse implications do not hold in general, as shown by some of the examples below.
For weak Hausdorff spaces the properties CG-2 and CG-3 are equivalent.
Sequential spaces are CG-2. This includes first countable spaces, Alexandrov-discrete spaces, finite spaces.
Every CG-3 space is a T$_1$ space (because given a singleton $\{x\}\subseteq X,$ its intersection with every compact Hausdorff subspace $K\subseteq X$ is the empty set or a single point, which is closed in $K;$ hence the singleton is closed in $X$). Finite T$_1$ spaces have the discrete topology. So among the finite spaces, which are all CG-2, the CG-3 spaces are the ones with the discrete topology. Any finite non-discrete space, like the Sierpiński space, is an example of CG-2 space that is not CG-3.
Compact spaces and weakly locally compact spaces are CG-1, but not necessarily CG-2 (see examples below).
Compactly generated Hausdorff spaces include the Hausdorff version of the various classes of spaces mentioned above as CG-1 or CG-2, namely Hausdorff sequential spaces, Hausdorff first countable spaces, locally compact Hausdorff spaces, etc. In particular, metric spaces and topological manifolds are compactly generated. CW complexes are also Hausdorff compactly generated.
To provide examples of spaces that are not compactly generated, it is useful to examine anticompact spaces, that is, spaces whose compact subspaces are all finite. If a space $X$ is anticompact and T$_1$, every compact subspace of $X$ has the discrete topology and the corresponding k-ification of $X$ is the discrete topology. Therefore, any anticompact T$_1$ non-discrete space is not CG-1. Examples include:
* The cocountable topology on an uncountable space.
* The one-point Lindelöfication of an uncountable discrete space (also called Fortissimo space).
* The Arens-Fort space.
* The Appert space.
* The "Single ultrafilter topology".
Other examples of (Hausdorff) spaces that are not compactly generated include:
* The product of uncountably many copies of $\mathbb {R}$ (each with the usual Euclidean topology).
* The product of uncountably many copies of $\mathbb {Z}$ (each with the discrete topology).
For examples of spaces that are CG-1 and not CG-2, one can start with any space $Y$ that is not CG-1 (for example the Arens-Fort space or an uncountable product of copies of $\mathbb {R}$) and let $X$ be the one-point compactification of $Y.$ The space $X$ is compact, hence CG-1. But it is not CG-2 because open subspaces inherit the CG-2 property and $Y$ is an open subspace of $X$ that is not CG-2.

## Properties

(See the Examples section for the meaning of the abbreviations CG-1, CG-2, CG-3.)

### Subspaces

Subspaces of a compactly generated space are not compactly generated in general, even in the Hausdorff case. For example, the ordinal space $\omega _{1}+1=[0,\omega _{1}]$ where $\omega _{1}$ is the first uncountable ordinal is compact Hausdorff, hence compactly generated. Its subspace with all limit ordinals except $\omega _{1}$ removed is isomorphic to the Fortissimo space, which is not compactly generated (as mentioned in the Examples section, it is anticompact and non-discrete). Another example is the Arens space, which is sequential Hausdorff, hence compactly generated. It contains as a subspace the Arens-Fort space, which is not compactly generated.
In a CG-1 space, every closed set is CG-1. The same does not hold for open sets. For instance, as shown in the Examples section, there are many spaces that are not CG-1, but they are open in their one-point compactification, which is CG-1.
In a CG-2 space $X,$ every closed set is CG-2; and so is every open set (because there is a quotient map $q:Y\to X$ for some locally compact Hausdorff space $Y$ and for an open set $U\subseteq X$ the restriction of $q$ to $q^{-1}(U)$ is also a quotient map on a locally compact Hausdorff space). The same is true more generally for every locally closed set, that is, the intersection of an open set and a closed set.
In a CG-3 space, every closed set is CG-3.

### Quotients

The disjoint union ${\coprod }_{i}X_{i}$ of a family $(X_{i})_{i\in I}$ of topological spaces is CG-1 if and only if each space $X_{i}$ is CG-1. The corresponding statements also hold for CG-2 and CG-3.
A quotient space of a CG-1 space is CG-1. In particular, every quotient space of a weakly locally compact space is CG-1. Conversely, every CG-1 space $X$ is the quotient space of a weakly locally compact space, which can be taken as the disjoint union of the compact subspaces of $X.$
A quotient space of a CG-2 space is CG-2. In particular, every quotient space of a locally compact Hausdorff space is CG-2. Conversely, every CG-2 space is the quotient space of a locally compact Hausdorff space.
A quotient space of a CG-3 space is not CG-3 in general. In fact, every CG-2 space is a quotient space of a CG-3 space (namely, some locally compact Hausdorff space); but there are CG-2 spaces that are not CG-3. For a concrete example, the Sierpiński space is not CG-3, but is homeomorphic to the quotient of the compact interval $[0,1]$ obtained by identifying $(0,1]$ to a point.
More generally, any final topology on a set induced by a family of functions from CG-1 spaces is also CG-1. And the same holds for CG-2. This follows by combining the results above for disjoint unions and quotient spaces, together with the behavior of final topologies under composition of functions.
A wedge sum of CG-1 spaces is CG-1. The same holds for CG-2. This is also an application of the results above for disjoint unions and quotient spaces.

### Products

The product of two compactly generated spaces need not be compactly generated, even if both spaces are Hausdorff and sequential. For example, the space $X=\mathbb {R} \setminus \{1,1/2,1/3,\ldots \}$ with the subspace topology from the real line is first countable; the space $Y=\mathbb {R} /\{1,2,3,\ldots \}$ with the quotient topology from the real line with the positive integers identified to a point is sequential. Both spaces are compactly generated Hausdorff, but their product $X\times Y$ is not compactly generated.
However, in some cases the product of two compactly generated spaces is compactly generated:
* The product of two first countable spaces is first countable, hence CG-2.
* The product of a CG-1 space and a locally compact space is CG-1. (Here, locally compact is in the sense of condition (3) in the corresponding article, namely each point has a local base of compact neighborhoods.)
* The product of a CG-2 space and a locally compact Hausdorff space is CG-2.
When working in a category of compactly generated spaces (like all CG-1 spaces or all CG-2 spaces), the usual product topology on $X\times Y$ is not compactly generated in general, so cannot serve as a categorical product. But its k-ification $k(X\times Y)$ does belong to the expected category and is the categorical product.

### Continuity of functions

The continuous functions on compactly generated spaces are those that behave well on compact subsets. More precisely, let $f:X\to Y$ be a function from a topological space to another and suppose the domain $X$ is compactly generated according to one of the definitions in this article. Since compactly generated spaces are defined in terms of a final topology, one can express the continuity of $f$ in terms of the continuity of the composition of $f$ with the various maps in the family used to define the final topology. The specifics are as follows.
If $X$ is CG-1, the function $f$ is continuous if and only if the restriction $f\vert _{K}:K\to Y$ is continuous for each compact $K\subseteq X.$
If $X$ is CG-2, the function $f$ is continuous if and only if the composition $f\circ u:K\to Y$ is continuous for each compact Hausdorff space $K$ and continuous map $u:K\to X.$
If $X$ is CG-3, the function $f$ is continuous if and only if the restriction $f\vert _{K}:K\to Y$ is continuous for each compact Hausdorff $K\subseteq X.$

### Miscellaneous

For topological spaces $X$ and $Y,$ let $C(X,Y)$ denote the space of all continuous maps from $X$ to $Y$ topologized by the compact-open topology. If $X$ is CG-1, the path components in $C(X,Y)$ are precisely the homotopy equivalence classes.

## K-ification

Given any topological space $X$ we can define a possibly finer topology on $X$ that is compactly generated, sometimes called the k-ification of the topology. Let $\{K_{\alpha }\}$ denote the family of compact subsets of $X.$ We define the new topology on $X$ by declaring a subset $A$ to be closed if and only if $A\cap K_{\alpha }$ is closed in $K_{\alpha }$ for each index $\alpha .$ Denote this new space by $kX.$ One can show that the compact subsets of $kX$ and $X$ coincide, and the induced topologies on compact subsets are the same. It follows that $kX$ is compactly generated. If $X$ was compactly generated to start with then $kX=X.$ Otherwise the topology on $kX$ is strictly finer than $X$ (i.e., there are more open sets).
This construction is functorial. We denote $\mathbf {CGTop}$ the full subcategory of $\mathbf {Top}$ with objects the compactly generated spaces, and $\mathbf {CGHaus}$ the full subcategory of $\mathbf {CGTop}$ with objects the Hausdorff spaces. The functor from $\mathbf {Top}$ to $\mathbf {CGTop}$ that takes $X$ to $kX$ is right adjoint to the inclusion functor $\mathbf {CGTop} \to \mathbf {Top} .$
The exponential object in $\mathbf {CGHaus}$ is given by $k(Y^{X})$ where $Y^{X}$ is the space of continuous maps from $X$ to $Y$ with the compact-open topology.
These ideas can be generalized to the non-Hausdorff case. This is useful since identification spaces of Hausdorff spaces need not be Hausdorff.