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