TITLE: Is any compact metric totally disconnected space homeomorphic to a compact subspace of a Cantor space?
QUESTION [8 upvotes]: Every compact metric totally disconnected perfect space is homeomorphic to a Cantor space. 
Is every compact metric totally disconnected space homeomorphic to a compact subspace of a Cantor space?
In other words, if you have a compact metric totally disconnected space can you embed it in a compact metric totally disconnected perfect space?

REPLY [7 votes]: From general facts we know that a compact totally disconnected Hausdorff space is zero-dimensional (has a base of clopen subsets) and as we also have a metric space, we have a countable clopen base for our space. The characteristic functions of these form an embedding family into  $\{0,1\}^\omega$, which is (homeomorphic to) the Cantor set. In fact every compact Hausdorff totally disconnected space of weight $\kappa$ can be embedded into a Cantor cube of weight $\kappa$ in this way.