Returns true if f is a diagonal, otherwise returns false. Recall f is called diagonal if it is of the form x1(a1)+...+xn(an) up to renumbering of the variables.