The topological hypothesis for discrete spin models