Definition int_round_odd (x: Z) (p: Z) :=
(if Z.eqb (x mod 2^p) 0 || Z.odd (x / 2^p) then x / 2^p else x / 2^p + 1) * 2^p.

Lemma int_round_odd_bits:
forall x y p, 0 <= p ->
(forall i, 0 <= i < p -> Z.testbit y i = false) ->
Z.testbit y p = (if Z.eqb (x mod 2^p) 0 then Z.testbit x p else true) ->
(forall i, p < i -> Z.testbit y i = Z.testbit x i) ->
int_round_odd x p = y.