Every locally compact space is compactly generated

Note that to show that a space $X$ is compactly generated, it suffices to show that given any non-closed $A \subseteq X$ there is a compact $K \subseteq X$ such that $A \cap K$ is not a closed subset of $K$.

Let $X$ be a locally compact space, and suppose that $A \subseteq X$ is not closed. Taking any $x \in \overline{A} \setminus A$, let $K$ be a compact neighbourhood of $x$. Note that if $V$ is any (open) neighbourhood of $x$, then so is $V \cap \operatorname{Int} (K)$, and so $\varnothing \neq A \cap (V \cap \operatorname{Int}(K)) \subseteq (A \cap K ) \cap V$. Therefore $x \in \overline{A \cap K} \cap K = \operatorname{cl}_K ( A \cap K )$, and since $x \notin A \cap K$ it follows that $A \cap K$ is not a closed subset of $K$.


I had some difficulty in understanding the proof-by-contrapositive in unfru's answer, so I reversed the proof and complemented all the sets to get the following:

Note that to show that a space $X$ is compactly generated, it suffices to show that for any $U \subseteq X$ such that for all compact $K \subseteq X$, $U\cap K$ is open in $K$, $U$ is open.

Let $X$ be a locally compact space, and suppose that $U\cap K$ is open in $K$ for all compact $K$. Taking any $x\in U$, let $K$ be a compact neighborhood of $x$, so that $U\cap K$ is open in $K$. Then $x\in(U\cap K)^\circ_K=((K\setminus U)^c)^\circ\cap K$, so there is an open neighborhood $V$ disjoint from $K\setminus U$, so that $V\cap K^\circ\subseteq V\cap K\subseteq U$. But then $x$ is interior to $U$, so $U$ is open.


Suppose $X$ is locally compact. Let $A$ be a subset of $X$ having the property that for every compact subspace $K$ of $X$, the intersection $K\cap A$ is closed $K$. To show that $A$ is closed in $X$, we show that every point in $X\setminus A$ has a neighborhood in $X$ disjoint from $A$.

Let $x\in X\setminus A$. Choose a compact subspace $K$ of $X$ that contains a neighborhood $U$ of $x$ in $X$. By hypothesis, $A_K:=K\setminus A$ is open in $K$; thus $U\cap A_K$ is open in $U$ and hence in $X$. This is the desired neighborhood of $x$.