Require Coq.funind.Recdef.

Lemma arith_aux06: forall lo hi n, 0 <= lo <= n -> 0 <= hi <= n -> 0 <= lo + Z.max 0 (hi - lo) <= n.
Ltac inv_int i :=
let ofs := fresh "ofs" in
let H := fresh "H" in
let H0 := fresh "H" in
let H1 := fresh "H" in
match type of i with
| int =>
pose proof Int.repr_unsigned i as H;
pose proof Int.unsigned_range i as H0;
remember (Int.unsigned i) as ofs eqn:H1;
rewrite <- H in *;
clear H H1; try clear i
| ptrofs =>
pose proof Ptrofs.repr_unsigned i as H;
pose proof Ptrofs.unsigned_range i as H0;
remember (Ptrofs.unsigned i) as ofs eqn:H1;
rewrite <- H in *;
clear H H1; try clear i
end.