  We study a model for dynamical localization of topology using ideas from
non-commutative geometry and topology in quantum mechanics. We consider a
collection $X$ of $N$ one-dimensional manifolds and the corresponding set of
boundary conditions (self-adjoint extensions) of the Dirac operator $D$. The
set of boundary conditions encodes the topology and is parameterized by unitary
matrices $g_N$. A particular geometry is described by a spectral triple
$x(g_N)=(A_X,{\cal H}_X, D(g_N))$. We define a partition function for the sum
over all $g_N$. In this model topology fluctuates but the dimension is kept
fixed. We use the spectral principle to obtain an action for the set of
boundary conditions. Together with invariance principles the procedure fixes
the partition function for fluctuating topologies. In the simplest case the
model has one free-parameter $\beta $ and it is equivalent to a one plaquette
gauge theory. We argue that topology becomes localized at $\beta=\infty$ for
any value of $N$. Moreover, the system undergoes a third-order phase transition
at $\beta=1$ for large $N$. We give a topological interpretation of the phase
transition by looking how it affects the topology.
