Let g be a simple complex Lie algebra of finite dimension. This paper gives an inequality relating the order of an automorphism of g to the dimension of its fixed-point subalgebra, and characterizes those automorphisms of g for which equality occurs. This is amounts to an inequality/equality for Thomae's function on the group of automorphisms of g. The result has applications to characters of zero weight spaces, graded Lie algebras, and inequalities for adjoint Swan conductors.