  Gapped ground states of quantum spin systems have been referred to in the
physics literature as being `in the same phase' if there exists a family of
Hamiltonians H(s), with finite range interactions depending continuously on $s
\in [0,1]$, such that for each $s$, H(s) has a non-vanishing gap above its
ground state and with the two initial states being the ground states of H(0)
and H(1), respectively. In this work, we give precise conditions under which
any two gapped ground states of a given quantum spin system that 'belong to the
same phase' are automorphically equivalent and show that this equivalence can
be implemented as a flow generated by an $s$-dependent interaction which decays
faster than any power law (in fact, almost exponentially). The flow is
constructed using Hastings' 'quasi-adiabatic evolution' technique, of which we
give a proof extended to infinite-dimensional Hilbert spaces. In addition, we
derive a general result about the locality properties of the effect of
perturbations of the dynamics for quantum systems with a quasi-local structure
and prove that the flow, which we call the {\em spectral flow}, connecting the
gapped ground states in the same phase, satisfies a Lieb-Robinson bound. As a
result, we obtain that, in the thermodynamic limit, the spectral flow converges
to a co-cycle of automorphisms of the algebra of quasi-local observables of the
infinite spin system. This proves that the ground state phase structure is
preserved along the curve of models $H(s), 0\leq s\leq 1$.
