fact: Fixpoint exact_log2(p:positive) : option positive := match p with | 1%positive | xI _ => None | 2%positive => Some xH | xO q => match exact_log2 q with | Some l => Some (l+1)%positive | _ => None end end.
imports: Coq(Arith NArith Lia Recdef) additions(Pow Compatibility Wf_transparent)