  For any locality-preserving action of a group $G$ on a quantum spin chain one
can define an anomaly index taking values in the group cohomology of $G$. The
anomaly index is a kinematic quantity, it does not depend on the Hamiltonian.
We prove that a nonzero anomaly index prohibits any $G$-invariant Hamiltonian
from having $G$-invariant gapped ground states. Lieb-Schultz-Mattis-type
theorems are a special case of this result when $G$ involves translations. In
the case when the symmetry group $G$ is a Lie group, we define an anomaly index
which takes values in the differentiable group cohomology as defined by J.-L.
Brylinski and prove a similar result.
