fact: Fixpoint startrem acc sh nbox pos := if (pos, sh) is (p.+1, s0 :: s) then let c := nth 0 s p + nbox in let cpos := s0 + pos in if c >= cpos then (acc, c - cpos) else startrem acc.+1 s nbox p else (acc + (pos - nbox), nbox - pos).
imports: HB(structures) mathcomp(all_ssreflect) tools sorted partition