The connection between topological and algebraic entropy