  Given a locally constant linear cocycle over a subshift of finite type, we
show that the existence of a uniform gap between the i-th and (i+1)-th Lyapunov
exponents for all invariant measures implies the existence of a dominated
splitting of index i. We establish a similar result for sofic subshifts coming
from word hyperbolic groups, in relation with Anosov representations of such
groups. We discuss the case of finitely generated semigroups, and propose a
notion of Anosov representation in this setting.
