Corollary Ztestbit_two_p_m1:
  forall n i, 0 <= n -> 0 <= i ->
  Z.testbit (two_p n - 1) i = if zlt i n then true else false.

Theorem sign_ext_equal_if_zero_equal: forall n x y, 0 < n -> zero_ext n x = zero_ext n y -> sign_ext n x = sign_ext n y.