Castelnuovo–Mumford regularity and Ratliff–Rush closure