Proof of the entropy bound on dynamical horizons