In my previous post, I showed that compact objects in the category of topological spaces have to be finite. Today we improve this to a full characterisation.
Lemma. Let be a topological space. Then is a compact object in if and only if is finite discrete.
This result dates back to Gabriel and Ulmer [GU71, 6.4], as was pointed out to me by Jiří Rosický in reply to my MO question and answer of this account (of which this post is essentially a retelling). Our proof is different from the one given in [GU71], instead using a variant of an argument given in the n-Lab.
Before giving the proof, we construct an auxiliary space against which we will be testing compactness. It is essentially the colimit constructed in the n-Lab, except that we swapped the roles of and (the reason for this will become clear in the proof).
Definition. For all , let be the topological space , where the nonempty open sets are given by for . They form a topology since
Define the map by
This is continuous since equals if and if . Let be the colimit of this diagram.
Since the elements map to the same element in , we conclude that is the two-point space , where the map is the second coordinate projection. Moreover, the colimit topology on is the indiscrete topology. Indeed, neither nor are open.
Proof of Lemma. If is compact, then my previous post shows that is finite. Let be any subset, and let be the indicator function . It is continuous because has the indiscrete topology. Since is a compact object, has to factor through some . Let be the first coordinate projection, i.e.
Let be a number such that for all ; this exists because is finite. Then , which shows that is open. Since was arbitrary, we conclude that is discrete.
Conversely, every finite discrete space is a compact object. Indeed, any map out of is continuous, and finite sets are compact in .
[GU71] Gabriel, Peter and Ulmer, Friedrich, Lokal präsentierbare Kategorien. Lecture Notes in Mathematics 221. Springer-Verlag, Berlin-New York, 1971. DOI: 10.1007/BFb0059396.