A theorem on a mapping from a sphere to the circle and the simultaneous diagonalization of two hermitian matrices