Generic flatness stratification

Thanks to Ofer Gabber