A coding theorem for the rate-distortion-perception function