Derivative Hartree—Fock theory to all orders