(* The integer bump / unbump operations. *)

Definition bump h i := (h <= i) + i.Definition unbump h i := i - (h < i).

(* Specifications: *)
Lemma bumpK h : cancel (bump h) (unbump h).
Lemma bump_addl h i k : bump (k + h) (k + i) = k + bump h i.
Lemma unbump_addl h i k : unbump (k + h) (k + i) = k + unbump h i.
Lemma leq_bump h i j : (i <= bump h j) = (unbump h i <= j).
Lemma leq_bump2 h i j : (bump h i <= bump h j) = (i <= j).
Lemma bumpC h1 h2 i : bump h1 (bump h2 i) = bump (bump h1 h2) (bump (unbump h2 h1) i).
Lemma splitK {m n} : cancel (@split m n) unsplit.
Lemma unsplitK {m n} : cancel (@unsplit m n) split.