A proof of validity for multiphase Whitham modulation theory