(* log2 is like log_inf except it returns nat, so I don't have to reason about an unnecessary conversion. This function is only used to implement lognat below.*)
Fixpoint log2(n : positive) : nat :=
  match n with 
    | xH => 0
    | xO n' | xI n' => (S (log2 n'))
  end.

Lemma log2_prod_sum : forall(a : positive), (S (log2 a)) = (log2 (Pmult 2 a)).