The thermodynamic formalism for sub-additive potentials