Section Even_Odd.
(** Zeven, used for rounding to nearest, ties to even *)
Definition Zeven (n : Z) :=
match n with
| Zpos (xO _) => true
| Zneg (xO _) => true
| Z0 => true
| _ => false
end.

(* Specifications: *)
Theorem Zeven_mult :
forall x y, Zeven (x * y) = orb (Zeven x) (Zeven y).
Theorem Zeven_opp :
forall x, Zeven (- x) = Zeven x.
Theorem Zeven_ex :
forall x, exists p, x = (2 * p + if Zeven x then 0 else 1)%Z.
Theorem Zeven_2xp1 :
forall n, Zeven (2 * n + 1) = false.
Theorem Zeven_plus :
forall x y, Zeven (x + y) = Bool.eqb (Zeven x) (Zeven y).