# Compactness and Hausdorffness

Is it possible to have a topological space having all compact subsets closed, but the space itselt is not Hausdorff?

I couldn't find any counterexample. I tried $\mathbb R$ with cofinite, point inclusion and point exclusion topologies, but these didn't work.

Any suggestion in this context will be helpful for me.

• The cocountable topology on $\mathbb{R}$ will work Oct 18, 2013 at 5:53

A space in which all compact sets are closed is known as a $$KC$$ space; $$T_B$$ space is another term that has been used.
A standard example of a compact $$KC$$ space that is not Hausdorff is the one-point compactification $$Q^*$$ of the space of rational numbers with the usual Euclidean topology. $$\Bbb Q$$ is not locally compact, so $$\Bbb Q^*$$ is not Hausdorff. Let $$p$$ be the point at infinity in $$\Bbb Q^*$$, and suppose that $$K\subseteq\Bbb Q^*$$ is compact. If $$p\notin K$$, then $$K$$ is a compact subset of $$\Bbb Q$$ with the usual topology, so $$K$$ is closed and compact in $$\Bbb Q$$, $$\Bbb Q^*\setminus K$$ is open in $$\Bbb Q^*$$, and $$K$$ is therefore closed in $$\Bbb Q^*$$.
Suppose, then, that $$p\in K$$. If $$K$$ is not closed, there is some $$x\in(\operatorname{cl}_{\Bbb Q^*}K)\setminus K$$. Clearly $$x\in\Bbb Q$$, and $$\Bbb Q$$ is open in $$\Bbb Q^*$$, so $$x\in\big(\operatorname{cl}_{\Bbb Q}(K\cap\Bbb Q)\big)\setminus K$$, and $$K\setminus\{p\}$$ is therefore not closed in $$\Bbb Q$$. There is therefore a sequence $$\langle x_n:n\in\Bbb N\rangle$$ of distinct points of $$K\setminus\{p\}$$ converging in $$\Bbb Q$$ to some $$x\in\Bbb Q\setminus K$$. Let $$C=\{x\}\cup\{x_n:n\in\Bbb N\}$$; then $$C$$ is a closed, compact subset of $$\Bbb Q$$, so $$\Bbb Q^*\setminus C$$ is an open nbhd of $$p$$ in $$\Bbb Q^*$$. Let $$D=\{x_n:n\in\Bbb N\}$$; $$D$$ is a discrete set in $$\Bbb Q$$, so we can find open sets $$U_n$$ in $$\Bbb Q$$ such that $$U_n\cap D=\{x_n\}$$ for each $$n\in\Bbb N$$. The sets $$U_n$$ are also open in $$\Bbb Q^*$$, so $$\{U_n:n\in\Bbb N\}\cup\{\Bbb Q^*\setminus C\}$$ is an open cover of $$K$$ with no finite subcover, contradicting the hypothesis that $$K$$ is compact. Thus, $$K$$ must be closed, and $$\Bbb Q^*$$ is $$KC$$.
Another example of a $KC$ space is the real line with the cocountable topology, where the open sets are just the complements of countable sets. An infinite set $A$ contains a countable subset $a_1, a_2, ...$. The cover $U_1, U_2, ...$ where $U_n=\Bbb R-\{a_n,a_{n+1},...\}$, is then an open cover without a finite subcover. This means that $A$ is not compact. In other words, the compact sets in this topology are just the finite ones, so they are closed.
Note that a $KC$ space has unique sequential limits, i.e. a sequence that converges has a unique limit. In a first countable space it can then be shown that the space must be Hausdorff.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8247329,"math_prob":1.0000004,"size":1681,"snap":"2023-40-2023-50","text_gpt3_token_len":612,"char_repetition_ratio":0.19797257,"word_repetition_ratio":0.014440433,"special_character_ratio":0.34086853,"punctuation_ratio":0.103174604,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000094,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-11-30T09:07:27Z\",\"WARC-Record-ID\":\"<urn:uuid:8c746e5e-8e87-4921-8bea-64770ba450ef>\",\"Content-Length\":\"158848\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6120293a-3edf-47de-8472-29d53e0acf6e>\",\"WARC-Concurrent-To\":\"<urn:uuid:e0a25cdd-7650-4895-969a-ee6485e2f88a>\",\"WARC-IP-Address\":\"104.18.43.226\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/530638/compactness-and-hausdorffness\",\"WARC-Payload-Digest\":\"sha1:5DHWMMGOPYUTP7NMBCKOUAEVUTGNOSGG\",\"WARC-Block-Digest\":\"sha1:CIZGOQRZIRQ4VTIJ2RYLEUHNP5XNE67V\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100172.28_warc_CC-MAIN-20231130062948-20231130092948-00661.warc.gz\"}"}