# Is every compact set is closed in any topological space? [duplicate]

Is every compact set is closed in any topological space ?

My attempt: I can say in usual topologies that every compact set is closed but I'm confused in other topologies.

## marked as duplicate by Asaf Karagila♦ general-topology StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 31 at 7:29

No. The simplest counterexample is arguably this. Consider $$X = \{0, 1\}$$ with the indiscrete topology i.e. the only two open sets are $$\emptyset$$ and $$X = \{0, 1\}$$ itself.
Then trivially any subset of $$X$$ is compact. After all, any open cover at most contains just those two open sets. But, for example, the singleton subset $$\{0\}$$ of $$X$$ is not closed because its complement $$X \setminus \{0\} = \{1\}$$ is not one of the two open sets listed above and therefore not open.
A different kind of example: The co-finite topology on an infinite set $$X.$$ That is, any $$A\subset X$$ is open iff (i) $$A=\emptyset$$ or (ii) $$X\setminus A$$ is finite. Equivalently any $$B\subset X$$ is closed iff (i') $$B=X$$ or (ii') $$B$$ is finite. In this space every subset is compact.