With the Becchi–Rouet–Stora–Tyutin (BRST) quantization of gauge theory, we solve the long-standing difficult problem of the local constraint conditions, i.e. the single occupation of a slave particle per site, in the slave particle theory. This difficulty is actually caused by inconsistently dealing with the local Lagrange multiplier λ i which ensures the constraint: in the Hamiltonian formalism of the theory, λ i is time-independent and commutes with the Hamiltonian while in the Lagrangian formalism, λ i (t) becomes time-dependent and plays a role of gauge field. This implies that the redundant degrees of freedom of λ i (t) are introduced and must be removed by the additional constraint, the gauge fixing condition (GFC) ∂ t λ i (t) = 0. In literature, this GFC was missed. We add this GFC and use the BRST quantization of gauge theory for Dirac’s first-class constraints in the slave particle theory. This GFC endows λ i (t) with dynamics and leads to important physical results. As an example, we study the Hubbard model at half-filling and find that the spinon is gapped in the weak U and the system is indeed a conventional metal, which resolves the paradox that the weak coupling state is a superconductor in the previous slave boson mean field (MF) theory. For the t–J model, we find that the dynamic effect of λ i (t) substantially suppresses the d-wave pairing gap and then the superconducting critical temperature may be lowered at least a factor of one-fifth of the MF value which is of the order of 1000 K. The renormalized T c is then close to that in cuprates.