Existence of equilibria in countable games: an algebraic approach