Variant elogn2_spec n : nat * nat -> Type :=
Elogn2Spec e m of n = 2 ^ e * m.*2.+1 : elogn2_spec n (e, m).

(* Specifications: *)
Lemma elogn2P n : elogn2_spec n.+1 (elogn2 0 n n).
Definition ifnz T n (x y : T) := if n is 0 then y else x.