TITLE: profinite spaces are the pro-completion of finite sets
QUESTION [5 upvotes]: The title sounds tautological, right? Perhaps I'm missing something completely trivial here ...
Assume $X$ is a compact totally disconnected hausdorff space. It is known that $X$ can be written as directed inverse limit of finite discrete spaces $X_i$ with surjective transition maps (i.e. $X$ is profinite). How do you prove that every map from $X$ to a finite discrete space factors through some projection $X \to X_i$?
I know that the fibers of the projections are a basis of the topology of $X$ (not only a subbasis). The corresponding result for profinite groups is true, but I cannot adopt the proof.
Of course you could use Stone duality to reduce the assertions to a completely trivial one (a finite boolean ring in a directed limit of boolean subrings lies in some of these boolean subrings), but I want a direct topological proof.

REPLY [7 votes]: Let $f:X \to Z$ be a map to a finite discrete space. Note that each fiber, $f^{-1}(z)$, is both open and closed in $X$. Let $p_i: X \to X_i$ be the projection maps. 
Fix some $z \in Z$. Since $f^{-1}(z)$ is open, and the fibers of the maps are a basis, there is an open cover of $f^{-1}(z)$ by sets of the form $p_i^{-1}(x)$, for $x$ in various $X_i$. 
Since $f^{-1}(z)$ is closed in a compact space, it is compact. So we can take a finite subcover of this cover. Thus, there is some single index $i$ for which $f^{-1}(z)$ is covered by sets of the form $p_i^{-1}(x)$, $x \in X_i$. 
Since $Z$ is finite, there is a single $i$ such that, for every $z \in Z$, the fiber $f^{-1}(z)$ is covered by sets of the form $p_i^{-1}(x)$, $x \in X_i$. The map $f$ factors through $X_i$.

REPLY [3 votes]: The key to generalizing the proof for groups is to argue that the space is a uniform space. In the case of a group, everything can be translated into neighborhoods of the identity. To do the same in the general case, we work with neighborhoods of the diagonal Δ = {(x,x) : x ∈ X}.
When X is an inverse limit of finite discrete spaces pi:X→Xi, then the preimages of the finite diagonals Ei = pi-1(Δi) form a fundamental system of entourages for X; this follows directly from the universal property of inverse limits. Now consider a partition U1,...,Uk of X into pairwise disjoint clopen sets, then U1×U1 ∪ ... ∪ Uk×Uk is a clopen neighborhood of the diagonal Δ. This neighborhood must contain one of the entourages Ei, which gives the required factorization.
See also my answer to question 15440 where I similarly characterize spaces that are inverse limits of discrete spaces.