Let be a polynomial-time verifier for , with witnesses of length . Consider the prefix language
This language lies in NP, so the assumption supplies a polynomial-size circuit family deciding .
Apply the usual search-to-decision reduction. Starting with the empty prefix, append zero if the circuit says that some accepting witness has that extended prefix; otherwise append one. Repeat for positions. Composing the polynomially many copies of the decision circuit produces a polynomial-size circuit . Whenever , at least one accepting extension exists at every step, so the final string satisfies
On negative inputs the output may be arbitrary, as required.