Necessary and sufficient conditions for optima in reflexive spaces