We develop fundamental aspects of the theory of metric, Hilbert, and Banach spaces in the context of subsystems of second-order arithmetic. In particular, we explore issues having to do with distances, closed subsets and subspaces, closures, bases, norms, and projections. We pay close attention to variations that arise when formalizing definitions and theorems, and study the relationships between them. For example, we show that a natural formalization of the mean ergodic theorem can be proved in ACA0; but even recognizing the theorem's "equivalent" existence assertions as such can also require the full strength of ACA0. Contents