Create function partition_fold to ease reasoning about iterate_norms.